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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#iframe-container {
    width: 100%;
    height: 100%;
    display: none;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#fallback {
    width: 100%;
    height: 100%;
    background-image: url('38240-vodopad_goryi_rechka.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

#fallback.active {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 60px;
}

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#search-input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

#search-button {
    padding: 18px 35px;
    border: none;
    background: #667eea;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#search-button:hover {
    background: #5568d3;
}

.time-container {
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#time {
    font-size: 120px;
    font-weight: 300;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#date {
    font-size: 32px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 40px;
    border-radius: 10px;
}

#search-yandex {
    background: #ffd600;
    border: 0;
    cursor: pointer;
    padding: 0 30px 0 37px;
    font-size: 16px;
}

#search-google {
    color: #fff;
    background: #667eea;
    font-size: 20px;
    line-height: 42px;
    width: 65px;
    text-align: center;
    border-radius: 50%;
    border: 5px solid #667eea;
    margin: -5px -15px;
    cursor: pointer;
    box-shadow: 0px 0px 16px -2px #223691;
}

.ai {
    display: none;
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

#prompt {
    width: calc(100% + 30px);
    max-width: 600px;
    margin: 0 auto;
    display: block;
    min-height: 140px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    padding-right: 10px;
    height: auto;
    resize: none;
    overflow-y: auto;
    line-height: 1.3;
    box-sizing: border-box;
    background: #33333300;
    border: 0;
    max-height: calc(80vh - 80px);
    margin-bottom: 20px;
    padding-right: 23px;
}

textarea {
    outline: none;
}

#ai-tools {
    display: flex;
    justify-content: space-between;
    padding: 14px 0 0 0;
    border-top: 1px solid #9e9e9eb3;
    align-items: center;
}

.sent_ai {
    border: 0;
    width: 40px;
    line-height: 40px;
    cursor: pointer;
    border-radius: 4px;
    background: #0188ae;
    color: #fff;
}

#wr-prompt {
    padding: 20px 15px 10px 15px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: #ffffffba;
    backdrop-filter: blur(5px);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}

.select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select {
    border: 0;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.custom-select i {
    margin-left: 8px;
    font-size: 12px;
}

.select-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-bottom: 5px;
}

.select-dropdown.active {
    display: block;
}

.select-group-title {
    padding: 10px 14px;
    font-weight: bold;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.select-option:hover {
    background: #f0f0f0;
}

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

.select-option.disabled:hover {
    background: transparent;
}

.select-option.selected {
    background: #e3f2fd;
}

/* Стилизованная полоса прокрутки */
.select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#chat-bord {
    max-height: calc(80vh - 230px);
    max-width: 600px;
    margin: 0 auto -20px;
    height: 30vh;
    border-radius: 10px;
    background: #ffffffba;
    backdrop-filter: blur(5px);
    flex-grow: 1;
    padding: 10px;
    display: none;
    height: auto;
    width: 100%;
    overflow-y: scroll;
}

.show-ai-bord {
    display: flex;
    max-height: 80vh;
    flex-direction: column;
    justify-content: flex-end;
}

.user_message, .bot_message, .typing {
    margin: 0 0 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.show-chatbord {
    display: block !important;
}

.bot_message p {
    line-height: 1.2;
    margin-bottom: 20px;
}

.login {
    position: fixed;
    z-index: 100;
    color: #fff;
    text-align: center;
    width: 39px;
    line-height: 40px;
    right: 15px;
    border: 1px solid;
    font-size: 21px;
    border-radius: 10px;
    opacity: .3;
    top: 13px;
    cursor: pointer;
    transition: all .4s;
}

.login:hover {
    opacity: .9;
}

.change-bg {
    position: fixed;
    z-index: 100;
    color: #fff;
    text-align: center;
    width: 39px;
    line-height: 40px;
    right: 15px;
    border: 1px solid;
    font-size: 21px;
    border-radius: 10px;
    opacity: .3;
    top: 63px;
    cursor: pointer;
    transition: all .4s;
}

.change-bg:hover {
    opacity: .9;
}

/* Модальное окно смены фона */
.bg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.bg-modal.active {
    display: flex;
}

.bg-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.bg-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.bg-close:hover {
    color: #000;
}

/* Модальное окно закладок */
.bookmark-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.bookmark-modal.active {
    display: flex;
}

.bookmark-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.bookmark-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.bookmark-close:hover {
    color: #000;
}

.bg-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bg-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.bg-input:focus {
    border-color: #667eea;
}

.bg-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bg-button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bg-button:hover {
    background: #5568d3;
}

.bg-reset {
    background: #e74c3c;
}

.bg-reset:hover {
    background: #c0392b;
}

.refresh {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    padding: 5px;
    transition: color 0.3s;
}

.refresh:hover {
    color: #0188ae;
}

.dialog {
    overflow-y: auto;
    max-height: 100%;
    padding-right: 10px;
}

.dialog::-webkit-scrollbar {
    width: 8px;
}

.dialog::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 4px;
}

.dialog::-webkit-scrollbar-thumb {
    background: rgba(136, 136, 136, 0.5);
    border-radius: 4px;
}

.dialog::-webkit-scrollbar-thumb:hover {
    background: rgba(85, 85, 85, 0.7);
}

/* Модальное окно авторизации */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.auth-modal.active {
    display: flex;
}

.auth-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.auth-close:hover {
    color: #000;
}

.auth-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.auth-input:focus {
    border-color: #667eea;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.auth-button:hover {
    background: #5568d3;
}

.auth-yandex {
    background: #ffd600;
    color: #000;
}

.auth-yandex:hover {
    background: #e6c200;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-tab.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: #667eea;
}

.tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ai-sent {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Мобильная кнопка Tab */
.mobile-tab {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s;
}

.mobile-tab:active {
    transform: translateX(-50%) scale(0.95);
}

.mobile-tab i {
    font-size: 24px;
    color: #667eea;
}

/* Диалоговая панель с чат-ботом */
.chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.chat-panel.active {
    opacity: 1;
    visibility: visible;
}

.chat-panel-container {
    width: 90%;
    max-width: 900px;
    height: 95vh;
    max-height: 1000px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s ease;
}

.chat-panel.active .chat-panel-container {
    transform: scale(1) translateY(0);
}

/* Заголовок чата */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-logo {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-header-right {
    display: flex;
    gap: 10px;
}

.chat-refresh,
.chat-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-refresh:hover,
.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.chat-refresh:active,
.chat-close:active {
    transform: scale(0.95);
}

/* Область сообщений */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #e9ecef;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Приветственное сообщение */
.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    margin: auto;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: #fff;
    animation: fadeInScale 0.6s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-welcome h2 {
    font-size: 28px;
    margin: 0 0 10px 0;
    color: #2d3748;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-welcome p {
    font-size: 16px;
    color: #718096;
    margin: 0 0 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.quick-prompt {
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    color: #4a5568;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.quick-prompt:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.quick-prompt i {
    font-size: 16px;
}

/* Сообщения */
.chat-message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.edite_massage {
    background: rgba(102, 126, 234, 0.05);
    padding: 10px;
    border-radius: 12px;
    margin: -10px -10px 20px -10px;
}

.chat-message.hidden {
    display: none;
}

/* Контейнер для message-content с иконками */
.message-wrapper {
    position: relative;
    display: inline-block;
}

.message-actions {
    position: absolute;
    bottom: -25px;
    left: 0;
    display: none;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-message.bot .message-actions {
    left: 0;
}

.chat-message.user .message-actions {
    right: 0;
    left: auto;
}

.chat-message:hover .message-actions {
    display: flex;
    opacity: 1;
}

.message-action-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-action-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.message-action-btn:active {
    transform: translateY(0);
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: #667eea;
    color: #fff;
    margin-left: 10px;
    order: 2;
}

.chat-message.bot .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    margin-right: 10px;
}

.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-message.user .message-content {
    background: #667eea;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-content {
    background: #fff;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-content p {
    margin: 0 0 10px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Индикатор печати */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    width: fit-content;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Панель ввода */
.chat-input-wrapper {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 15px 20px;
}

.chat-tools {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    min-height: 40px;
}

.tools-left,
.tools-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: none;
    outline: none;
    transition: all 0.3s;
    max-height: 150px;
    min-height: 44px;
}

#chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send:active {
    transform: scale(0.95);
}

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

/* Плавное скрытие/показ fallback */
#fallback {
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#fallback.hidden {
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 749px) {
    #fallback {
        display: flex;
        flex-direction: column-reverse;
        justify-content: space-between;
    }
    
    .mobile-tab {
        display: flex;
    }
    
    .ai {
        bottom: 80px;
    }
    
    .chat-panel-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-prompts {
        flex-direction: column;
    }
    
    .quick-prompt {
        width: 100%;
        justify-content: center;
    }
}

/* ── Закладки (Speed Dial) ── */
.bookmarks-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 40px;
    position: relative;
    overflow: hidden;
    padding: 10px 0;
}

.bookmarks-carousel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 10px 20px;
    /* Скрываем скроллбар */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.bookmarks-carousel::-webkit-scrollbar {
    display: none;
}

.bookmark-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    flex: 0 0 calc((100% - (16px * 8)) / 9); /* 9 элементов (с учетом gap=16px) */
    min-width: 60px; /* на мобильных пусть ужимаются до этого минимума */
    scroll-snap-align: start;
    transition: transform 0.2s;
    position: relative;
}


.bookmark-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 8px;
    overflow: hidden;
}

.bookmark-icon-wrapper img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.bookmark-title {
    font-size: 11px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bookmark-delete {
    position: absolute;
    top: -5px;
    right: 0px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.bookmark-item:hover .bookmark-delete {
    opacity: 1;
}

/* Кнопка добавления (FAB) */
.add-bookmark-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 90;
    opacity: .2;
}

.add-bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
}

.add-bookmark-btn:active {
    transform: translateX(-50%) scale(0.95);
}
