* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-image: url('https://i.imgur.com/lrxpaDQ.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #ffffff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Overlay sombre pour lisibilité */
.background-animation {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

/* Conteneur principal */
.glass-app {
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    display: flex;
    gap: 8px;
    padding: 8px;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
}

.glass-app.hidden { display: none; }

/* --- BOUTON ADMIN --- */
.admin-panel-btn {
    position: fixed;
    bottom: 24px;
    right: 28px;
    z-index: 50;
    background: rgba(20, 18, 35, 0.42);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(142, 45, 226, 0.45);
    color: #c4b5fd;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(142, 45, 226, 0.25);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.1s, padding 0.3s;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
}

.admin-panel-btn .admin-label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: max-width 0.35s ease, opacity 0.3s ease, margin-left 0.35s ease;
    margin-left: 0;
}

.admin-panel-btn:hover .admin-label {
    max-width: 120px;
    opacity: 1;
    margin-left: 8px;
}

.admin-panel-btn:hover {
    border-color: rgba(142, 45, 226, 0.9);
    box-shadow: 0 6px 32px rgba(142, 45, 226, 0.45);
}

.admin-panel-btn:active { transform: scale(0.97); }

.admin-panel-btn.hidden { display: none; }

/* --- SIDEBAR --- */
.sidebar {
    width: 250px;
    background: rgba(20, 18, 35, 0.42);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#ia-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(74, 0, 224, 0.2)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a78bfa' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
        no-repeat right 12px center;
    border: 1px solid rgba(142, 45, 226, 0.5);
    color: #c4b5fd;
    padding: 0 36px 0 14px;
    height: 48px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(142, 45, 226, 0.2);
}

#ia-select:hover {
    border-color: rgba(142, 45, 226, 0.9);
    box-shadow: 0 0 18px rgba(142, 45, 226, 0.4);
}

#ia-select:focus {
    border-color: rgba(142, 45, 226, 1);
    box-shadow: 0 0 20px rgba(142, 45, 226, 0.5);
}

#ia-select option { background: #1a1a2e; color: white; }

/* --- ZONE DE CHAT --- */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    padding-right: 14px;
    background: rgba(20, 18, 35, 0.42);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
}

/* Scrollbar stylisée */
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Les bulles de message */
.message {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    transform-origin: bottom center;
    will-change: transform, opacity;
}

/* Animation défilement historique (sélection d'un chat) */
@keyframes msgScrollIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.message.history {
    animation: msgScrollIn 0.28s ease both;
}

/* Animation message envoyé */
@keyframes msgSendIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Animation message reçu */
@keyframes msgReceiveIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Animation message système (fade discret) */
@keyframes msgSystemIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    font-style: italic;
    color: #aaa;
    font-size: 0.9rem;
    border-radius: 8px;
    animation: msgSystemIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message.user {
    align-self: flex-end;
    background: rgba(142, 45, 226, 0.65);
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: msgSendIn 0.3s ease both;
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom-left-radius: 4px;
    animation: msgReceiveIn 0.3s ease both;
}

/* La barre pour taper */
.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(20, 18, 35, 0.42);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    flex-shrink: 0;
}

@keyframes inputBarBounceIn {
    0%   { opacity: 0; transform: translateY(18px) scale(0.94); }
    55%  { opacity: 1; transform: translateY(-6px) scale(1.02); }
    75%  { transform: translateY(3px) scale(0.99); }
    90%  { transform: translateY(-2px) scale(1.005); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-input-area.animate #ia-select,
.chat-input-area.animate #user-input {
    animation: inputBarBounceIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-input-area.animate #user-input {
    animation-delay: 80ms;
}

#user-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#user-input:focus { border-color: rgba(142, 45, 226, 0.8); }

#send-btn {
    background: linear-gradient(135deg, #4a00e0, #8e2de2);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.1s, width 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* État étendu (aucun texte saisi) */
#send-btn.expanded {
    width: 138px;
    border-radius: 12px;
    gap: 8px;
    padding: 0 16px;
}

.send-label {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

#send-btn.expanded .send-label {
    max-width: 80px;
    opacity: 1;
}

#send-btn:hover { opacity: 0.9; }
#send-btn:active { transform: scale(0.95); }

/* --- GESTION DES CHATS --- */
.chat-management {
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.action-btn {
    background: linear-gradient(135deg, #4a00e0, #8e2de2);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: opacity 0.3s, transform 0.1s;
}

.action-btn:hover { opacity: 0.9; }
.action-btn:active { transform: scale(0.95); }

.chat-management h3 {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar discrète pour la liste des chats */
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.chat-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #ccc;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Ajoute "..." si le titre est trop long */
    transition: all 0.2s ease;
}

.chat-item:hover { background: rgba(255, 255, 255, 0.1); color: white; }

.chat-item.active {
    background: rgba(142, 45, 226, 0.3);
    border-color: rgba(142, 45, 226, 0.6);
    color: white;
    font-weight: bold;
}

/* --- BLOC THOUGHT (réflexion interne IA) --- */
.thought-block {
    margin-bottom: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.2);
    background: rgba(74, 0, 224, 0.08);
}

.thought-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    color: rgba(196, 181, 253, 0.75);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-align: left;
    transition: color 0.2s, background 0.2s;
    user-select: none;
}

.thought-toggle:hover {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.08);
}

