* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Скрытые элементы для screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Offline индикатор */
.offline-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
    font-size: 14px;
    font-weight: 500;
}

.offline-indicator[aria-hidden="true"] {
    display: none;
}

.offline-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.offline-text {
    flex: 1;
}

/* Сообщения об ошибках */
.error-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Уведомления для админ-панели */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    max-width: 400px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.notification-success {
    background: rgba(76, 175, 80, 0.95);
    color: white;
}

.notification-error {
    background: rgba(244, 67, 54, 0.95);
    color: white;
}

.notification-info {
    background: rgba(33, 150, 243, 0.95);
    color: white;
}

:root {
    --typing-pulse: 1;
    --typing-scale: 1;
    --blob-scale-1: 1;
    --blob-scale-2: 1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #FFFFFF;
    color: #000000;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Blob-анимация на фоне (морфинг органических форм) */
body::before {
    content: '';
    position: fixed;
    width: 54%;
    height: 54%;
    top: var(--blob-1-top, 5%);
    left: var(--blob-1-left, 5%);
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity, filter, border-radius;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
    background: rgba(255, 215, 0, 0.25);
    border-radius: 35% 65% 65% 35% / 35% 35% 65% 65%;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    animation: morphBlob1 65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

body::after {
    content: '';
    position: fixed;
    width: 49.5%;
    height: 49.5%;
    bottom: var(--blob-2-bottom, 8%);
    right: var(--blob-2-right, 8%);
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity, filter, border-radius;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
    background: rgba(255, 215, 0, 0.22);
    border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%;
    border: 3px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    animation: morphBlob2 70s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

@keyframes morphBlob1 {
    0%, 100% { 
        transform: translate(0, 0) scale(calc(1 * var(--blob-scale-1, 1))) rotate(0deg);
        opacity: 1;
        border-radius: 25% 75% 75% 25% / 25% 25% 75% 75%;
    }
    14.28% { 
        transform: translate(100px, -120px) scale(calc(1.25 * var(--blob-scale-1, 1))) rotate(60deg);
        opacity: 0.92;
        border-radius: 75% 25% 30% 70% / 30% 75% 25% 70%;
    }
    28.57% { 
        transform: translate(-120px, 100px) scale(calc(0.8 * var(--blob-scale-1, 1))) rotate(120deg);
        opacity: 1;
        border-radius: 30% 70% 70% 30% / 70% 30% 25% 75%;
    }
    42.85% { 
        transform: translate(80px, 140px) scale(calc(1.2 * var(--blob-scale-1, 1))) rotate(180deg);
        opacity: 0.95;
        border-radius: 70% 30% 35% 65% / 35% 70% 30% 65%;
    }
    57.14% { 
        transform: translate(-80px, -100px) scale(calc(0.9 * var(--blob-scale-1, 1))) rotate(240deg);
        opacity: 0.93;
        border-radius: 35% 65% 65% 35% / 65% 35% 40% 60%;
    }
    71.42% { 
        transform: translate(60px, -80px) scale(calc(1.15 * var(--blob-scale-1, 1))) rotate(300deg);
        opacity: 0.97;
        border-radius: 65% 35% 45% 55% / 45% 65% 35% 55%;
    }
    85.71% { 
        transform: translate(-50px, 90px) scale(calc(1.1 * var(--blob-scale-1, 1))) rotate(360deg);
        opacity: 0.94;
        border-radius: 45% 55% 65% 35% / 35% 45% 55% 65%;
    }
}

@keyframes morphBlob2 {
    0%, 100% { 
        transform: translate(0, 0) scale(calc(1 * var(--blob-scale-2, 1))) rotate(0deg);
        opacity: 1;
        border-radius: 30% 70% 70% 30% / 70% 30% 40% 60%;
    }
    14.28% { 
        transform: translate(-120px, 80px) scale(calc(1.2 * var(--blob-scale-2, 1))) rotate(60deg);
        opacity: 0.94;
        border-radius: 70% 30% 35% 65% / 35% 70% 30% 65%;
    }
    28.57% { 
        transform: translate(100px, -140px) scale(calc(0.85 * var(--blob-scale-2, 1))) rotate(120deg);
        opacity: 1;
        border-radius: 25% 75% 75% 25% / 75% 25% 30% 70%;
    }
    42.85% { 
        transform: translate(-90px, -110px) scale(calc(1.15 * var(--blob-scale-2, 1))) rotate(180deg);
        opacity: 0.96;
        border-radius: 75% 25% 40% 60% / 40% 75% 25% 60%;
    }
    57.14% { 
        transform: translate(110px, 90px) scale(calc(0.9 * var(--blob-scale-2, 1))) rotate(240deg);
        opacity: 0.92;
        border-radius: 40% 60% 60% 40% / 60% 40% 50% 50%;
    }
    71.42% { 
        transform: translate(-70px, 120px) scale(calc(1.1 * var(--blob-scale-2, 1))) rotate(300deg);
        opacity: 0.98;
        border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%;
    }
    85.71% { 
        transform: translate(90px, -100px) scale(calc(0.95 * var(--blob-scale-2, 1))) rotate(360deg);
        opacity: 0.93;
        border-radius: 55% 45% 45% 55% / 55% 55% 45% 45%;
    }
}

/* Увеличение при отправке запроса - оптимизировано через transform */
body.blob-sending::before {
    animation: morphBlob1 65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    --blob-scale-1: 1.4;
    background: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transition: background 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity, filter, border-radius, background, box-shadow;
}

body.blob-sending::after {
    animation: morphBlob2 70s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    --blob-scale-2: 1.35;
    background: rgba(255, 215, 0, 0.32);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transition: background 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity, filter, border-radius, background, box-shadow;
}

body.blob-sending .blob-3 {
    /* Третий блоб также увеличивается при отправке */
    animation: morphBlob3 75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    background: rgba(255, 215, 0, 0.32);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transition: background 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Трансформация в 3 круглых блоба ожидания */
body.blob-loading::before {
    /* Первый блоб - трансформируется в левый круг */
    width: 64px !important;
    height: 64px !important;
    top: 50% !important;
    left: calc(50% - 100px) !important;
    border-radius: 50% !important;
    background: rgba(255, 215, 0, 0.5) !important;
    border: 3px solid rgba(255, 215, 0, 0.7) !important;
    animation: loadingBlobWave 1.6s ease-in-out infinite !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)) !important;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                left 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                border 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 1s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform, opacity, box-shadow;
}

body.blob-loading::after {
    /* Второй блоб - трансформируется в центральный круг */
    width: 64px !important;
    height: 64px !important;
    bottom: auto !important;
    right: auto !important;
    top: 50% !important;
    left: 50% !important;
    border-radius: 50% !important;
    background: rgba(255, 215, 0, 0.5) !important;
    border: 3px solid rgba(255, 215, 0, 0.7) !important;
    animation: loadingBlobWave 1.6s ease-in-out infinite 0.3s !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)) !important;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                left 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                bottom 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                right 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                border 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 1s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform, opacity, box-shadow;
}

