/* ===== Preflight (упрощённый) ===== */
*,
::before,
::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

body {
    margin: 0;
    line-height: inherit;
    color: #111827;
    background: #fff;
}

h1,
h2,
h3,
h4,
p {
    margin: 0
}

button {
    all: unset;
    box-sizing: border-box
}

img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto
}

:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px
}

/* ===== Цвета/шрифты ===== */
:root {
    --black: #0f172a;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --border: #e5e7eb;
    --bg-soft: #f8fafc;
    --card: #ffffff;
    --primary: #111827;
    --buy: #111827;
    --buy-text: #ffffff;
    --price-gray: #f3f4f6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
    --anim-fast: 150ms;
    --anim-medium: 260ms;
    --anim-slow: 420ms;
    --soft-shadow: 0 18px 36px rgba(2, 6, 23, 0.06);
}

/* ===== Контейнер/сетка/утилиты ===== */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem
}

@media(min-width:640px) {
    .container {
        max-width: 640px
    }
}

@media(min-width:768px) {
    .container {
        max-width: 768px
    }
}

@media(min-width:1024px) {
    .container {
        max-width: 1024px
    }
}

@media(min-width:1280px) {
    .container {
        max-width: 1240px;
        padding-left: 2rem;
        padding-right: 2rem
    }
}

.mx-auto {
    margin-left: auto;
    margin-right: auto
}

.mt-2 {
    margin-top: .5rem
}

.mt-3 {
    margin-top: .75rem
}

.mt-4 {
    margin-top: 1rem
}

.mt-6 {
    margin-top: 1.5rem
}

.mt-8 {
    margin-top: 2rem
}

.mt-10 {
    margin-top: 2.5rem
}

.mt-12 {
    margin-top: 3rem
}

.mt-16 {
    margin-top: 4rem
}

.mb-2 {
    margin-bottom: .5rem
}

.mb-3 {
    margin-bottom: .75rem
}

.mb-4 {
    margin-bottom: 1rem
}

.mb-6 {
    margin-bottom: 1.5rem
}

.mb-8 {
    margin-bottom: 2rem
}

.mb-12 {
    margin-bottom: 3rem
}

.pt-14 {
    padding-top: 3.5rem
}

.pb-28 {
    padding-bottom: 7rem
}

.py-2 {
    padding: .5rem 0
}

.py-3 {
    padding: .75rem 0
}

.py-4 {
    padding: 1rem 0
}

.px-3 {
    padding-left: .75rem;
    padding-right: .75rem
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem
}

.px-5 {
    padding-left: 1.25rem;
    padding-right: 1.25rem
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem
}

.p-4 {
    padding: 1rem
}

.p-6 {
    padding: 1.5rem
}

.flex {
    display: flex
}

.flex-col {
    flex-direction: column
}

.inline-flex {
    display: inline-flex
}

.grid {
    display: grid
}

.hidden {
    display: none
}

.items-center {
    align-items: center
}

.justify-between {
    justify-content: space-between
}

.justify-center {
    justify-content: center
}

.gap-2 {
    gap: .5rem
}

.gap-3 {
    gap: .75rem
}

.gap-4 {
    gap: 1rem
}

.gap-6 {
    gap: 1.5rem
}

.gap-8 {
    gap: 2rem
}

.text-center {
    text-align: center
}

.text-right {
    text-align: right
}

.text-xs {
    font-size: .75rem;
    line-height: 1rem
}

.text-sm {
    font-size: .875rem;
    line-height: 1.25rem
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem
}

