/* ============================================================ */
/* FILE: css/conversationScriptChat.css - CHAT STYLES           */
/* Script Mode - Chat, Intent, Sample, Summary, Feedback        */
/* Prefix: cs-* để tránh trùng CSS cũ                           */
/* ============================================================ */
/* V14 (SPLIT từ V9.9): Tách từ conversationScript.css          */
/*   - conversationScript.css     → Core (Setup/Folder/Modal)   */
/*   - conversationScriptChat.css → Chat (file này)             */
/* V9.9: Bỏ nút 💡 Gợi ý khỏi AI bubble                         */
/* V9.8: 2 nút nghe + 2 phím tắt cho user bubble                */
/* V9.7: Nút nghe câu user                                      */
/* V9.1: FIX layout — chat box không bị che khi mở sample       */
/*       + intent-hint/sample-wrap có max-height + scrollbar    */
/*       + chat-box có min-height 150px                         */
/* V6 (PLAN C): FIX N5 (animation)                              */
/* ============================================================ */

/* ============================================================ */
/* ===== CHAT SCREEN ===== */
/* ============================================================ */

.cs-chat-wrap {
    background: var(--bg-secondary);
    border-radius: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 75vh;
    max-height: 750px;
    overflow: hidden;
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ===== HEADER ===== */

.cs-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    gap: 0.8rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cs-header-left {
    flex: 1;
    min-width: 0;
}

.cs-topic-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.cs-role-badge {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.cs-level-badge {
    background: var(--bg-card);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--warning);
}

.cs-progress-badge {
    background: var(--bg-card);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ============================================================ */
/* ⭐ V9.1 FIX: CHAT BOX có min-height để không bị che khuất    */
/* ============================================================ */

.cs-chat-box {
    flex: 1;
    min-height: 150px;              /* ⭐ FIX V9.1: Đảm bảo chat luôn hiển thị */
    overflow-y: auto;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.cs-chat-box::-webkit-scrollbar {
    width: 6px;
}

.cs-chat-box::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

.cs-chat-box::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 10px;
}

.cs-chat-box::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ===== MESSAGE ===== */

.cs-message {
    display: flex;
    gap: 0.6rem;
    max-width: 85%;
    animation: csFadeIn 0.3s ease;
}

.cs-message.cs-ai {
    align-self: flex-start;
}

.cs-message.cs-user {
    align-self: flex-end;
    flex-direction: row;
}

.cs-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

.cs-message.cs-ai .cs-avatar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.cs-message.cs-user .cs-avatar {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-color: rgba(34, 197, 94, 0.3);
}

.cs-bubble {
    background: var(--bg-primary);
    border-radius: 18px;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cs-message.cs-ai .cs-bubble {
    border-top-left-radius: 4px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
}

.cs-message.cs-user .cs-bubble {
    border-top-right-radius: 4px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
}

/* ===== QUESTION EN + SPEAK BTN ===== */

.cs-question-en {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    animation: csFadeIn 0.25s ease;
}

.cs-speak-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
    font-family: inherit;
}

.cs-speak-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

/* ===== SUB BUTTONS ===== */

.cs-sub-btns {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.cs-sub-btn {
    background: var(--bg-card);
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.15s ease;
    font-family: inherit;
}

.cs-sub-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
    color: var(--text-primary);
}

.cs-sub-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ===== SUBTITLES ===== */

.cs-sub-vi,
.cs-sub-en {
    margin-top: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: csFadeIn 0.25s ease;
}

.cs-sub-vi {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning);
    color: var(--text-primary);
}

.cs-sub-en {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent);
    color: var(--text-primary);
    font-style: italic;
}

/* ===== HINTS (dùng trong AI bubble nếu cần — hiện không dùng) ===== */

.cs-hints {
    margin-top: 0.7rem;
    padding: 0.6rem 0.8rem;
    background: rgba(34, 197, 94, 0.05);
    border-radius: 12px;
    border-left: 3px solid var(--success);
    animation: csFadeIn 0.3s ease;
}

.cs-hints-title {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.cs-hints-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cs-hint-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.35rem 0.7rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.78rem;
    text-align: left;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
}

.cs-hint-item:hover {
    background: var(--bg-card);
    border-color: var(--success);
    color: var(--text-primary);
    transform: translateX(3px);
}

/* ===== USER TEXT ===== */

.cs-user-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ============================================================ */
/* ===== FEEDBACK ===== */
/* ============================================================ */

