:root {
    /* Primary theme color - change this to change the entire color scheme */
    --theme-primary: #696bc9; /* Base green color */
    --theme-primary-rgb: 16, 163, 127;
    --bg-primary-rgb: 255, 255, 255;

    /* Light theme colors (derived from primary) */
    --bg-primary: #ffffff;
    --bg-secondary: #fff;
    --text-primary: #333;
    --text-secondary: #555;
    --border-color: #e5e5e5;
    --accent-color: var(--theme-primary);
    --accent-hover: color-mix(in srgb, var(--theme-primary), #000 15%);
    --accent-color-rgb: var(--theme-primary-rgb);
    --accent-hover-rgb: 13, 142, 111;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --user-message-bg: var(--theme-primary);
    --user-message-text: white;
    --assistant-message-bg: white;
    --assistant-message-text: #333;
    --input-bg: white;
    --link-color: var(--theme-primary);

    --pagination-bg: #f0f0f0;
    --pagination-text: #333;
    --pagination-hover-bg: #dcdcdc;
    --pagination-hover-text: #000;
    --pagination-active-bg: #333;
    --pagination-active-text: #fff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --pagination-bg: #2d2d2d;
        --pagination-text: #e0e0e0;
        --pagination-hover-bg: #444;
        --pagination-hover-text: #fff;
        --pagination-active-bg: #fff;
        --pagination-active-text: #111;
    }
}

[data-theme="dark"] {
    /* Dark theme colors (derived from the same primary) */
    --bg-primary: #1e1e2e;
    --bg-secondary: #2c2c3c;
    --text-primary: #ececf1;
    --text-secondary: #a9a9b3;
    --border-color: #3c3c4c;
    --accent-color: var(--theme-primary);
    --accent-hover: color-mix(in srgb, var(--theme-primary), #000 15%);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --user-message-bg: var(--theme-primary);
    --user-message-text: white;
    --assistant-message-bg: #2c2c3c;
    --assistant-message-text: #ececf1;
    --input-bg: #2c2c3c;
    --link-color: color-mix(in srgb, var(--theme-primary), #fff 20%);
}

/* Добавляем стили для темной темы */
[data-theme="dark"] .chat-input-container.footer {
    background-color: rgba(60, 60, 90, 0.8);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
}

.avatar-flip-wrapper {
    width: 100px;
    height: 100px;
    perspective: 600px;
    display: inline-block;
    position: relative;
    margin-right: 15px;
    vertical-align: top;
    transition: transform 0.6s;
}
.avatar-flip-wrapper:hover {
    transform: rotateY(180deg);
}
.avatar-flip-front, .avatar-flip-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    top: 0; left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-flip-front { z-index: 2; }
.avatar-flip-back {
    transform: rotateY(180deg);
    background: #fff;
    font-size: 60px;
    color: #333;
    z-index: 1;
}
.avatar-flip-wrapper.flipped {
    transform: rotateY(180deg);
}
.question-mark {
    width: 100px;
    height: 100px;
    font-size: 60px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Overlay --- */
.tour-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 30, 46, 0.3);
    z-index: 9998;
    display: none;
}

/* --- Popup --- */
.tour-popup {
    position: fixed;
    width: 550px; /* Make width flexible based on content */
    background: var(--bg-secondary, #fff);
    color: var(--text-primary, #333);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 24px 24px 24px 24px;
    z-index: 9999;
    transition: background 0.2s, color 0.2s;
    animation: fadeInUp 0.3s ease;
}

/* Optional animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Dark Theme --- */
body.dark-theme .tour-popup {
    background-color: rgba(40, 40, 40, 0.85);
    color: #ececf1;
}

/* --- Tail --- */
.tour-popup-tail {
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    transform: rotate(45deg);
    z-index: 10000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Tail Position Classes */
.tour-popup.tail-bottom-center .tour-popup-tail {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    margin-bottom: -6px;
}
.tour-popup.tail-top-center .tour-popup-tail {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    margin-top: -6px;
}
.tour-popup.tail-top-left .tour-popup-tail {
    top: 100%;
    left: 35px; /* Position for left-aligned button */
    transform: rotate(45deg);
    margin-top: -6px;
}
.tour-popup.tail-top-right .tour-popup-tail {
    top: 100%;
    right: 35px; /* Position for right-aligned button */
    transform: rotate(45deg);
    margin-top: -6px;
}
.tour-popup.tail-bottom-left .tour-popup-tail {
    bottom: 100%;
    left: 35px; /* Position for left-aligned button */
    transform: rotate(45deg);
    margin-bottom: -6px;
}
.tour-popup.tail-bottom-right .tour-popup-tail {
    bottom: 100%;
    right: 35px; /* Position for right-aligned button */
    transform: rotate(45deg);
    margin-bottom: -6px;
}
.tour-popup.tail-left-center .tour-popup-tail,
.tour-popup.tail-left-middle .tour-popup-tail,
.tour-popup.tail-left-top .tour-popup-tail,
.tour-popup.tail-left-bottom .tour-popup-tail {
    left: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    margin-left: 0;
}
.tour-popup.tail-right-center .tour-popup-tail,
.tour-popup.tail-right-middle .tour-popup-tail,
.tour-popup.tail-right-top .tour-popup-tail,
.tour-popup.tail-right-bottom .tour-popup-tail {
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    margin-right: 0;
}

/* --- Buttons --- */
.tour-popup-buttons {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    justify-content: space-between;
    align-items: center;
}

.tour-nav-buttons {
    display: flex;
    gap: 12px;
}

.tour-popup button {
    border: none;
    border-radius: 12px;
    padding: 6px 10px;
    background: linear-gradient(to right, #6c63ff, #8752f3);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tour-popup button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.tour-popup button:active {
    transform: scale(0.98);
}

.tour-popup button#tour-prev {
    background: #e2e2e2;
    color: #333;
}

.tour-popup button#tour-prev:hover {
    background: #d4d4d4;
}

/* Optional skip button styling */
.tour-popup button#tour-skip {
    background: #ff6666;
    color: white;
}

.tour-popup button#tour-skip:hover {
    background: #e65555;
}


[data-theme="dark"] .tour-popup button#tour-prev {
    background: #555;
    color: #ececf1;
}