@media(min-width:768px) {
    .md\:grid {
        display: grid
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr))
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .pricing-grid {
        max-width: 780px;
        /* уменьшено с 1200px для более компактного расположения */
        margin: 0 auto;
        justify-items: center;
        gap: 0.75rem;
        /* плитки ближе */
    }

    /* Галерея - сетка */
    .gallery-grid-container {
        margin-top: 2rem;
    }

    .gallery-item {
        width: 100%;
        aspect-ratio: 1;
        overflow: hidden;
        border-radius: 0.75rem;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .gallery-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }

    .gallery-thumb {
        width: 100%;
        height: 100%;
    }

    .gallery-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Кнопка Load More */
    .gallery-load-more-btn {
        display: block;
        margin: 2rem auto 0;
        padding: 0.75rem 1.5rem;
        background: #111827;
        color: white;
        border: none;
        border-radius: 0.5rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
    }

    .gallery-load-more-btn:hover {
        background: #374151;
    }

    /* Модальное окно для сравнения */
    .gallery-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10000; /* Увеличиваем до уровня других модальных окон */
    }

    .gallery-modal.active {
        display: flex !important;
        align-items: center;
        justify-content: center;
        visibility: visible;
        opacity: 1;
    }

    .gallery-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
    }

    .gallery-modal-content {
        position: relative;
        z-index: 1001;
        max-width: 90vw;
        max-height: 90vh;
        width: 100%;
        background: white;
        border-radius: 0.75rem;
        padding: 1rem;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
    }

    .gallery-modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
        z-index: 1002;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
        padding: 0;
        margin: 0;
    }

    .gallery-modal-close::before {
        content: '×';
        display: block;
        line-height: 1;
        font-size: 2rem;
        /* Увеличено с 1.5rem для лучшей видимости */
        font-weight: 300;
        margin: 0;
        padding: 0;
    }

    .gallery-modal-close:hover {
        background: rgba(0, 0, 0, 0.7);
    }

    .gallery-modal-slider {
        width: 100%;
    }

    .gallery-modal-slider-wrapper {
        position: relative;
        width: 100%;
        max-width: 1200px;
        max-height: calc(90vh - 4rem);
        min-height: 500px;
        /* Увеличено с 400px чтобы кнопки не налазили */
        aspect-ratio: 4/3;
        margin: 0 auto;
        overflow: hidden;
        border-radius: 0.5rem;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Стили для состояния загрузки */
    .gallery-modal-slider>div:not(.gallery-modal-slider-wrapper) {
        min-height: 500px;
        /* Минимальная высота для loading сообщения */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Кнопки навигации в модальном окне */
    .gallery-modal-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1003;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .gallery-modal-nav:hover {
        transform: translateY(-50%) translateY(-3px);
        box-shadow: 0 10px 20px rgba(2, 6, 23, 0.15);
        background: rgba(255, 255, 255, 1);
    }

    .gallery-modal-nav.prev {
        left: 1rem;
    }

    .gallery-modal-nav.next {
        right: 1rem;
    }

    .gallery-modal-nav:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .gallery-modal-nav:disabled:hover {
        transform: translateY(-50%);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .gallery-comparison-before,
    .gallery-comparison-after {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: 100%;
        /* Убеждаемся что занимают всю высоту */
        overflow: hidden;
    }

    .gallery-comparison-before {
        z-index: 1;
    }

    .gallery-comparison-after {
        z-index: 2;
        clip-path: inset(0 0 0 50%);
        /* Обрезаем слева, показываем справа (after) */
    }

    .gallery-comparison-before img,
    .gallery-comparison-after img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        max-width: 100%;
        max-height: 100%;
    }

    .gallery-comparison-slider {
        position: absolute;
        top: 0;
        left: 50%;
        width: 4px;
        height: 100%;
        background: rgba(255, 255, 255, 0.5);
        z-index: 3;
        cursor: ew-resize;
        transform: translateX(-50%);
    }

    .gallery-comparison-handle {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 48px;
        height: 48px;
        background: white;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-comparison-handle-arrows {
        display: flex;
        gap: 4px;
    }

    /* Мобильная адаптация для галереи */
    @media (max-width: 767px) {
        .gallery-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }

        /* Исправляем .gallery-card на мобильных - убираем фиксированную высоту */
        .gallery-card {
            width: 100% !important;
            height: auto !important;
            min-height: 0 !important;
            aspect-ratio: unset !important;
        }

        /* Встроенный слайдер в карточке галереи на мобильных */
        /* Используем ТУ ЖЕ структуру и классы, что в загрузчике */
        .gallery-card-slider-wrapper {
            position: relative;
            width: 100%;
            max-width: 100%;
            overflow: hidden;
            border-radius: 1rem;
            background: #ffffff;
            min-height: 200px;
        }
        
        /* Применяем те же стили, что для .uploader .comparison-* */
        .gallery-card-slider-wrapper .comparison-before,
        .gallery-card-slider-wrapper .comparison-after {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-radius: 1rem;
            background: #ffffff;
        }
        
        .gallery-card-slider-wrapper .comparison-before {
            z-index: 1;
        }
        
        .gallery-card-slider-wrapper .comparison-after {
            z-index: 2;
            clip-path: inset(0 0 0 50%); /* Обрезаем слева, показываем справа (after = результат) */
        }
        
        .gallery-card-slider-wrapper .comparison-before img,
        .gallery-card-slider-wrapper .comparison-after img {
            object-fit: contain; /* ВСЕГДА contain - никогда не обрезать */
            width: 100%;
            height: 100%;
            display: block;
            border-radius: 1rem;
        }
        
        .gallery-card-slider-wrapper .comparison-slider {
            position: absolute;
            top: 0;
            left: 50%;
            width: 4px;
            height: 100%;
            background: rgba(17, 24, 39, 0.3);
            z-index: 3;
            cursor: ew-resize;
            transform: translateX(-50%);
            pointer-events: none;
        }
        
        .gallery-card-slider-wrapper .comparison-handle {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 48px;
            height: 48px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid rgba(17, 24, 39, 0.2);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 4;
            pointer-events: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        
        .gallery-card-slider-wrapper .comparison-handle-arrows {
            display: flex;
            gap: 2px;
            align-items: center;
        }
        
        .gallery-card-slider-wrapper .comparison-handle-arrows .chev {
            width: 8px;
            height: 8px;
            border-top: 2px solid #111827;
            border-left: 2px solid #111827;
        }
        
        /* Бирка всегда видна внизу */
        .gallery-card-slider-label {
            position: absolute;
            bottom: 0.5rem;
            left: 0.5rem;
            right: 0.5rem;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 0.5rem;
            border-radius: 0.25rem;
            font-size: 0.875rem;
            font-weight: 600;
            z-index: 10;
            pointer-events: none;
            text-align: center;
        }

        .gallery-modal-content {
            max-width: 95vw;
            max-height: 95vh;
            padding: 0.5rem;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .gallery-modal-slider {
            width: 100%;
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .gallery-modal-slider-wrapper {
            position: relative;
            aspect-ratio: 3/4;
            max-height: calc(95vh - 2rem);
            min-height: 300px;
            width: 100%;
            flex-shrink: 0;
            overflow: hidden;
        }
        
        .gallery-comparison-before,
        .gallery-comparison-after {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            min-height: 0;
            overflow: hidden;
        }
        
        .gallery-comparison-before img,
        .gallery-comparison-after img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            max-width: 100%;
            max-height: 100%;
        }
        
        .gallery-comparison-slider {
            position: absolute;
            top: 0;
            left: 50%;
            width: 4px;
            height: 100%;
            transform: translateX(-50%);
            z-index: 3;
        }
        
        .gallery-comparison-handle {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 4;
        }
        
        .gallery-card {
            touch-action: manipulation; /* Улучшает отзывчивость на touch */
            -webkit-tap-highlight-color: transparent; /* Убирает подсветку при тапе */
        }
    }

    .md\:text-left {
        text-align: left
    }

    .md\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem
    }

    .md\:pt-16 {
        padding-top: 4rem
    }

    .md\:text-5xl {
        font-size: 3rem;
        line-height: 1.1
    }
}

@media(min-width:1024px) {
    .lg\:px-10 {
        padding-left: 2.5rem;
        padding-right: 2.5rem
    }
}

.rounded {
    border-radius: .5rem
}

.rounded-lg {
    border-radius: .75rem
}

.rounded-xl {
    border-radius: 1rem
}

.rounded-2xl {
    border-radius: 1.25rem
}

.rounded-full {
    border-radius: 9999px
}

.border {
    border: 1px solid var(--border)
}

.border-dashed {
    border-style: dashed
}

.shadow {
    box-shadow: var(--shadow)
}

.font-medium {
    font-weight: 500
}

.font-semibold {
    font-weight: 600
}

.font-bold {
    font-weight: 700
}

.leading-tight {
    line-height: 1.15
}

.leading-snug {
    line-height: 1.25
}

.text-muted {
    color: var(--muted)
}

.text-muted-2 {
    color: var(--muted-2)
}

.text-black {
    color: var(--black)
}

.text-white {
    color: #fff
}

.text-primary {
    color: var(--primary)
}

.uppercase {
    text-transform: uppercase
}

.tracking-tight {
    letter-spacing: -.01em
}

.block {
    display: block
}

.w-full {
    width: 100%
}

/* ===== Header ===== */
.header {
    height: 80px;
    padding-left: .75rem;
    padding-right: .75rem;
    display: flex;
    align-items: center
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 56px;
    width: auto;
    display: block;
}

.header nav a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500
}

.header nav a:hover {
    color: inherit
}

/* ===== Hero ===== */
.hero-banner {
    width: 100%;
    padding-top: 80px;
    padding-bottom: 12px;
    text-align: center
}

.hero-banner .hero-title {
    white-space: nowrap;
    display: block;
    margin: 0 auto;
    max-width: 80ch;
    width: calc(100% - 40px);
    font-size: clamp(1.875rem, 3.5vw, 3.25rem);
    line-height: 1.05;
    font-weight: 700;
}

.hero-section {
    position: relative;
    padding-top: 0;
    padding-bottom: 24px;
    max-width: 100%
}

.hero-section p {
    margin-top: .75rem;
    color: var(--muted)
}

@media(max-width:1200px) {
    .hero-section {
        padding-top: 100px
    }
}

@media(max-width:767px) {
    .hero-banner {
        padding-top: 24px;
        padding-bottom: 8px
    }

    .hero-banner .hero-title {
        white-space: normal
    }

    .hero-section {
        padding-top: 8px;
        padding-bottom: 8px
    }
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border);
    padding: .375rem .75rem;
    border-radius: 9999px;
    background: #fff;
    color: #111827;
    font-size: .875rem;
    font-weight: 500;
    transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast), background var(--anim-fast);
    cursor: pointer;
    user-select: none;
}