/* Третий блоб - всегда виден */
.blob-3 {
    content: '';
    position: fixed;
    width: 54%;
    height: 54%;
    top: var(--blob-3-top, 20%);
    right: var(--blob-3-right, 5%);
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity, filter, border-radius;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
    background: rgba(255, 215, 0, 0.22);
    border-radius: 50% 50% 45% 55% / 45% 50% 50% 55%;
    border: 3px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    animation: morphBlob3 75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    opacity: 1;
}

body.blob-loading .blob-3 {
    /* Третий блоб - трансформируется в правый круг */
    width: 64px !important;
    height: 64px !important;
    top: 50% !important;
    right: auto !important;
    left: calc(50% + 100px) !important;
    border-radius: 50% !important;
    background: rgba(255, 215, 0, 0.5) !important;
    border: 3px solid rgba(255, 215, 0, 0.7) !important;
    animation: loadingBlobWave 1.6s ease-in-out infinite 0.6s !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)) !important;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                left 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                right 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                border 1s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 1s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform, opacity, box-shadow;
}

/* Анимация для третьего блоба в обычном состоянии - рассинхронизирована со вторым */
@keyframes morphBlob3 {
    0%, 100% { 
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
        border-radius: 45% 55% 55% 45% / 45% 45% 55% 55%;
    }
    14.28% { 
        transform: translate(130px, -90px) scale(1.3) rotate(90deg);
        opacity: 0.91;
        border-radius: 55% 45% 40% 60% / 40% 55% 45% 60%;
    }
    28.57% { 
        transform: translate(-110px, 130px) scale(0.75) rotate(180deg);
        opacity: 0.98;
        border-radius: 40% 60% 60% 40% / 60% 40% 55% 45%;
    }
    42.85% { 
        transform: translate(90px, 120px) scale(1.18) rotate(270deg);
        opacity: 0.94;
        border-radius: 60% 40% 50% 50% / 50% 60% 40% 50%;
    }
    57.14% { 
        transform: translate(-130px, -110px) scale(0.88) rotate(360deg);
        opacity: 0.96;
        border-radius: 55% 45% 65% 35% / 65% 55% 45% 35%;
    }
    71.42% { 
        transform: translate(110px, -80px) scale(1.22) rotate(450deg);
        opacity: 0.92;
        border-radius: 45% 55% 60% 40% / 40% 45% 55% 60%;
    }
    85.71% { 
        transform: translate(-100px, 100px) scale(0.82) rotate(540deg);
        opacity: 0.95;
        border-radius: 65% 35% 50% 50% / 50% 65% 35% 50%;
    }
}

