
        /* ... (CSS เดิมทั้งหมด) ... */
        :root { --primary-color: #007bff; --primary-gradient: linear-gradient(135deg, #00c6ff, #0072ff); --bg-color: #f4f7f6; --chat-width: 380px; --chat-height: 550px; }
        body { font-family: 'Kanit', sans-serif; margin: 0; background-color: #eee; }
        
        /* ... (CSS เดิมย่อไว้เพื่อประหยัดพื้นที่) ... */
        .mascot-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; cursor: pointer; }
        .cta-bubble { background: white; padding: 10px 15px; border-radius: 20px; border-bottom-right-radius: 5px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); margin-bottom: 10px; margin-right: 10px; font-size: 0.9rem; color: #333; position: relative; animation: fadeInUp 0.5s ease-out; border: 1px solid #e0e0e0; max-width: 200px; }
        .cta-close { position: absolute; top: -5px; left: -5px; background: #eee; border-radius: 50%; width: 15px; height: 15px; font-size: 10px; display: flex; align-items: center; justify-content: center; color: #888; cursor: pointer; }
        @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
        @keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .chat-toggle-btn { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.3s; position: relative; }
        .madee-mascot { width: 100%; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3)); animation: bounce 3s infinite ease-in-out; transition: 0.3s; }
        .chat-toggle-btn:hover .madee-mascot { transform: scale(1.1) rotate(-5deg); }
        .close-icon-overlay { position: absolute; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; opacity: 0; transition: 0.3s; }
        
        /* Chat Widget Styles */
        .chat-widget { position: fixed; bottom: 100px; right: 20px; width: var(--chat-width); height: var(--chat-height); background: #fff; border-radius: 20px; box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; overflow: hidden; z-index: 999; opacity: 0; transform: translateY(20px) scale(0.9); visibility: hidden; transition: all 0.3s ease; transform-origin: bottom right; }
        .chat-widget.active { opacity: 1; transform: translateY(0) scale(1); visibility: visible; }
        .chat-header { background: var(--primary-gradient); padding: 15px 20px; color: white; display: flex; align-items: center; justify-content: space-between; }
        .header-profile { display: flex; align-items: center; }
        .avatar-img { width: 45px; height: 45px; background: white; border-radius: 50%; padding: 2px; object-fit: cover; margin-right: 12px; }
        .status-info h3 { margin: 0; font-size: 1.1rem; font-weight: 500; }
        .status-indicator { font-size: 0.8rem; display: flex; align-items: center; color: #e0e0e0; }
        .status-dot { width: 8px; height: 8px; background-color: #ccc; border-radius: 50%; margin-right: 5px; }
        .status-indicator.is-active { color: #a0ffbd; }
        .status-indicator.is-active .status-dot { background-color: #00ff48; box-shadow: 0 0 8px #00ff48; }
        .chat-body { flex: 1; padding: 20px; overflow-y: auto; background-color: #f9f9f9; }
        .message { display: flex; margin-bottom: 15px; animation: slideUp 0.3s ease; }
        .message-content { max-width: 75%; padding: 10px 14px; border-radius: 18px; font-size: 0.95rem; line-height: 1.5; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
        .bot-message .message-content { background: #fff; color: #333; border-bottom-left-radius: 4px; max-width: 100%;}
        .bot-icon-small { width: 30px; height: 30px; border-radius: 50%; margin-right: 8px; align-self: flex-end; }
        .user-message { justify-content: flex-end; }
        .user-message .message-content { background: var(--primary-color); color: white; border-bottom-right-radius: 4px; }
        .msg-col-wrapper {
            display: flex;
            flex-direction: column; /* สั่งให้ข้อความกับดาวเรียงแนวตั้ง */
            align-items: flex-start; /* ชิดซ้าย */
            max-width: 75%; /* ย้ายการคุมความกว้างมาที่กล่องนี้แทน */
        }
        
        /* Chat Footer & Accessibility Buttons */
        .chat-footer { padding: 10px 15px; background: white; border-top: 1px solid #eee; display: flex; align-items: center; gap: 5px; }
        #userInput { flex: 1; border: 1px solid #ddd; border-radius: 25px; padding: 10px 15px; outline: none; transition: 0.2s; }
        #userInput:focus { border-color: var(--primary-color); }
        
        /* ปุ่มส่ง/พูด/ฟัง */
        .icon-btn {
            background: none;
            border: none;
            color: #888;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.2s;
        }
        .icon-btn:hover { background: #f0f0f0; color: var(--primary-color); }
        
        #sendBtn { background: var(--primary-color); color: white; margin-left: 5px; }
        #sendBtn:hover { transform: scale(1.1); background: #0056b3; }
        #sendBtn:disabled { background-color: #ccc; transform: none; }

        /* สถานะกำลังฟัง (Mic Active) */
        .listening { color: #dc3545 !important; animation: pulse 1.5s infinite; }
        @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

        /* สถานะกำลังพูด (Speaker Active) */
        .speaking-wave { display: inline-block; width: 10px; height: 10px; background: var(--primary-color); border-radius: 50%; margin-left: 5px; animation: wave 1s infinite; display: none;}
        @keyframes wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

        /* ปุ่มปิดเสียง/เปิดเสียง */
        #ttsToggle.active { color: var(--primary-color); }

        /* Quick Replies */
        .quick-replies { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
        .quick-btn { background: white; border: 1px solid var(--primary-color); color: var(--primary-color); border-radius: 15px; padding: 5px 10px; font-size: 0.85rem; cursor: pointer; transition: 0.2s; }
        .quick-btn:hover { background: var(--primary-color); color: white; }
        
        .typing { display: none; margin-left: 40px; margin-bottom: 10px; font-size: 0.8rem; color: #888; font-style: italic; }
        @media (max-width: 480px) { .chat-widget { width: 90%; height: 80%; bottom: 90px; right: 5%; left: 5%; } }
        .message-content a { color: #007bff; text-decoration: none; font-weight: 500; border-bottom: 1px dashed #007bff; transition: 0.2s; }
        .message-content a:hover { color: #0056b3; border-bottom: 1px solid #0056b3; }
        .user-message .message-content a { color: white; border-color: white; }

        /* Feedback Stars */
        .feedback-container {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px dashed #eee;
            text-align: left;
            font-size: 0.9rem;
            color: #666;
        }
        .star-rating {
            display: inline-block;
            direction: rtl; /* เรียงขวาไปซ้ายเพื่อให้ CSS Hover ทำงานง่าย */
        }
        .star-rating input { display: none; }
        .star-rating label {
            color: #ddd;
            font-size: 1.2rem;
            padding: 0 2px;
            cursor: pointer;
            transition: 0.2s;
        }
        .star-rating label:hover,
        .star-rating label:hover ~ label,
        .star-rating input:checked ~ label {
            color: #ffc107; /* สีเหลืองทอง */
        }
        .feedback-sent { color: #198754; font-size: 0.9rem; font-weight: 500; }
    