.badge:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 24px rgba(2, 6, 23, .06)
}

.badge.is-active {
    background: #111827;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(17, 24, 39, .06)
}

.badge:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.badge-sm {
    padding: .25rem .6rem;
    font-size: .825rem
}

/* БАЗА — оставить одну */
.uploader {
    aspect-ratio: 3 / 2;
    /* Соотношение 3:2 (1.5:1) */
    max-height: 400px;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
    width: 100%;
    cursor: pointer;

    /* ховер/анимации */
    position: relative;
    overflow: hidden;
    transition:
        transform var(--anim-medium) cubic-bezier(.2, .9, .2, 1),
        box-shadow var(--anim-medium),
        border-color var(--anim-fast),
        height var(--anim-medium),
        aspect-ratio var(--anim-medium);
}

.uploader:hover:not(.comparison-mode) {
    transform: translateY(-6px);
    box-shadow: var(--soft-shadow);
    border-color: #d1d5db;
}

/* Респонсы — только ширина/высота, без дубликатов свойств */
@media (min-width: 768px) {
    .uploader {
        max-height: 500px;
        max-width: 820px;
        margin: 0 auto;
    }
}

/* Если у uploader установлен кастомный aspect-ratio через style, отключаем дефолтный */
.uploader.has-custom-aspect {
    aspect-ratio: unset;
    max-height: none !important; /* Убираем ограничение по высоте для загруженных изображений */
}

@media (min-width: 1280px) {
    .uploader {
        max-width: 880px;
    }
}

@media (min-width: 1920px) {
    .uploader {
        max-width: 720px;
    }

    /* под твой макет, если нужно */
}

/* Если используешь пульс — опционально */
@keyframes pulse-dash {
    0% {
        box-shadow: none;
        border-color: rgba(229, 231, 235, 1);
    }

    50% {
        box-shadow: 0 12px 28px rgba(17, 24, 39, .03);
        border-color: rgba(239, 68, 68, .06);
    }

    100% {
        box-shadow: none;
        border-color: rgba(229, 231, 235, 1);
    }
}