/* Волновая анимация для блобов загрузки с поднятием и опусканием */
@keyframes loadingBlobWave {
    0% {
        transform: translate(-50%, -50%) translateY(0px) scale(1);
        opacity: 0.7;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6),
                    0 0 60px rgba(255, 215, 0, 0.3);
    }
    25% {
        transform: translate(-50%, -50%) translateY(-15px) scale(1.15);
        opacity: 0.85;
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.75),
                    0 0 80px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) translateY(0px) scale(1.3);
        opacity: 1;
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.9),
                    0 0 100px rgba(255, 215, 0, 0.5);
    }
    75% {
        transform: translate(-50%, -50%) translateY(15px) scale(1.15);
        opacity: 0.85;
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.75),
                    0 0 80px rgba(255, 215, 0, 0.4);
    }
    100% {
        transform: translate(-50%, -50%) translateY(0px) scale(1);
        opacity: 0.7;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6),
                    0 0 60px rgba(255, 215, 0, 0.3);
    }
}

/* Восстановление нормального состояния - оптимизировано через transform */
body.blob-normal::before {
    animation: morphBlob1 65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    --blob-scale-1: 1;
    opacity: 1;
    filter: grayscale(0%) brightness(1);
    background: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                filter 1s cubic-bezier(0.4, 0, 0.2, 1),
                background 1s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 1s cubic-bezier(0.4, 0, 0.2, 1),
                width 1s cubic-bezier(0.4, 0, 0.2, 1),
                height 1s cubic-bezier(0.4, 0, 0.2, 1),
                top 1s cubic-bezier(0.4, 0, 0.2, 1),
                left 1s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity, filter, border-radius, background, box-shadow;
}

body.blob-normal::after {
    animation: morphBlob2 70s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    --blob-scale-2: 1;
    opacity: 1;
    filter: grayscale(0%) brightness(1);
    background: rgba(255, 215, 0, 0.22);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                filter 1s cubic-bezier(0.4, 0, 0.2, 1),
                background 1s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 1s cubic-bezier(0.4, 0, 0.2, 1),
                width 1s cubic-bezier(0.4, 0, 0.2, 1),
                height 1s cubic-bezier(0.4, 0, 0.2, 1),
                top 1s cubic-bezier(0.4, 0, 0.2, 1),
                bottom 1s cubic-bezier(0.4, 0, 0.2, 1),
                left 1s cubic-bezier(0.4, 0, 0.2, 1),
                right 1s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity, filter, border-radius, background, box-shadow;
}

body.blob-normal .blob-3 {
    /* Возврат третьего блоба в исходное состояние */
    animation: morphBlob3 75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                width 1s cubic-bezier(0.4, 0, 0.2, 1),
                height 1s cubic-bezier(0.4, 0, 0.2, 1),
                top 1s cubic-bezier(0.4, 0, 0.2, 1),
                left 1s cubic-bezier(0.4, 0, 0.2, 1),
                right 1s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1s cubic-bezier(0.4, 0, 0.2, 1),
                background 1s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 1s cubic-bezier(0.4, 0, 0.2, 1),
                filter 1s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

/* Возврат блобов в исходное состояние после blob-normal */
body:not(.blob-loading):not(.blob-sending):not(.blob-normal)::before,
body:not(.blob-loading):not(.blob-sending)::before {
    width: 54%;
    height: 54%;
    top: var(--blob-1-top, 5%);
    left: var(--blob-1-left, 5%);
    transform: translate(0, 0) scale(calc(1 * var(--blob-scale-1, 1))) rotate(0deg);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

body:not(.blob-loading):not(.blob-sending):not(.blob-normal)::after,
body:not(.blob-loading):not(.blob-sending)::after {
    width: 49.5%;
    height: 49.5%;
    bottom: var(--blob-2-bottom, 8%);
    right: var(--blob-2-right, 8%);
    top: auto;
    left: auto;
    transform: translate(0, 0) scale(calc(1 * var(--blob-scale-2, 1))) rotate(0deg);
    border-radius: 60% 40% 30% 70% / 50% 60% 70% 40%;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

body:not(.blob-loading):not(.blob-sending) .blob-3 {
    width: 54%;
    height: 54%;
    top: var(--blob-3-top, 20%);
    right: 5%;
    left: auto;
    bottom: auto;
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 60% 40% 30% 70% / 50% 60% 70% 40%;
    opacity: 1;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== MAIN PAGE ========== */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    position: relative;
    padding: 20px;
    z-index: 1;
}

/* Логотип */
.logo-section {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: transform, opacity;
}

.logo {
    max-width: 300px;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto;
    animation: logoFadeIn 1s ease-out;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5)) 
            drop-shadow(0 0 40px rgba(255, 255, 255, 0.3))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Секция ввода */
.input-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    top: calc(50% + 30px); /* Смещение вниз для предотвращения пересечения с логотипом */
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    z-index: 10;
    will-change: transform;
    contain: layout style;
}

.input-section.input-moved {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto 30px auto;
    padding-top: 20px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Секция ответа */
.response-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 40px 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Элемент ответа в стэке */
.response-item {
    width: 100%;
    animation: slideDown 0.5s ease-out;
    margin-bottom: 60px;
}

.response-item:last-child {
    margin-bottom: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: flex-start;
    animation: fadeInGlow 0.7s ease-out;
    will-change: transform, opacity;
    transform: translateZ(0);
    contain: layout style;
}

/* Горизонтальное расположение для одного изображения 50/50 */
.response-content.has-single-image {
    flex-direction: row;
    align-items: flex-start; /* Выравнивание по верхнему краю */
    gap: 25px; /* Уменьшенный отступ между элементами */
    /* Убеждаемся, что оба дочерних элемента выравниваются одинаково */
}

.response-content.has-single-image > * {
    align-self: flex-start; /* Явное выравнивание всех дочерних элементов */
}

.response-content.has-single-image .response-text {
    flex: 1;
    min-width: 0; /* Позволяет тексту сжиматься */
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Растягиваем на всю высоту */
    align-self: flex-start; /* Выравнивание по верхнему краю */
}

.response-content.has-single-image .response-text-content {
    flex: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Прокрутка для длинного текста */
    max-height: 70vh; /* Ограничение максимальной высоты */
    padding: 10px 22px; /* Одинаковый верхний padding как у карточки изображения */
    margin: 0; /* Убираем любые отступы */
    align-self: flex-start; /* Выравнивание по верхнему краю */
    border-radius: 20px; /* Одинаковый border-radius как у карточки */
    box-sizing: border-box; /* Учитываем border в размерах */
    /* Унифицируем border и box-shadow для правильного выравнивания */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Одинаковый border как у карточки */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); /* Одинаковый box-shadow как у карточки */
    position: relative; /* Сохраняем для эффектов */
    top: 0; /* Убеждаемся, что нет смещения */
    vertical-align: top; /* Дополнительное выравнивание */
}

.response-content.has-single-image .response-images {
    flex: 1;
    min-width: 0;
    max-width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Растягиваем на всю высоту */
    margin-top: 0; /* Убираем верхний отступ для правильного выравнивания с текстом */
}

/* Стили для одного изображения */
.single-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.single-image-card {
    position: relative;
    margin: 0; /* Убираем любые отступы */
    width: 100%;
    height: 100%;
    min-height: 300px; /* Минимальная высота */
    max-height: 70vh; /* Ограничение максимальной высоты */
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-radius: 20px;
    padding: 10px; /* Одинаковый padding со всех сторон */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    align-self: flex-start; /* Выравнивание по верхнему краю */
    box-sizing: border-box; /* Учитываем border в размерах */
    top: 0; /* Убеждаемся, что нет смещения */
}

.single-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), 0 0 30px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
}

