        html {
            height: 100%;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
            background: #f8fafc;
            padding: 12px;
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .widget-container {
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 0;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .widget-header {
            background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
            color: white;
            padding: 12px 14px;
            font-size: 13px;
            font-weight: bold;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .status {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            opacity: 0.7;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animate: pulse 2s infinite;
        }

        .status-dot.online {
            background: #10b981;
        }

        .status-dot.offline {
            background: #ef4444;
        }

        .widget-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
            position: relative;
        }

        /* Pantalla de arranque: oculta el parpadeo del combo + "Conectando…" hasta que /embed/course-flows responda */
        .embed-boot-overlay {
            position: absolute;
            inset: 0;
            z-index: 40;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
            background: rgba(248, 250, 252, 0.92);
            backdrop-filter: blur(2px);
            transition: opacity 0.18s ease;
        }
        html.embed-boot-overlay-done .embed-boot-overlay {
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
        }
        /* Formulario de login: no tapar con el overlay */
        html.embed-login-gate:not(.embed-token-present) .embed-boot-overlay {
            display: none !important;
        }
        .embed-boot-spinner {
            width: 36px;
            height: 36px;
            border: 3px solid #e2e8f0;
            border-top-color: #8b5cf6;
            border-radius: 50%;
            animation: embed-boot-spin 0.75s linear infinite;
        }
        @keyframes embed-boot-spin {
            to { transform: rotate(360deg); }
        }
        .embed-boot-text {
            font-size: 13px;
            color: #64748b;
            font-weight: 600;
            text-align: center;
            max-width: 220px;
            line-height: 1.35;
        }

        .login-form {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 16px;
            flex: 1;
            min-height: 0;
            overflow-y: scroll;
            scrollbar-gutter: stable;
        }

        .chat-interface {
            display: none;
            flex-direction: row;
            height: 100%;
            min-height: 0;
            overflow: hidden;
            position: relative;
            align-items: stretch;
        }

        /*
         * Evita parpadeo del login: si ya hay token en localStorage, primera pintura muestra el chat.
         * Clases las pone un <script> síncrono en <head> (buildEmbedIframeHtml.js).
         */
        html.embed-no-login-gate #loginForm,
        html.embed-no-login-gate .login-form {
            display: none !important;
        }
        html.embed-no-login-gate #chatInterface,
        html.embed-no-login-gate .chat-interface {
            display: flex !important;
        }
        html.embed-login-gate:not(.embed-token-present) #loginForm,
        html.embed-login-gate:not(.embed-token-present) .login-form {
            display: flex !important;
        }
        html.embed-login-gate:not(.embed-token-present) #chatInterface,
        html.embed-login-gate:not(.embed-token-present) .chat-interface {
            display: none !important;
        }
        html.embed-login-gate.embed-token-present #loginForm,
        html.embed-login-gate.embed-token-present .login-form {
            display: none !important;
        }
        html.embed-login-gate.embed-token-present #chatInterface,
        html.embed-login-gate.embed-token-present .chat-interface {
            display: flex !important;
        }

        .embed-main-column {
            flex: 1;
            min-width: 0;
            height: 100%;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }

        .embed-copilot-resizer {
            display: none;
            width: 4px;
            background: transparent;
            cursor: col-resize;
            transition: background 0.2s ease;
            z-index: 10;
            margin-left: -2px;
            margin-right: -2px;
        }
        .embed-copilot-resizer:hover, .embed-copilot-resizer.is-resizing {
            background: #8b5cf6;
        }

        .embed-copilot-aside {
            display: none;
            flex-direction: column;
            width: min(500px, 38vw);
            min-width: 500px;
            max-width: 800px;
            height: 80vh;
            max-height: 80vh;
            flex-shrink: 0;
            border-left: 1px solid #e2e8f0;
            background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
            min-height: 0;
            overflow: hidden;
            transition: width 0.2s ease, min-width 0.2s ease, max-width 0.2s ease;
        }
        .embed-copilot-aside.no-transition {
            transition: none !important;
        }

        .embed-copilot-aside.is-collapsed {
            width: 44px !important;
            min-width: 44px !important;
            max-width: 44px !important;
            background: #f4f4f5;
        }

        .embed-copilot-expanded {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .embed-copilot-aside.is-collapsed .embed-copilot-expanded {
            display: none !important;
        }

        .embed-copilot-collapsed {
            display: none;
            flex: 1;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 80px;
            padding: 6px 0;
        }

        .embed-copilot-aside.is-collapsed .embed-copilot-collapsed {
            display: flex;
        }

        /* Modo copilot-only: perfil sin flujos de contenido + chat humano vía copilot */
        .chat-interface.is-copilot-only {
            align-items: stretch;
            justify-content: stretch;
        }
        .chat-interface.is-copilot-only .embed-main-column {
            display: none !important;
        }
        .chat-interface.is-copilot-only .embed-copilot-resizer {
            display: none !important;
        }
        .chat-interface.is-copilot-only .embed-copilot-aside {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            height: 100% !important;
            max-height: 100% !important;
            border-left: none !important;
            align-self: stretch;
        }
        .chat-interface.is-copilot-only .embed-copilot-collapse-btn {
            display: none !important;
        }
        /* Un solo historial por usuario: sin desplegable ni acciones de hilo en la fila inferior */
        .embed-copilot-aside #embedCopilotThreadRow {
            display: none !important;
        }
        .embed-copilot-aside #embedCopilotHistoryToggleBtn {
            display: none !important;
        }
        .embed-copilot-aside #embedCopilotClearBtn {
            display: inline-flex !important;
        }
        .chat-interface.is-copilot-only .embed-copilot-msgs {
            padding: 12px 16px;
            gap: 10px;
        }

        .embed-copilot-expand-btn {
            border: none;
            cursor: pointer;
            background: linear-gradient(180deg, #4f46e5, #7c3aed);
            color: #fff;
            font-size: 8px;
            font-weight: 800;
            letter-spacing: 0.06em;
            line-height: 1.35;
            padding: 12px 6px;
            border-radius: 8px 0 0 8px;
            writing-mode: vertical-rl;
            text-orientation: mixed;
            transform: rotate(180deg);
            font-family: ui-sans-serif, system-ui, sans-serif;
        }

        .embed-copilot-expand-btn:hover {
            filter: brightness(1.08);
        }

        .embed-copilot-head {
            flex-shrink: 0;
            padding: 10px 10px 8px;
            border-bottom: 1px solid #e4e4e7;
            background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
        }

        .embed-copilot-head-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
        }

        .embed-copilot-head-title {
            font-size: 13px;
            font-weight: 800;
            color: #312e81;
            letter-spacing: -0.02em;
        }

        .embed-copilot-collapse-btn {
            flex-shrink: 0;
            border: none;
            background: rgba(255, 255, 255, 0.65);
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 6px 8px;
            color: #4f46e5;
            font-weight: 700;
        }

        .embed-copilot-collapse-btn:hover {
            background: rgba(99, 102, 241, 0.18);
        }

        .embed-copilot-head-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }

        .embed-copilot-history-toggle-btn {
            flex-shrink: 0;
            border: none;
            background: rgba(255, 255, 255, 0.65);
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 6px 7px;
            color: #4f46e5;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .embed-copilot-history-toggle-btn:hover {
            background: rgba(99, 102, 241, 0.18);
        }

        .embed-copilot-clear-btn {
            flex-shrink: 0;
            border: none;
            background: rgba(255, 255, 255, 0.65);
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 6px 7px;
            color: #dc2626;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .embed-copilot-clear-btn:hover {
            background: rgba(220, 38, 38, 0.12);
        }

        .embed-copilot-msgs {
            flex: 1;
            min-height: 80px;
            overflow-y: auto;
            padding: 8px;
            font-size: 12px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            scrollbar-gutter: stable;
        }

        .embed-copilot-foot {
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 8px;
            border-top: 1px solid #e4e4e7;
            background: #fafafa;
        }

        .embed-copilot-foot-row {
            display: flex;
            flex-direction: row;
            gap: 6px;
            align-items: stretch;
        }

        .embed-copilot-foot input {
            width: 100%;
            box-sizing: border-box;
            padding: 8px 10px;
            border: 1px solid #d4d4d8;
            border-radius: 6px;
            font-size: 12px;
            font-family: inherit;
        }

        .embed-copilot-dest-select {
            flex: 1;
            min-width: 0;
            padding: 7px 8px;
            border: 1px solid #d4d4d8;
            border-radius: 6px;
            font-size: 11px;
            font-family: inherit;
            background: #fff;
            color: #3f3f46;
            cursor: pointer;
        }

        .embed-copilot-foot .embed-copilot-foot-row button#embedCopilotSendBtn {
            padding: 8px 14px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            line-height: 1.25;
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: #fff;
            border: none;
            white-space: nowrap;
        }

        #sendBtn {
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: #fff !important;
            border: none !important;
            border-radius: 8px;
            padding: 0 14px;
        }

        #sendBtn:disabled,
        .embed-copilot-foot button:disabled,
        .embed-copilot-dest-select:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .embed-delay-hover-tip {
            position: fixed;
            z-index: 2147483646;
            max-width: min(300px, calc(100vw - 24px));
            padding: 10px 12px;
            border-radius: 8px;
            background: #0f172a;
            color: #f1f5f9;
            font-size: 11px;
            line-height: 1.45;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.12);
            pointer-events: none;
            box-sizing: border-box;
        }

        .embed-ai-threads-bar {
            display: none;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            padding: 8px 12px;
            border-bottom: 1px solid #e2e8f0;
            background: #f1f5f9;
        }
        .embed-ai-threads-bar .embed-ai-threads-label {
            font-size: 11px;
            font-weight: 700;
            color: #475569;
            flex-shrink: 0;
        }
        .embed-ai-threads-bar select {
            flex: 1;
            min-width: 120px;
            font-size: 12px;
            padding: 6px 8px;
            border-radius: 6px;
            border: 1px solid #cbd5e1;
            background: #fff;
        }
        .embed-ai-threads-bar .embed-ai-thread-btn {
            flex-shrink: 0;
            border: 1px solid #cbd5e1;
            background: #fff;
            border-radius: 6px;
            padding: 5px 8px;
            font-size: 12px;
            cursor: pointer;
            line-height: 1.2;
            color: #334155;
        }
        .embed-ai-threads-bar .embed-ai-thread-btn:hover {
            background: #e2e8f0;
        }
        .embed-ai-icon-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 5px 7px;
            min-width: 30px;
            color: #334155;
        }
        .embed-ai-icon-btn svg {
            display: block;
            flex-shrink: 0;
        }
        #embedMainAiThreadDelete.embed-ai-icon-btn {
            color: #b91c1c;
        }
        #embedMainAiThreadDelete.embed-ai-icon-btn:hover {
            background: #fee2e2;
            border-color: #fecaca;
        }
        .embed-copilot-icon-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 5px;
            min-width: 26px;
            color: #4338ca;
        }
        .embed-copilot-icon-btn svg {
            display: block;
            flex-shrink: 0;
        }
        #embedCopilotThreadDelete.embed-copilot-icon-btn {
            color: #b91c1c;
        }
        #embedCopilotThreadDelete.embed-copilot-icon-btn:hover {
            background: #fee2e2;
            border-color: #fca5a5;
        }
        .embed-copilot-thread-row {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            align-items: center;
            margin-top: 8px;
        }
        .embed-copilot-thread-row select {
            flex: 1;
            min-width: 0;
            font-size: 11px;
            padding: 4px 6px;
            border-radius: 4px;
            border: 1px solid #c7d2fe;
            background: #fff;
        }
        .embed-copilot-thread-row .embed-copilot-tbtn {
            border: 1px solid #c7d2fe;
            background: #fff;
            border-radius: 4px;
            padding: 3px 6px;
            font-size: 11px;
            cursor: pointer;
            color: #4338ca;
            line-height: 1.2;
        }
        .embed-copilot-thread-row .embed-copilot-tbtn:hover {
            background: #eef2ff;
        }

        .embed-copilot-processing {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 9px;
            border-radius: 8px;
            font-size: 12px;
            background: #e4e4e7;
            color: #3f3f46;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
        }
        .embed-copilot-processing-label {
            font-weight: 600;
            font-size: 11px;
            color: #52525b;
        }
        .embed-copilot-processing-dots {
            display: inline-flex;
            gap: 4px;
            align-items: center;
        }
        .embed-copilot-processing-dots span {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: #6366f1;
            animation: embedCopilotProcessingDot 1.1s ease-in-out infinite;
        }
        .embed-copilot-processing-dots span:nth-child(2) { animation-delay: 0.17s; }
        .embed-copilot-processing-dots span:nth-child(3) { animation-delay: 0.34s; }
        @keyframes embedCopilotProcessingDot {
            0%, 70%, 100% { transform: translateY(0); opacity: 0.35; }
            35% { transform: translateY(-4px); opacity: 1; }
        }

        /* Espera explícita a Ollama / clasificador LLM en SE (mensaje hasta respuesta real) */
        .embed-copilot-processing.embed-copilot-processing--llm {
            animation: embedCopilotLlmPulse 2.2s ease-in-out infinite;
            border: 1px solid rgba(99, 102, 241, 0.45);
            background: linear-gradient(135deg, #eef2ff 0%, #e4e4e7 50%, #eef2ff 100%);
            background-size: 200% 200%;
        }
        @keyframes embedCopilotLlmPulse {
            0%, 100% {
                box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
                background-position: 0% 50%;
            }
            50% {
                box-shadow: 0 4px 16px rgba(99, 102, 241, 0.22);
                background-position: 100% 50%;
            }
        }
        .embed-copilot-processing.embed-copilot-processing--llm .embed-copilot-processing-dots span {
            animation-duration: 0.75s;
            background: #4f46e5;
        }

        @media (max-width: 520px) {
            .chat-interface {
                flex-direction: column;
            }
            .embed-copilot-aside {
                width: 100% !important;
                min-width: 0 !important;
                max-width: none !important;
                max-height: min(38vh, 280px);
                border-left: none;
                border-top: 1px solid #e2e8f0;
            }
            .embed-copilot-aside.is-collapsed {
                width: 100% !important;
                min-width: 0 !important;
                max-width: none !important;
                max-height: 48px !important;
                flex-direction: row !important;
            }
            .embed-copilot-aside.is-collapsed .embed-copilot-collapsed {
                flex-direction: row;
                width: 100%;
                min-height: 0;
                padding: 0 8px;
            }
            .embed-copilot-expand-btn {
                writing-mode: horizontal-tb !important;
                transform: none !important;
                width: 100%;
                max-width: 100%;
                padding: 10px 12px;
                border-radius: 8px;
                font-size: 11px;
                letter-spacing: 0.08em;
            }
            .embed-main-column {
                flex: 1;
                min-height: 0;
            }
        }

        .flow-selector {
            padding: 12px;
            border-bottom: 1px solid #e2e8f0;
            background: #f8fafc;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        .flow-selector select {
            flex: 0 1 auto;
            min-width: 0;
            max-width: min(220px, 52vw);
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            border: 1px solid #cbd5e1;
            font-size: 12px;
            cursor: pointer;
            box-sizing: border-box;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .flow-selector select option:disabled {
            color: #94a3b8;
            background: #f1f5f9;
        }

        .messages-container {
            flex: 1;
            min-height: 0;
            overflow-y: scroll;
            scrollbar-gutter: stable;
            padding: 12px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            gap: 8px;
        }

        .messages-container {
            scrollbar-width: auto;
            scrollbar-color: #94a3b8 #e2e8f0;
        }



        .empty-state {
            text-align: center;
            color: #94a3b8;
            font-size: 12px;
        }

        .message {
            margin-bottom: 8px;
            display: flex;
            width: 100%;
        }

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

        .message.bot {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }

        .message-bubble {
            padding: 10px 14px;
            border-radius: 12px;
            max-width: 90%;
            word-wrap: break-word;
            font-size: 13px;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .message.user .message-bubble {
            background: #3b82f6;
            color: white;
        }

        .message.bot .message-bubble {
            background: #e2e8f0;
            color: #1e293b;
        }

        /* Audio: burbuja al 50% del ancho del hilo */
        .message.bot .message-bubble.embed-audio-msg-bubble {
            max-width: 50%;
            width: 50%;
            box-sizing: border-box;
            align-self: flex-start;
        }
        .message.bot .message-bubble.embed-audio-msg-bubble audio {
            width: 100%;
            max-width: 100%;
        }
        .message.bot .message-bubble.embed-audio-msg-bubble iframe {
            width: 100% !important;
            max-width: 100% !important;
        }

        .embed-flow-human-chat-anon-bar {
            display: none;
            flex-shrink: 0;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-top: 1px solid #e2e8f0;
            background: #f1f5f9;
            font-size: 11px;
            color: #475569;
        }
        .embed-flow-human-chat-anon-btn {
            padding: 6px 10px;
            border-radius: 6px;
            border: 1px solid #cbd5e1;
            background: #fff;
            color: #334155;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            font-family: inherit;
        }
        .embed-flow-human-chat-anon-btn:hover {
            background: #f8fafc;
            border-color: #94a3b8;
        }
        .embed-flow-human-chat-anon-logout {
            border-color: #fca5a5;
            color: #b91c1c;
            background: #fef2f2;
        }
        .embed-flow-human-chat-anon-logout:hover {
            background: #fee2e2;
        }

        .input-area {
            padding: 12px;
            border-top: 1px solid #e2e8f0;
            background: #f8fafc;
            display: flex;
            gap: 8px;
        }

        .input-area input {
            flex: 1;
            padding: 8px 10px;
            border-radius: 4px;
            border: 1px solid #cbd5e1;
            font-size: 12px;
            font-family: inherit;
        }

        .input-area button {
            padding: 8px 12px;
            background: #3b82f6;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            transition: background 0.2s;
        }

        .input-area button:hover:not(:disabled) {
            background: #2563eb;
        }

        .input-area button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        input:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

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

        .embed-human-reply-badge {
            display: none;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 999px;
            background: rgba(16, 185, 129, 0.95);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.35);
            cursor: pointer;
            max-width: 200px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .embed-human-reply-badge:hover {
            filter: brightness(1.08);
        }
        .human-reply-flash {
            animation: embedHumanReplyFlash 1.8s ease-out 1;
        }
        @keyframes embedHumanReplyFlash {
            0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
            40% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
            100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
        }

        #embedClassHumanChatBar {
            display: none;
            flex-shrink: 0;
            padding: 8px 12px;
            border-bottom: 1px solid #99f6e4;
            background: linear-gradient(90deg, #ecfeff 0%, #f0fdfa 100%);
        }
        #embedClassHumanChatOpenBtn {
            width: 100%;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid #6366f1;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: #fff;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            font-family: inherit;
        }
        #embedClassHumanChatOpenBtn:hover {
            filter: brightness(1.06);
        }
        #embedClassHumanChatModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 100000;
            background: rgba(15, 23, 42, 0.5);
            align-items: center;
            justify-content: center;
            padding: 16px;
            box-sizing: border-box;
        }
        #embedClassHumanChatModal .embed-chc-panel {
            background: #fff;
            max-width: 420px;
            width: 100%;
            border-radius: 12px;
            padding: 16px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
            box-sizing: border-box;
        }
        #embedClassHumanChatModalTa {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            padding: 10px;
            font-size: 13px;
            font-family: inherit;
            resize: vertical;
            min-height: 100px;
        }
        #embedClassHumanChatModalSend {
            padding: 8px 14px;
            border-radius: 8px;
            border: none;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: #fff;
            font-weight: 700;
            font-size: 12px;
            cursor: pointer;
            font-family: inherit;
        }
        #embedClassHumanChatModalSend:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }
        #embedClassHumanChatModalCancel {
            padding: 8px 14px;
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            background: #f8fafc;
            color: #334155;
            font-weight: 600;
            font-size: 12px;
            cursor: pointer;
            font-family: inherit;
        }

        /* Indicador “procesando” (IA / esperando respuesta del flujo) */
        .embed-ai-processing {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: #e2e8f0;
            border-radius: 12px;
            max-width: 92%;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
        }
        .embed-ai-processing-label {
            font-size: 12px;
            color: #475569;
            font-weight: 600;
            letter-spacing: 0.01em;
        }
        .embed-ai-processing-dots {
            display: inline-flex;
            gap: 5px;
            align-items: center;
        }
        .embed-ai-processing-dots span {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #6366f1;
            animation: embedProcessingDot 1.15s ease-in-out infinite;
        }
        .embed-ai-processing-dots span:nth-child(2) { animation-delay: 0.18s; }
        .embed-ai-processing-dots span:nth-child(3) { animation-delay: 0.36s; }
        @keyframes embedProcessingDot {
            0%, 70%, 100% { transform: translateY(0); opacity: 0.35; }
            35% { transform: translateY(-6px); opacity: 1; }
        }

        /* Scrollbar styling */
        .widget-content::-webkit-scrollbar,
        .login-form::-webkit-scrollbar,
        .messages-container::-webkit-scrollbar {
            width: 12px;
        }

        .widget-content::-webkit-scrollbar-track,
        .login-form::-webkit-scrollbar-track,
        .messages-container::-webkit-scrollbar-track {
            background: #e2e8f0;
        }

        .widget-content::-webkit-scrollbar-thumb,
        .login-form::-webkit-scrollbar-thumb,
        .messages-container::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }

        .widget-content::-webkit-scrollbar-thumb:hover,
        .login-form::-webkit-scrollbar-thumb:hover,
        .messages-container::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }