/* =================================================================== */
/* --- TABLE DES MATIÈRES --- */
/* =================================================================== */
/*
    1. Styles Globaux & Racine
    2. Widget Flottant (Déclencheur & Bulle d'accroche)
    3. Panneau Principal du Chatbot (Plein écran)
       - Conteneur & Header
       - Avatar Principal
       - Zone de Conversation & Messages
       - Formatage Markdown
       - Effets de frappe & chargement
    4. Formulaire de Saisie (Input, Boutons, Sélecteur)
    5. Animations (@keyframes)
    6. Variante : Mode Shortcode (Intégré dans une page)
    7. Styles Responsives (Mobiles < 768px)
       - Layout Général
       - Formulaire Mobile
       - Avatar Mobile
       - Mode Paysage
*/

/* =================================================================== */
/* --- 1. Styles Globaux & Racine --- */
/* =================================================================== */

* {
    box-sizing: border-box;
}

/* =================================================================== */
/* --- 2. Widget Flottant (Déclencheur & Bulle d'accroche) --- */
/* =================================================================== */

/* --- Conteneur du widget --- */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

.open-chatbot-trigger {
    cursor: pointer;
    transition: transform 0.4s ease; /* Transition fluide pour l'effet de grossissement */
}

.open-chatbot-trigger:hover {
    transform: scale(1.08); /* Grossissement de 10% au survol */
}

/* --- Bouton déclencheur flottant --- */
#chatbot-trigger {
    position: relative;
    width: 75px;
    height: 75px;
    background-color: #313b77;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,122,255,0.4);
    transition: transform 0.3s ease-out, opacity 0.5s ease-out, box-shadow 0.3s;
    overflow: hidden; /* Pour que la vidéo/image reste dans le cercle */
}

#chatbot-trigger img.trigger-image,
#chatbot-trigger .trigger-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#chatbot-trigger .trigger-video {
    display: block;
    transition: opacity 0.3s ease-in-out;
    opacity: 0; /* Caché jusqu'au chargement par JS */
}

#chatbot-trigger .trigger-video.is-loaded {
    opacity: 1;
}

#chatbot-trigger.is-hidden {
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
}

#chatbot-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0,122,255,0.5);
}

#chatbot-trigger.is-animating {
    animation: spin-and-flash 2s ease-in-out 2;
}

/* --- Bulle de dialogue d'accroche --- */
#speech-bubble {
    position: absolute;
    left: -241px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 230px;
    background: rgba(49, 59, 119, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    padding: 15px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    z-index: 1;
    pointer-events: none;
    cursor: pointer;
}

#speech-bubble p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

#speech-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(49, 59, 119, 0.2);
}

#speech-bubble.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: bubbleGrow 1.5s ease-out forwards, bubbleWobble 5s infinite 1s;
    pointer-events: auto;
}

/* =================================================================== */
/* --- 3. Panneau Principal du Chatbot (Plein écran) --- */
/* =================================================================== */

/* --- Conteneur principal du panneau --- */
#chatbot-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 0; /* Caché par défaut */
    background-color: #313b77;
    z-index: 9990;
    overflow: hidden;
    padding: 0 8%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: height 0.5s ease-in-out, padding 0.5s ease-in-out;
}

#chatbot-panel.is-open {
    height: 100vh;
    padding: 20px 8%;
    display: flex;
    flex-direction: column;
}

.chatbot-shortcode-wrapper #chatbot-panel.is-open {
    height: auto;
    padding: 0;
}

/* --- Bouton de fermeture --- */
#chatbot-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.2s;
}

#chatbot-close-btn:hover {
    background-color: rgba(0,0,0,0.4);
}

#chatbot-close-btn svg {
    fill: #ffffff;
}

/* --- Header du panneau (titre) --- */
#chatbot-header {
    padding: 25px 10px 20px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
    text-align: center;
}

#chatbot-header h2 {
    font-size: 23px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

/* --- Layout interne --- */
.chatbot-inner-layout {
    max-width: 1200px;
    margin: 0 auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chatbot-conversation-container {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 90vh; /* Ajusté */
    flex-grow: 1;
}

/* --- Avatar principal (dans le panneau) --- */
#chatbot-avatar {
    position: relative; 
    flex-shrink: 0; 
    border-radius: 50%;
    overflow: hidden;
    background-color: #313b77; 
}

#chatbot-avatar-poster,
#chatbot-avatar .robot-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

#chatbot-avatar-poster {
    opacity: 1;
    z-index: 2;
}

#chatbot-avatar .robot-video {
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

#chatbot-avatar.video-active #chatbot-avatar-poster {
    opacity: 0;
}

#chatbot-avatar.video-active .robot-video.is-active {
    opacity: 1;
    pointer-events: auto;
}


/* --- Zone de conversation & messages --- */
#chatbot-messages {
    flex-grow: 1;
    background-color: #ecf2f5;
    border-radius: 13px;
    padding: 15px;
    padding-left: 150px; /* Espace pour l'avatar en mode paysage/desktop */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 55vh;
}

.message {
    padding: 10px 15px;
    margin-bottom: 10px;
    max-width: 95%;
    line-height: 1.4;
    flex-shrink: 0;
}

.message.user {
    background-color: #313b77;
    color: #fff;
    align-self: flex-end;
    border-radius: 18px 18px 4px 18px;
}

.message.bot {
    background-color: #f0f2f5;
    color: #000;
    align-self: flex-start;
    border-radius: 18px 18px 18px 4px;
    position: relative;
    padding-bottom: 15px;
}

.message.bot.error {
    background-color: #ff3b30;
    color: white;
}

.message.bot.loading span {
    animation-name: loading-blink;
    animation-duration: 1.4s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}
.message.bot.loading span:nth-child(2) { animation-delay: .2s; }
.message.bot.loading span:nth-child(3) { animation-delay: .4s; }

.chatbot-copy-btn {
    position: absolute;
    bottom: 7px;
    right: -30px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Caché par défaut */
    transition: opacity 0.2s ease-in-out, background-color 0.2s;
    z-index: 5;
}
/* Le bouton apparaît quand on survole le message du bot */
.message.bot:hover .chatbot-copy-btn {
    opacity: 0.7;
}

.chatbot-copy-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.chatbot-copy-btn svg {
    width: 18px;
    height: 18px;
    fill: #333;
}

/* Style pour le feedback visuel après avoir cliqué */
.chatbot-copy-btn.copied {
    background-color: #d4edda; /* Vert clair */
    border-color: #c3e6cb;
}

.chatbot-copy-btn.copied svg {
    display: none; /* On cache l'icône de copie */
}


/* --- Formatage Markdown dans les messages du bot --- */
.message.bot, .message.bot * {
    font-family: -apple-system, BlinkMacSystemFont, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    line-height: 1.5;
    margin: 0.1em 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.message.bot p { margin: 0.5em 0; }
.message.bot h1 { font-size: 1.5em; font-weight: bold; margin: 0.4em 0; }
.message.bot h2 { font-size: 1.3em; font-weight: bold; margin: 0.4em 0; }
.message.bot h3 { font-size: 1.2em; font-weight: bold; margin: 0.4em 0; }
.message.bot strong { font-weight: bold; }
.message.bot ul, .message.bot ol { margin-left: 1.5em; padding-left: 0; }
.message.bot li { margin-bottom: 0.3em; }
.message.bot table { border-collapse: collapse; width: 100%; margin: 0.5em 0; }
.message.bot th, .message.bot td { border: 1px solid #ddd; padding: 0.5em; text-align: left; }
.message.bot th { background-color: #f2f2f2; font-weight: bold; }
.message.bot pre { background-color: #f4f4f4; padding: 0.5em; border-radius: 4px; overflow-x: auto; }
.message.bot code { font-family: monospace; }
.message.bot img.emoji { display: inline-block; vertical-align: middle; height: 1.2em; }


/* --- Effets de frappe et optimisation --- */
.message.bot .bot-text, .message.bot .bot-text-static {
    display: block;
    width: 100%;
    transform: translate3d(0,0,0);
    will-change: contents;
}

.typed-cursor {
    display: inline-block;
    width: 0.5em;
    height: 1em;
    background-color: #000;
    opacity: 0.8;
    animation: blink 0.7s infinite;
    vertical-align: middle;
}


/* =================================================================== */
/* --- 4. Formulaire de Saisie (Input, Boutons, Sélecteur) --- */
/* =================================================================== */

/* --- Conteneur du formulaire (Desktop) --- */
#chatbot-form {
    display: flex;
    flex-direction: row;
    align-items: stretch; 
    gap: 15px;
    flex-shrink: 0;
    padding: 20px 10px;
    background-color: #313b77;
    flex-wrap: nowrap; /* LA RÈGLE CLÉ : Empêche le passage à la ligne */
}

/* --- Sélecteur de modèle --- */
.chatbot-model-selector-wrapper {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 150px;
    min-width: 80px;
    display: flex; /* Pour que son enfant puisse s'étirer */
}

#chatbot-model-selector {
    width: 100%; /* Prend toute la place de son parent wrapper */
    /* Styles existants */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 16px;
    cursor: pointer;
    height: 52px;
    margin: 0;
}

#chatbot-model-selector:focus {
    outline-color: #313b77;
}

/* --- Wrapper pour input + boutons --- */
.chatbot-input-wrapper {
    flex-grow: 2;
    flex-shrink: 1;
    flex-basis: 300px;
    min-width: 150px;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    align-items: center;
    position: relative; /* <-- NÉCESSAIRE pour positionner le micro */
}
/* --- Champ de saisie --- */
#chatbot-input {
    flex-grow: 1;
    min-width: 50px;
    border: none;
    padding: 15px 50px 15px 15px; /* Augmentation du padding-right pour les 3 boutons */
    font-size: 16px;
    margin: 0;
    background-color: transparent; 
    outline: none;
    font-family: inherit;
    resize: none;
    overflow-y: hidden; /* Affiche une barre de défilement verticale UNIQUEMENT si le contenu dépasse la hauteur max */
    box-sizing: border-box; /* Assure que le padding ne s'ajoute pas à la largeur totale */
    line-height: 1.4; /* Améliore la lisibilité pour le texte sur plusieurs lignes */
    max-height: 120px; /* Empêche le textarea de devenir immense et de casser le design */
}