.tour-popup button.tour-skip {
    background: #bbb;
    color: #222;
}
[data-theme="dark"] .tour-popup button.tour-skip {
    background: #444;
    color: #ececf1;
}

/* Pagination styles */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    font-family: system-ui, sans-serif;
    font-size: 0.95rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Левая часть — текст */
.pagination-info {
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 0;
}

/* Правая часть — кнопки */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    font-family: system-ui, sans-serif;
    font-size: 0.95rem;
    gap: 1rem;
    box-sizing: border-box;
    width: 100%;
}

/* Текст слева */
.pagination-info {
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 50px;
}

/* Кнопки справа */
.pagination-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Кнопка пагинации */
.paging-button {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    background: var(--pagination-bg);
    color: var(--pagination-text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-weight: 500;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.paging-button:hover {
    background: var(--pagination-hover-bg);
    color: var(--pagination-hover-text);
    border-color: var(--accent-color);
}

.paging-button.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* 🔁 Мобильный режим: текст сверху, кнопки снизу */
@media (max-width: 940px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-info {
        margin-left: 0;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }

    .pagination-buttons {
        justify-content: center;
        align-items: center;
        width: 100%;
    }
}



/* Стили для делителя контекста в светлой теме */
.message.system.context-divider {
    background-color: transparent !important;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
    margin: 20px 0;
    text-align: center;
    font-style: italic;
    color: var(--text-primary);
}

/* Стили для делителя контекста в темной теме */
[data-theme="dark"] .message.system.context-divider {
    background-color: #2c2c3c !important;
    color: #ececf1;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

body {
    font-family: 'Söhne', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px var(--shadow-color), 0 0 0 2px rgba(var(--accent-color-rgb), 0.3);
}

.theme-toggle:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 3px 10px var(--shadow-color), 0 0 0 3px rgba(var(--accent-color-rgb), 0.5);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.message-content p {
    padding-right: 30px;
    padding-left: 50px;
    margin: 0;
}

/* Form styling */
form {
    margin-top: 10px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

form select, form input[type="text"] {
    width: 95%;
    padding: 8px 10px;
    margin-bottom: 15px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

form select:focus, form input[type="text"]:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

form button {
    padding: 8px 12px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    font-weight: 600;
}

form button:hover {
    background-color: var(--accent-hover);
}

/* Chat column styling */
.chat-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    min-width: 0;
    min-height: 100vh;
    transition: margin-left 0.3s;
    overflow-y: auto;
}

/* Messages area */
.messages {
    max-width: 1000px;
    margin: 0 auto;
    flex: 1;
    padding: 5%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.message-with-avatar img {
    width: 100px !important;
    height: 100px !important;
    box-shadow: inset 0 1px 15px 0 rgba(0, 0, 0, 0.18);
}

.message {
    padding: 12px 16px;
    margin-bottom: 25px;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 15px;
}

.message.user {
    margin-right: 10px;
    max-width: 80%;
    align-self: flex-end;
    background-color: var(--user-message-bg);
    color: var(--user-message-text);
}

.message.assistant {
    align-self: flex-start;
    background-color: var(--assistant-message-bg);
    color: var(--assistant-message-text);
}

/* Добавляем обработку длинных ссылок и текста */
.message {
    word-wrap: break-word; /* Перенос слов */
    overflow-wrap: break-word; /* Современный аналог word-wrap */
    word-break: break-word; /* Разрыв длинных слов */
    hyphens: auto; /* Автоматическая расстановка переносов */
}

.message a {
    max-width: 100%;
    display: inline-block;
    text-overflow: ellipsis;
    white-space: normal; /* Разрешаем переносы в ссылках */
}

.message pre, .message code {
    max-width: 100%;
    white-space: pre-wrap; /* Перенос в блоках кода */
}

/* Input container */
.input-wrapper {
    display: flex;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    box-shadow: 0 2px 6px var(--shadow-color);
}

.input-container input {
    flex: 1;
    padding: 33px 33px 70px 33px;
    border: none;
    background-color: transparent;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.input-container textarea {
    flex: 1;
    height: calc(2em * 2);
    padding: 23px 100px 33px 53px;
    border: none;
    background-color: transparent;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    min-height: 20px;
    max-height: 200px;
    line-height: 1.5;
    font-family: inherit;
    overflow: auto !important;
    resize: vertical;
}

.input-container .switch-session, .input-container .reset-context {
    left: 10px;
}

.switch-session, .reset-context {
    background-color: #f3c146 !important;
}

.switch-session.active, .reset-context.active {
    background-color: #f14d20 !important;
}

.message.system {
    align-self: center;
    /*width: 100%;*/
    font-size: 0.9em;
    font-style: italic;
}

.input-container button {
    position: absolute;
    right: 10px;
    bottom: -10px;
    transform: translateY(-50%);
    padding: 8px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 23px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    width: 35px;
    height: 35px;
}

.input-container hover {
    background-color: var(--accent-hover);
}

/* Microphone button styling */
.mic-button {
    position: absolute;
    right: 50px !important;
    transform: translateY(-50%);
    padding: 6px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.mic-button:hover {
    background-color: var(--accent-hover);
}

.mic-button.recording {
    background-color: #e53935;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

/* Collapse button */
.collapse-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    width: auto;
}

.collapse-button svg {
    margin-right: 5px;
    transition: transform 0.3s;
}

.collapse-button:hover {
    background-color: var(--accent-hover);
}

/* Link and formatting styles */
.message.assistant a {
    color: var(--link-color);
    text-decoration: underline;
}

.message.assistant ul, .message.assistant ol {
    margin: 10px 0;
    padding-left: 25px;
}

.message.assistant li {
    margin-bottom: 15px;
}

strong {
    font-weight: 600;
}

/* Transition effects */
* {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* User prompt styles - ChatGPT style */
.chat-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    transition: all 0.3s ease;
    /* Add margin-left to offset sidebar */
    width: 100%;
}

/* Center position for initial state */
.chat-input-container.initial {
    position: fixed;
    top: 50%;
    left: 0;
    /* Offset for sidebar */
    width: 100%;
    transform: none;
    padding: 20px 0;
}

/* Footer position for after response */
.chat-input-container.footer {
    position: fixed;
    bottom: 20px;
    /* Offset for sidebar */
    width: 1050px;
    /*width: 1200px;*/
    transform: none;
    padding: 20px 0;
    margin-left: auto;
    margin-right: auto;
    right: 0;
    border-radius: 25px;
    max-width: 90%;
    background-color: rgba(var(--bg-primary-rgb), 0.7);
    z-index: 100;
}

footer {
    z-index: 200;
    text-align: center;
    font-size: 14px;
    width: 50%;
    position: fixed;
    bottom: 25px;
    left: 45%;
    transform: translateX(-50%);
}

/* Spinner styling */
.spinner {
    display: none;
    margin: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* слайдер */
.slider {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 300px;
    overflow: hidden;
    margin: 0 auto;
}

.slider .slides {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.slider .slides img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
}

.slider .prev,
.slider .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffffcc;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 10px;
    z-index: 10;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.slider .prev {
    left: 5px;
}

.slider .next {
    right: 5px;
}

.slider-wrapper {
    padding-bottom: 30px;
}

/* Стили для контейнера критериев поиска */
#search-criteria-container {
    position: sticky;
    top: 5px;
    background-color: var(--bg-primary);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow-color);
    z-index: 1000;
    display: none;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

#search-criteria-container::before {
    content: "🔍 ";
    margin-right: 5px;
}

[data-theme="dark"] #search-criteria-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 900px) {
    .message.assistant img {
        display: none;
    }

    .message-content p {
        padding-right: 20px;
        padding-left: 0;
    }
}

.info-hr {
    border: none;
    /*border-top: 2px dashed #007BFF;*/
    margin: 10px 0;
}

.progress-container {
    font-size: 14px;
    margin-bottom: 6px;
    padding-left: 50px;
}

.progress-text {
    margin-bottom: 6px;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    height: 17px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s ease;
}

.button-menu-wrapper {
    position: fixed;
    top: 107px;
    right: 20px;
    z-index: 100;
}

.button-menu-wrapper.info-video {
    position: fixed;
    top: 150px;
    right: 20px;
    z-index: 100;
}

.button-menu-wrapper.nemu {
    display: none;
}

.button-menu {
    padding: 8px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 23px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    width: 35px;
    height: 35px;
}

.button-menu:hover {
    background-color: var(--accent-hover, #7b88b4);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(98, 114, 164, 0.5);
    z-index: 100;
}

.doc-form-tooltip {
    position: absolute;
    right: 45px;
    background: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.button-menu:hover .doc-form-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Hide avatar on mobile devices */
@media (max-width: 768px) {

    .dropdown-menu {
        left: 52px;
        background-color: gray !important;
    }

    #dropdownMenuContent {
        position:absolute;
        width:250px;
        left: 45px;
        height: 130px;
        background:rgba(255,255,255,0.98);
        border-radius:16px;
        box-shadow:0 8px 32px rgba(0,0,0,0.2);
        z-index:10000;
        bottom:48px; right:0;
        flex-direction:column;
        gap:18px;
        padding:24px 16px;
    }

.tour-popup {
        width: 80%;
        font-size: 16px;
    }

    .avatar-flip-wrapper {
        display: none;
    }

    .button-menu-wrapper {
        bottom: 30px;
        right: 52px;
        top: unset;
        z-index: 200;
    }

    [data-theme="dark"] .button-menu-wrapper {
        bottom: 0px;
        right: 45px;
        top: unset;
        z-index: 200;
    }

    [data-theme="dark"]  #dropdownMenuContent {
        background: var(--bg-secondary, #fff);
    }

    #dropdownMenuContent button {
        left: 20px;
    }
    #dropdownMenuContent #theme-toggle {
        top: 40px;
    }
    #dropdownMenuContent #language-toggle {
        top: 90px;
        bottom: auto !important;
        display: block;
    }
    #dropdownMenuContent #runInfoVideo {
        top: 140px;
    }
    .language-dropdown {
        position: fixed;
        bottom: 150px !important;
        top: auto !important;
        left: 120px;
        z-index: 1001;
        display: none;
        width: 100px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .message-icon-column img {
        display: none !important;
    }

    .progress-container {
        padding: 10px;
    }

    .message {
        padding: 0;
        margin-bottom: 55px;
    }

    .message p, .message-content p {
        padding-right: 10px;
        padding-left: 10px;
    }

    .message-with-avatar img {
        display: none !important;
    }

    /* Optional: adjust spacing when avatar is hidden */
    .message-with-avatar {
        margin-left: 0 !important;
    }

    footer {
        z-index: 200;
        text-align: center;
        font-size: 14px;
        width: 60%;
        position: fixed;
        bottom: 35px;
        left: 50%;
        transform: translateX(-50%);
        color: var(--text-color);
    }

    .chat-input-container {
        position: fixed;
        right: 0 !important;
        left: 0 !important;
        margin: 7px !important;
        width: -webkit-fill-available !important;
        max-width: -webkit-fill-available !important;
        padding: 0 !important;
    }

    .message.user {
        padding: 10px 20px;
        margin: 10px;
        max-width: 100%;
    }

    .input-container textarea {
        flex: 1;
        height: calc(2em * 2);
        padding: 20px 50px 53px 20px;
        border: none;
        background-color: transparent;
        color: var(--text-primary);
        font-size: 13px;
        outline: none;
        min-height: 20px;
        max-height: 200px;
        line-height: 1.5;
        font-family: inherit;
        overflow: auto !important;
        resize: vertical;
    }

    .message.assistant {
        margin-top: 60px;
        align-self: flex-start;
        background-color: transparent;
    }

    .messages {
        padding: 0;
        margin: 0;
        display: block;
    }

    footer a {
        position: absolute;
        bottom: -27px;
        left: 20%;
        font-size: 12px;
    }

    /* Slider adjustments for mobile */
    .slider {
        position: relative;
        width: 100%;
        overflow: hidden;
        max-width: 100%;
        height: 200px; /* Reduce height for mobile */
        user-select: none; /* Предотвращает выделение текста при свайпе */
        touch-action: pan-y; /* Позволить вертикальную прокрутку, но контролировать горизонтальную */
        -webkit-user-select: none;
    }

    .slider .slides {
        display: flex;
        height: 100%;
        transition: transform 0.3s ease-in-out;
        will-change: transform;
        touch-action: pan-x; /* Разрешаем горизонтальные свайпы */
        cursor: grab;
    }

    .slider .prev,
    .slider .next {
        font-size: 1rem;
        padding: 12px 18px;
    }

    /* Improve slider controls visibility on mobile */
    .slider .prev {
        left: 2px;
    }

    .slider .next {
        right: 2px;
    }

    /* Make sure slides adapt properly to smaller screens */
    .slider .slides img {
        display: block;
    }

    .theme-toggle, #language-toggle, .doc-chat-button-wrapper, #micButton {
        display: none; /* Hide theme toggle and doc chat button on mobile */
    }

    #search-criteria-container {
        top: 60px;
        margin: 5px;
        font-size: 14px;
        padding: 8px;
    }

    html, body {
        overscroll-behavior-x: none;
        overscroll-behavior-y: contain;
    }
}

/* iPhone-specific override */
@supports (-webkit-touch-callout: none) {
    /* iOS-specific */
    #search-criteria-container {
        top: 5px;
    }

    input,
    textarea {
        font-size: 16px;
    }
}

.tour-highlight-input-wrapper {
    border: 3px solid #9200fc !important;
    box-shadow: 0 0 0 2px #e5d6fa;
}

.tour-highlight-send-button {
    outline: 3px solid #9200fc !important;
    outline-offset: 3px !important;
    z-index: 1000 !important;
}

.tour-highlight-switch-session {
    outline: 3px solid #9200fc !important;
    outline-offset: 3px !important;
    z-index: 1000 !important;
}

.tour-highlight-question-textarea {
    color: var(--text-primary, #333);
    font-size: 1em !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 20px 50px 25px 20px !important;
}