.uploader.pulse {
    animation: pulse-dash 3.6s ease-in-out infinite;
}


/* ===== Controls (центр блока, внутри — слева) ===== */
.controls-wrapper {
    display: flex;
    justify-content: center;
    width: 100%
}

.controls-content {
    width: 560px;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    align-items: center;
    padding: 0 20px;
}

.controls-content .row {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.controls-content .row .badge {
    min-width: 120px;
    flex-shrink: 0;
    justify-content: center;
}

.controls-content .row .desc {
    text-align: center;
    max-width: 400px;
}

/* ===== Buttons/Chips ===== */
.action-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: .35rem .8rem;
    font-weight: 600;
    transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast);
    cursor: pointer;
}

.action-chip:active,
.buy:active {
    transform: translateY(1px)
}

.action-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-chip--sm {
    padding: .28rem .7rem;
    font-size: .9rem;
    line-height: 1.1;
    border-radius: 9999px
}

.desc {
    color: var(--muted);
    font-size: .875rem
}

.desc--tight {
    font-size: .875rem;
    line-height: 1.2
}

/* ===== Cards / Pricing ===== */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp var(--anim-slow) cubic-bezier(.2, .9, .2, 1) forwards;
    transition: transform var(--anim-medium), box-shadow var(--anim-medium);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 48px rgba(2, 6, 23, .08)
}

@media(min-width:768px) {
    .md\:grid .card:nth-child(1) {
        animation-delay: .04s
    }

    .md\:grid .card:nth-child(2) {
        animation-delay: .08s
    }

    .md\:grid .card:nth-child(3) {
        animation-delay: .12s
    }

    .md\:grid .card:nth-child(4) {
        animation-delay: .16s
    }
}

/* Подсветка активного плана */
.card.active {
    border: 2px solid #111827;
    box-shadow: 0 22px 48px rgba(17, 24, 39, .15);
}

.buy {
    display: block;
    width: 100%;
    text-align: center;
    padding: .6rem 1rem;
    border-radius: .5rem;
    background: var(--buy);
    color: var(--buy-text);
    font-weight: 600;
    transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast);
    cursor: pointer
}

.buy:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(17, 24, 39, .06)
}

/* Стиль для неактивной кнопки Active */
.buy:disabled,
.buy.active-plan {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.buy.active-plan:hover {
    transform: none;
    box-shadow: none;
}

.price {
    font-size: 1.75rem;
    font-weight: 800
}

.price small {
    font-weight: 400;
    font-size: .875rem;
    color: var(--muted)
}

.price-amount {
    display: inline-block;
    transition: transform var(--anim-fast) ease, opacity var(--anim-fast) ease;
    min-width: 2ch;
    text-align: left;
}

.price-amount.updating {
    transform: translateY(-6px);
    opacity: .2
}

.subnote {
    font-size: .75rem;
    color: var(--muted-2);
    text-align: center
}

/* Стиль для периода оплаты в карточках (без центрирования) */
.billing-period {
    font-size: .75rem;
    color: var(--muted-2);
    text-align: left;
    /* Оставляем по левому краю */
}

/* Стиль для заметки о скидке в карточках */
.annual-save-note {
    font-size: .75rem;
    color: var(--muted-2);
    text-align: left;
}

.hr {
    height: 1px;
    background: var(--border);
    border: 0
}

.max-w-prose {
    max-width: 64ch
}

/* ===== Toggle ===== */
/* Контейнер для переключателя и текста - гарантированное центрирование */
.text-center.mb-6>.flex.flex-col {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.text-center.mb-6>.flex.flex-col .subnote {
    text-align: center !important;
    width: 100%;
}

.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    padding: 4px;
    border-radius: 9999px;
    gap: 6px;
    margin-left: auto;
    margin-right: auto;
}

.toggle .chip {
    position: relative;
    z-index: 1;
    padding: .45rem 1rem;
    border-radius: 9999px;
    font-size: .875rem;
    color: #374151;
    background: transparent;
    transition: color var(--anim-fast), transform var(--anim-fast), box-shadow var(--anim-fast);
    cursor: pointer;
    border: none
}

.toggle .chip.active {
    color: #fff;
    transform: translateY(-1px)
}

/* Ползунок активного состояния */
.toggle .toggle-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 8px);
    height: calc(100% - 8px);
    background: #111827;
    border-radius: 9999px;
    transition: transform var(--anim-medium) cubic-bezier(.2, .9, .2, 1);
    box-shadow: 0 2px 8px rgba(17, 24, 39, .25);
}

/* Сдвиг ползунка для monthly */
.toggle.monthly .toggle-thumb {
    transform: translateX(100%);
}

/* ===== History ===== */
.history-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
}

.history-strip {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: auto;
    padding: .75rem 1.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.history-strip::-webkit-scrollbar {
    display: none
}

.thumb {
    width: 140px;
    height: 88px;
    border: 1px dashed var(--border);
    border-radius: .75rem;
    background: var(--bg-soft);
    transition: transform var(--anim-medium) cubic-bezier(.2, .9, .2, 1), box-shadow var(--anim-medium)
}

.thumb:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(2, 6, 23, .08)
}

.mini {
    font-size: .75rem;
    color: #6b7280
}

