* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --green: rgb(10, 133, 51);
    ---yellow: rgb(170, 204, 98);
    --pale-green:rgb(195, 237, 196);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: white;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    min-height: 100vh;
    display: flex;
    max-width: 100%; /* Не вылезать за края */
    flex-direction: column;  /* Располагать блоки вертикально */
    /*justify-content: center;
    align-items: center;*/
    padding: 20px;
    margin: 0;
    padding: 0;
    background-image: url('images/фон.png'); 
    background-size: cover; /* Масштабирует изображение так, чтобы оно полностью закрывало фон (часть может обрезаться) */
    background-position: center center; /* Центрирует изображение по горизонтали и вертикали */
    background-repeat: no-repeat; /* Запрещает повторение картинки (мозаикой) */
    background: rgb(59, 59, 59);
    position: relative;
    overflow: hidden;
}

header {
    display: flex;
    position: relative;
}
@media (max-width: 768px) {
    header {
        display: block;
    }
}

.hamburger {
    display: none;
    /* скрыт по умолчанию, покажем на мобильных */
    flex-direction: column;
    justify-content: space-around;
    width: 20px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    bottom: -7px;
    right: 20px;
}
@media (max-width: 767px) {
    .hamburger {
        display: flex;/* показываем кнопку */
    }
}.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--green);
    border-radius: 2px;
    transition: all 0.3s;
}
/* Мобильное меню – скрыто */
.mobile-contact {
    display: flex;
    /* при желании добавьте стиль для раскрытия */
    background: transparent;
    color: white;
    padding-top: 7vh;
    height: 50px;
    border-radius: 5px;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 5vw;
}
@media (max-width: 767px) {
    .mobile-contact {
        display: none;
        margin: 0 12px;
        padding: 20px;
        position: unset;
    }
}
.mobile-contact.active {
    display: flex;
}
.telephone {
    width: 20px;
    height: auto;
}
.tel {
    padding-left: 10px;
}

/*Анимация гамбургера → «X» (по желанию)*/
.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

                /* Затемнение фона */
                .modal-video-overlay {
                    display: none;
                    position: fixed;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100vh;   /* fallback для старых браузеров */
                    height: 100dvh; /* современный способ (на десктопе = 100vh) */
                    background: rgba(0, 0, 0, 0.85);
                    z-index: 9999;
                    justify-content: center;
                    align-items: center;
                }
                .modal-video-overlay.active {
                    display: flex !important;
                    align-items: center;
                    justify-content: center;
                }
                /* Контейнер с видео */
                .modal-video-content {
                    position: relative;
                    width: min(80vw, 960px);
                    max-height: min(90dvh, 90vh);
                    /*aspect-ratio: 16 / 9;*/
                    background: #000;
                    border-radius: 10px;
                    overflow: hidden;
                    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }

                /* Видео */
                .modal-video-content video {
                    height: 100%; /* всегда по высоте контейнера */
                    width: auto; /* ширина подстраивается под пропорции */
                    max-width: 100%; /* не выходит за ширину контейнера */
                    object-fit: contain; /* сохраняем пропорции, чёрные полосы нормальны */
                    display: block;
                }
                @media (max-width: 768px) {
                    .modal-video-content {
                        width: 95vw;
                        height: 80vh;  /* чуть меньше, чтобы не касаться панелей браузера */
                    }
                }
                /* Кнопка закрытия */
                .modal-video-close {
                    position: absolute;
                    top: 10px;
                    right: 15px;
                    font-size: 36px;
                    color: #fff;
                    cursor: pointer;
                    z-index: 10;
                    background: none;
                    border: none;
                    line-height: 1;
                    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
                }
                .modal-video-close:hover {
                    color: #ccc;
                }
                /* Ссылка для открытия видео */
                .open-local-video {
                    display: inline-block;
                    padding: 12px 24px;
                    background: #4CAF50;
                    color: #fff;
                    text-decoration: none;
                    border-radius: 6px;
                    cursor: pointer;
                    font-size: 16px;
                    transition: background 0.3s;
                }
                .open-local-video:hover {
                    background: #388E3C;
                }
                /*video {
                    width: 100%;
                    max-width: 800px;
                    max-height: 90vh;
                }*/




@media (max-width: 768px) {
    body {
        overflow: unset;
    }
}
h1 {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-weight: normal;
}
p {
    margin-top: 1em !important;
    margin-bottom: 1em !important;
}
.rainbow {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 0;
    width: 30vw;
    height: auto;
    pointer-events: none;
}
.silhouette {
    position: absolute;
    left: 20vw;
    top: 20vh;
    z-index: 0;
    /*width: 50vw;*/
    height: auto;
    opacity: 0.1;
    z-index: 10;
    overflow: hidden;
    max-width: 60vh;
    pointer-events: none;
    display: none;
}
@media (max-width: 768px) {
    .silhouette {
        top: 60vh;
        left: 0;
        max-width: 100vw;
    }
}
.logo-title {
    /*position: fixed;  Фиксируем в углу */
    /*top: 0;*/
    /*left: 0;*/
    /*height: 20vh;*/
    /*width: 100%; Занимает всю ширину экрана */
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.1); Тень для красоты */
    /*padding: 50px 50px; /* Внутренние отступы */
    margin-left: 7vw;
    display: flex; /* Используем flex для выравнивания */
    z-index: 1000; /* Чтобы header был поверх контента */
    }
    @media (max-width: 768px) {
        .logo-title {
            margin-left: 30px;
        }
    }
    .logo-box {
        /*max-width: 20vw; /* Ограничиваем максимальную ширину блока */
        justify-content: center;
        align-items: center;
    }
    .logo {
        max-width: 12vw;
        height: auto;
        margin-top: 3vh;
    }
    @media (max-width: 768px) {
        .logo {
        margin-top: 2vh;
        max-width: 35vw;
        }
    }

    .logo-link {
        display: block; /* Делаем ссылку блочной, чтобы она занимала всю ширину .logo-box */
        text-decoration: none; /* Убираем подчеркивание */
    }
    .logo a{
    /*	position:fixed;*/
        
        height:120px;
        width:120px;
        left:10px;
        top:60px;
        background:url(images/logo.png) no-repeat;
        display:block;
        text-indent:-9999px;
            -moz-transition: all 1s ease-out;
            -o-transition: all 1s ease-out;
            -webkit-transition: all 1s ease-out;
            transition: all 1s ease-out;
    }
    .logo a:hover{
        -webkit-transform: scale(1.15);
        -moz-transform: scale(1.15);
        -o-transform: scale(1.15);
        transform: scale(1.15);
    }
    .title {
        /*padding-left: 50px;*/
        display: flex;
        flex-shrink: 1;
        padding-left: 7vw;
        padding-top: 5vh;    }
    .title-part1 {
        color: white;
    }
    .title-part2 {
        margin-left: 12px;
        color: rgb(170, 204, 98);
        position: relative;
    }
        @media (max-width: 768px) {
            .title {
                font-size: clamp(0.5rem, 2vw, 1rem);
                padding: 0;
                flex-flow: column;
                /*margin-top: 3vh;*/
            }
            .title h1{
                font-weight: bold;            }
            .title-part1 {
                padding: 10px 0 0 30px;
            }
            .title-part2 {
                padding-left: 30px;
                margin-left: 0;
            }
        }

