.video-form-group select {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    color: #fff;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    width: 100%;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M5%207l5%205%205-5H5z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-form-group select:focus {
    border-color: #ffc400;
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.2);
}

.video-form-group select option {
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
}

/* 2025-10-20: Предотвращаем авто-увеличение текста на iOS/Android */
html, body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 2025-10-20: iOS zoom fix — принудительно 16px на touch-устройствах */
@media (pointer: coarse) {
    textarea#chatInput {
        font-size: 16px !important;
    }
}

@media screen and (max-width: 768px) {
    .video-form-group select {
        font-size: 13px;
        padding: 8px;
        background-size: 10px;
    }
} 
  .custom-video-wrapper {
    display: none;
    margin-top: 20px;
    flex-direction: row;
    background: #1c1c1c;
    border-radius: 18px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    overflow: hidden;
    min-height: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: #fff;
}
.custom-video-wrapper.animate-in {
    display: flex;
    animation: macOSFadeIn 0.3s ease-out forwards;
}
.custom-video-wrapper.hide {
    animation: macOSFadeOut 0.3s ease-in forwards;
}
.custom-video-sidebar {
    width: 300px;
    background: #2a2a2a;
    border-right: 1px solid #444;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
}
.custom-video-sidebar-header h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}
.custom-video-list {
    list-style: none;
    padding: 0;
}
.custom-video-list li {
    background: #333;
    margin: 5px 0;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
}
.custom-video-list li:hover {
    background: #444;
}
.custom-video-list li img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
}
.custom-video-list li .video-info {
    flex: 1;
}
.custom-video-list li .video-info .video-title {
    margin-left:10px;
    font-size: 16px;
    font-weight: 500;
}
.custom-video-list li .video-info .video-date {
    margin-left:10px;
    font-size: 12px;
    color: #aaa;
}
.custom-video-list li .video-status {
    position: absolute;
    top: 10px;
    right: 10px;
}
.custom-video-list li .video-status.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #444;
    border-top: 3px solid #ffc400;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.custom-video-list li .video-status.checkmark {
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ffc400" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M20 6L9 17l-5-5"%3E%3C/path%3E%3C/svg%3E') no-repeat center;
    background-size: contain;
}
/* 2025-11-15: Стили для статуса error - красный крестик */
.custom-video-list li .video-status.error {
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ff4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cline x1="18" y1="6" x2="6" y2="18"%3E%3C/line%3E%3Cline x1="6" y1="6" x2="18" y2="18"%3E%3C/line%3E%3C/svg%3E') no-repeat center;
    background-size: contain;
}
.custom-video-editor {
    flex: 1;
    padding: 20px;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.custom-video-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.video-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.video-form-group label {
    font-size: 14px;
    color: #fff;
}
.video-form-group textarea,
.video-form-group input[type="file"] {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    color: #fff;
    font-size: 14px;
}
.video-form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.custom-video-submit-btn {
    background: #ffc400;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}
.custom-video-submit-btn:hover {
    background: #ffd94d;
}

/* 2025-10-20: Стили для VIDEO — aspect и images */
.video-aspect-ratio {
    display: flex;
    gap: 8px;
}
.aspect-btn {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.aspect-btn:hover {
    background: #333333;
}
.aspect-btn.active {
    background: #ffc400;
    color: #000;
    border-color: #ffc400;
}

#videoAddImagesBtn {
    background: #333333;
    color: #ffffff;
    border: 1px solid #444444;
    border-radius: 8px;
    padding: 8px 12px;
}
#videoAddImagesBtn:hover {
    background: #3d3d3d;
}

.video-images-preview {
    background: #1a1a1a;
    border: 1px dashed #333333;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
}
.video-images-container img {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.custom-video-submit-btn:hover {
    background: #e6a700;
}
.custom-video-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
    font-weight: 500;
}
.custom-video-player {
    display: none;
    flex-direction: column;
    gap: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@media screen and (max-width: 768px) {
    .custom-video-wrapper {
        flex-direction: column;
        min-height: auto;
        margin: 0px;
    }
    .custom-video-sidebar {
        width: 100%;
        border-right: none;
        padding: 15px;
    }
    .custom-video-editor {
        padding: 15px;
    }
    .custom-video-list li img {
        width: 40px;
        height: 40px;
    }
    .custom-video-list li .video-info .video-title {
        font-size: 14px;
    }
    .custom-video-list li .video-info .video-date {
        font-size: 10px;
    }
}

/* Прокрутка сайдбара на мобильных в fullscreen */
@media screen and (max-width: 768px) {
    .custom-video-wrapper.veo-fullscreen .custom-video-sidebar {
        max-height: 200px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }
    .custom-video-wrapper.veo-fullscreen .custom-video-list {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .custom-video-wrapper.veo-fullscreen .custom-video-editor {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 120px;
    }
}
       </style>

    <style>
        /* 2024-12-19: Переработан дизайн чата для соответствия стилю chat-test.html */
        * {
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
        .content-container {
            margin-top: 20px;
            display: none;
        }
        .content-container.show {
            display: block;
            animation: macOSFadeIn 0.3s ease-out forwards;
        }
        .content-container.hide {
            animation: macOSFadeOut 0.3s ease-in forwards;
        }
        .custom-iframe-container iframe {
            width: 100%;
            height: 100%;
        }
        
        /* Новые стили для чата в стиле chat-test.html - 2025-01-27: Обновлена цветовая схема в черно-серые тона */
        .chat-container {
            background: #0f0f0f;
            padding: 0;
            border-radius: 0;
            width: 100%;
            max-width: 1200px;
            margin: 20px auto;
            min-height: 600px;
            display: flex;
            color: #ffffff;
            border: 1px solid #333333;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        .chat-sidebar {
            width: 280px;
            background: #1a1a1a;
            border-right: 1px solid #333333;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }
        
        .nav-menu {
            padding: 20px;
        }
        
        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s ease;
            margin-bottom: 8px;
        }
        
        .nav-item:hover {
            background: #2a2a2a;
        }
        
        .nav-item.active {
            background: #ffc400;
            color: #000000;
        }
        
        .nav-icon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-label {
            font-size: 14px;
            font-weight: 500;
        }
        
        .history-section {
            flex: 1;
            padding: 0 20px;
        }
        
        .history-title {
            font-size: 12px;
            font-weight: 600;
            color: #888888;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 16px;
            padding: 0 16px;
        }
        
        .history-item {
            padding: 12px 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s ease;
            margin-bottom: 4px;
            font-size: 14px;
            color: #cccccc;
        }
        
        .history-item:hover {
            background: #2a2a2a;
        }
        
        .history-item.active {
            background: #ffc400;
            color: #000000;
        }
        
        .main-chat {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #0f0f0f;
        }
        
        .chat-header {
            background: #212121;
            padding: 20px;
            border-bottom: 1px solid #212121;
            text-align: center;
        }
        .chat-header h2,
        .chat-title {
            font-size: 24px;
            font-weight: 700;
            color: #ffffff;
            margin-bottom: 8px;
        }
        
        .chat-subtitle {
            color: #888888;
            font-size: 14px;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 0;
            background: #212121;
            border-radius: 0;
            margin-bottom: 0;
            min-height: 400px;
            scrollbar-width: thin;
            scrollbar-color: #444 #0f0f0f;
            width: 100%;
            box-sizing: border-box;
        }
        .sidebar::-webkit-scrollbar,
        .chat-messages::-webkit-scrollbar {
            width: 6px;
        }
        
        .sidebar::-webkit-scrollbar-track,
        .chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .sidebar::-webkit-scrollbar-thumb,
        .chat-messages::-webkit-scrollbar-thumb {
            background: #3d3d4a;
            border-radius: 3px;
        }
        
        .sidebar::-webkit-scrollbar-thumb:hover,
        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: #4d4d5a;
        }
        .chat-message {
            margin-bottom: 0;
            display: flex;
            align-items: flex-start;
            padding: 24px;
            border-bottom: 1px solid #333333;
            transition: all 0.2s ease;
            animation: messageSlideIn 0.3s ease-out;
        }
        @keyframes messageSlideIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .chat-message.user {
            justify-content: flex-end;
            background: #0f0f0f;
        }
        .chat-message.bot {
            justify-content: flex-start;
            background: #1a1a1a;
        }
        .chat-message.typing {
            background: #1a1a1a;
        }
        .chat-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            margin-right: 16px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.2s ease;
        }
        .chat-avatar.user {
            background: #ffc400;
            color: #000000;
        }
        .chat-avatar.bot {
            background: #888888;
            color: #fff;
        }
        .chat-avatar.typing {
            background: #888888;
            color: #fff;
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        .chat-message-content {
            max-width: 70%;
            line-height: 1.6;
            font-size: 16px;
            color: #ececf1;
            word-wrap: break-word;
        }
        .chat-message.user .chat-message-content {
            background: #2d2d3a;
            padding: 16px 20px;
            border-radius: 18px;
            border-bottom-right-radius: 6px;
        }
        .chat-message.bot .chat-message-content {
            background: #2d2d3a;
            padding: 16px 20px;
            border-radius: 18px;
            border-bottom-left-radius: 6px;
        }
        .chat-message.typing .chat-message-content {
            background: transparent;
            color: #8e8ea0;
        }
        
        .message-actions {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-top: 12px;
            padding-left: 48px;
        }
        
        .action-btn {
            background: none;
            border: none;
            color: #8e8ea0;
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: color 0.2s ease;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
        }
        
        .action-btn:hover {
            color: #ececf1;
        }
        
        .think-harder {
            background: #2d2d3a;
            border: 1px solid #3d3d4a;
            color: #ececf1;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            margin: 20px;
        }
        
        .think-harder:hover {
            background: #3d3d4a;
        }
        .typing-indicator {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 0;
        }
        .typing-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #8e8ea0;
            animation: typing 1.4s infinite ease-in-out;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        .typing-dot:nth-child(1) { animation-delay: -0.32s; }
        .typing-dot:nth-child(2) { animation-delay: -0.16s; }
        .typing-dot:nth-child(3) { animation-delay: 0s; }
        @keyframes typing {
            0%, 80%, 100% { 
                transform: scale(0.8); 
                opacity: 0.5; 
            }
            40% { 
                transform: scale(1); 
                opacity: 1; 
            }
        }
        .chat-input {
            background: #303030;
            border-top: 1px solid #2d2d3a;
            padding: 24px;
        }
        .chat-input-wrapper {
            max-width: 768px;
            margin: 0 auto;
            position: relative;
        }
        
        .input-actions {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
        }
        
        .chat-input textarea {
            background: #2d2d3a;
            border: 1px solid #3d3d4a;
            border-radius: 12px;
            padding: 16px 20px;
            padding-right: 60px;
            color: #ececf1;
            font-size: 16px;
            line-height: 1.5;
            resize: none;
            outline: none;
            width: 100%;
            min-height: 56px;
            max-height: 200px;
            font-family: inherit;
        }
        .chat-input textarea:focus {
            border-color: #ffffff;
            box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
        }

        .chat-input textarea::placeholder {
            color: #8e8ea0;
        }
        .chat-input button,
        .send-button {
            position: relative;
            background: #ffc400;
            color: #0f0f23;
            border: none;
            border-radius: 8px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.2s ease;
        }


        .chat-input button:hover:not(:disabled) {
            background: #e6b000;
        }
        .chat-input button:disabled {
            background: #3d3d4a;
            cursor: not-allowed;
            opacity: 0.6;
        }
        .chat-input button svg {
            width: 16px;
            height: 16px;
        }
        .chat-input .send-icon {
            width: 16px;
            height: 16px;
        }
        .chat-input .loading-icon {
            width: 16px;
            height: 16px;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .chat-message .markdown-content {
            line-height: 1.6;
            word-break: break-word;
        }
        .chat-message .markdown-content p {
            margin: 0 0 16px 0;
        }
        .chat-message .markdown-content p:last-child {
            margin-bottom: 0;
        }
        .chat-message .markdown-content code {
            background: #2a2a2a;
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 14px;
            border: 1px solid #444;
        }
        .chat-message .markdown-content pre {
            background: #2a2a2a;
            padding: 16px;
            border-radius: 8px;
            overflow-x: auto;
            margin: 16px 0;
            border: 1px solid #444;
        }
        .chat-message .markdown-content pre code {
            background: transparent;
            padding: 0;
            border: none;
        }
        .chat-message .markdown-content ul, .chat-message .markdown-content ol {
            margin: 16px 0;
            padding-left: 20px;
        }
        .chat-message .markdown-content li {
            margin: 8px 0;
        }
        .chat-message .markdown-content blockquote {
            border-left: 4px solid #10a37f;
            margin: 16px 0;
            padding-left: 16px;
            color: #ccc;
            font-style: italic;
        }
        .payment-modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.1);
            overflow: auto;
        }
        .payment-modal-content {
            background: #1a1a1a;
            color: #fff;
            margin: 15% auto;
            padding: 30px;
            border-radius: 16px;
            width: 90%;
            max-width: 500px;
            position: relative;
            border: 1px solid #2a2a2a;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
            animation: modalSlideIn 0.3s ease-out;
            transition: all 0.3s ease;
        }
        .payment-modal-content:hover {
            transform: scale(1.02);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
        }
        .payment-modal-content h2 {
            margin-bottom: 20px;
            font-size: 24px;
        }
        .payment-modal-content p {
            margin-bottom: 20px;
            font-size: 16px;
        }
        .payment-modal-content button {
            background: #ffc400;
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
        }
        .payment-modal-content button:hover {
            background: #0e8c6b;
        }
        .payment-modal-close {
            color: #fff;
            position: absolute;
            top: 10px;
            right: 20px;
            font-size: 24px;
            cursor: pointer;
        }
        .payment-modal-close:hover {
            color: #ccc;
        }
        .bg-blue.container {
            max-width: 100%;
            padding: 0;
            overflow-x: hidden;
        }
        .grid-container.full {
            width: 100%;
        }
        .custom-note-wrapper {
            display: none;
            margin-top: 20px;
            flex-direction: row;
            background: #1c1c1c;
            border-radius: 18px;
            width: 100%;
            max-width: 1200px;
            margin: 20px auto;
            overflow: hidden;
            min-height: 500px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            color: #fff;
        }
        .custom-note-wrapper.animate-in {
            display: flex;
            animation: macOSFadeIn 0.3s ease-out forwards;
        }
        .custom-note-wrapper.hide {
            animation: macOSFadeOut 0.3s ease-in forwards;
        }
        .custom-note-sidebar {
            width: 300px;
            background: #2a2a2a;
            border-right: 1px solid #444;
            padding: 20px;
            overflow-y: auto;
            height: 100%;
        }
        .custom-note-sidebar-header h3 {
            color: #fff;
            font-size: 18px;
            margin-bottom: 10px;
        }
        .custom-note-new-btn {
            background: #ffc400;
            color: white;
            border: none;
            padding: 8px 12px;
            cursor: pointer;
            border-radius: 4px;
            font-size: 14px;
            width: 100%;
            margin-top: 10px;
        }
        .custom-note-new-btn:hover {
            background: #ffa300;
        }
        .custom-note-list {
            list-style: none;
            padding: 0;
        }
        .custom-note-list li {
            background: #333;
            margin: 5px 0;
            padding: 10px;
            border-radius: 5px;
            cursor: pointer;
            color: #fff;
        }
        .custom-note-list li:hover {
            background: #444;
        }
        .custom-note-editor {
            min-height: 400px;
            flex: 1;
            padding: 20px;
            background: #1e1e1e;
            display: flex;
            flex-direction: column;
            gap: 10px;
            color: #fff;
        }
        .custom-note-editor-title {
            border: none;
            font-size: 22px;
            font-weight: 600;
            color: #fff;
            background: transparent;
            padding: 0;
            margin: 0;
            outline: none;
            width: 100%;
        }
        .custom-note-editor-content {
            border: none;
            font-size: 16px;
            color: #fff;
            background: transparent;
            padding: 0;
            margin: 0;
            outline: none;
            resize: none;
            flex: 1;
            width: 100%;
            line-height: 1.5;
        }
        .custom-note-delete-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px;
            display: flex;
            align-items: center;
        }
        .custom-note-delete-btn img {
            width: 24px;
            height: 24px;
            opacity: 0.7;
        }
        .custom-note-empty {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #666;
            font-size: 18px;
            font-weight: 500;
        }
        .crypto-module {
            padding: 20px;
            border-radius: 10px;
            margin: 20px auto;
            max-width: 100%;
            color: #FFF;
        }
        .crypto-module h2 {
            text-align: center;
            margin-bottom: 20px;
        }
        .crypto-table-container {
            width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            display: block;
        }
        .crypto-table {
            width: 100%;
            min-width: 600px;
            border-collapse: collapse;
            font-size: 16px;
        }
        .crypto-table th,
        .crypto-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #333;
        }
        .crypto-table th {
            background: #222;
            color: #FFF;
            position: sticky;
            top: 0;
            z-index: 10;
        }
        .crypto-table tr:hover {
            background: #1a1a1a;
        }
        .crypto-table td.rank,
        .crypto-table th.rank {
            text-align: center;
            width: 60px;
        }
        .crypto-table td.icon,
        .crypto-table th.icon {
            text-align: center;
            width: 60px;
        }
        .crypto-table td.icon img {
            width: 24px;
            height: 24px;
            vertical-align: middle;
            object-fit: contain;
            crossorigin: anonymous;
        }
        .crypto-table td.name,
        .crypto-table th.name {
            width: 200px;
        }
        .crypto-table td.symbol,
        .crypto-table th.symbol {
            width: 100px;
        }
        .crypto-table td.price,
        .crypto-table th.price {
            text-align: right;
            width: 120px;
        }
        .crypto-table td.change,
        .crypto-table th.change {
            text-align: right;
            width: 120px;
        }
        .crypto-table td.change.positive {
            color: #28a745;
        }
        .crypto-table td.change.negative {
            color: #dc3545;
        }
        .crypto-loading,
        .crypto-error {
            text-align: center;
            padding: 20px;
            color: #FFF;
        }
        .info-button {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .info-button svg {
            width: 24px;
            height: 24px;
            opacity: 0.7;
            transition: opacity 0.3s;
        }
        .info-button:hover svg {
            opacity: 1;
        }
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            overflow: auto;
        }
        .modal-content {
            background: #1c1c1c;
            color: #fff;
            margin: 10% auto;
            padding: 20px;
            border-radius: 10px;
            width: 80%;
            max-width: 800px;
            position: relative;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }
        .modal-close {
            color: #fff;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            position: absolute;
            top: 10px;
            right: 20px;
        }
        .modal-close:hover {
            color: #ccc;
        }
        #modalInfoContent {
            font-size: 14px;
            line-height: 1.5;
        }
        #modalInfoContent h3 {
            color: #ffc400;
            margin-top: 20px;
            font-size: 18px;
        }
        #modalInfoContent p {
            margin: 5px 0;
        }
        @keyframes macOSFadeIn {
            0% {
                opacity: 0;
                transform: scale(0.95) translateY(10px);
            }
            100% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }
        @keyframes macOSFadeOut {
            0% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
            100% {
                opacity: 0;
                transform: scale(0.95) translateY(10px);
            }
        }
        @media screen and (max-width: 768px) {
            .custom-note-wrapper {
                flex-direction: column;
                min-height: auto;
                margin: 0px;
            }
            .custom-note-sidebar {
                width: 100%;
                border-right: none;
                padding: 15px;
            }
            .custom-note-editor {
                padding: 15px;
            }
            .custom-note-new-btn {
                width: 100%;
            }
            .custom-note-list li {
                padding: 12px;
                font-size: 14px;
            }
            .custom-note-editor-title {
                font-size: 20px;
            }
            .custom-note-editor-content {
                font-size: 14px;
            }
            .custom-note-empty {
                font-size: 16px;
            }
            .crypto-table-container {
                overflow-x: auto;
            }
            .crypto-table {
                font-size: 14px;
                min-width: 600px;
            }
            .crypto-table th,
            .crypto-table td {
                padding: 8px;
            }
            .crypto-table td.rank,
            .crypto-table th.rank {
                width: 50px;
            }
            .crypto-table td.icon,
            .crypto-table th.icon {
                width: 50px;
            }
            .crypto-table td.icon img {
                width: 20px;
                height: 20px;
            }
            .crypto-table td.name,
            .crypto-table th.name {
                width: 150px;
            }
            .crypto-table td.symbol,
            .crypto-table th.symbol {
                width: 80px;
            }
            .crypto-table td.price,
            .crypto-table th.price {
                width: 100px;
            }
            .crypto-table td.change,
            .crypto-table th.change {
                width: 100px;
            }
            .chat-container {
                padding: 10px;
                margin: 10px;
            }
            .chat-input {
                flex-direction: column;
                gap: 5px;
            }
            .chat-input textarea {
                width: 100%;
            }
            .chat-input button {
                width: 100%;
            }
            .crypto-module {
                padding: 10px;
                margin: 10px;
            }
            .custom-iframe-container iframe {
                height: 100%;
            }
            .modal-content {
                width: 90%;
                margin: 20% auto;
                padding: 15px;
            }
            .payment-modal-content {
                width: 90%;
                margin: 20% auto;
                padding: 15px;
            }
            #modalInfoContent {
                font-size: 13px;
            }
            .modal-close,
            .payment-modal-close {
                font-size: 24px;
                top: 5px;
                right: 15px;
            }
        }
        @media screen and (max-width: 480px) {
            .crypto-table {
                font-size: 12px;
                min-width: 500px;
            }
            .crypto-table th,
            .crypto-table td {
                padding: 6px;
            }
            .crypto-table td.icon img {
                width: 18px;
                height: 18px;
            }
            .custom-note-sidebar-header h3 {
                font-size: 14px;
            }
            .custom-note-new-btn {
                padding: 6px 12px;
                font-size: 13px;
            }
            .custom-note-list-item-title {
                font-size: 14px;
            }
            .custom-note-list-item-date {
                font-size: 12px;
            }
            .custom-note-editor-title {
                font-size: 18px;
            }
            .custom-note-editor-content {
                font-size: 14px;
            }
            .chat-container {
                padding: 5px;
            }
            .chat-messages {
                max-height: 300px;
            }
            .chat-input button {
                font-size: 14px;
            }
        }
        @media screen and (max-width: 899px) {
            button[onclick="showContent('gpt')"] {
                /* Стили для кнопки GPT */
            }
        }
        .note {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
        }
            /* Увеличение ширины чата */

    /* Фиксированная высота чата и ширина */
    .chat-container {
        background: #151515;
        padding: 20px;
        border-radius: 10px;
        width: 100%;
        max-width: 1400px;
        margin: 20px auto;
        height: 800px; /* Фиксированная высота чата */
        display: flex;
        flex-direction: column;
        color: #fff;
    }

    /* Прокручиваемая область сообщений - 2025-10-19: Убран max-height для правильной работы flex-контейнера */
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        background: #212121;
        border-radius: 8px;
        /* margin-bottom: 20px; */
        /* max-height: 600px; */ /* Убрано - мешает flex: 1 работать корректно */
    }

    /* Сообщения пользователя — желтый цвет */
    .chat-message.user .chat-message-content {
        background: #ffc400;
        color: #fff;
    }

    /* Кнопка отправки — желтый цвет */
    .chat-input button {
        background: #ffc400;
        color: #fff;
        border: none;
        padding: 8px 16px;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .chat-input button:hover {
        background: #e6a700; /* Темнее желтый для hover */
    }

    /* Фокус селекта — желтый цвет */
    .chat-header select:focus {
        border-color: #ffc400;
        box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.2);
    }

    .payment-modal button {
            background: #10a37f;
            color: #fff;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 500;
            transition: all 0.2s ease;
            margin-top: 20px;
            width: 100%;
            position: relative;
            overflow: hidden;
        }
        .payment-modal button::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;
        }
        .payment-modal button:hover::before {
            left: 100%;
        }
        .payment-modal button:hover {
            background: #0e8c6b;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(16, 163, 127, 0.3);
        }

    .payment-modal h2 {
            color: #fff;
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 16px;
            text-align: center;
        }
        .payment-modal p {
            color: #ccc;
            font-size: 16px;
            line-height: 1.6;
            text-align: center;
            margin-bottom: 0;
        }

    .payment-modal .close-button {
        position: absolute;
        top: 15px;
        right: 20px;
        background: rgba(255, 255, 255, 0.1);
        color: #ffc400;
        border: none;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        font-size: 18px;
        line-height: 30px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        display: block;
    }
    .payment-modal .close-button:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1) rotate(90deg);
        color: #fff;
    }

    /* Адаптивность для мобильных устройств */
    @media (max-width: 768px) {
        .chat-container {
            margin: 10px;
            max-width: none;
            min-height: 500px;
        }
        .chat-header {
            flex-direction: column;
            gap: 16px;
            align-items: flex-start;
        }
        .chat-header h2 {
            font-size: 18px;
        }
        .chat-message {
            padding: 16px;
        }
        .chat-avatar {
            width: 28px;
            height: 28px;
            font-size: 12px;
            margin-right: 12px;
        }
        .chat-input {
            padding: 16px;
            flex-direction: column;
            align-items: stretch;
        }
        .chat-input textarea {
            min-height: 40px;
            margin-bottom: 12px;
        }
        .chat-input button {
            width: 100%;
            justify-content: center;
        }
        .payment-modal-content {
            margin: 10% auto;
            padding: 20px;
            width: 95%;
        }
    }

    /* Стили для уведомлений */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10000;
        max-width: 400px;
        animation: notificationSlideIn 0.3s ease-out;
        transition: all 0.3s ease;
    }
    .notification:hover {
        transform: translateX(-5px);
    }
    @keyframes notificationSlideIn {
        from {
            opacity: 0;
            transform: translateX(100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    .notification-content {
        background: #1a1a1a;
        border: 1px solid #2a2a2a;
        border-radius: 8px;
        padding: 16px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .notification-info {
        border-left: 4px solid #10a37f;
    }
    .notification-success {
        border-left: 4px solid #10a37f;
    }
    .notification-error {
        border-left: 4px solid #ff4444;
    }
    .notification-warning {
        border-left: 4px solid #ffc400;
    }
    .notification-message {
        color: #fff;
        font-size: 14px;
        line-height: 1.4;
        flex: 1;
    }
    .notification-close {
        background: none;
        border: none;
        color: #888;
        font-size: 18px;
        cursor: pointer;
        padding: 0;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        border-radius: 50%;
    }
    .notification-close:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.1);
    }

        /* ===== GEMINI REDESIGN 2026 — Google Gemini Style ===== */
        /* Gemini чат — обычный режим (не fullscreen) */
        #dynamicContent:has(.app-container) {
            background: transparent;
        }
        #dynamicContent:has(.app-container) .content-container {
            height: 100vh;
            display: flex;
            flex-direction: column;
            margin-top: 0;
        }
        /* Fullscreen режим Gemini — только по кнопке */
        #dynamicContent.gemini-fullscreen-mode {
            background: #1c1c1e;
        }
        #dynamicContent.gemini-fullscreen-mode .content-container {
        }

        /* ── Основной контейнер ── */
        .app-container {
            display: flex;
            height: 80%;
            width: 100%;
            max-width: 1200px;
            margin: 20px auto;
            border-radius: 18px;
            overflow: hidden;
            background: #1c1c1c;
            color: #e8eaed;
            font-family: 'Google Sans', 'Roboto', sans-serif;
            position: relative;
            overflow: hidden;
        }

        /* ── Sidebar ── */
        .sidebar {
            width: 256px;
            min-width: 256px;
            background: #323235;
            display: flex;
            flex-direction: column;
            border-right: 1px solid #2d2d2f;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            flex-shrink: 0;
            z-index: 10;
        }

        .sidebar.collapsed {
            width: 0;
            min-width: 0;
            border-right: none;
        }

        /* Sidebar overlay для мобильных */
        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 99;
        }

        .sidebar-overlay.active {
            display: block;
        }

        /* ── Sidebar top ── */
        .sidebar-top {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px 12px 12px 16px;
            flex-shrink: 0;
        }

        .sidebar-toggle-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
            flex-shrink: 0;
        }

        .sidebar-toggle-btn:hover {
            background: rgba(255,255,255,0.08);
            color: #e8eaed;
        }

        /* ── New Chat кнопка в sidebar ── */
        .custom-note-new-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            padding: 10px 16px;
            background: transparent;
            border: 1px solid #3c4043;
            border-radius: 24px;
            color: #e8eaed;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s;
            margin-bottom: 8px !important;
        }

        .custom-note-new-btn:hover {
            background: rgba(255,255,255,0.08);
        }

        /* ── History section ── */
        .history-section {
            flex: 1;
            overflow-y: auto;
            padding: 8px 8px 16px;
        }

        .history-section::-webkit-scrollbar {
            width: 4px;
        }

        .history-section::-webkit-scrollbar-track {
            background: transparent;
        }

        .history-section::-webkit-scrollbar-thumb {
            background: #3c4043;
            border-radius: 2px;
        }

        .history-title {
            font-size: 11px;
            font-weight: 500;
            color: #9aa0a6;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            padding: 8px 8px 4px;
            margin-bottom: 4px;
        }

        .history-actions {
            padding: 0 4px;
            margin-bottom: 8px;
        }

        /* ── Chat groups ── */
        .chat-group {
            margin-bottom: 4px;
            border: none;
            border-radius: 0;
            overflow: visible;
        }

        .group-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 8px;
            cursor: pointer;
            border-radius: 8px;
            background: transparent;
            transition: background 0.2s;
        }

        .group-header:hover {
            background: rgba(255,255,255,0.06);
        }

        .group-name {
            font-size: 13px;
            font-weight: 500;
            color: #9aa0a6;
        }

        .group-toggle {
            color: #9aa0a6;
            transition: transform 0.2s;
            font-size: 12px;
        }

        .group-toggle.expanded {
            transform: rotate(180deg);
        }

        .group-chats {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .group-chats.expanded {
            max-height: 1000px;
        }

        .group-chat-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 8px 8px 16px;
            cursor: pointer;
            border-radius: 8px;
            border: none;
            transition: background 0.2s;
            color: #e8eaed;
            font-size: 14px;
        }

        .group-chat-item:hover {
            background: rgba(255,255,255,0.06);
        }

        .group-chat-item.active {
            background: rgba(138, 180, 248, 0.12);
            color: #8ab4f8;
        }

        .chat-actions-menu {
            display: flex;
            gap: 2px;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .group-chat-item:hover .chat-actions-menu {
            opacity: 1;
        }

        .chat-action-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            transition: all 0.2s;
        }

        .chat-action-btn:hover {
            background: rgba(255,255,255,0.1);
            color: #e8eaed;
        }

        .chat-action-btn.delete:hover {
            background: rgba(242, 139, 130, 0.15);
            color: #f28b82;
        }

        /* ── Main chat area ── */
        .main-chat {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            background: #1c1c1e;
            position: relative;
        }

        /* ── Chat header ── */
        .chat-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            background: #1c1c1e;
            border-bottom: 1px solid #2d2d2f;
            flex-shrink: 0;
            min-height: 56px;
            position: relative; /* 2026-04-09: нужно для абсолютного позиционирования modelSelect */
        }

        /* Hamburger кнопка в header */
        .header-menu-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
            flex-shrink: 0;
        }

        .header-menu-btn:hover {
            background: rgba(255,255,255,0.08);
            color: #e8eaed;
        }

        /* Скрываем hamburger когда sidebar открыт на десктопе (только десктоп) */
        @media screen and (min-width: 769px) {
            .sidebar:not(.collapsed) ~ .main-chat .header-menu-btn {
                display: none;
            }
        }

        /* 2026-04-09: Левая колонка шапки */
        .chat-header-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            min-width: 0;
        }

        /* 2026-04-09: Трёхколоночный flex layout: название слева, модель по центру, действия справа */
        .chat-title {
            font-size: 16px;
            font-weight: 500;
            color: #e8eaed;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            align-self: center;
            line-height: 1;
        }

        /* ── Model select ── */
        /* 2026-04-09: контейнер для центрирования модели + иконки инфо вместе */
        .model-center-wrapper {
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            flex-shrink: 0;
            /* position:absolute только на десктопе — см. ниже */
            z-index: 0; /* ниже chat-actions */
        }
        /* Десктоп: центрируем select через absolute */
        @media screen and (min-width: 769px) {
            .model-center-wrapper {
                position: absolute;
                left: 50%;
                transform: translateX(-50%);
            }
        }
        .model-center-wrapper > * {
            pointer-events: auto;
        }

        /* 2026-04-09: выборка модели без абсолютного позиционирования */
        #modelSelect {
            background: transparent;
            border: 1px solid #3c4043;
            border-radius: 24px;
            color: #e8eaed;
            font-size: 13px;
            padding: 6px 28px 6px 12px;
            cursor: pointer;
            outline: none;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 8px center;
            transition: border-color 0.2s, background-color 0.2s;
            flex-shrink: 0; /* не сжимать выборку */
        }

        #modelSelect:hover {
            border-color: #5f6368;
            background-color: rgba(255,255,255,0.04);
        }

        #modelSelect:focus {
            border-color: #8ab4f8;
        }

        #modelSelect option,
        #modelSelect optgroup {
            background: #2d2d2f;
            color: #e8eaed;
        }

        /* ── Chat actions ── */
        .chat-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .web-search-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            transition: background 0.2s, color 0.2s;
        }

        .web-search-btn:hover {
            background: rgba(255,255,255,0.08);
            color: #e8eaed;
        }

        .web-search-btn.active {
            color: #8ab4f8;
            background: rgba(138, 180, 248, 0.12);
        }

        /* ── Info icon ── */
        .gemini-info-icon {
            position: relative;
            color: #9aa0a6;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            transition: background 0.2s, color 0.2s;
        }

        .gemini-info-icon:hover {
            background: rgba(255,255,255,0.08);
            color: #e8eaed;
        }

        .gemini-info-tooltip {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: #2d2d2f;
            border: 1px solid #3c4043;
            border-radius: 12px;
            padding: 16px;
            width: 280px;
            z-index: 100;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
        }

        .gemini-info-icon:hover .gemini-info-tooltip {
            display: block;
        }

        .model-info {
            font-size: 13px;
            color: #e8eaed;
            padding: 6px 0;
            border-bottom: 1px solid #3c4043;
            line-height: 1.5;
        }

        .model-info:last-child {
            border-bottom: none;
        }

        /* ── Fullscreen button ── */
        .gemini-fullscreen-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, color 0.2s;
            flex-shrink: 0;
        }

        .gemini-fullscreen-btn:hover {
            background: rgba(255,255,255,0.08);
            color: #e8eaed;
        }

        /* ── Chat messages ── */
        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 24px 0;
            scroll-behavior: smooth;
        }

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

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

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

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

        /* ── Message ── */
        .message {
            display: flex;
            gap: 16px;
            padding: 8px 24px;
            max-width: 900px;
            margin: 0 auto;
            width: 100%;
        }

        .message.user-message {
            flex-direction: row-reverse;
        }

        .message.user-message .message-content {
            background: #2d2d2f;
            border-radius: 18px 18px 4px 18px;
            padding: 12px 16px;
            max-width: 70%;
            color: #e8eaed;
        }

        .message.assistant-message .message-content {
            background: transparent;
            padding: 4px 0;
            flex: 1;
            color: #e8eaed;
        }

        .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 600;
            flex-shrink: 0;
            background: linear-gradient(135deg, #4285f4, #34a853, #fbbc04, #ea4335);
        }

        .message.user-message .avatar {
            background: #3c4043;
            color: #e8eaed;
        }

        .message-content {
            font-size: 15px;
            line-height: 1.6;
            word-break: break-word;
        }

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

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

        .message-content code {
            background: rgba(255,255,255,0.1);
            border-radius: 4px;
            padding: 2px 6px;
            font-family: 'Roboto Mono', monospace;
            font-size: 13px;
            color: #8ab4f8;
        }

        .message-content pre {
            background: #2d2d2f;
            border-radius: 8px;
            padding: 16px;
            overflow-x: auto;
            margin: 8px 0;
            border: 1px solid #3c4043;
        }

        .message-content pre code {
            background: transparent;
            padding: 0;
            color: #e8eaed;
        }

        .message-content ul,
        .message-content ol {
            padding-left: 20px;
            margin: 8px 0;
        }

        .message-content li {
            margin-bottom: 4px;
        }

        .message-content h1,
        .message-content h2,
        .message-content h3 {
            color: #e8eaed;
            margin: 12px 0 8px;
        }

        .message-content blockquote {
            border-left: 3px solid #8ab4f8;
            padding-left: 12px;
            color: #9aa0a6;
            margin: 8px 0;
        }

        /* ── Think harder badge ── */
        .think-harder-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(138, 180, 248, 0.12);
            color: #8ab4f8;
            border-radius: 12px;
            padding: 4px 10px;
            font-size: 12px;
            margin-bottom: 8px;
        }

        /* ── Typing indicator ── */
        .typing-indicator {
            display: flex;
            gap: 4px;
            align-items: center;
            padding: 8px 0;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #9aa0a6;
            animation: typing-bounce 1.4s infinite ease-in-out;
        }

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

        @keyframes typing-bounce {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
            30% { transform: translateY(-6px); opacity: 1; }
        }

        /* ── Input area ── */
        .chat-input-container {
            padding: 16px 24px 20px;
            background: #1c1c1e;
            flex-shrink: 0;
        }

        .chat-input-wrapper {
            background: #2d2d2f;
            border: 1px solid #3c4043;
            border-radius: 24px;
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: border-color 0.2s, box-shadow 0.2s;
            position: relative;
        }

        .chat-input-wrapper:focus-within {
            border-color: #8ab4f8;
            box-shadow: 0 0 0 1px rgba(138, 180, 248, 0.3);
        }

        .chat-input {
            background: transparent;
            border: none;
            outline: none;
            color: #e8eaed;
            font-size: 15px;
            line-height: 1.5;
            resize: none;
            width: 100%;
            min-height: 24px;
            max-height: 200px;
            overflow-y: auto;
            font-family: 'Google Sans', 'Roboto', sans-serif;
        }

        .chat-input::placeholder {
            color: #9aa0a6;
        }

        .chat-input::-webkit-scrollbar {
            width: 4px;
        }

        .chat-input::-webkit-scrollbar-thumb {
            background: #3c4043;
            border-radius: 2px;
        }

        /* ── Input actions row ── */
        .input-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .input-left-actions {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .input-attachments {
            display: flex;
            align-items: center;
        }

        /* ── Attachment button ── */
        .attachment-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            cursor: pointer;
            padding: 6px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, color 0.2s;
        }

        .attachment-btn:hover {
            background: rgba(255,255,255,0.08);
            color: #e8eaed;
        }

        /* ── Send button ── */
        .send-button {
            background: #8ab4f8;
            border: none;
            color: #1c1c1e;
            cursor: pointer;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, transform 0.1s;
            flex-shrink: 0;
        }

        .send-button:hover {
            background: #aecbfa;
            transform: scale(1.05);
        }

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

        .send-button:disabled {
            background: #3c4043;
            color: #5f6368;
            cursor: not-allowed;
            transform: none;
        }

        .send-icon {
            width: 16px;
            height: 16px;
        }

        /* ── Character counter ── */
        .character-counter {
            font-size: 12px;
            color: #9aa0a6;
            text-align: center;
            margin-top: 8px;
        }

        /* ── Image preview in input ── */
        .input-images-preview {
            position: static !important;
            top: auto !important;
            padding: 0 !important;
            background: transparent;
            border: none;
            margin: 0;
        }

        .input-images-container {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            pointer-events: auto;
        }

        .input-image-preview {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            object-fit: cover;
            border: 2px solid #3c4043;
            cursor: pointer;
            transition: all 0.2s;
        }

        .input-image-preview:hover {
            border-color: #8ab4f8;
            transform: scale(1.05);
        }

        .input-image-remove {
            position: absolute;
            top: -6px;
            right: -6px;
            width: 18px;
            height: 18px;
            background: #f28b82;
            color: white;
            border: none;
            border-radius: 50%;
            font-size: 11px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* ── Message image ── */
        .message-image {
            max-width: 320px;
            max-height: 320px;
            border-radius: 12px;
            margin-top: 8px;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .message-image:hover {
            opacity: 0.9;
        }

        /* ── Fullscreen mode ── */
        /* 2026-04-10: Исправлен селектор - JS добавляет класс на .content-container */
        #dynamicContent .content-container.gemini-fullscreen-mode {
            position: fixed !important;
            inset: 0 !important;
            z-index: 9999 !important;
            display: flex !important;
            margin: 0 !important;
            height: 100dvh !important;
            width: 100vw !important;
        }
        #dynamicContent .content-container.gemini-fullscreen-mode .app-container {
            height: 100% !important;
            width: 100% !important;
            max-width: 100% !important;
            border-radius: 0 !important;
            margin: 0 !important;
        }
        /* Оставляем старый селектор для обратной совместимости */
        #geminiContent.gemini-fullscreen-mode {
            position: fixed !important;
            inset: 0 !important;
            z-index: 9999 !important;
            display: flex !important;
        }
        #geminiContent.gemini-fullscreen-mode .app-container {
            height: 100vh !important;
            width: 100vw !important;
            border-radius: 0 !important;
        }
        body.gemini-fullscreen-active {
            overflow: hidden;
        }
        /* ── Responsive: Tablet (≤ 1024px) ── */
        @media screen and (max-width: 1024px) {
            .sidebar {
                width: 220px;
                min-width: 220px;
            }
        }

        /* ── Responsive: Mobile (≤ 768px) ── */
        @media screen and (max-width: 768px) {
            /* Sidebar становится drawer поверх контента */
            .sidebar {
                position: fixed;
                top: 0;
                left: 0;
                height: 100%;
                width: 280px;
                min-width: 280px;
                z-index: 100;
                transform: translateX(-100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                box-shadow: 4px 0 20px rgba(0,0,0,0.5);
            }

            .sidebar.mobile-open {
                transform: translateX(0);
            }

            /* Hamburger всегда виден на мобильных */
            .header-menu-btn {
                display: flex !important;
            }

            /* Скрываем sidebar-toggle-btn внутри sidebar на мобильных */
            .sidebar-toggle-btn {
                display: flex;
            }

            .chat-header {
                padding: 10px 12px;
                gap: 6px;
            }

            .chat-title {
                font-size: 14px;
            }

            #modelSelect {
                font-size: 12px;
                padding: 5px 24px 5px 10px;
                max-width: 140px;
            }

            .chat-messages {
                padding: 16px 0;
            }

            .message {
                padding: 6px 16px;
                gap: 10px;
            }

            .message.user-message .message-content {
                max-width: 85%;
            }

            .avatar {
                width: 30px;
                height: 30px;
                font-size: 12px;
            }

            .message-content {
                font-size: 14px;
            }

            .chat-input-container {
                padding: 12px 16px 16px;
            }

            .chat-input-wrapper {
                border-radius: 20px;
                padding: 10px 14px;
            }

            .chat-input {
                font-size: 16px; /* iOS anti-zoom */
            }

            .send-button {
                width: 32px;
                height: 32px;
            }

            .gemini-info-tooltip {
                right: -50px;
                width: 240px;
            }
            /* 2026-04-10: Mobile header v2
               JS перемещает modelSelect и infoIcon внутрь chatActionsEl
               Строка 1: [☰ гамбургер] [spacer] [⛶ fullscreen]
               Строка 2: [название] [To Group] [select] [ⓘ]
            */
            #geminiContent .chat-header {
                display: flex !important;
                flex-wrap: wrap !important;
                align-items: center !important;
                padding: 4px 8px 4px 0 !important;
                gap: 0 !important;
                min-height: auto !important;
            }
            /* СТРОКА 1: chat-header-left — вся ширина, содержит гамбургер + spacer + fullscreen */
            #geminiContent .chat-header-left {
                display: flex !important;
                align-items: center !important;
                width: 100% !important;
                flex: 0 0 100% !important;
                order: 0 !important;
            }
            #geminiContent .header-menu-btn {
                display: flex !important;
                flex-shrink: 0 !important;
                padding: 6px !important;
                width: 36px !important;
                height: 36px !important;
            }
            /* Строка 1 — spacer (JS управляет через inline) */
            /* Строка 1 — правый: fullscreen-mobile */
            #geminiContent .gemini-fullscreen-btn-mobile {
                display: flex !important;
                order: 2 !important;
                width: 36px !important;
                height: 36px !important;
                padding: 6px !important;
                flex-shrink: 0 !important;
            }
            /* model-center-wrapper — скрыт на мобильных (JS перемещает его содержимое в actions) */
            #geminiContent .model-center-wrapper {
                display: none !important;
            }
            /* Строка 2: chat-actions — название + To Group + select + ⓘ */
            #geminiContent .chat-actions {
                order: 3 !important;
                width: 100% !important;
                flex: 0 0 100% !important;
                display: flex !important;
                align-items: center !important;
                gap: 6px !important;
                margin-left: 0 !important;
                padding: 2px 0 6px !important;
                flex-wrap: nowrap !important;
            }
            /* Название чата — показываем в строке 2 */
            #geminiContent .chat-actions .chat-title {
                display: block !important;
                font-size: 13px !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                max-width: 80px !important;
                flex-shrink: 1 !important;
            }
            /* To Group — иконка + текст */
            #geminiContent .to-group-wrapper {
                display: flex !important;
                flex-shrink: 0 !important;
            }
            #geminiContent #toGroupBtn {
                padding: 5px 8px !important;
                font-size: 11px !important;
                gap: 4px !important;
            }
            #geminiContent #toGroupBtn svg {
                width: 14px !important;
                height: 14px !important;
            }
            /* select внутри actions на мобильных */
            #geminiContent .chat-actions #modelSelect {
                flex: 1 !important;
                min-width: 0 !important;
                max-width: 100% !important;
                font-size: 12px !important;
                padding: 6px 24px 6px 10px !important;
            }
            /* ⓘ иконка внутри actions */
            #geminiContent .chat-actions .gemini-info-icon {
                display: flex !important;
                flex-shrink: 0 !important;
                width: 20px !important;
                height: 20px !important;
            }
            /* Fullscreen оригинальный внутри chat-actions — скрыть */
            #geminiContent .chat-actions .gemini-fullscreen-btn:not(.gemini-fullscreen-btn-mobile) {
                display: none !important;
            }
            /* mobile-chat-select-btn — скрыть */
            #geminiContent .mobile-chat-select-btn {
                display: none !important;
            }
            /* chat-actions-hidden — скрыть строку 2 когда нет открытого чата */
            #geminiContent .chat-actions.chat-actions-hidden {
                display: none !important;
            }
            /* Mobile: убираем промежуток снизу */
            #dynamicContent:has(.app-container) .content-container {
                height: 100dvh !important;
                max-height: 100dvh !important;
            }
            .app-container {
                margin: 0 !important;
                border-radius: 0 !important;
                height: 100% !important;
            }
        }

        /* ── Responsive: Small mobile (≤ 480px) ── */
        @media screen and (max-width: 480px) {
            .message {
                padding: 4px 12px;
                gap: 8px;
            }

            .message.user-message .message-content {
                max-width: 90%;
                border-radius: 16px 16px 4px 16px;
            }

            .chat-input-container {
                padding: 10px 12px 14px;
            }

            .chat-input-wrapper {
                border-radius: 18px;
                padding: 8px 12px;
            }

            .gemini-info-tooltip {
                right: -80px;
                width: 220px;
            }
        }

        /* ── Gemini fullscreen на мобильных ── */
        @media screen and (max-width: 768px) {
            /* 2026-04-10: Исправлен селектор */
            #dynamicContent .content-container.gemini-fullscreen-mode {
                position: fixed !important;
                inset: 0 !important;
                z-index: 9999 !important;
                height: 100dvh !important;
                width: 100vw !important;
                margin: 0 !important;
            }
            #dynamicContent .content-container.gemini-fullscreen-mode .app-container {
                height: 100% !important;
                width: 100% !important;
                max-width: 100% !important;
                max-height: 100dvh !important;
                overflow: hidden;
                margin: 0 !important;
                border-radius: 0 !important;
            }
            #dynamicContent .content-container.gemini-fullscreen-mode .sidebar {
                position: fixed;
            }
            /* Обратная совместимость */
            #geminiContent.gemini-fullscreen-mode {
                position: fixed !important;
                inset: 0 !important;
                z-index: 9999 !important;
                height: 100dvh !important;
                width: 100vw !important;
            }
            #geminiContent.gemini-fullscreen-mode .app-container {
                height: 100% !important;
                width: 100% !important;
                max-height: 100dvh !important;
                overflow: hidden;
            }
            #geminiContent.gemini-fullscreen-mode .sidebar {
                position: fixed;
            }
        }

        /* ── Mobile chat select button — скрыт ── */
        .mobile-chat-select-btn {
            display: none !important;
        }

        /* ── Notification image preview ── */
        .notification-image-preview {
            width: 30px;
            height: 30px;
            border-radius: 6px;
            margin-right: 10px;
            object-fit: cover;
            border: 2px solid #8ab4f8;
            flex-shrink: 0;
        }

        /* ── Form elements (modals) ── */
        .form-group {
            margin-bottom: 16px;
        }

        .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #3c4043;
            border-radius: 8px;
            font-size: 14px;
            background: #2d2d2f;
            color: #e8eaed;
            outline: none;
            transition: border-color 0.2s;
        }

        .form-input:focus {
            border-color: #8ab4f8;
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }

        .delete-btn {
            background: #f28b82;
            color: #1c1c1e;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: background 0.2s;
        }

        .delete-btn:hover {
            background: #ee675c;
        }

        .cancel-btn {
            background: #3c4043;
            color: #e8eaed;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: background 0.2s;
        }

        .cancel-btn:hover {
            background: #5f6368;
        }

        .primary-btn {
            background: #8ab4f8;
            color: #1c1c1e;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: background 0.2s;
        }

        .primary-btn:hover {
            background: #aecbfa;
        }

        /* ── Character counter states ── */
        .character-counter.warning {
            color: #fbbc04;
        }

        .character-counter.danger {
            color: #f28b82;
        }

        /* ===== END GEMINI REDESIGN 2026 ===== */