.cs-feedback {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cs-praise {
    color: var(--success);
    font-weight: 500;
    line-height: 1.5;
    padding: 0.4rem 0.6rem;
    background: rgba(34, 197, 94, 0.08);
    border-radius: 10px;
    border-left: 3px solid var(--success);
}

.cs-grammar-error {
    color: var(--warning);
    line-height: 1.5;
    padding: 0.4rem 0.6rem;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 10px;
    border-left: 3px solid var(--warning);
}

.cs-better-version {
    color: var(--text-primary);
    line-height: 1.5;
    padding: 0.4rem 0.6rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    border-left: 3px solid var(--accent);
}

.cs-better-version strong {
    color: var(--accent);
    font-weight: 600;
    font-style: italic;
}

.cs-context-note {
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 3px solid var(--text-secondary);
    font-size: 0.8rem;
}

/* ============================================================ */
/* ===== LOADING ===== */
/* ============================================================ */

.cs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem;
    background: var(--bg-primary);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    align-self: center;
    border: 1px solid var(--border);
}

.cs-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-card);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: csSpin 0.8s linear infinite;
}

@keyframes csSpin {
    to { transform: rotate(360deg); }
}

.cs-error {
    align-self: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 3px solid var(--danger);
    color: var(--danger);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    max-width: 90%;
    text-align: center;
}

/* ============================================================ */
/* ===== INPUT AREA ===== */
/* ============================================================ */

.cs-input-wrap {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 1.2rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    align-items: flex-end;
    flex-shrink: 0;
}

.cs-answer-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 16px;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    transition: all 0.2s;
    line-height: 1.5;
    min-height: 44px;
    max-height: 120px;
}

.cs-answer-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cs-answer-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cs-send-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 44px;
    font-family: inherit;
}

.cs-send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.cs-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cs-actions {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem 0.8rem 1.2rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cs-action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: 60px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
}

.cs-action-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.cs-action-btn.cs-action-danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.cs-action-btn.cs-action-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.cs-action-btn.cs-action-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.cs-action-btn.cs-action-primary:hover {
    background: var(--accent-hover);
    color: white;
}

/* ============================================================ */
/* ===== SUMMARY SCREEN ===== */
/* ============================================================ */

.cs-summary {
    text-align: center;
    padding: 2rem 1rem;
}

.cs-summary-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: csBounce 0.6s ease;
}

@keyframes csBounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.cs-summary h3 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cs-summary-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    display: inline-block;
}

.cs-summary-info {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cs-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    gap: 1rem;
}

.cs-summary-row + .cs-summary-row {
    border-top: 1px solid var(--border);
}

.cs-summary-row span {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cs-summary-row strong {
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
}

.cs-summary-section {
    text-align: left;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cs-summary-section h4 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.cs-summary-words-list {
    list-style: none;
    padding: 0.8rem 1rem;
    margin: 0;
    background: var(--bg-primary);
    border-radius: 16px;
    max-height: 250px;
    overflow-y: auto;
}

.cs-summary-words-list li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.cs-summary-words-list li:last-child {
    border-bottom: none;
}

.cs-summary-words-list li strong {
    color: var(--success);
    font-weight: 600;
}

.cs-summary-turns {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0.8rem 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.cs-summary-turn {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.82rem;
    line-height: 1.5;
    align-items: flex-start;
    border-bottom: 1px dashed var(--border);
}

.cs-summary-turn:last-child {
    border-bottom: none;
}

.cs-summary-turn-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.cs-summary-turn-text {
    color: var(--text-secondary);
    word-break: break-word;
}

.cs-empty-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.6;
    padding: 1rem;
    font-style: italic;
}

/* ============================================================ */
/* ===== ANIMATIONS ===== */
/* ============================================================ */

@keyframes csFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================ */
/* ⭐ V9.1 FIX: INTENT HINT có max-height + scrollbar           */
/* ============================================================ */

.cs-intent-hint {
    margin: 0.8rem 1.2rem;             /* ⭐ FIX V9.1: Giảm margin */
    padding: 0.8rem 1rem;              /* ⭐ FIX V9.1: Giảm padding */
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(59, 130, 246, 0.05));
    border-radius: 16px;
    border-left: 4px solid var(--success);
    animation: csFadeIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 220px;                 /* ⭐ FIX V9.1: Giới hạn chiều cao */
    overflow-y: auto;                  /* ⭐ FIX V9.1: Scroll khi quá dài */
    flex-shrink: 0;                    /* ⭐ FIX V9.1: Không bị nén */
}

.cs-intent-hint::-webkit-scrollbar {
    width: 5px;
}

.cs-intent-hint::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.cs-intent-hint::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 10px;
}

