/* ============================================
   References.html Specific Styles
   ============================================ */

/* Step-based layout - no containers, no backgrounds */
.step {
    display: none;
    width: 100%;
    overflow-y: auto; /* Enable scroll */
    overflow-x: hidden;
}

.step.active {
    display: block;
}

/* Header on pages - NO BACKGROUND */
.header {
    padding: 0;
    margin-bottom: 8px;
    background: none !important;
}

/* Заголовок "Попробуй готовые шоты" - без градиента */
.gradient-title {
    color: var(--color-text-primary);
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

        .gallery {
            display: grid;
            grid-template-columns: 1fr 1fr !important;
            gap: 12px 6px; /* row-gap: 12px, column-gap: 6px */
            width: 100%;
            max-width: var(--container-max-width);
            margin: 0 auto; /* Center gallery on desktop */
            padding: 50px var(--spacing-sm) 80px var(--spacing-sm); /* Small padding from edges */
            box-sizing: border-box;
        }

        .reference-card {
            position: relative;
            border-radius: 24px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.2s ease;
            background: var(--color-surface);
            aspect-ratio: 3/4;
            will-change: transform;
            contain: layout style paint;
        }

        /* NEW badge for cards published < 7 days ago */
        .reference-card .new-badge {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 10;

            background: #FFD400;
            color: #000000;

            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;

            padding: 4px 8px;
            border-radius: 8px;

            box-shadow: 0 2px 8px rgba(255, 212, 0, 0.4);
        }

        .reference-card.selected {
            position: relative;
            border-radius: 24px;
            transform: scale(1.02);
            box-shadow: 0 0 30px rgba(106, 44, 255, 0.7),
                        0 0 60px rgba(181, 101, 216, 0.4);
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        }

        .reference-card.selected::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 24px;
            padding: 3px;
            background: linear-gradient(135deg, #6A2CFF, #B565D8, #00C8FF);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
            z-index: 1;
        }

        /* ============================================
           Блок инструментов (Tools Section)
           ============================================ */
        .tools-section {
            max-width: 900px;
            margin: 0 auto 24px auto;
            padding: 0 8px;
            display: flex;
            gap: 12px;
            justify-content: flex-start;
        }

        .tool-btn {
            width: 90px;
            height: 90px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
            position: relative;
            overflow: hidden;
        }

        .tool-btn::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg,
                transparent 30%,
                rgba(255, 255, 255, 0.1) 50%,
                transparent 70%);
            animation: toolShimmer 3s infinite;
        }

        @keyframes toolShimmer {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        .tool-btn:active {
            transform: scale(0.95);
        }

        .tool-btn:hover {
            border-color: rgba(255, 255, 255, 0.4);
            box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
            transform: translateY(-2px);
        }

        .tool-icon {
            font-size: 32px;
            position: relative;
            z-index: 1;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
        }

        .tool-label {
            font-size: 11px;
            font-weight: 600;
            color: white;
            text-align: center;
            position: relative;
            z-index: 1;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            line-height: 1.2;
        }

        /* Разделитель "Или" */
        .divider-section {
            max-width: 900px;
            margin: 24px auto 24px auto;
            padding: 0 8px;
            text-align: center;
        }

        .divider-text {
            font-size: 14px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.4);
            text-transform: uppercase;
        }

        /* Специальная карточка "Конструктор" - DEPRECATED (перенесена в custom-prompt-section) */
        .custom-style-card {
            grid-column: span 1; /* Занимает половину ширины */
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4),
                        inset 0 1px 0 rgba(255, 255, 255, 0.15);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        .custom-style-card::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg,
                transparent 30%,
                rgba(255, 255, 255, 0.08) 50%,
                transparent 70%);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        .custom-style-card:hover {
            border-color: rgba(255, 255, 255, 0.4);
            transform: scale(1.05);
            box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6),
                        0 0 40px rgba(118, 75, 162, 0.3),
                        inset 0 1px 0 rgba(255, 255, 255, 0.25);
        }

        .custom-style-icon {
            font-size: 48px;
            margin-bottom: 8px;
            animation: pulse 2s ease-in-out infinite;
            position: relative;
            z-index: 1;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.1); opacity: 0.8; }
        }

        .reference-card:active {
            transform: scale(0.98);
        }

        .reference-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            border-radius: 24px;
        }

        .overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 40px 12px 10px 12px;
            z-index: 2;
            -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.95) 30%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
            mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.95) 30%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
        }

        .name {
            font-size: 14px;
            font-weight: 400;
            color: #FFFFFF;
            text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,0.8);
        }

        /* Wrapper для карточки + creator badge */
        .style-card-container {
            display: flex;
            flex-direction: column;
            max-width: 300px; /* 300px × 2 (retina) = 600px миниатюры */
        }

        /* Специфичные стили для references.html */
        .gallery .creator-badge {
            margin-top: 6px;
            padding: 0 2px;
        }

        .profile-info {
            font-size: 11px;
            font-weight: 400;
            color: #B0B0B0;
            margin-top: 2px;
            text-shadow: 0 1px 5px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,0.7);
        }

        .reference-card.selected::after {
            content: '✓';
            position: absolute;
            top: 12px;
            right: 12px;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #6A2CFF 0%, #B565D8 50%, #00C8FF 100%);
            color: #FFFFFF;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            box-shadow: 0 4px 20px rgba(181, 101, 216, 0.7), 0 2px 10px rgba(106, 44, 255, 0.5);
            border: 2px solid rgba(255, 255, 255, 0.4);
            z-index: 3;
        }

        /* Кнопка "Загрузить новые фото" */
        .upload-new-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            background: linear-gradient(135deg, #6A2CFF 0%, #B565D8 50%, #00C8FF 100%);
            cursor: pointer;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            padding: 20px;
            position: relative;
        }

        .upload-new-card::before {
            content: '';
            position: absolute;
            inset: 8px;
            background: rgba(0, 0, 0, 0.25);
            border-radius: 24px;
        }

        .upload-new-card:active {
            transform: scale(0.98);
        }

        .upload-new-card .icon {
            font-size: 48px;
            position: relative;
            z-index: 1;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .upload-new-card .icon svg {
            width: 48px;
            height: 48px;
            display: block;
        }

        .upload-new-card .text {
            font-size: 15px;
            font-weight: 700;
            text-align: center;
            color: #FFFFFF;
            position: relative;
            z-index: 1;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            line-height: 1.3;
        }


        /* Skeleton loader */
        .reference-card.loading-img img {
            opacity: 0;
        }

        .reference-card.loading-img::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, #0B0B12 25%, #1a1a1a 50%, #0B0B12 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* Staggered animation - только при первой загрузке */
        body:not(.gallery-loaded) .style-card-container {
            opacity: 0;
            animation: fadeInUp 0.4s ease forwards;
        }

        /* При повторном показе (после modal) - сразу видимы */
        body.gallery-loaded .style-card-container {
            opacity: 1;
        }

        body:not(.gallery-loaded) .style-card-container:nth-child(1) { animation-delay: 0.05s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(2) { animation-delay: 0.1s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(3) { animation-delay: 0.15s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(4) { animation-delay: 0.2s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(5) { animation-delay: 0.25s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(6) { animation-delay: 0.3s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(7) { animation-delay: 0.35s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(8) { animation-delay: 0.4s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(n+9) { animation-delay: 0.45s; }


        /* Photo upload loader */
        .photo-loader {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            z-index: 10;
        }

        /* Spinner использует стили из loader.css */

        .photo-loaded {
            animation: photoFadeIn 0.3s ease forwards;
        }

        @keyframes photoFadeIn {
            from {
                opacity: 0;
                transform: scale(0.9);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* ✅ Удалено - используется глобальный .btn-action-primary и .buttons-container из common.css */

        /* Settings Button */
        .settings-button {
            width: 56px;
            height: 56px;
            border-radius: 28px;
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .settings-button:hover {
            background: rgba(255, 255, 255, 0.15);
            transform: scale(1.05);
        }

        .settings-button:active {
            transform: scale(0.95);
        }

        /* Model Settings Content */
        .model-settings-content {
            max-width: 500px;
            margin: 0 auto;
        }

        /* Model Option */
        .model-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            margin-bottom: 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .model-option:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(181, 101, 216, 0.3);
        }

        .model-option.active {
            background: rgba(181, 101, 216, 0.15);
            border-color: rgba(181, 101, 216, 0.5);
        }

        .model-info {
            flex: 1;
        }

        /* model-name и model-description moved to components.css */

        /* Toggle Switch */
        .toggle-switch {
            position: relative;
            width: 48px;
            height: 28px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 14px;
            transition: background 0.3s ease;
        }

        .model-option.active .toggle-switch {
            background: linear-gradient(90deg, #B565D8 0%, #6A2CFF 100%);
        }

        .toggle-slider {
            position: absolute;
            top: 3px;
            left: 3px;
            width: 22px;
            height: 22px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s ease;
        }

        .model-option.active .toggle-slider {
            transform: translateX(20px);
        }

        /* Generation Count Alert */
        .generation-count-alert {
            margin-top: 16px;
            padding: 0;
            max-height: 0;
            opacity: 0;
            overflow: hidden;
            background: rgba(181, 101, 216, 0.1);
            border: 1px solid rgba(181, 101, 216, 0.3);
            border-radius: 8px;
            color: rgba(255, 255, 255, 0.7);
            font-size: 13px;
            text-align: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .generation-count-alert.visible {
            padding: 12px;
            max-height: 100px;
            opacity: 1;
            animation: shimmerPulse 0.6s ease-out;
        }

        @keyframes shimmerPulse {
            0% {
                box-shadow: 0 0 0 0 rgba(181, 101, 216, 0.7);
                transform: scale(0.98);
            }
            50% {
                box-shadow: 0 0 20px 10px rgba(181, 101, 216, 0);
                transform: scale(1.02);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(181, 101, 216, 0);
                transform: scale(1);
            }
        }

        .generation-count-alert span {
            font-weight: 600;
            color: #B565D8;
        }

        /* Back Button */
        }

        /* Превью выбранного стиля на шаге 2 */
        .selected-style-preview {
            width: 120px !important;   /* Средний размер */
            max-width: 120px !important;
            margin: 0 auto 16px;       /* Больше отступ снизу до header */
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.3s ease, visibility 0s 0.3s;
        }

        .selected-style-preview.show {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transition: opacity 0.3s ease, visibility 0s 0s;
        }

        .selected-style-preview .preview-card {
            aspect-ratio: 3/4;
            border-radius: 24px;
            overflow: hidden;
            box-shadow:
                0 0 40px rgba(106, 44, 255, 0.6),
                0 0 80px rgba(181, 101, 216, 0.4),
                inset 0 0 30px rgba(106, 44, 255, 0.3);
            position: relative;
        }

        .selected-style-preview .preview-card::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 24px;
            padding: 2px;
            background: linear-gradient(135deg, #6A2CFF, #B565D8, #00C8FF);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
            z-index: 1;
        }

        .selected-style-preview .preview-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .selected-style-preview .preview-label {
            text-align: center;
            margin-top: 6px;     /* Уменьшен */
            font-size: 11px;     /* Уменьшен */
            font-weight: 600;
            color: #8A8FA3;
        }

        /* FLIP Animation */

        /* Горизонтальный слайдер профилей - ПОЛНОСТЬЮ ПЕРЕПИСАН v21.0 */
        #gallery-profiles {
            display: flex !important;
            flex-direction: row;
            gap: 20px;
            /* Большой padding для свечения со всех сторон */
            padding: 60px 20px;
            /* НЕ используем margin - держим все внутри */
            overflow-x: auto;
            overflow-y: visible;
            scrollbar-width: none;
            -ms-overflow-style: none;
            scroll-behavior: smooth;
            -webkit-overflow-scrolling: touch;
            /* Фиксируем ширину чтобы scrollbar работал */
            width: 100%;
        }

        #gallery-profiles::-webkit-scrollbar {
            display: none;
        }

        /* Карточки профилей и загрузки */
        #gallery-profiles .profile-card,
        #gallery-profiles .upload-new-card {
            flex-shrink: 0;
            width: 140px;
            min-width: 140px;
            height: 140px;
            border-radius: 24px;
            position: relative;
            transition: filter 0.3s ease;
            cursor: pointer;
        }

        /* Выбранный профиль - стиль как у превью */
        #gallery-profiles .profile-card.selected {
            transform: scale(1.02);
            filter: none !important; /* Отключаем старое свечение из общего стиля */
            box-shadow:
                0 0 40px rgba(106, 44, 255, 0.6),
                0 0 80px rgba(181, 101, 216, 0.4),
                inset 0 0 30px rgba(106, 44, 255, 0.3);
        }

        /* Градиентная рамка для выбранного профиля (статический градиент как у превью) */
        #gallery-profiles .profile-card.selected::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 24px;
            padding: 2px;
            background: linear-gradient(135deg, #6A2CFF, #B565D8, #00C8FF);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
            z-index: 1;
        }

        /* Галочка для выбранного профиля */
        #gallery-profiles .profile-card.selected::after {
            content: '✓';
            position: absolute;
            top: 12px;
            right: 12px;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #6A2CFF 0%, #B565D8 50%, #00C8FF 100%);
            color: #FFFFFF;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            border: 2px solid rgba(255, 255, 255, 0.4);
            z-index: 3;
        }


/* Profiles Slider styles moved to components.css */

/* ============================================
   Inline Styles Migration
   Refactored styles from inline HTML attributes
   ============================================ */

/* Utility classes */
.hidden {
    display: none;
}

/* Model settings (shared with custom-style) */
.model-settings-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

/* Legacy upload section (step3) */
.upload-container-center {
    text-align: center;
    margin: 20px 0;
}

.legacy-upload-btn {
    background: linear-gradient(90deg, #3A1CFF 0%, #6A2CFF 20%, #B565D8 40%, #00C8FF 60%, #6A2CFF 80%, #3A1CFF 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    color: #FFFFFF;
    padding: 18px 48px;
    border-radius: 24px;
    font-size: 17px;
    font-weight: 700;
    border: 2px solid rgba(181, 101, 216, 0.5);
    box-shadow: 0 8px 24px rgba(181, 101, 216, 0.5), 0 4px 12px rgba(106, 44, 255, 0.3);
    cursor: pointer;
    min-width: 280px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photos-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.photo-status-container {
    text-align: center;
    margin: 20px 0;
}

.photo-status-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.photo-count-current {
    color: #999;
}

.photo-count-total {
    color: #666;
}

.photo-hint-text {
    font-size: 14px;
    color: #666;
}

/* Profile save section (step4) */
.profile-save-container {
    margin: 40px 20px;
}

.profile-name-input {
    width: 100%;
    background: #1a1a1a;
    color: white;
    padding: 16px;
    border-radius: 20px;
    font-size: 16px;
    border: 2px solid #333;
    margin-bottom: 20px;
}

.confirm-save-btn {
    width: 100%;
    background: linear-gradient(90deg, #3A1CFF 0%, #6A2CFF 20%, #B565D8 40%, #00C8FF 60%, #6A2CFF 80%, #3A1CFF 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    color: #FFFFFF;
    padding: 18px 48px;
    border-radius: 24px;
    font-size: 17px;
    font-weight: 700;
    border: 2px solid rgba(181, 101, 216, 0.5);
    box-shadow: 0 8px 24px rgba(181, 101, 216, 0.5), 0 4px 12px rgba(106, 44, 255, 0.3);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skip-save-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 18px 48px;
    border-radius: 24px;
    font-size: 17px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

/* ============================================
   Горизонтальные слайдеры групп
   ============================================ */

.group-section {
    grid-column: 1 / -1; /* Занимает всю ширину сетки */
    margin: 16px 0 24px 0;
}

.group-header {
    padding: 0 0 12px 0;
    margin: 0 8px; /* Отступы как у карточек */
}

.group-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
}

.group-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.group-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 0 -8px; /* Компенсация отступов галереи */
}

.group-slider {
    display: flex;
    gap: 16px;
    padding: 0 8px; /* Соответствует padding галереи */
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE и Edge */
    scroll-snap-type: x mandatory;
}

.group-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.group-slider.auto-scrolling {
    scroll-behavior: smooth;
}

.group-slider .style-card-container {
    flex: 0 0 calc(30% - 10px); /* 3 карточки видимы + 4-я торчит */
    min-width: calc(30% - 10px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* ============================================
   Нижний бар меню - стили теперь в common.css
   ============================================ */

/* ============================================
   Upload Progress Overlay (v24.334 - Centered White)
   ============================================ */

/* Overlay поверх shimmer карточки - СТРОГО ПО ЦЕНТРУ */
.upload-progress-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 100;
}

/* Контейнер для loader - относительное позиционирование для процентов */
.upload-progress-overlay .circular-loader-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

/* Круговой прогресс SVG */
.upload-progress-overlay .circular-progress {
    display: block;
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 16px rgba(255, 255, 255, 0.25));
}

/* Плавная анимация заполнения круга */
.upload-progress-overlay .progress-circle-fill {
    transition: stroke-dashoffset 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Проценты СТРОГО внутри круга */
.upload-progress-overlay .progress-percent-overlay {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 101 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* ============================================
   CRITICAL OVERRIDES - MUST BE AT END
   ============================================ */

/* Step2 profiles - используем стили из components.css */

/* Кнопка "Создай стиль" */
.tools-section {
    padding: 28px 16px;
    overflow: visible;
}

.custom-prompt-btn {
    --round: 24px;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.1s ease;
    background: #7a5af8;
    border-radius: var(--round);
    border: none;
    outline: none;
    padding: 18px 24px;
    margin: 0 auto;
    width: 75%;
    max-width: 260px;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.custom-prompt-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 50%);
    border-radius: var(--round);
    pointer-events: none;
    z-index: 1;
}

.custom-prompt-btn:active,
.custom-prompt-btn.btn-pressed {
    transform: scale(0.92);
    transition: transform 0.05s ease;
}

.custom-prompt-btn .points_wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.custom-prompt-btn .points_wrapper .point {
    bottom: -10px;
    position: absolute;
    animation: floating-points infinite ease-in-out;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 9999px;
}

@keyframes floating-points {
    0% {
        transform: translateY(0);
    }
    85% {
        opacity: 0;
    }
    100% {
        transform: translateY(-55px);
        opacity: 0;
    }
}

.custom-prompt-btn .points_wrapper .point:nth-child(1) {
    left: 10%;
    opacity: 1;
    animation-duration: 2.35s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(2) {
    left: 30%;
    opacity: 0.7;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(3) {
    left: 25%;
    opacity: 0.8;
    animation-duration: 2.2s;
    animation-delay: 0.1s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(4) {
    left: 44%;
    opacity: 0.6;
    animation-duration: 2.05s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(5) {
    left: 50%;
    opacity: 1;
    animation-duration: 1.9s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(6) {
    left: 75%;
    opacity: 0.5;
    animation-duration: 1.5s;
    animation-delay: 1.5s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(7) {
    left: 88%;
    opacity: 0.9;
    animation-duration: 2.2s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(8) {
    left: 58%;
    opacity: 0.8;
    animation-duration: 2.25s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(9) {
    left: 98%;
    opacity: 0.6;
    animation-duration: 2.6s;
    animation-delay: 0.1s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(10) {
    left: 65%;
    opacity: 1;
    animation-duration: 2.5s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .inner {
    z-index: 2;
    gap: 6px;
    position: relative;
    width: 100%;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.2s ease-in-out;
}

.custom-prompt-btn .inner .icon {
    width: 18px;
    height: 18px;
}
