<style>
        * { box-sizing: border-box; }

        @keyframes spin { to { transform: rotate(360deg); } }
        .animate-spin { animation: spin 1s linear infinite; }
        .modal { display: none; }
        .modal.active { display: flex; }

        /* Требования пароля */
        .requirement { transition: all 0.3s ease; }
        .requirement.met { color: #10b981; }
        .requirement.met::before { content: "✓ "; font-weight: bold; }
        .requirement:not(.met) { color: #6b7280; }
        .requirement:not(.met)::before { content: "○ "; }

        /* Прогресс бар пароля */
        .password-strength-bar {
            height: 4px;
            background: #e5e7eb;
            border-radius: 2px;
            overflow: hidden;
            margin-top: 8px;
        }
        .password-strength-fill {
            height: 100%;
            transition: all 0.3s ease;
            border-radius: 2px;
        }
        .strength-weak { width: 25%; background: #ef4444; }
        .strength-fair { width: 50%; background: #f59e0b; }
        .strength-good { width: 75%; background: #3b82f6; }
        .strength-strong { width: 100%; background: #10b981; }

        /* Split layout */
        .split-container {
    display: flex;
    height: calc(100vh - 80px);
    position: relative;
}

.left-panel {
    background: white;
    width: 400px;
    min-width: 300px;
    max-width: 800px;
    overflow-y: auto;
    flex-shrink: 0;
}

.resizer {
    width: 8px;
    background: #e5e7eb;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}

.resizer:hover {
    background: #6366f1;
}

.resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: #9ca3af;
    border-radius: 2px;
}

.resizer:hover::after {
    background: white;
}

.right-panel {
    background: #ddd;
    overflow-y: auto;
    flex: 1;
}

        /* ============ РЕДАКТОР СЛАЙДОВ ============ */

        .slides-container {
            padding: 40px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 80px;
        }

        .slide-wrapper {
            width: 800px;
            flex-shrink: 0;
            position: relative;
        }

        /* 🗑️ Кнопка удаления слайда */
        .delete-slide-btn {
            position: absolute;
            top: 10px;
            right: -50px;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
            transition: all 0.3s ease;
            z-index: 10;
        }

        .delete-slide-btn:hover {
            transform: scale(1.1) rotate(10deg);
            box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        }

        .delete-slide-btn:active {
            transform: scale(0.95);
        }

        /* 🖼️ Кнопка добавления фото */
        .add-image-btn {
            position: absolute;
            top: 60px;
            right: -50px;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
            transition: all 0.3s ease;
            z-index: 10;
        }

        .add-image-btn:hover {
            transform: scale(1.1) rotate(-10deg);
            box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
            background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
        }

        .add-image-btn:active {
            transform: scale(0.95);
        }

        .slide {
            width: 800px;
            height: 500px;
            background: white;
            box-shadow: 0 0 20px rgba(0,0,0,0.3);
            position: relative;
            overflow: hidden;
        }

        /* Элементы на слайде */
        .element {
            position: absolute;
            cursor: move;
            border: 2px solid transparent;
            transition: border-color 0.2s;
        }

        .element.selected {
            border-color: #2b579a;
        }

        .element.resizing {
            border-color: #ff9800;
        }

        .element.editing {
            border-color: #4CAF50;
        }

        .element textarea {
            width: 100%;
            height: 100%;
            border: none;
            outline: none;
            background: transparent;
            resize: none;
            font-family: inherit;
            font-size: inherit;
            font-weight: inherit;
            color: inherit;
            padding: 10px;
        }

        /* Ручки изменения размера */
        .resize-handle {
            position: absolute;
            width: 10px;
            height: 10px;
            background: #2b579a;
            border: 1px solid white;
            display: none;
            z-index: 10;
        }

        .selected .resize-handle {
            display: block;
        }

        .resize-nw { top: -5px; left: -5px; cursor: nw-resize; }
        .resize-ne { top: -5px; right: -5px; cursor: ne-resize; }
        .resize-sw { bottom: -5px; left: -5px; cursor: sw-resize; }
        .resize-se { bottom: -5px; right: -5px; cursor: se-resize; }
        .resize-n { top: -5px; left: 50%; margin-left: -5px; cursor: n-resize; }
        .resize-s { bottom: -5px; left: 50%; margin-left: -5px; cursor: s-resize; }
        .resize-w { top: 50%; left: -5px; margin-top: -5px; cursor: w-resize; }
        .resize-e { top: 50%; right: -5px; margin-top: -5px; cursor: e-resize; }

        .title-box {
            font-size: 48px;
            font-weight: bold;
            color: #000;
            padding: 10px;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        .text-box {
            font-size: 18px;
            color: #333;
            padding: 10px;
            line-height: 1.4;
            width: 100%;
            height: 100%;
        }

        .image-box {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .delete-btn {
            position: absolute;
            top: -12px;
            left: -12px;
            background: #ff4444;
            color: white;
            border: 2px solid white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 16px;
            display: none;
            z-index: 100;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
            transition: all 0.2s;
        }

        .selected .delete-btn {
            display: flex;
        }

        .delete-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
        }

        .delete-btn:active {
            transform: scale(0.95);
        }

        /* 🎨 КНОПКА СТИЛИЗАЦИИ ТЕКСТА */
        .style-text-btn {
            position: absolute;
            top: -12px;
            left: 22px;
            width: 28px;
            height: 28px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: 2px solid white;
            border-radius: 50%;
            cursor: pointer;
            font-size: 14px;
            display: none;
            z-index: 100;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
            transition: all 0.2s;
        }

        .selected .style-text-btn {
            display: flex;
        }

        .style-text-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
        }

        .style-text-btn:active {
            transform: scale(0.95);
        }

        /* Панель инструментов над слайдами */
        .editor-toolbar {
            background: #f4f4f4;
            padding: 12px 20px;
            border-bottom: 2px solid #ccc;
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
            position: sticky;
            top: 0;
            z-index: 20;
        }

        .tool-btn {
            width: 40px;
            height: 40px;
            background: white;
            border: 1px solid #ccc;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
        }

        .tool-btn:hover {
            background: #e6e6e6;
            transform: scale(1.05);
        }

        .tool-btn.active {
            background: #2b579a;
            color: white;
            border-color: #2b579a;
        }

        /* ============ ЧАТ С ИИ ============ */

        /* Сообщения */
        .chat-message {
            display: flex;
            gap: 12px;
            align-items: flex-start;
            animation: slideIn 0.3s ease-out;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .chat-message-user {
            flex-direction: row-reverse;
        }

        .chat-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }

        .chat-message-user .chat-avatar {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        }

        .chat-bubble {
            max-width: 85%;
            padding: 12px 16px;
            border-radius: 16px;
            background: #f3f4f6;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        .chat-message-user .chat-bubble {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .chat-message-ai .chat-bubble {
            background: white;
            border: 2px solid #e5e7eb;
        }

        .chat-text {
            font-size: 15px;
            line-height: 1.6;
            word-wrap: break-word;
            white-space: pre-wrap;
        }

        .chat-copy-btn {
            margin-top: 8px;
            padding: 6px 12px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .chat-copy-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        .chat-copy-btn.copied {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }

        /* Анимация загрузки */
        .chat-loading-dots {
            display: flex;
            gap: 6px;
            padding: 8px 0;
        }

        .chat-loading-dots span {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #667eea;
            animation: bounce 1.4s infinite ease-in-out both;
        }

        .chat-loading-dots span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .chat-loading-dots span:nth-child(2) {
            animation-delay: -0.16s;
        }

        @keyframes bounce {
            0%, 80%, 100% {
                transform: scale(0);
                opacity: 0.5;
            }
            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* Скролл для сообщений */
        #chatMessages {
            scrollbar-width: thin;
            scrollbar-color: #cbd5e1 #f1f5f9;
        }

        #chatMessages::-webkit-scrollbar {
            width: 6px;
        }

        #chatMessages::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 10px;
        }

        #chatMessages::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 10px;
        }

        #chatMessages::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        /* Адаптация чата под высоту */
        @media (max-height: 800px) {
            #chatMessages {
                max-height: calc(100vh - 400px) !important;
            }
        }

        @media (max-height: 600px) {
            #chatMessages {
                max-height: calc(100vh - 450px) !important;
            }
        }

       @media (max-width: 1024px) {
            .split-container {
                grid-template-columns: 1fr;
                height: auto;
            }

            .left-panel {
                border-right: none;
                border-bottom: 2px solid #e5e7eb;
            }
        }

        /* ============ ПАНЕЛЬ СТИЛИЗАЦИИ ТЕКСТА ============ */
        .text-style-panel {
            animation: slideInRight 0.2s ease-out;
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(-10px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        /* Стили для иконки "без фона" */
        .text-style-panel input[type="range"] {
            accent-color: #6366f1;
        }

        /* Скроллбар для панели */
        .text-style-panel .overflow-y-auto::-webkit-scrollbar {
            width: 4px;
        }

        .text-style-panel .overflow-y-auto::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 10px;
        }

        .text-style-panel .overflow-y-auto::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 10px;
        }

        .text-style-panel .overflow-y-auto::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

       /* Улучшенные кнопки слайдов */
.delete-slide-btn svg,
.add-image-btn svg {
  transition: all 0.3s ease;
}

.delete-slide-btn:hover svg {
  transform: scale(1.2);
  stroke: #fff;
}

.add-image-btn:hover svg {
  transform: scale(1.2);
  stroke: #fff;
}

/* Иконка "сделать красиво" */
.beautify-btn {
  top: 110px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 10;
  width: 40px;
  height: 40px;
  position: absolute;
  right: -50px;
}

.beautify-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.beautify-btn svg {
  stroke: white;
}
/* Анимация кнопки при наведении, если она активна */
#sendCodeBtn:not(:disabled):hover {
    background-color: #4f46e5; /* Более темный индиго */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

#sendCodeBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* ============ ЛОГОТИП SMIDE ============ */

/* Логотип в хедере */
h1 img[alt="Smide Logo"] {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

h1 img[alt="Smide Logo"]:hover {
    transform: scale(1.05);
}

/* Логотип в аватарке чата */
.chat-avatar img {
    border-radius: 50%;
    padding: 4px;
    background: white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}