.cs-intent-label {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cs-intent-text {
    font-size: 0.95rem;                /* ⭐ FIX V9.1: Giảm từ 1rem */
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
    font-style: italic;
    padding: 0.2rem 0;
    word-break: break-word;
}

.cs-show-sample-btn {
    margin-top: 0.6rem;                /* ⭐ FIX V9.1: Giảm */
    background: var(--bg-card);
    border: 1px dashed var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;            /* ⭐ FIX V9.1: Nhỏ hơn */
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cs-show-sample-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
    border-style: solid;
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ============================================================ */
/* ⭐ V9.1 FIX: SAMPLE WRAP có max-height + scrollbar           */
/* ============================================================ */

.cs-sample-wrap {
    margin-top: 0.7rem;                /* ⭐ FIX V9.1: Giảm */
    padding: 0.7rem 0.9rem;            /* ⭐ FIX V9.1: Giảm */
    background: var(--bg-primary);
    border-radius: 12px;
    border-left: 3px solid var(--accent);
    animation: csFadeIn 0.3s ease;
    max-height: 140px;                 /* ⭐ FIX V9.1: Giới hạn chiều cao */
    overflow-y: auto;                  /* ⭐ FIX V9.1: Scroll khi nhiều */
}

.cs-sample-wrap::-webkit-scrollbar {
    width: 5px;
}

.cs-sample-wrap::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.cs-sample-wrap::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 10px;
}

.cs-sample-title {
    font-size: 0.72rem;                /* ⭐ FIX V9.1: Nhỏ hơn */
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cs-sample-item {
    padding: 0.4rem 0.7rem;            /* ⭐ FIX V9.1: Nhỏ hơn */
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.35rem;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    word-break: break-word;
}

.cs-sample-item:last-of-type {
    margin-bottom: 0;
}

.cs-sample-item:hover {
    background: var(--bg-card);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateX(3px);
}

.cs-sample-note {
    font-size: 0.68rem;                /* ⭐ FIX V9.1: Nhỏ hơn */
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.7;
    text-align: center;
    padding: 0.25rem 0;
    border-top: 1px dashed var(--border);
}

/* ============================================================ */
/* ===== QUESTION HIDDEN ===== */
/* ============================================================ */

.cs-question-hidden {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(168, 85, 247, 0.04));
    border-radius: 14px;
    border: 1px dashed rgba(59, 130, 246, 0.35);
    text-align: center;
    animation: csFadeIn 0.3s ease;
    min-width: 220px;
}

.cs-question-hidden-icon {
    font-size: 2.2rem;
    animation: csPulse 1.5s ease-in-out infinite;
    line-height: 1;
}

@keyframes csPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(1.15); }
}

.cs-question-hidden-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
}

.cs-question-hidden-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.4;
}

.cs-question-hidden-hint strong {
    color: var(--accent);
    font-weight: 700;
}

.cs-speak-btn-big {
    margin-top: 0.6rem;
    padding: 0.55rem 1.3rem;
    font-size: 0.85rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.cs-speak-btn-big:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.cs-speak-btn-big:active {
    transform: translateY(0);
}

/* ============================================================ */
/* ===== AUTO SPEAK TOGGLE ===== */
/* ============================================================ */

.cs-autospeak-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    font-family: inherit;
    flex-shrink: 0;
}

.cs-autospeak-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.1);
}

.cs-autospeak-toggle:active {
    transform: scale(0.95);
}