/* NOUVEAU : Styles pour le bouton de reconnaissance vocale */
#start-recognition-btn {
    position: absolute;
    right: 115px; /* Positionné à gauche du bouton "submit" et "clear" */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #888;
    transition: color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

#start-recognition-btn:hover {
    color: #000;
}

/* Style quand l'écoute est active */
#start-recognition-btn.is-listening {
    color: #ff4136; /* Rouge pour indiquer l'enregistrement */
    animation: glow 1.5s infinite;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(255, 82, 82, 0.7);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 82, 82, 1);
    }
}

/* --- Bouton Effacer la conversation --- */
#chatbot-clear-btn {
    background-color: #ea4242 !important;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    color: #ffffff;
    transition: color 0.2s ease;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

#chatbot-clear-btn:hover {
    background-color: #ffffff !important;
    color: #ea4242 !important;
}

#chatbot-clear-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

#chatbot-form.has-conversation #chatbot-clear-btn {
    opacity: 1;
    pointer-events: auto;
}

/* --- Bouton Envoyer --- */
#chatbot-form button[type="submit"] {
    background-color: #000000;
    color: white;
    border: 1px solid #000 !important;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    margin: 0;
    align-self: stretch;
    transition: background-color 0.2s;
}

#chatbot-form button[type="submit"],
#chatbot-clear-btn {
    flex-shrink: 0; /* LA MAGIE : Empêche les boutons d'être compressés ou de disparaître */ 
    flex-grow: 1;
}

#chatbot-form button[type="submit"]:hover {
    background-color: #b7b7b7;
    color: #000000;
}

#chatbot-form button[type="submit"]:disabled {
    background-color: #7f7f7f;
    cursor: not-allowed;
}

/* Ajout par défaut pour le nouveau wrapper (n'affecte pas desktop) */
.chatbot-tools {
    display: flex;
    align-items: center;
    gap: 0; /* Espace entre les boutons */
    flex-shrink: 0;
    height: 100%;
}

/* =================================================================== */
/* --- 5. Animations (@keyframes) --- */
/* =================================================================== */

@keyframes loading-blink { 
    0% { opacity: .2; } 
    20% { opacity: 1; } 
    100% { opacity: .2; } 
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes shake-animation {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes spin-and-flash {
    0%, 100% { transform: rotate(0deg) scale(1); background-color: #313b77; box-shadow: 0 0 20px rgba(255,255,255,0.8); }
    25% { transform: rotate(180deg) scale(1.2); background-color: #ff007a; box-shadow: 0 0 40px rgba(255,0,122,1); }
    50% { transform: rotate(360deg) scale(1.15); background-color: #4a5ab8; box-shadow: 0 0 30px rgba(0,122,255,1); }
    75% { transform: rotate(360deg) scale(1.1); background-color: #ff007a; box-shadow: 0 0 40px rgba(255,0,122,1); }
}

@keyframes bubbleGrow {
    0% { transform: translateY(-50%) scale(0); opacity: 0; }
    70% { transform: translateY(-50%) scale(1.1); opacity: 1; }
    100% { transform: translateY(-50%) scale(1); }
}

@keyframes bubbleWobble {
    0%, 100% { transform: translateY(-50%) scale(1) translateX(0); }
    25% { transform: translateY(-50%) scale(1) translateX(-5px); }
    75% { transform: translateY(-50%) scale(1) translateX(5px); }
}

/* =================================================================== */
/* --- 6. Variante : Mode Shortcode (Intégré dans une page) --- */
/* =================================================================== */

.chatbot-shortcode-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 2em auto;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}

.chatbot-shortcode-wrapper #chatbot-panel {
    position: static;
    width: 100%;
    height: auto;
    padding: 0;
    background-color: #313b77;
    display: flex;
    flex-direction: column;
}

.chatbot-shortcode-wrapper #chatbot-close-btn {
    display: none;
}

.chatbot-shortcode-wrapper .chatbot-inner-layout {
    max-width: 100%;
    padding: 15px;
}

.chatbot-shortcode-wrapper .chatbot-conversation-container {
    max-height: none;
    min-height: 0;
}

.chatbot-shortcode-wrapper #chatbot-messages {
    min-height: 300px;
    max-height: 60vh;
    padding-left: 15px; /* Défaut pour mobile */
}

.chatbot-shortcode-wrapper #chatbot-avatar {
    display: block; /* Toujours visible */
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
}

/* --- Layout Desktop pour le mode shortcode --- */
@media (min-width: 769px) {
    #chatbot-avatar {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 120px;
        height: 120px;
        margin: 0; /* Annule la marge du mode mobile */
    }

    #chatbot-messages {
        padding-left: 150px !important; /* largeur avatar (120px) + marge (30px) */
    }
    .chatbot-shortcode-wrapper #chatbot-header {
            padding: 0 10px 20px 10px;
    }

    .chatbot-shortcode-wrapper #chatbot-header h2 {
        font-size: 23px;
    }

    .chatbot-shortcode-wrapper .chatbot-conversation-container {
        position: relative; /* Contexte pour l'avatar */
    }

    .chatbot-shortcode-wrapper #chatbot-avatar {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 120px;
        height: 120px;
        margin: 0;
    }

    .chatbot-shortcode-wrapper #chatbot-messages {
        padding-left: 150px;
    }
}


/* =================================================================== */
/* --- 7. Styles Responsives (Mobiles < 768px) --- */
/* =================================================================== */