.main {
    display: flex;
    /*margin-top: 15vh;*/
    width: 100%;
    justify-content: space-evenly; 
    }
    @media (max-width: 768px) {
        .main {
            flex-direction: column;
            /* Меняем направление на вертикальное */
            }
        .left-block {
            display: flow;
    }
    }

    .left-block {
        display: none;
        /*flex: 2;*/
        /*padding: 0px 10px;*/
        /*display: flex;*/
    }

    @media (max-width: 768px) {
        .left-block {
            display: flow;
        }
    }
        .menu-container {
            width: 100%;
            /*max-width: 350px;*/
            max-width: 20vw;
            padding: 10px 50px;
            /*margin-left: 3vw;*/
            display: flex;
            flex-direction: column;
            height: 80vh;
            height: 80dvh; /* новейшие браузеры */
            overflow-y: auto;
            /*flex-grow: 1;*/
            justify-content: center;
            z-index: 200;
        }
        @media (max-width: 1500px) { /* узкий, меню влево */
            .menu-container {
                margin-left: 0;
                max-width: 20vw;
                padding: 5px 20px;            }
        }
        @media (max-width: 768px) {
            .menu-container {
                /*position: fixed;*/
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                width: auto;
                height: 100%;
                margin: 0;
                transition: left 0.3s;
                padding: 10px 10px;
                max-width: none;
            }
            .menu-container.active {
                left: 0;
            }
            /* Кнопка гамбургер-меню */
            .menu-toggle {
                display: block;
                position: fixed;
                top: 20px;
                left: 20px;
                z-index: 1001;
            }
        }
            .open-btn {
                background: var(--green);
                font-size: 16px;
                box-shadow: 1px 1px 1px rgb(196, 196, 196);
                transition: box-shadow 0.2s;
                /* плавное изменение тени при наведении */
                /*color: #c3edc4;*/
                color: white;
                padding: 10px 15px;
                margin: 10px;
                cursor: pointer;
                border-radius: 20px;
                border: none;
                flex: 1;
                white-space: nowrap;
                max-height: 50px;
                position: sticky;
                z-index: 100;
            }
            @media (max-width: 768px) {
                .open-btn {
                    font-size: 13px;
                    display: inline;
                    margin: 2px;
                    border-radius: 5px;
                    color: white;
                }
            }
            @media (max-height: 601px) { /* мал.высота, сужаем кнопки */
                .open-btn {
                    padding: 0px 10px;
                }
            }
            @media (max-height: 500px) { /* мал.высота, сужаем кнопки */
                .open-btn {
                    margin: 5px;
                }
            }
            .open-btn.active {
                background-color: var(--green);
                color: white;
                box-shadow: 0 0 0 3px rgb(170, 204, 98);
                transform: scale(1.02);
                transition: all 0.2s;
            }
            .btn-modal {
                background: rgb(10, 133, 51);
                transition: box-shadow 0.2s;
                color: white;
                border: none;
                box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
                border-radius: 30px;
                padding: 10px 25px;
                opacity: 0.7;
            }

        .right-block {
            display: none;
            /*flex: 1.5;*/
            /*padding: 20px;*/
            /*display: flex;
            justify-content: center;
            align-items: center;*/
        }
        .modal-header h1 {
            font-size: 22px;
            padding-left: 20px;
        }

    /*.modal-overlay {*/
        /*display: flex;*/
        /*width: 100%;*/
        /*margin-right: 20px;*/
    /*}*/

    .modal {
        background: var(--pale-green);
        color: #333;
        border-radius: 15px;
        width: 100%;
        max-width: 38vw;
        height: 80vh;
        height: 80dvh; /* новейшие браузеры */
        /*margin-top: 20px;*/
        margin-right: 10px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        z-index: 10;
    }
    @media (max-width: 768px) {
        .modal {
            border: none;
            margin-right: 0;
            width: 100vw;
            max-width: none;       }
        .modal-wrapper {
            margin-right: 0;
        }
    }
    .modal-header {
        /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
        /*background: rgb(170, 204, 98);*/
        background: var(--green);
        color: black;
        padding: 15px;
        text-align: center;
        position: relative;
        display: flex;
        justify-content: center;
        /*box-shadow: 0 0 0 3px rgb(170, 204, 98);*/
        transform: scale(1.02);
        transition: all 0.2s;
        /*outline: 3px solid rgb(170, 204, 98);*/
        /*border-radius: 15px;*/
        border: 5px solid rgb(170, 204, 98);

    }
    .modal.active {
        display: block; /* Показать при добавлении класса active */
    }

        .chat-container {
            /*flex: 1;*/
            width: 100%;
            max-width: 38vw;
            /*margin-top: -3vh;*/
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            max-height: 80vh;
            height: 80dvh; /* новейшие браузеры */
            overflow: hidden;
            z-index: 100;
            display: flex;
            flex-direction: column;
            margin-right: 20px;
        }
        @media (max-width: 768px) {
            .chat-container {
                margin-top: 20px; 
                margin-right: 0;
                max-width: none;
           }
        }
        .chat-container.highlight {
            box-shadow: 0 10px 40px rgb(245 247 97);
        }
        .chat-header {
            /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
            background: var(--green);
            color: white;
            padding: 15px;
            display: flex;
            text-align: center;
            justify-content: center;

        }

        .chat-header h1 {
            font-size: 22px;
            padding-right: 20px;
            padding-top: 3px;
        }
        .chat-header p {
            opacity: 0.9;
            font-size: 14px;
        }
        .chat-header p {
            opacity: 0.9;
            font-size: 14px;
        }
        .chat-header img {
            margin-top: -3px;
        }
        .modal-header img {
            margin-top: 3px;
        }
        .chat-messages {
            height: 380px;
            overflow-y: auto;
            padding: 0 15px;
            background: #c3edc4;
            box-sizing: border-box;
            align-items: flex-start;
            display: flex;
            flex-direction: column;
            flex-grow: 1;
        }
        .message {
            margin-bottom: 10px;
            /* display: flex; */
        }

    .modal-title {
        padding-left: 20px;
        color: white;
    }
    .modal-dimmed {
        filter: brightness(0.5);
    }

    .modal-body {
        padding: 10px;
        overflow-y: auto;
        z-index: 100;
    }

.modal-body h1,
.modal-body h2,
.modal-body h3 {
    margin-top: 0.5em;
    color: #333;
}

.modal-body p {
    line-height: 1.6;
}

.modal-body ul,
.modal-body ol {
    padding-left: 1.5em;
}

.modal-body blockquote {
    border-left: 3px solid #ccc;
    padding-left: 1em;
    color: #555;
}

.modal-body code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
}


    .modal-content {
        /*max-height: 100%;*/
        max-height: calc(100% - 80px);
        overflow-y: auto;
        padding: 20px;
        overflow-y: auto;
    }

    .close-btn {
        position: absolute;
        top: -12px;
        right: -12px;
        font-size: 20px;
        cursor: pointer;
        color: rgb(51, 51, 51);
        background-color: rgb(255, 255, 255);
        width: 30px;
        height: 30px;
        line-height: 30px;
        /* Это выравнивает текст по вертикали */
        text-align: center;
        /* Это выравнивает текст по горизонтали */
        box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 5px;
        border: 1px solid rgb(204, 204, 204);
        /* Сокращенная запись */
        border-radius: 50%;
        /* Ключевое исправление: */
        box-sizing: border-box;
        /* Граница теперь ВНУТРИ 30px */
        /* Дополнительно для идеального центрирования: */
        display: flex;
        /* или display: grid; */
        align-items: center;
        justify-content: center;
        padding: 0;
        /* На всякий случай обнуляем */
    }

    .user-message {
        justify-content: flex-end;
    }
    .bot-message {
        justify-content: flex-start;
    }
    .message-content {
        max-width: 100%;
        padding: 5px 12px;
        border-radius: 18px;
        word-wrap: break-word;
    }
    .user-message .message-content {
        background: #667eea;
        color: white;
        border-bottom-right-radius: 4px;
    }
    .bot-message .message-content {
        background: white;
        color: #333;
        border: 1px solid #e0e0e0;
        border-bottom-left-radius: 4px;
        white-space: pre-wrap; /* Заставляет браузер учитывать переносы \n */
    }
    .quick-buttons {
        padding: 2px 2px;
        padding-bottom: 0;
        background: white;
        border-top: 1px solid #e0e0e0;
        display: flex;
        flex-wrap: wrap;
        /*gap: 5px;*/
    }
    .quick-btn {
        background: #f0f2f5;
        border: none;
        border-radius: 5px;
        padding: 7px 15px;
        font-size: 13px;
        color: rgb(94, 94, 94);
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        font-weight: bold;
        /*margin-right: 6px;*/
        width: 100%;
    }

    @media (max-width: 768px) {
        .quick-btn {
            border: 1px solid rgb(204, 204, 204);
        }
    }
    .quick-btn:hover {
        background: #e4e6eb;
        transform: translateY(-2px);
    }
    .quick-btn:active {
        transform: translateY(0);
    }
    .input-container {
        padding: 5px 10px;
        background: white;
        border-top: 1px solid #e0e0e0;
        display: flex;
        gap: 10px;
    }
    #userInput {
        flex: 1;
        padding: 12px 16px;
        border: 1px solid #e0e0e0;
        border-radius: 24px;
        font-size: 16px;
        outline: none;
        transition: border-color 0.3s ease;
    }
    #userInput:focus {
        border-color: #667eea;
    }
    #sendButton {
        background: #a1e088;
        color: white;
        border: none;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    #sendButton:hover {
        background: #5a67d8;
        transform: scale(1.05);
    }
    .typing-indicator {
        display: none;
        padding: 0px 15px;
        color: #666;
        font-style: italic;
        font-family: monospace; /* Для эффекта печатной машинки */
        font-size: 12px;
    }
    .cursor {
        animation: blink 1s steps(5, start) infinite; /* Мигаем 5 раз в секунду */
        color: black; /* Цвет курсора */
    }
    @keyframes blink {
        from, to { visibility: hidden; }
        50% { visibility: visible; }
    }
    .typing-indicator.active {
        display: block;
    }
    .keyboard-row {
        gap: 5px;
        display: flex;
        flex-grow: 1;
        padding: 0 3px;
        /*margin-bottom: 10px;*/
        /*margin-left: 10px;*/
    }
    .keyboard-row:last-child {
        margin-bottom: 0;
    }
    .inline-keyboard {
        display: flex;
        flex-shrink: 0; 
        flex-wrap: wrap;
        /*gap: 5px;  Задаем промежуток здесь */
        margin-top: 3px;
        margin-bottom: 3px;
    }
    .keyboard-row {
        display: flex;
        gap: 5px;
        margin-bottom: 2px;
    }
    /* Стили для кнопок клавиатуры */
    .inline-keyboard .inline-btn {
        /*flex: 1;  Занимает всё доступное пространство в ряду */
        padding: 8px 12px; /* Внутренние отступы */
        margin-bottom: 2px;
        color: white;
        background: var(--green);
        /*opacity: 0.6;*/
        border: none; /* Убирает рамку */
        border-radius: 8px; /* Скругление углов */
        cursor: pointer; /* Меняет курсор на "руку" при наведении */
        font-size: 14px; /* Размер шрифта */
        transition: all 0.2s; /* Плавный переход для всех свойств */
        width: 100%;
        white-space: nowrap;
        /*overflow: hidden; /* скрываем всё, что выходит за границы */
        /*text-overflow: ellipsis; /* добавляем многоточие */
    }
    .inline-keyboard .keyboard-row.last-group .inline-btn {
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
    }
    /* Стили при наведении курсора (ховер) */
    .inline-btn:hover {
        background: rgb(84, 141, 103); /* Меняем цвет фона при наведении */
    }