/* ===== Arrows ===== */
.arrow {
    transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast);
    width: 44px;
    height: 44px;
    min-width: 44px;
    /* Предотвращает сжатие */
    min-height: 44px;
    /* Предотвращает сжатие */
    flex-shrink: 0;
    /* Не сжимается в flex контейнере */
    border-radius: 9999px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer
}

.arrow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(2, 6, 23, .06)
}

.chev {
    width: 9px;
    height: 9px;
    border-top: 2px solid #111827;
    border-left: 2px solid #111827
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Focus outline — мягче */
:focus-visible {
    outline: 3px solid rgba(17, 24, 39, .10);
    outline-offset: 3px
}

.uploader.dragover {
    border-color: #111827;
    box-shadow: 0 18px 36px rgba(2, 6, 23, .06);
    transform: translateY(-4px);
}

.uploader img.preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.uploader-content {
    pointer-events: none;
}

/* Стили для слайдера ВНУТРИ uploader */
.uploader.comparison-mode {
    border: none;
    background: #ffffff !important;
    /* Белый фон - наименее заметный */
    cursor: default;
    overflow: hidden;
    /* Скрываем содержимое, выходящее за границы */
    box-shadow: var(--shadow);
    border-radius: 1rem;
    /* Закругленные уголки контейнера */
}

.uploader.comparison-mode:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.uploader.smart-overlay {
    overflow: hidden;
    /* Скрываем артефакты */
    border-radius: 1rem;
}

.uploader .comparison-before,
.uploader .comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Правильная обрезка */
    border-radius: 1rem;
    /* Закругленные уголки для каждого контейнера */
    background: #ffffff;
    /* Белый фон */
}

.uploader .comparison-before {
    z-index: 1;
}

.uploader .comparison-after {
    z-index: 2;
    clip-path: inset(0 0 0 50%); /* Обрезаем слева, показываем справа (after = результат) */
    border-radius: 1rem;
}

.uploader .comparison-before img,
.uploader .comparison-after img {
    object-fit: contain;
    /* ВСЕГДА contain - никогда не обрезать */
    width: 100%;
    /* Заполняем контейнер по ширине */
    height: 100%;
    /* Заполняем контейнер по высоте */
    display: block;
    border-radius: 1rem;
    /* Закругленные уголки для каждого изображения */
    /* Изображения всегда показываются полностью без обрезки */
}

.uploader .comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: rgba(17, 24, 39, 0.3);
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.uploader .comparison-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(17, 24, 39, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: ew-resize;
    transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast);
}

.uploader .comparison-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.uploader .comparison-handle-arrows {
    display: flex;
    gap: 2px;
    align-items: center;
}

.uploader .comparison-handle-arrows .chev {
    width: 8px;
    height: 8px;
    border-top: 2px solid #111827;
    border-left: 2px solid #111827;
}

/* Мобильная адаптация для слайдера сравнения */
@media (max-width: 767px) {
    .uploader.comparison-mode {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto;
    }
    
    .uploader.comparison-mode.has-custom-aspect {
        max-width: calc(100vw - 40px) !important;
        width: calc(100vw - 40px) !important;
    }
    
    .uploader .comparison-before,
    .uploader .comparison-after {
        max-width: 100%;
    }
    
    .uploader .comparison-before img,
    .uploader .comparison-after img {
        max-width: 100%;
        height: auto;
    }
}

/* Ссылка Download: чёрная, без подчёркивания, как текст в макете */
.status-download {
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    opacity: .9;
}

.status-download:hover {
    opacity: 1;
}

.status-download.disabled {
    pointer-events: none;
    opacity: .35;
    text-decoration: none;
}

.status-right {
    color: var(--muted-2);
}

/* Лаконичный мини-лог под строкой статуса */
.mini-log {
    margin: .25rem 0 0;
    padding: 0;
    list-style: none;
    font-size: .875rem;
    color: var(--muted-2);
}

.mini-log li {
    margin-top: .15rem;
}

/* Status под загрузчиком — ровно как у .uploader */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    width: 100%;
    margin: 12px auto 0;
    /* вплотную под загрузчик и по центру */
}

/* такие же max-width, как у .uploader */
@media (min-width:768px) {
    .status-bar {
        max-width: 820px;
    }
}

@media (min-width:1280px) {
    .status-bar {
        max-width: 880px;
    }
}

@media (min-width:1920px) {
    .status-bar {
        max-width: 720px;
    }
}

/* ===== Loading State (минималистичный с прогресс-баром) ===== */
.uploader.generating {
    pointer-events: none;
    position: relative;
    animation: uploaderPulse 2s ease-in-out infinite;
    will-change: transform, opacity;
    /* Оптимизация для производительности */
}

/* Улучшенная пульсация холста (scale + opacity для более заметного эффекта) */
@keyframes uploaderPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.01);
        /* Легкое увеличение для пульсации */
    }
}

/* Белый оверлей - убираем border, чтобы не было артефактов */
.uploader.generating::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    /* Такие же загругленные уголки как у .uploader */
    z-index: 10;
    animation: fadeIn 0.3s ease;
    /* Убираем любые border/outline */
    border: none;
    outline: none;
    box-shadow: none;
}

/* Контейнер для прогресс-бара и статуса */
.uploader-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    text-align: center;
    width: 80%;
    max-width: 320px;
    animation: fadeIn 0.3s ease;
}

/* Текст статуса */
.uploader-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