.cs-autospeak-toggle.active {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.cs-autospeak-toggle.active:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* ============================================================ */
/* ===== RESPONSIVE — CHAT / INTENT / SAMPLE / SUMMARY ===== */
/* ============================================================ */

@media (max-width: 768px) {
    .cs-chat-wrap {
        height: 78vh;
        border-radius: 20px;
        margin: 0;
    }

    .cs-chat-header { padding: 0.6rem 0.8rem; }
    .cs-topic-label { font-size: 0.82rem; }

    /* ⭐ V9.1: min-height nhỏ hơn trên mobile */
    .cs-chat-box {
        padding: 0.8rem;
        gap: 0.8rem;
        min-height: 120px;
    }

    .cs-message { max-width: 92%; }
    .cs-avatar { width: 30px; height: 30px; font-size: 1rem; }
    .cs-bubble { padding: 0.65rem 0.85rem; border-radius: 15px; }
    .cs-question-en { font-size: 0.88rem; }
    .cs-user-text { font-size: 0.88rem; }
    .cs-sub-btn { font-size: 0.65rem; padding: 0.2rem 0.55rem; }
    .cs-sub-vi,
    .cs-sub-en { font-size: 0.78rem; padding: 0.4rem 0.65rem; }
    .cs-hints { padding: 0.5rem 0.6rem; }
    .cs-hints-title { font-size: 0.7rem; }
    .cs-hint-item { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
    .cs-feedback { font-size: 0.78rem; }

    .cs-praise,
    .cs-grammar-error,
    .cs-better-version,
    .cs-context-note {
        font-size: 0.78rem;
        padding: 0.35rem 0.5rem;
    }

    .cs-input-wrap { padding: 0.6rem 0.8rem; gap: 0.4rem; }
    .cs-answer-input { font-size: 0.85rem; padding: 0.6rem 0.8rem; min-height: 40px; }
    .cs-send-btn { padding: 0.6rem 1rem; font-size: 0.82rem; height: 40px; }
    .cs-actions { padding: 0.5rem 0.8rem 0.7rem 0.8rem; gap: 0.4rem; }
    .cs-action-btn { font-size: 0.72rem; padding: 0.4rem 0.9rem; }

    .cs-summary h3 { font-size: 1.3rem; }
    .cs-summary-icon { font-size: 3rem; }
    .cs-summary-message { font-size: 0.85rem; }
    .cs-summary-info { padding: 0.8rem 1rem; }
    .cs-summary-row { font-size: 0.82rem; }

    /* ⭐ V9.1: Intent hint responsive */
    .cs-intent-hint {
        margin: 0.6rem 0.8rem;
        padding: 0.7rem 0.85rem;
        max-height: 180px;
    }

    .cs-intent-label { font-size: 0.72rem; }
    .cs-intent-text { font-size: 0.88rem; }
    .cs-show-sample-btn { font-size: 0.7rem; padding: 0.35rem 0.75rem; }

    /* ⭐ V9.1: Sample wrap responsive */
    .cs-sample-wrap { padding: 0.6rem 0.75rem; max-height: 120px; }
    .cs-sample-title { font-size: 0.68rem; }
    .cs-sample-item { font-size: 0.76rem; padding: 0.35rem 0.6rem; }
    .cs-sample-note { font-size: 0.65rem; }

    .cs-question-hidden { padding: 1rem 1.2rem; min-width: 180px; }
    .cs-question-hidden-icon { font-size: 1.8rem; }
    .cs-question-hidden-text { font-size: 0.85rem; }
    .cs-question-hidden-hint { font-size: 0.72rem; }
    .cs-speak-btn-big { font-size: 0.8rem; padding: 0.5rem 1.1rem; }
    .cs-autospeak-toggle { width: 30px; height: 30px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .cs-message { max-width: 95%; }
    .cs-avatar { width: 26px; height: 26px; font-size: 0.9rem; }
    .cs-header-right { gap: 0.3rem; }

    .cs-role-badge,
    .cs-level-badge,
    .cs-progress-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }

    /* ⭐ V9.1: Intent hint cực nhỏ */
    .cs-intent-hint {
        margin: 0.5rem 0.5rem;
        padding: 0.6rem 0.7rem;
        max-height: 160px;
        border-left-width: 3px;
    }

    .cs-intent-text { font-size: 0.82rem; }
    .cs-show-sample-btn { font-size: 0.68rem; padding: 0.3rem 0.65rem; }

    /* ⭐ V9.1: Sample wrap cực nhỏ */
    .cs-sample-wrap { padding: 0.5rem 0.65rem; max-height: 100px; }
    .cs-sample-item { font-size: 0.72rem; padding: 0.3rem 0.5rem; }

    .cs-question-hidden { padding: 0.9rem 1rem; gap: 0.4rem; min-width: 160px; }
    .cs-question-hidden-icon { font-size: 1.6rem; }
    .cs-question-hidden-text { font-size: 0.78rem; }
    .cs-question-hidden-hint { font-size: 0.68rem; }
    .cs-speak-btn-big { font-size: 0.75rem; padding: 0.45rem 1rem; }
    .cs-autospeak-toggle { width: 28px; height: 28px; font-size: 0.8rem; }
}

/* ============================================================ */
/* ===== SCROLLBAR — CHAT (summary words/turns + move list) ===== */
/* ============================================================ */

.cs-summary-words-list::-webkit-scrollbar,
.cs-summary-turns::-webkit-scrollbar {
    width: 6px;
}

.cs-summary-words-list::-webkit-scrollbar-track,
.cs-summary-turns::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

.cs-summary-words-list::-webkit-scrollbar-thumb,
.cs-summary-turns::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 10px;
}

.cs-summary-words-list::-webkit-scrollbar-thumb:hover,
.cs-summary-turns::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ============================================================ */
/* ===== END FILE 1B ===== */
/* ============================================================ */