.thought-icon { font-size: 0.85rem; }
.thought-label { flex: 1; }

.thought-chevron {
    font-size: 1rem;
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.thought-toggle[aria-expanded="true"] .thought-chevron {
    transform: rotate(180deg);
}

.thought-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s ease,
                padding 0.35s ease;
}

.thought-body.open {
    max-height: 220px;
    overflow-y: auto;
    opacity: 1;
    padding: 8px 12px 12px;
}

/* Scrollbar de la zone de réflexion */
.thought-body::-webkit-scrollbar { width: 4px; }
.thought-body::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, 0.3); border-radius: 10px; }
.thought-body::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.55); }

.reply-text {
    display: block;
    white-space: pre-wrap;
}

/* --- ANIMATION DE RÉFLEXION --- */
.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

/* On décale l'animation pour chaque point pour créer la vague */
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- USER INFO / LOGOUT --- */

/* Animation défilement des éléments de la sidebar */
@keyframes sidebarItemIn {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}

.sidebar-item {
    opacity: 0;
}

.sidebar.animate .sidebar-item {
    animation: sidebarItemIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sidebar.animate .sidebar-item:nth-child(1) { animation-delay: 0ms; }
.sidebar.animate .sidebar-item:nth-child(2) { animation-delay: 110ms; }
.sidebar.animate .sidebar-item:nth-child(3) { animation-delay: 220ms; }
.sidebar.animate .sidebar-item:nth-child(4) { animation-delay: 330ms; }
.sidebar.animate .sidebar-item:nth-child(5) { animation-delay: 440ms; }

/* Empêche l'opacité 0 une fois l'animation terminée */
.sidebar.animate .sidebar-item { animation-fill-mode: both; }

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(142, 45, 226, 0.15);
    border: 1px solid rgba(142, 45, 226, 0.3);
    border-radius: 10px;
    margin-bottom: 16px;
}

.username-display {
    font-size: 0.9rem;
    font-weight: 600;
    color: #c4b5fd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: rgba(239, 68, 68, 0.6);
    color: rgba(239, 68, 68, 0.9);
}

/* --- OVERLAY D'AUTHENTIFICATION --- */
.auth-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.auth-overlay.hidden { display: none; }

.auth-card {
    background: rgba(10, 10, 20, 0.7);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 44px 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.auth-panel { display: flex; flex-direction: column; gap: 16px; }
.auth-panel.hidden { display: none; }

.auth-logo {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 4px;
}

.auth-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e2e8f0;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    line-height: 1.5;
}

.auth-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.auth-btn {
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-align: center;
}

.auth-btn:active { transform: scale(0.97); }

.auth-btn.primary {
    background: linear-gradient(135deg, #4a00e0, #8e2de2);
    color: white;
    box-shadow: 0 4px 20px rgba(142, 45, 226, 0.35);
}

.auth-btn.primary:hover { opacity: 0.9; }

.auth-btn.secondary {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
}

.auth-btn.secondary:hover { background: rgba(255,255,255,0.12); }

.auth-btn.ghost {
    background: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    padding: 8px;
}

.auth-btn.ghost:hover { color: rgba(255,255,255,0.7); }

.auth-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    width: 100%;
}

.auth-input:focus { border-color: rgba(142, 45, 226, 0.8); }

.auth-error {
    color: #f87171;
    font-size: 0.9rem;
    text-align: center;
}

.auth-error.hidden { display: none; }

.secret-reveal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(74, 0, 224, 0.1);
    border: 1px solid rgba(142, 45, 226, 0.35);
    border-radius: 12px;
    padding: 16px;
}

.secret-reveal.hidden { display: none; }

.secret-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secret-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px 14px;
}

.secret-box code {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 2px;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover { border-color: #a78bfa; color: #a78bfa; }

.secret-warning {
    font-size: 0.85rem;
    color: #fbbf24;
    text-align: center;
}

/* ====================================================
   RESPONSIVE MOBILE (max 700px)
   ==================================================== */

/* Éléments uniquement desktop */
.mobile-topbar { display: none; }
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 700px) {

    body {
        align-items: flex-start;
        background-attachment: scroll;
        height: 100dvh;
        overflow: hidden;
    }

    /* --- APP container plein écran --- */
    .glass-app {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        border-radius: 0;
        padding: 0;
        gap: 0;
        flex-direction: column;
    }

    /* --- SIDEBAR : panneau coulissant par-dessus --- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 80vw;
        max-width: 300px;
        height: 100dvh;
        border-radius: 0 16px 16px 0;
        border-left: none;
        z-index: 200;
        transform: translateX(-110%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 56px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Bouton × pour fermer la sidebar */
    .sidebar-close {
        display: flex;
        position: absolute;
        top: 14px;
        right: 14px;
        background: none;
        border: 1px solid rgba(255,255,255,0.15);
        color: rgba(255,255,255,0.6);
        border-radius: 8px;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .sidebar-close:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

    /* Backdrop sombre quand sidebar ouverte */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 190;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.visible {
        opacity: 1;
        pointer-events: all;
    }

    /* --- BARRE MOBILE EN HAUT --- */
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        background: rgba(20, 18, 35, 0.42);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255,255,255,0.08);
        flex-shrink: 0;
        z-index: 10;
    }

    .mobile-menu-btn {
        background: none;
        border: 1px solid rgba(255,255,255,0.15);
        color: rgba(255,255,255,0.8);
        border-radius: 8px;
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        cursor: pointer;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }

    .mobile-menu-btn:hover { background: rgba(255,255,255,0.08); }

    .mobile-title {
        flex: 1;
        font-size: 1rem;
        font-weight: 700;
        background: linear-gradient(135deg, #c4b5fd, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .ia-select-mobile {
        appearance: none;
        -webkit-appearance: none;
        background: rgba(74, 0, 224, 0.2)
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a78bfa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
            no-repeat right 8px center;
        border: 1px solid rgba(142, 45, 226, 0.5);
        color: #c4b5fd;
        padding: 0 28px 0 10px;
        height: 38px;
        border-radius: 10px;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        outline: none;
        flex-shrink: 0;
    }

    .ia-select-mobile option { background: #1a1a2e; color: white; }

    /* Cacher le select dans la barre d'envoi sur mobile */
    .chat-input-area #ia-select { display: none; }

    /* Désactive l'animation du bouton envoyer sur mobile */
    #send-btn.expanded {
        width: 48px;
        gap: 0;
        padding: 0;
    }
    #send-btn.expanded .send-label { max-width: 0; opacity: 0; }

    /* --- ZONE CHAT plein écran --- */
    .chat-area {
        flex: 1;
        min-height: 0;
        border-radius: 0;
        gap: 0;
    }

    .chat-history {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        padding: 14px 12px;
    }

    .chat-input-area {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 10px;
    }

    /* --- AUTH card plein écran mobile --- */
    .auth-card {
        border-radius: 0;
        width: 100vw;
        height: 100dvh;
        max-width: none;
        padding: 40px 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-shadow: none;
        border: none;
    }

    /* --- Admin btn : intégré dans la sidebar, plus de position fixe --- */
    .admin-panel-btn {
        position: static;
        width: 100%;
        margin-top: auto;
        padding: 12px 14px;
        border-radius: 12px;
        justify-content: flex-start;
        gap: 10px;
        box-shadow: none;
        flex-shrink: 0;
    }

    .admin-panel-btn .admin-label {
        max-width: 200px;
        opacity: 1;
        margin-left: 0;
    }

    /* La sidebar doit être flex-column pour pousser le btn en bas */
    .sidebar {
        display: flex;
        flex-direction: column;
    }

    .sidebar .chat-management {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
}