/* Прогресс-бар (минималистичный) */
.uploader-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.uploader-progress-bar {
    height: 100%;
    background: #111827;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Процент */
.uploader-loading-percent {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Оптимизация пульсации для мобильных устройств */
@media (max-width: 768px) {
    .uploader.generating {
        /* На мобильных используем только opacity для экономии ресурсов */
        animation: uploaderPulseMobile 2s ease-in-out infinite;
    }

    @keyframes uploaderPulseMobile {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.88;
        }
    }
}

/* Простая анимация загрузки */
.simple-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.simple-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(17, 24, 39, 0.1);
    border-top-color: #111827;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Компенсируем вращение родителя, чтобы секундомер оставался статичным */
.simple-spinner .loading-seconds {
    position: absolute;
    color: #111827;
    font-weight: 600;
    font-size: 12px;
    margin: 0;
    line-height: 1;
    z-index: 1;
    animation: spin-reverse 1s linear infinite;
    transform-origin: center center;
}

@keyframes spin-reverse {
    to {
        transform: rotate(-360deg);
    }
}

.simple-loading-text {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.loading-message {
    color: #111827;
}

.loading-dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

/* Блокировка истории во время генерации */
.history-strip.disabled {
    pointer-events: none;
    opacity: 0.5;
    filter: grayscale(50%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Блокировка Download во время генерации */
.status-download.disabled {
    pointer-events: none;
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===== Auth Links ===== */
#auth-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

#auth-nav a,
#auth-nav button,
.auth-links-container {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 0.25rem;
}

.auth-link {
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    padding: 0.25rem;
}

#auth-nav a:hover,
#auth-nav button:hover,
.auth-link:hover {
    color: var(--black);
    text-decoration: none;
}

/* ===== User Menu / Avatar Dropdown ===== */
.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-avatar {
    width: 47px;
    height: 47px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-soft);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--anim-fast) ease;
}

.user-avatar:hover {
    border-color: var(--muted);
    transform: scale(1.05);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.avatar-initials {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--black);
    line-height: 1;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 24px rgba(2, 6, 23, .1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--anim-fast) ease;
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.dropdown-avatar-img,
.dropdown-avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dropdown-avatar-img {
    object-fit: cover;
    display: block;
}

.dropdown-avatar-initials {
    background: var(--bg-soft);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--black);
}

.user-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    font-weight: 600;
    color: var(--black);
    font-size: 0.875rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-email {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-credits {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.user-dropdown-item {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--black);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--anim-fast) ease;
}

.user-dropdown-item:hover {
    background: var(--bg-soft);
}

.user-dropdown-item:first-of-type {
    border-radius: 0.75rem 0.75rem 0 0;
}

.user-dropdown-item:last-of-type {
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Центрирование кнопок Manage billing и Sign out */
#billing-btn,
#logout-btn {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin-bottom: 8px;
}

/* ===== Subscription Modal ===== */
.subscription-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--anim-medium) ease;
}

.subscription-modal.active {
    opacity: 1;
    visibility: visible;
}

.subscription-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.subscription-modal-content {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(2, 6, 23, .2);
    max-width: 500px;
    width: calc(100% - 32px);
    padding: 2rem;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--anim-medium) ease;
}

.subscription-modal.active .subscription-modal-content {
    transform: translateY(0) scale(1);
}

.subscription-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--muted);
    transition: all var(--anim-fast) ease;
}

.subscription-modal-close:hover {
    background: var(--border);
    color: var(--black);
}

.subscription-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.subscription-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.subscription-modal-header p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
}

.subscription-modal-features {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-soft);
    border-radius: 0.5rem;
}

.feature-item {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--black);
}

.subscription-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.subscription-modal-btn-primary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: var(--black);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--anim-fast) ease;
}

.subscription-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(17, 24, 39, .2);
}

.subscription-modal-btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--anim-fast) ease;
}

.subscription-modal-btn-secondary:hover {
    border-color: var(--muted);
    color: var(--black);
}

/* Мобильные стили для кнопок */
@media (max-width: 767px) {

    /* Кнопки стилей - гарантированный перенос на несколько строк */
    .inline-flex.gap-3.flex-wrap {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 0.75rem;
        /* горизонтальный и вертикальный gap */
    }

    .badge[data-style] {
        flex-shrink: 0;
    }

    /* Pro Photo и Upscale - используют те же стили что и кнопки стилей (круглые) */
    /* Убираем любые переопределения, чтобы они выглядели как на ПК */
}

/* ===== Auth Modal ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--anim-medium) ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(2, 6, 23, .2);
    max-width: 400px;
    width: calc(100% - 32px);
    padding: 2rem;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--anim-medium) ease;
}

.auth-modal.active .auth-modal-content {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--anim-fast);
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

.auth-modal-close:hover {
    background: #f3f4f6;
    color: var(--black);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.auth-modal-header p {
    font-size: 0.875rem;
    color: var(--muted);
}

.auth-modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-modal-google-fallback {
    padding: 0.75rem 1.5rem;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--anim-fast);
}

.auth-modal-google-fallback:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===== Demo Slider ===== */
.demo-slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 1rem;
}

.demo-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.demo-slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.demo-split-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.demo-before,
.demo-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.demo-before {
    z-index: 1;
}

.demo-after {
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.demo-before img,
.demo-after img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.demo-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
}

.demo-divider:hover {
    width: 6px;
}

.demo-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.demo-handle-arrows {
    display: flex;
    gap: 4px;
}

.demo-try-free-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    padding: 1rem 2rem;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all var(--anim-fast);
}

.demo-try-free-btn:hover {
    background: #1f2937;
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.demo-try-free-btn:active {
    transform: translate(-50%, -50%) scale(0.98);
}

/* Мобильные стили для демо-слайдера */
@media (max-width: 767px) {
    .demo-try-free-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .demo-divider::before {
        width: 32px;
        height: 32px;
    }
    
    .demo-divider::after {
        font-size: 14px;
    }
}/* ===== Apple Design System ===== */
:root {
    --apple-black: #1d1d1f;
    --apple-gray: #86868b;
    --apple-light-gray: #f5f5f7;
    --apple-white: #ffffff;
    --apple-border: rgba(0, 0, 0, 0.1);
}

body {
    background: var(--apple-white);
    color: var(--apple-black);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px clamp(22px, 5vw, 44px);
    background: var(--apple-white);
    border-bottom: 1px solid var(--apple-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.72);
    gap: 32px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--apple-gray);
    text-decoration: none;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--apple-black);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--apple-black);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    width: 47px;
    height: 47px;
    display: block;
    object-fit: contain;
    padding-top: 8px;
    padding-bottom: 8px;
}

#auth-nav {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

#auth-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 980px;
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    color: var(--apple-gray);
    border: 1px solid transparent;
    transition: color 0.2s ease;
}

#auth-status:hover {
    color: var(--apple-black);
}

.page-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px clamp(22px, 5vw, 44px) 120px;
    display: grid;
    gap: 120px;
}

.section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: grid;
    gap: 0;
}

.hero-section {
    text-align: center;
    padding: 0;
}

.section-heading {
    display: grid;
    gap: 8px;
    text-align: center;
    margin-bottom: 48px;
}

.hero-section .section-heading {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    margin: 0;
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.05;
    color: var(--apple-black);
}

.hero-section .section-title {
    font-size: clamp(48px, 10vw, 112px);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.section-sub {
    margin: 0 auto;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.381;
    color: var(--apple-gray);
    font-weight: 400;
    max-width: 680px;
    text-align: center;
}

.hero-section .section-sub {
    margin: 0 auto;
    font-size: clamp(19px, 2.5vw, 24px);
}

.upload-section {
    margin-top: 0;
}

.upload-shell {
    display: grid;
    place-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: 1500px;
}

.uploader {
    width: 100%;
    max-width: 1500px;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    border: 1px solid var(--apple-border);
    background: var(--apple-light-gray);
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--apple-gray);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.uploader:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: #f0f0f2;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.upload-content strong {
    font-size: 19px;
    font-weight: 600;
    color: var(--apple-black);
    letter-spacing: -0.01em;
}

.upload-content span {
    font-size: 17px;
    color: var(--apple-gray);
}

.upload-cta {
    margin: 0;
    border: none;
    border-radius: 980px;
    padding: 12px 22px;
    background: var(--apple-black);
    color: var(--apple-white);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: -0.01em;
    box-shadow: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.upload-cta:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

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

.status-bar {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    padding: 16px 0;
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    margin-top: 16px;
}

.status-right {
    color: var(--apple-gray);
    font-size: 14px;
}

.status-download {
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-decoration: none;
    color: var(--apple-black);
    font-size: 14px;
    font-weight: 400;
    border-bottom: 1px solid var(--apple-black);
    transition: opacity 0.2s ease;
}

.status-download:hover {
    opacity: 0.6;
    transform: none;
}

.status-download.disabled {
    opacity: 0.3;
    pointer-events: none;
    border-bottom-color: var(--apple-gray);
}

.chip-band {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--apple-border);
    border-radius: 980px;
    padding: 8px 16px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    background: var(--apple-white);
    color: var(--apple-black);
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}

.badge:hover {
    background: var(--apple-light-gray);
    border-color: rgba(0, 0, 0, 0.15);
    transform: none;
}

.badge.is-active,
.badge.active {
    background: var(--apple-black);
    color: var(--apple-white);
    border-color: var(--apple-black);
    box-shadow: none;
}

.badge.is-active:hover,
.badge.active:hover {
    opacity: 0.9;
}

.badge-tonal {
    background: var(--apple-light-gray);
    border-color: transparent;
}

.badge-tonal:hover {
    background: #e8e8ed;
}

.enhance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.enh-card {
    border-radius: 18px;
    background: var(--apple-white);
    padding: 32px;
    display: grid;
    gap: 12px;
    box-shadow: none;
    border: 1px solid var(--apple-border);
    transition: border-color 0.2s ease, transform 0.1s ease;
}

.enh-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.enh-copy {
    margin: 0;
    color: var(--apple-gray);
    font-size: 17px;
    line-height: 1.47;
    font-weight: 400;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.gallery-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--apple-light-gray);
    box-shadow: 0 12px 24px rgba(16, 22, 33, 0.12);
    border: 1px solid var(--apple-border);
    transition: border-color 0.2s ease, transform 0.1s ease;
}

.gallery-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.gallery-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    filter: grayscale(10%);
}