/* ===== 2026-04-09: Редизайн VIDEO — новые контролы ===== */

/* Строка с моделью */
.video-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}
.video-form-row--controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 4px;
}
.video-form-group--model {
    flex: 1;
}

/* Группа кнопок (aspect / resolution / duration) */
.video-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.vbtn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    font-family: inherit;
}
.vbtn:hover:not([disabled]) {
    border-color: #ffc400;
    color: #fff;
}
.vbtn.active {
    background: #ffc400;
    border-color: #ffc400;
    color: #000;
    font-weight: 600;
}
.vbtn[disabled] {
    cursor: not-allowed;
    opacity: 0.3;
}
.vbtn--add-img {
    background: #333;
    color: #aaa;
    margin-top: 8px;
}
.vbtn--add-img:hover {
    background: #3a3a3a;
    color: #fff;
    border-color: #666;
}

/* Блок стоимости */
.video-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.video-cost-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 8px 18px;
    min-width: 80px;
}
.video-cost-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.video-cost-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffc400;
    line-height: 1.2;
}

/* Кнопка Generate */
.custom-video-submit-btn {
    background: #ffc400;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}
.custom-video-submit-btn:hover {
    background: #e6b000;
    transform: translateY(-1px);
}
.custom-video-submit-btn:active {
    transform: translateY(0);
}

/* Адаптив */
@media screen and (max-width: 600px) {
    .video-form-row--controls {
        flex-direction: column;
        gap: 10px;
    }
    .video-cost-value {
        font-size: 16px;
    }
}
/* ===== END 2026-04-09 ===== */

/* -- Store iframe fullscreen button -- restored 2026-04-09 */
.custom-iframe-container {
    position: relative;
    height: 1300px;
}
.store-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(100, 100, 100, 0.85);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.15s;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.store-fullscreen-btn:hover {
    background: rgba(130, 130, 130, 0.95);
    transform: scale(1.08);
}
.custom-iframe-container.store-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
    background: #000;
}
.custom-iframe-container.store-fullscreen iframe {
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.custom-iframe-container.store-fullscreen .store-fullscreen-btn {
    top: 14px;
    right: 18px;
    width: 40px;
    height: 40px;
    font-size: 20px;
}
body.store-fullscreen-active {
    overflow: hidden;
}

        /* 2026-04-10: Мобильная fullscreen кнопка — скрыта по умолчанию, показывается только на мобильных */
        .gemini-fullscreen-btn-mobile {
            display: none;
        }
        @media screen and (max-width: 768px) {
            .gemini-fullscreen-btn-mobile {
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                order: 2 !important;
                flex-shrink: 0 !important;
                width: 36px !important;
                height: 36px !important;
                padding: 6px !important;
            }
            /* Оригинальная fullscreen кнопка внутри chat-actions — скрыть на мобильных */
            .chat-actions .gemini-fullscreen-btn:not(.gemini-fullscreen-btn-mobile) {
                display: none !important;
            }
        }


/* ── Sidebar token stats block ── */
.sidebar-token-stat {
    flex-shrink: 0;
    text-align: left;
    padding: 10px 12px;
    margin: 8px 10px 10px;
    border: 1px solid #3c4043;
    border-radius: 8px;
    background: #2a2a2c;
    font-size: 11px;
    color: #9aa0a6;
    line-height: 1.6;
}
/* -- Hide model selector -- */
.model-center-wrapper {
    display: none !important;
}
/* -- Chat title centered -- */
#geminiContent .chat-header {
    position: relative;
}
#geminiContent .chat-title {
    flex: 1 1 auto;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #e8eaed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
#geminiContent .chat-actions {
    flex-shrink: 0;
    margin-left: 0;
}
/* -- Fullscreen btn right corner -- */
#geminiContent #geminiFullscreenBtn {
    margin-left: auto;
}
/* -- Info dropdown model items -- */
.tools-model-info-item {
    padding: 8px 16px;
    color: #e8eaed;
    font-size: 13px;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tools-model-info-item:last-child {
    border-bottom: none;
}
.tools-model-info-item strong {
    color: #8ab4f8;
    display: block;
    margin-bottom: 2px;
}