.single-image-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 200px; /* Минимальная высота для wrapper */
    max-height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15); /* Более темный фон для лучшего контраста */
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Сохраняем пропорции, не обрезаем */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border-radius: 12px;
}

.single-image.loaded {
    opacity: 1;
}

.single-image-card:hover .single-image {
    transform: scale(1.05);
}

.single-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    pointer-events: none;
}

.single-image-card:hover .single-image-overlay {
    opacity: 1;
}

.single-image-overlay .zoom-icon {
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.single-image-card:hover .single-image-overlay .zoom-icon {
    transform: scale(1);
}

.single-image-caption {
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5); /* Более приглушенный цвет */
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Показывать только одну строку */
    -webkit-box-orient: vertical;
    opacity: 0.6; /* Полупрозрачность */
    transition: opacity 0.3s ease;
    flex-shrink: 0; /* Не сжимать подпись */
}

/* Показывать подпись при hover */
.single-image-card:hover .single-image-caption {
    opacity: 0.8;
}

.response-text {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.response-text-content {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px) saturate(150%);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    color: #1a1a1a;
    padding: 20px 24px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 0 0 1px rgba(255, 255, 255, 0.15);
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
    font-weight: 400;
    will-change: transform;
    transform: translateZ(0);
    contain: layout style paint;
}

/* Стили для прокрутки текста при одном изображении */
.response-content.has-single-image .response-text-content {
    overflow-y: auto;
    overflow-x: hidden;
    /* Кастомный скроллбар */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.response-content.has-single-image .response-text-content::-webkit-scrollbar {
    width: 6px;
}

.response-content.has-single-image .response-text-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.response-content.has-single-image .response-text-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.response-content.has-single-image .response-text-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.response-text-content p {
    margin-bottom: 10px;
}

.response-text-content ul.response-list {
    padding-left: 20px;
    margin: 10px 0;
    list-style: disc;
    color: inherit;
}

.response-text-content ul.response-list li {
    margin-bottom: 6px;
}

.response-text-content strong {
    font-weight: 700;
    color: #000;
}

/* Интерактивные ссылки на юниты */
.unit-link {
    color: #FFD700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 215, 0, 0.5);
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
    background: transparent;
}

.unit-link:hover {
    color: #FFE135;
    text-decoration-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

.unit-link:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
    border-radius: 4px;
    background: rgba(255, 215, 0, 0.1);
}

.unit-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
}

/* Анимация при наведении */
.unit-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #FFD700;
    transition: width 0.3s ease;
}

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

/* Эффект светового блика для Liquid Glass */
.response-text-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.5s;
}

.response-text-content:hover::before {
    left: 100%;
}