.gallery-card .label {
    position: absolute;
    left: 16px;
    bottom: 16px;
    padding: 6px 12px;
    border-radius: 980px;
    background: rgba(29, 29, 31, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    color: var(--apple-white);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.gallery-load-more-btn {
    border: 1px solid var(--apple-border);
    border-radius: 980px;
    padding: 12px 22px;
    background: var(--apple-white);
    color: var(--apple-black);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: -0.01em;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    margin: 32px auto 0;
    display: block;
}

.gallery-load-more-btn:hover {
    background: var(--apple-light-gray);
    border-color: rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.pricing-header {
    display: grid;
    gap: 12px;
    text-align: center;
    margin-bottom: 40px;
}

#billing-note {
    text-align: center;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    border-radius: 980px;
    background: var(--apple-light-gray);
    position: relative;
    border: 1px solid var(--apple-border);
}

.toggle-thumb {
    position: absolute;
    inset: 4px auto 4px 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    border-radius: 980px;
    background: var(--apple-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle.monthly .toggle-thumb {
    transform: translateX(calc(100% + 4px));
}

.toggle .chip {
    position: relative;
    z-index: 1;
    border: none;
    border-radius: 980px;
    padding: 8px 20px;
    background: transparent;
    font-size: 17px;
    font-weight: 400;
    color: var(--apple-gray);
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.toggle .chip.active {
    color: var(--apple-white);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.plan-card {
    border-radius: 18px;
    background: var(--apple-white);
    padding: 40px 36px;
    box-shadow: none;
    border: 1px solid var(--apple-border);
    display: grid;
    gap: 16px;
    transition: border-color 0.2s ease;
    width: 100%;
    min-width: 0;
}

.plan-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.plan-card.active {
    border: 2px solid var(--apple-black);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.plan-card h3 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--apple-black);
}

.plan-card .price {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.07;
    color: var(--apple-black);
}

.plan-card .price small {
    font-size: 17px;
    font-weight: 400;
    color: var(--apple-gray);
}

.buy {
    border: none;
    border-radius: 980px;
    padding: 12px 22px;
    background: var(--apple-black);
    color: var(--apple-white);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: -0.01em;
    transition: opacity 0.2s ease, transform 0.1s ease;
    margin-top: 8px;
}

.buy:hover {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: none;
}

.buy:active {
    transform: scale(0.98);
}

.plan-card .text-sm {
    font-size: 14px;
    color: var(--apple-gray);
    margin: 0;
}

.billing-period {
    font-size: 14px;
    color: var(--apple-gray);
    margin: 0;
    min-height: 1.2em;
}

.credits-shell {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.credits-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.credit-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--apple-border);
    border-radius: 980px;
    background: var(--apple-white);
    font-size: 15px;
    font-weight: 400;
    color: var(--apple-black);
    letter-spacing: -0.01em;
}

.credit-value {
    color: var(--apple-gray);
    font-weight: 400;
}

@media (max-width: 1068px) {
    .page-shell {
        gap: 80px;
        padding: 60px clamp(22px, 5vw, 44px) 100px;
    }
    
    .section-title {
        font-size: clamp(32px, 6vw, 64px);
    }
    
    .hero-section .section-title {
        font-size: clamp(40px, 8vw, 96px);
    }
}

@media (max-width: 734px) {
    .top-bar {
        padding: 16px 22px;
        gap: 16px;
    }
    
    .main-nav {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 15px;
    }
    
    .auth-links-container {
        font-size: 15px;
    }
    
    .page-shell {
        gap: 64px;
        padding: 40px 22px 80px;
    }
    
    .section-heading {
        margin-bottom: 32px;
    }
    
    .hero-section .section-heading {
        margin-bottom: 48px;
    }
    
    .chip-band {
        gap: 8px;
    }
    
    .badge {
        font-size: 15px;
        padding: 6px 14px;
    }
    
    .enhance-grid,
    .gallery-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .plan-card {
        padding: 32px 24px;
    }
    
    .plan-card .price {
        font-size: 48px;
    }
}

/* ===== Apple-style Modals ===== */
.auth-modal-overlay,
.subscription-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
}

.auth-modal-content,
.subscription-modal-content {
    background: var(--apple-white);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--apple-border);
    max-width: 480px;
    padding: 40px;
}

.auth-modal-header h2,
.subscription-modal-header h2 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--apple-black);
    margin-bottom: 8px;
}

.auth-modal-header p,
.subscription-modal-header p {
    font-size: 17px;
    line-height: 1.47;
    color: var(--apple-gray);
    font-weight: 400;
}

.auth-modal-close,
.subscription-modal-close {
    width: 28px;
    height: 28px;
    background: var(--apple-light-gray);
    color: var(--apple-gray);
    font-size: 20px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.auth-modal-close:hover,
.subscription-modal-close:hover {
    background: #e8e8ed;
    color: var(--apple-black);
}

.subscription-modal-features {
    background: var(--apple-light-gray);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.feature-item {
    font-size: 17px;
    line-height: 1.47;
    color: var(--apple-black);
    padding: 8px 0;
    font-weight: 400;
}

.subscription-modal-btn-primary {
    background: var(--apple-black);
    color: var(--apple-white);
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    padding: 12px 22px;
    box-shadow: none;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.subscription-modal-btn-primary:hover {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: none;
}

.subscription-modal-btn-secondary {
    background: transparent;
    color: var(--apple-black);
    border: 1px solid var(--apple-border);
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    padding: 12px 22px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.subscription-modal-btn-secondary:hover {
    background: var(--apple-light-gray);
    border-color: rgba(0, 0, 0, 0.15);
}

.auth-modal-google-fallback {
    border: 1px solid var(--apple-border);
    border-radius: 980px;
    background: var(--apple-white);
    color: var(--apple-black);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-modal-google-fallback:hover {
    background: var(--apple-light-gray);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: none;
}