@media (max-width: 768px) {

    /* --- Widget flottant --- */
    #speech-bubble {
        left: 50%; /* Centré par rapport au parent */
        transform: translateX(-50%) translateY(-100%) scale(0); /* Positionné au-dessus du trigger */
        top: -15px;
        bottom: auto;
        max-width: calc(100vw - 40px);
    }
    
    #speech-bubble::after {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border-color: rgba(49, 59, 119, 0.2) transparent transparent transparent;
    }

    #speech-bubble.show {
        transform: translateX(-117%) translateY(-20%) scale(1);
        animation: none; /* Simplification pour mobile */
    }

    /* --- Panneau principal en plein écran --- */
    #chatbot-panel {
        transition: none;
    }

    #chatbot-panel.is-open {
        padding: 0;
        z-index: 9999;
    }

    .chatbot-inner-layout {
        width: 100%;
        padding: 10px;
        height: 100%;
    }

    .chatbot-conversation-container {
        height: 100%;
        width: 100%;
        gap: 10px;
    }

    #chatbot-header {
        padding: 10px 42px 0 0;
        border-bottom: none;
    }

    #chatbot-header h2 {
        font-size: 18px;
    }
    #chatbot-close-btn {
        right: 8px;
    }

    /* --- Avatar sur mobile --- */
    #chatbot-avatar {
        position: relative;
        width: 80px !important;
        height: 80px !important;
        margin: 10px auto !important;
    }

    #chatbot-messages {
        padding-left: 15px !important; /* Annule le padding pour l'avatar desktop */
        min-height: auto;
    }

    .message {
        max-width: 100%;
        font-size: 15px;
    }

    /* --- Formulaire sur mobile --- */
    #chatbot-form {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

    #chatbot-model-selector {
        width: 100%;
        max-width: none;
        height: auto;
        padding: 12px;
    }

    .chatbot-model-selector-wrapper,
    .chatbot-input-wrapper {
        flex-basis: auto !important; /* ANNULATION DE LA LARGEUR DE BASE */
        min-width: 0; /* On annule aussi la largeur minimale */
        width: 100%; /* Chaque wrapper prend toute la largeur */
    }

    .chatbot-input-wrapper {
        border-radius: 50px;
        padding: 5px 5px 5px 20px;
    }

    #chatbot-input {
        padding: 10px 0;
    }

    #start-recognition-btn {
        right: 90px;
    }

    #chatbot-clear-btn {
        padding: 0 8px;
    }
    #chatbot-form button {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        padding: 0;
        flex-shrink: 0;
        margin-left: 3px;
    }

    #chatbot-form button svg {
        width: 20px;
        height: 20px;
    }

    #chatbot-form button[type="submit"] {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        padding: 0;
        flex-shrink: 0;
        align-self: center;
    }

    #chatbot-form button[type="submit"] svg {
        width: 20px;
        height: 20px;
    }
    .chatbot-copy-btn {
        bottom: 10px;
        right: -5px;
        padding: 3px 5px;
    }
    .chatbot-copy-btn svg {
        width: 16px;
        height: 16px;
        fill: #333;
    }

    /* --- Mode paysage sur mobile --- */
    @media (orientation: landscape) {
        #chatbot-avatar {
            position: absolute;
            top: 10px;
            left: 10px;
            width: 120px !important;
            height: 120px !important;
        }

        #chatbot-header {
            padding: 0 10px 0 10px;
        }
    }
}
/* =================================================================== */
/* --- 8. Styles pour très petits mobiles (< 480px) --- */
/* =================================================================== */

@media (max-width: 479px) {
    .chatbot-shortcode-wrapper #chatbot-avatar {
        margin: 0 auto;
    }
    .chatbot-input-wrapper {
        flex-direction: column; /* Change en colonne : input en haut, outils en bas */
        align-items: stretch; /* Étire tout à pleine largeur */
        padding: 10px; /* Ajuste le padding pour plus d'espace */
        border-radius: 8px; /* Garde le border-radius */
    }

    #chatbot-input {
        padding: 0 10px 5px 10px; /* Padding uniforme, sans extra à droite */
        margin-bottom: 1px; /* Espace entre input et boutons */
        width: 100%; /* Pleine largeur */
    }

    .chatbot-tools {
        justify-content: flex-end; /* Aligne les boutons à droite (comme dans tes images), ou change en 'center' si tu préfères centré */
        gap: 15px; /* Plus d'espace sur petit écran */
        height: auto;
    }

    #start-recognition-btn {
        position: static; /* Annule l'absolute pour qu'il s'intègre dans le flex row */
        top: auto;
        right: auto;
        transform: none;
        padding: 0; /* Ajuste si besoin */
    }

    /* Ajustements pour les boutons ronds sur très petit mobile (override les styles <768px si besoin) */
    #chatbot-clear-btn,
    #chatbot-form button[type="submit"],
    #start-recognition-btn {
        width: 40px; /* Taille plus petite pour petit écran */
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Si le selector est visible un jour, assure-toi qu'il ne casse rien */
    .chatbot-model-selector-wrapper {
        margin-bottom: 5px;
    }
    #chatbot-form {    
        padding: 5px 0;
    }
    #chatbot-form button[type="submit"],
    #chatbot-clear-btn {
        flex-grow: 0;
    }
    #chatbot-form button[type="submit"] svg {
        width: 17px;
        height: 17px;
    }
    #chatbot-clear-btn, #chatbot-form button[type="submit"], #start-recognition-btn {
        width: 30px;
        height: 30px;
    }
    #chatbot-form button {
        width: 30px;
        height: 30px;
    }
}