.response-text-content.error-text {
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    border: 2px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Курсор для эффекта печати */
.typing-cursor {
    display: inline-block;
    color: #FFD700;
    font-weight: bold;
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Галерея изображений в стиле лендингов */
.response-images {
    display: block;
    width: 100%;
    margin-top: 20px;
    flex-shrink: 0;
}

.gallery-container {
    width: 100%;
}

.gallery-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

.gallery-1-col {
    grid-template-columns: 1fr;
}

.gallery-2-col {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-grid-col {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gallery-item {
    opacity: 0;
    animation: galleryItemFadeIn 0.6s ease-out forwards;
}

@keyframes galleryItemFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.image-card {
    position: relative;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-radius: 20px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), 0 0 30px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Соотношение сторон 4:3 */
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.1);
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.gallery-image.loaded {
    opacity: 1;
}

.image-card:hover .gallery-image {
    transform: scale(1.08);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-card:hover .zoom-icon {
    transform: scale(1);
}

.image-caption {
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-counter {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* Lightbox модальное окно */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content.small-image {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxImageFadeIn 0.4s ease-out;
    width: auto;
    height: auto;
}

.lightbox-content.small-image .lightbox-image {
    width: auto !important;
    height: auto !important;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

@keyframes lightboxImageFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    text-align: center;
    max-width: 80vw;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 32px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 32px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Обратная совместимость со старыми классами */
.response-image-wrapper {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 100%;
    max-width: 350px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.response-image {
    display: block;
    width: 100%;
    max-height: 320px;
    border-radius: 12px;
    border: none;
    object-fit: cover;
    background: transparent;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.loading-indicator {
    display: inline-block;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px) saturate(150%);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: loadingPulse 2s ease-in-out infinite;
    will-change: transform, opacity;
    transform: translateZ(0);
    contain: layout style paint;
}

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

/* Улучшенная анимация появления с фиолетовым свечением */
.fade-in {
    animation: fadeInGlow 0.7s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes fadeInGlow {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Улучшенная анимация точек загрузки */
.loading-dots {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
    display: inline-block;
    animation: loadingDotWave 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    will-change: transform, opacity;
    transform: translateZ(0);
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Анимация волны для точек загрузки */
@keyframes loadingDotWave {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: translateY(-12px) scale(1.2);
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

.query-form {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.query-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px) saturate(150%);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    color: #1a1a1a;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease, height 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    will-change: transform;
    transform: translateZ(0);
    contain: layout style paint;
    min-height: 48px;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    line-height: 1.5;
}

.query-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2), 
                0 8px 24px rgba(0, 0, 0, 0.12);
    transform: scale(1.01);
    background: rgba(255, 255, 255, 0.25);
}

.query-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: rgba(204, 204, 204, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.query-input::placeholder {
    color: #666;
}

.send-button {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
    border: 2px solid #000000;
    border-radius: 50%;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
}

/* Пульсирующая анимация для кнопки */
.send-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.send-button:hover:not(:disabled)::before {
    width: 100px;
    height: 100px;
}

.send-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFC107 0%, #FFD700 100%);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), 0 0 50px rgba(255, 215, 0, 0.4);
    transform: scale(1.1) rotate(5deg);
    border-color: #000000;
}

.send-button:active:not(:disabled) {
    transform: scale(0.9) rotate(-5deg);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #666;
}

/* Примеры запросов */
.example-queries {
    margin-top: 30px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.example-queries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

.example-query {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px) saturate(150%);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: #1a1a1a;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    will-change: transform, background, box-shadow;
    transform: translateZ(0);
}

.example-query:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.example-query:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Кнопка контакта Telegram */
.telegram-contact-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px) saturate(150%);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 400;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    will-change: transform, background, box-shadow;
    transform: translateZ(0);
    flex-shrink: 0;
    height: 48px;
    align-self: center;
}

.telegram-contact-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.telegram-contact-button:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2), 
                0 8px 24px rgba(0, 0, 0, 0.12);
}

.telegram-contact-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.input-section.input-moved .example-queries {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
}

.delete-button {
    padding: 6px 12px;
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    border: none;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
}

.delete-button:hover {
    background: linear-gradient(135deg, #BA68C8 0%, #9C27B0 100%);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.image-info {
    color: #FFD700;
    font-size: 12px;
    margin-top: 8px;
}

/* Responsive */

/* Большие экраны */
@media (min-width: 1400px) {
    .main-container {
        max-width: 1400px;
    }
    
    .response-section {
        max-width: 1400px;
    }
}

/* Планшеты - базовый брейкпоинт */
@media (max-width: 968px) {
    .response-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .response-content.has-single-image {
        flex-direction: column;
        gap: 20px;
    }
    
    .response-content.has-single-image .response-text-content {
        max-height: none;
        overflow-y: visible;
        padding: 18px 20px;
    }
    
    .response-content.has-single-image .response-images {
        max-width: 100%;
        width: 100%;
    }
    
    .response-content.has-single-image .single-image-card {
        max-height: none;
        min-height: 250px;
    }
    
    .response-text {
        max-width: 100%;
    }
    
    .response-images {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .gallery-grid {
        gap: 16px;
    }
    
    .gallery-2-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-3-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid-col {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    
    .response-image {
        max-width: 100%;
        width: 100%;
    }
    
    .response-image-wrapper {
        max-width: 100%;
    }
    
    .lightbox-nav {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* Промежуточный брейкпоинт для планшетов */
@media (max-width: 968px) and (min-width: 769px) {
    .response-content {
        gap: 25px;
    }
    
    .response-content.has-single-image {
        flex-direction: column;
        gap: 20px;
    }
    
    .response-content.has-single-image .response-text-content {
        max-height: none;
        overflow-y: visible;
    }
    
    .response-content.has-single-image .response-images {
        max-width: 100%;
        width: 100%;
    }
    
    .response-content.has-single-image .single-image-card {
        max-height: none;
        min-height: 250px;
    }
    
    .response-images {
        width: 100%;
        max-width: 100%;
    }
    
    .response-image-wrapper {
        max-width: 100%;
    }
}

/* Средние планшеты */
@media (max-width: 900px) {
    .main-container {
        padding: 18px;
    }
    
    .response-text-content {
        padding: 18px 22px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 15px;
    }
    
    .logo-section {
        top: 10%;
        z-index: 5;
    }
    
    .logo {
        max-width: 200px;
    }
    
    .input-section {
        max-width: 100%;
        top: calc(45% + 20px);
        transform: translate(-50%, -50%);
    }
    
    .input-section.input-moved {
        top: auto;
    }
    
    .response-item {
        margin-bottom: 30px;
    }
    
    .response-item:last-child {
        margin-bottom: 0;
    }
    
    .response-content.has-single-image {
        flex-direction: column;
        gap: 15px;
    }
    
    .response-content.has-single-image .response-text-content {
        max-height: none;
        overflow-y: visible;
        padding: 16px 18px;
    }
    
    .response-content.has-single-image .response-images {
        max-width: 100%;
        width: 100%;
    }
    
    .response-content.has-single-image .single-image-card {
        max-height: none;
        min-height: 200px;
        padding: 8px;
    }
    
    .gallery-grid {
        gap: 12px;
    }
    
    .gallery-2-col,
    .gallery-3-col,
    .gallery-grid-col {
        grid-template-columns: 1fr;
    }
    
    .image-wrapper {
        padding-top: 70%;
    }
    
    .response-image-wrapper {
        max-width: 100%;
    }
    
    .lightbox-image {
        max-height: 80vh;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .response-text-content {
        padding: 18px 20px;
        font-size: 15px;
        line-height: 1.6;
    }
}

/* Landscape ориентация для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .logo-section {
        top: 5%;
    }
    
    .logo {
        max-width: 150px;
        max-height: 60px;
    }
    
    .input-section {
        top: 30%;
    }
    
    .input-section.input-moved {
        margin-top: 10px;
    }
    
    .response-item {
        margin-bottom: 20px;
    }
}

/* Средние мобильные устройства */
@media (max-width: 600px) {
    .gallery-grid {
        gap: 10px;
    }
    
    .image-card {
        padding: 8px;
        border-radius: 16px;
    }
    
    .image-wrapper {
        padding-top: 65%;
        border-radius: 10px;
    }
    
    .image-caption {
        font-size: 12px;
        margin-top: 8px;
    }
    
    .gallery-counter {
        font-size: 12px;
        margin-top: 12px;
    }
    
    .response-image {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    
    .response-images.has-multiple .response-image-wrapper {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo-section {
        top: 5%;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .input-section {
        top: calc(35% + 15px);
        padding: 0 10px;
    }
    
    .example-queries {
        margin-top: 20px;
    }
    
    .example-queries-list {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .example-query {
        width: 100%;
        text-align: center;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .telegram-contact-button {
        padding: 10px 14px;
        font-size: 13px;
        height: 44px;
        flex-shrink: 0;
    }
    
    .telegram-contact-button span {
        display: none;
    }
    
    .response-text-content {
        padding: 16px 18px;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .query-input {
        font-size: 16px; /* Предотвращает zoom на iOS */
    }
    
    .gallery-grid {
        gap: 8px;
    }
    
    .image-card {
        padding: 6px;
    }
    
    .image-wrapper {
        padding-top: 60%;
    }
    
    .lightbox-image {
        max-height: 75vh;
    }
    
    .lightbox-caption {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Landscape ориентация для маленьких мобильных */
@media (max-width: 480px) and (orientation: landscape) {
    .logo-section {
        top: 2%;
    }
    
    .logo {
        max-width: 100px;
        max-height: 50px;
    }
    
    .input-section {
        top: calc(25% + 10px);
        padding: 0 5px;
    }
}

@media (max-width: 375px) {
    .main-container {
        padding: 10px;
        min-height: 100vh;
    }
    
    .logo-section {
        top: 2vh;
        position: absolute;
    }
    
    .logo {
        max-width: 120px;
        max-height: 80px;
        object-fit: contain;
    }
    
    .input-section {
        top: calc(28vh + 10px);
        padding: 0 5px;
        position: absolute;
    }
    
    .input-section.input-moved {
        position: relative;
        top: auto;
        margin-top: 20px;
    }
    
    .query-form {
        gap: 8px;
    }
    
    .query-input {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .send-button {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
    
    .send-button svg {
        width: 18px;
        height: 18px;
    }
    
    .example-queries {
        margin-top: 15px;
    }
    
    .example-queries-list {
        gap: 6px;
    }
    
    .example-query {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 16px;
    }
    
    .telegram-contact-button {
        padding: 10px 12px;
        font-size: 12px;
        border-radius: 20px;
        height: 44px;
        flex-shrink: 0;
    }
    
    .telegram-contact-button svg {
        width: 18px;
        height: 18px;
    }
    
    .telegram-contact-button span {
        display: none;
    }
    
    .response-text-content {
        padding: 14px 16px;
        font-size: 13px;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 375px) and (max-height: 667px) {
    .logo-section {
        top: 1vh;
    }
    
    .logo {
        max-width: 100px;
        max-height: 60px;
    }
    
    .input-section {
        top: calc(25vh + 10px);
    }
}

/* Touch-friendly элементы для устройств без hover */
@media (hover: none) and (pointer: coarse) {
    .send-button {
        min-width: 48px;
        min-height: 48px;
    }
    
    .example-query {
        min-height: 44px;
        padding: 12px 18px;
    }
    
    .telegram-contact-button {
        min-height: 44px;
        padding: 10px 14px;
        height: 44px;
    }
    
    .telegram-contact-button span {
        display: none;
    }
    
    .slider-indicator {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
    }
    
    /* Убираем hover эффекты на touch устройствах */
    .response-image:hover {
        transform: none;
    }
    
    .response-image-wrapper:hover {
        transform: none;
    }
    
    .example-query:hover {
        transform: none;
    }
    
    .telegram-contact-button:hover {
        transform: none;
    }
}

/* Поддержка safe-area для iPhone с вырезом */
@supports (padding: max(0px)) {
    .main-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    @media (max-width: 768px) {
        .main-container {
            padding-left: max(15px, env(safe-area-inset-left));
            padding-right: max(15px, env(safe-area-inset-right));
        }
    }
    
    @media (max-width: 375px) {
        .main-container {
            padding-left: max(10px, env(safe-area-inset-left));
            padding-right: max(10px, env(safe-area-inset-right));
        }
    }
}
