/* ============================================================
   Conseiller IA « Atlas » — widget de chat flottant
   Feuille de style dédiée (namespace .conseiller-*)
   Palette : primaire #3a4a9e · foncé #2C387E · accent #d92a2e
   ============================================================ */

.conseiller-present .retour-haut {
    /* Laisse la place au bouton du conseiller (bas-droite). */
    bottom: 5.4rem;
}

/* Repli si Tailwind n'est pas chargé (accessibilité). */
.conseiller-saisie .sr-only,
.conseiller .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Bulle de lancement ---------- */
.conseiller-bulle {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 70;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #3a4a9e, #2C387E);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 14px 30px -10px rgba(44, 56, 126, 0.6);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.conseiller-bulle:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 18px 36px -12px rgba(44, 56, 126, 0.7); }
.conseiller-bulle:focus-visible { outline: 3px solid #f6b9ba; outline-offset: 2px; }
.conseiller-bulle svg { width: 28px; height: 28px; }
.conseiller-bulle .conseiller-bulle-fermer { display: none; }
.conseiller-ouvert .conseiller-bulle .conseiller-bulle-chat { display: none; }
.conseiller-ouvert .conseiller-bulle .conseiller-bulle-fermer { display: block; }

/* Halo lumineux pulsant sur la bulle pour attirer l'attention des nouveaux visiteurs */
.conseiller-bulle.attention {
    animation: conseiller-aura-pulse 2.2s ease-in-out infinite;
}
@keyframes conseiller-aura-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(58, 74, 158, 0.7), 0 14px 30px -10px rgba(44, 56, 126, 0.6);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(58, 74, 158, 0), 0 14px 30px -10px rgba(44, 56, 126, 0.6);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(58, 74, 158, 0), 0 14px 30px -10px rgba(44, 56, 126, 0.6);
    }
}
.conseiller-bulle.wiggle {
    animation: conseiller-wiggle 0.7s ease-in-out;
}
@keyframes conseiller-wiggle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    20%      { transform: scale(1.08) rotate(-8deg); }
    40%      { transform: scale(1.08) rotate(8deg); }
    60%      { transform: scale(1.04) rotate(-4deg); }
    80%      { transform: scale(1.02) rotate(4deg); }
}

/* ---------- Bulle d'accroche (Salutation "Bonjour") ---------- */
.conseiller-accroche {
    position: fixed;
    right: calc(1.25rem + 72px);
    bottom: 1.4rem;
    z-index: 69;
    display: flex;
    align-items: center;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    box-shadow: 0 16px 36px -10px rgba(35, 45, 92, 0.22), 0 0 0 1px rgba(58, 74, 158, 0.06);
    padding: 6px;
    transform-origin: bottom right;
    animation: conseiller-accroche-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease;
}
.conseiller-accroche:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px -12px rgba(35, 45, 92, 0.3);
}
.conseiller-accroche::after {
    content: '';
    position: absolute;
    right: -7px;
    bottom: 20px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    transform: rotate(45deg);
}
.conseiller-accroche-corps {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.conseiller-accroche-icone {
    font-size: 24px;
    line-height: 1;
    flex: none;
    animation: conseiller-salut 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}
@keyframes conseiller-salut {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(14deg); }
    30%      { transform: rotate(-10deg); }
    45%      { transform: rotate(12deg); }
    60%      { transform: rotate(-4deg); }
    75%      { transform: rotate(8deg); }
}
.conseiller-accroche-texte {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.conseiller-accroche-titre {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
}
.conseiller-accroche-soustitre {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.35;
}
.conseiller-accroche-fermer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    flex: none;
    margin-right: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}
.conseiller-accroche-fermer:hover {
    background: #fee2e2;
    color: #ef4444;
}
@keyframes conseiller-accroche-pop {
    0%   { opacity: 0; transform: scale(0.85) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.conseiller-ouvert .conseiller-accroche {
    display: none !important;
}

.conseiller-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #d92a2e;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 0 0 3px #fff;
    animation: conseiller-pulse 2.4s ease-in-out infinite;
}
.conseiller-badge.visible { display: inline-flex; }
@keyframes conseiller-pulse {
    0%, 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 0 rgba(217, 42, 46, 0.5); }
    50%      { box-shadow: 0 0 0 3px #fff, 0 0 0 10px rgba(217, 42, 46, 0); }
}

/* ---------- Panneau ---------- */
.conseiller-panneau {
    position: fixed;
    right: 1.25rem;
    bottom: 6.2rem;
    z-index: 70;
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 2.5rem));
    height: min(620px, calc(100dvh - 8.5rem));
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(35, 45, 92, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
.conseiller-ouvert .conseiller-panneau {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* ---------- En-tête ---------- */
.conseiller-entete {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #3a4a9e, #2C387E);
    color: #fff;
}
.conseiller-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 800;
}
.conseiller-entete-titre { flex: 1; min-width: 0; }
.conseiller-entete-titre strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.conseiller-entete-titre span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c3cbea; }
.conseiller-point { width: 7px; height: 7px; border-radius: 9999px; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }
.conseiller-entete-btn {
    width: 34px;
    height: 34px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}
.conseiller-entete-btn:hover { background: rgba(255, 255, 255, 0.25); }
.conseiller-entete-btn svg { width: 17px; height: 17px; }

/* ---------- Fil de discussion ---------- */
.conseiller-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    scrollbar-width: thin;
}
.conseiller-messages::-webkit-scrollbar { width: 8px; }
.conseiller-messages::-webkit-scrollbar-thumb { background: #d7dbe7; border-radius: 9999px; }

.conseiller-ligne { display: flex; }
.conseiller-ligne.utilisateur { justify-content: flex-end; }
.conseiller-ligne.assistant { justify-content: flex-start; }

.conseiller-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 1rem;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.conseiller-ligne.utilisateur .conseiller-msg {
    background: #3a4a9e;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.conseiller-ligne.assistant .conseiller-msg {
    background: #fff;
    color: #1f2937;
    border: 1px solid #e9edf5;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px -3px rgba(35, 45, 92, 0.12);
}
.conseiller-msg a { color: #d92a2e; font-weight: 700; text-decoration: underline; }
.conseiller-msg strong { font-weight: 800; }
.conseiller-msg ul { margin: 6px 0 2px; padding-left: 18px; }
.conseiller-msg li { margin-bottom: 2px; }

/* Indicateur « en train d'écrire » */
.conseiller-frappe { display: inline-flex; gap: 4px; padding: 4px 2px; }
.conseiller-frappe span {
    width: 7px; height: 7px;
    border-radius: 9999px;
    background: #9aa4c0;
    animation: conseiller-frappe 1.2s ease-in-out infinite;
}
.conseiller-frappe span:nth-child(2) { animation-delay: 0.15s; }
.conseiller-frappe span:nth-child(3) { animation-delay: 0.3s; }
@keyframes conseiller-frappe {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Cartes produit (Design Moderne & Épuré) ---------- */
.conseiller-produits {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.conseiller-carte {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
    text-decoration: none !important;
}

.conseiller-carte:hover {
    border-color: #cbd5e1;
    background: #fafcff;
    box-shadow: 0 8px 18px -4px rgba(15, 23, 42, 0.09), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    transform: translateY(-1px);
}

/* Annulation stricte de tout soulignement hérité pour la carte */
.conseiller-carte,
.conseiller-carte *,
.conseiller-msg .conseiller-carte,
.conseiller-msg .conseiller-carte a,
.conseiller-msg .conseiller-carte span {
    text-decoration: none !important;
}

.conseiller-carte-img-wrap {
    width: 58px;
    height: 58px;
    flex: none;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3px;
    text-decoration: none !important;
}

.conseiller-carte-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.conseiller-carte:hover .conseiller-carte-img-wrap img {
    transform: scale(1.06);
}

.conseiller-carte-infos {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.conseiller-carte-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1;
    margin-bottom: 1px;
}

.conseiller-carte-role {
    display: inline-flex;
    align-items: center;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
    padding: 2px 6px;
    line-height: 1.1;
}

.conseiller-carte-marque {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.1;
    text-decoration: none !important;
}

.conseiller-msg .conseiller-carte .conseiller-carte-nom {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a !important;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.conseiller-msg .conseiller-carte:hover .conseiller-carte-nom,
.conseiller-msg .conseiller-carte .conseiller-carte-nom:hover {
    color: #d92a2e !important;
    text-decoration: none !important;
}

.conseiller-carte-bas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.conseiller-carte-prix {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    letter-spacing: -0.01em;
}

/* Bouton Panier ICÔNE : compact, moderne & tactile */
.conseiller-carte-btn-panier {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid #dcfce7;
    background: #f0fdf4;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    flex: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.08);
}

.conseiller-carte-btn-panier svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    transition: transform 0.18s ease;
}

.conseiller-carte-btn-panier:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 4px 10px -1px rgba(22, 163, 74, 0.35);
}

.conseiller-carte-btn-panier:active {
    transform: scale(0.95);
}

.conseiller-carte-btn-panier.succes {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
    transform: scale(1.06);
    box-shadow: 0 4px 12px -2px rgba(22, 163, 74, 0.4);
}

.conseiller-carte-btn-panier.erreur {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.conseiller-carte-btn-panier:disabled {
    cursor: wait;
    opacity: 0.85;
}

.conseiller-carte-dispo.rupture {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 3px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Spinner pour le bouton d'ajout rapide */
.conseiller-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(22, 163, 74, 0.25);
    border-top-color: #16a34a;
    border-radius: 9999px;
    animation: conseiller-spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes conseiller-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Blocs d'actions interactives (Panier & Navigation) ---------- */
.conseiller-action-bloc {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 0.85rem;
    font-size: 13px;
    animation: conseiller-fade-in 0.25s ease;
}
@keyframes conseiller-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Bloc d'action : Panier */
.conseiller-action-panier {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.conseiller-action-panier-haut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.conseiller-action-panier-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 800;
    color: #15803d;
    background: #dcfce7;
    padding: 3px 8px;
    border-radius: 9999px;
}
.conseiller-action-panier-total {
    font-size: 12px;
    font-weight: 700;
    color: #166534;
}

/* Boutons d'action */
.conseiller-action-boutons {
    display: flex;
    gap: 6px;
}
.conseiller-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 0.65rem;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.18s ease;
    flex: 1;
    text-align: center;
    box-sizing: border-box;
}
.conseiller-action-btn.secondaire {
    background: #fff;
    color: #15803d;
    border: 1px solid #86efac;
}
.conseiller-action-btn.secondaire:hover {
    background: #ecfdf5;
    border-color: #4ade80;
}
.conseiller-action-btn.primaire {
    background: #15803d;
    color: #fff !important;
    border: 1px solid #15803d;
    box-shadow: 0 4px 10px -2px rgba(22, 163, 74, 0.35);
}
.conseiller-action-btn.primaire:hover {
    background: #166534;
    border-color: #166534;
}

/* Bloc d'action : Navigation / Page */
.conseiller-action-nav {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px;
}
.conseiller-action-nav .conseiller-action-btn.primaire {
    background: #3a4a9e;
    color: #fff !important;
    border: 1px solid #3a4a9e;
    box-shadow: 0 4px 10px -2px rgba(58, 74, 158, 0.35);
}
.conseiller-action-nav .conseiller-action-btn.primaire:hover {
    background: #1a2253;
    border-color: #1a2253;
}
.conseiller-action-btn.pleine-largeur {
    width: 100%;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 12.5px;
}

/* Bloc d'action : Vider panier */
.conseiller-action-vider {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}
.conseiller-action-vider-icone {
    font-size: 15px;
}

/* Bloc d'action : Suivi de commande */
.conseiller-action-suivi {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.conseiller-action-suivi-haut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.conseiller-action-suivi-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 800;
    color: #2b3a7e;
    background: #e4e8fb;
    padding: 3px 8px;
    border-radius: 9999px;
}
.conseiller-action-suivi-statut {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #334155;
}
.conseiller-action-suivi-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #94a3b8;
    flex: 0 0 auto;
}
.conseiller-action-suivi-statut.st-nouvelle       { background: #fef3c7; color: #92400e; }
.conseiller-action-suivi-statut.st-nouvelle .conseiller-action-suivi-dot { background: #f59e0b; }
.conseiller-action-suivi-statut.st-en_preparation { background: #dbeafe; color: #1e40af; }
.conseiller-action-suivi-statut.st-en_preparation .conseiller-action-suivi-dot { background: #3b82f6; }
.conseiller-action-suivi-statut.st-expediee       { background: #ede9fe; color: #6d28d9; }
.conseiller-action-suivi-statut.st-expediee .conseiller-action-suivi-dot { background: #8b5cf6; }
.conseiller-action-suivi-statut.st-livree         { background: #dcfce7; color: #166534; }
.conseiller-action-suivi-statut.st-livree .conseiller-action-suivi-dot { background: #22c55e; }
.conseiller-action-suivi-statut.st-annulee        { background: #fee2e2; color: #991b1b; }
.conseiller-action-suivi-statut.st-annulee .conseiller-action-suivi-dot { background: #ef4444; }
.conseiller-action-suivi-infos {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.conseiller-action-suivi-ligne {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    line-height: 1.35;
}
.conseiller-action-suivi-cle {
    color: #64748b;
    font-weight: 600;
    flex: 0 0 auto;
}
.conseiller-action-suivi-val {
    color: #0f172a;
    font-weight: 700;
    text-align: right;
}
.conseiller-action-suivi-produits {
    margin: 8px 0 0;
    padding: 8px 10px 0;
    border-top: 1px dashed #cbd5e1;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.conseiller-action-suivi-produits li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11.5px;
}
.conseiller-action-suivi-produit {
    color: #334155;
}
.conseiller-action-suivi-prix {
    color: #0f172a;
    font-weight: 700;
    flex: 0 0 auto;
}

/* ---------- Suggestions rapides au démarrage ---------- */
.conseiller-suggestions-bloc {
    margin: 6px 0 10px;
    padding: 0 2px;
    animation: conseiller-fade-in 0.25s ease;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.conseiller-suggestions-titre {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.conseiller-suggestions-grille {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.conseiller-suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(35, 45, 92, 0.05);
}
.conseiller-suggestion-chip:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(22, 163, 74, 0.2);
}
.conseiller-suggestion-chip:active {
    transform: translateY(0);
}
.conseiller-suggestion-icone {
    font-size: 13px;
    line-height: 1;
}
.conseiller-suggestion-texte {
    line-height: 1.25;
}

@media (max-width: 639px) {
    .conseiller-suggestions-grille {
        gap: 6px;
    }
    .conseiller-suggestion-chip {
        padding: 8px 12px;
        font-size: 12.5px;
    }
}

/* ---------- Saisie ---------- */
.conseiller-saisie {
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    padding: 10px 14px 10px;
    position: relative;
    z-index: 2;
}

/* Capsule unifiée de saisie */
.conseiller-form {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 26px;
    padding: 5px 6px 5px 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}
.conseiller-form:focus-within {
    background: #ffffff;
    border-color: #d92a2e;
    box-shadow: 0 0 0 3px rgba(217, 42, 46, 0.12), 0 2px 8px rgba(15, 23, 42, 0.05);
}

.conseiller-champ {
    flex: 1;
    min-width: 0;
    min-height: 24px;
    max-height: 120px;
    resize: none;
    padding: 7px 4px 7px 0;
    border: none;
    border-radius: 0;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    color: #0f172a;
    background: transparent;
    overflow-y: hidden;
    scrollbar-width: thin;
    transition: none;
    box-sizing: border-box;
}
.conseiller-champ:focus {
    outline: none;
    border: none;
    background: transparent;
    box-shadow: none;
}
.conseiller-champ::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Groupe d'actions micro & envoi */
.conseiller-actions-saisie {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-bottom: 1px;
}

/* Bouton micro vocal */
.conseiller-micro {
    width: 34px;
    height: 34px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.conseiller-micro svg {
    width: 19px;
    height: 19px;
}
.conseiller-micro:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.05);
}
.conseiller-micro:active {
    transform: scale(0.95);
}
.conseiller-micro.enregistrement {
    background: #ef4444 !important;
    color: #ffffff !important;
    animation: conseiller-pulse-micro 1.2s infinite ease-in-out;
}
@keyframes conseiller-pulse-micro {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Bouton envoyer */
.conseiller-envoyer {
    width: 34px;
    height: 34px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #e11d48 0%, #d92a2e 50%, #b91c1c 100%);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(217, 42, 46, 0.28);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.conseiller-envoyer svg {
    width: 17px;
    height: 17px;
    margin-left: 2px;
}
.conseiller-envoyer:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 10px rgba(217, 42, 46, 0.38);
    filter: brightness(1.06);
}
.conseiller-envoyer:active {
    transform: translateY(0) scale(0.96);
}
.conseiller-envoyer:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* Barre d'enregistrement audio en cours */
.conseiller-enregistrement-barre {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px 8px 6px 14px;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border: 1.5px solid #fecaca;
    border-radius: 26px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
    animation: conseiller-fade-in 0.2s ease;
    box-sizing: border-box;
}
.conseiller-enregistrement-point {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
    animation: conseiller-blink 1s infinite;
}
@keyframes conseiller-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}
.conseiller-enregistrement-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
    letter-spacing: -0.1px;
}
.conseiller-enregistrement-chrono {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #b91c1c;
    background: rgba(254, 202, 202, 0.45);
    padding: 3px 8px;
    border-radius: 12px;
}
.conseiller-vocal-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}
.conseiller-vocal-btn.annuler {
    background: #fee2e2;
    color: #991b1b;
}
.conseiller-vocal-btn.annuler:hover {
    background: #fca5a5;
    transform: scale(1.05);
}
.conseiller-vocal-btn.valider {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}
.conseiller-vocal-btn.valider:hover {
    background: #15803d;
    transform: scale(1.05);
}

/* Bouton lecture vocale sur les bulles de l'assistant */
.conseiller-voix-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.conseiller-voix-btn:hover {
    background: #e5e7eb;
    color: #111827;
}
.conseiller-voix-btn.en-lecture {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    animation: conseiller-pulse-voice 1.4s infinite;
}
@keyframes conseiller-pulse-voice {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.conseiller-mention {
    margin: 8px auto 0;
    text-align: center;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #94a3b8;
    letter-spacing: 0.1px;
}

/* ---------- Mobile & Écrans tactiles (< 640px) ---------- */
@media (max-width: 639px) {
    /* Bulle d'accroche au-dessus de la bulle pour ne pas déborder de l'écran */
    .conseiller-accroche {
        right: max(1rem, env(safe-area-inset-right, 1rem));
        bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 2rem);
        border-radius: 1rem;
    }
    .conseiller-accroche::after {
        display: none;
    }

    /* Le panneau reste une fenêtre flottante compacte sur mobile (pas de plein écran) */
    .conseiller-panneau {
        right: 0.75rem;
        left: auto;
        top: auto;
        bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
        width: min(390px, calc(100vw - 1.5rem));
        height: min(600px, calc(100dvh - 11rem));
        border-radius: 1.25rem;
        border: 1px solid #e5e7eb;
        box-shadow: 0 24px 60px -20px rgba(35, 45, 92, 0.5);
        z-index: 70;
    }

    .conseiller-bulle {
        width: 56px;
        height: 56px;
        right: max(1rem, env(safe-area-inset-right, 1rem));
        bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
        z-index: 9998;
    }

    /* En-tête mobile avec encoche (notch) et boutons tactiles confortables */
    .conseiller-entete {
        padding-top: max(12px, env(safe-area-inset-top, 12px));
        padding-left: 14px;
        padding-right: 14px;
        padding-bottom: 12px;
    }
    .conseiller-entete-btn {
        width: 40px;
        height: 40px;
    }

    /* Zone de saisie avec safe area pour iPhone (barre d'accueil) */
    .conseiller-saisie {
        padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
        padding-left: 12px;
        padding-right: 12px;
    }
    /* CRITIQUE : font-size 16px empêche le zoom forcé indésirable d'iOS Safari */
    .conseiller-champ {
        font-size: 16px;
        min-width: 0;
    }
    .conseiller-actions-saisie {
        display: flex !important;
        flex-shrink: 0;
    }
    .conseiller-micro {
        display: inline-flex !important;
        flex-shrink: 0;
    }
    .conseiller-envoyer {
        flex-shrink: 0;
    }
    .conseiller-msg {
        max-width: 90%;
    }
}

/* Accessibilité : réduire les animations */
@media (prefers-reduced-motion: reduce) {
    .conseiller-panneau,
    .conseiller-bulle,
    .conseiller-badge,
    .conseiller-frappe span { animation: none !important; transition: none !important; }
}


/* ---------- Curseur de frappe (réponses progressives de l'assistant) ---------- */
.conseiller-curseur {
    display: inline-block;
    width: 2px;
    height: 1.15em;
    margin-left: 2px;
    vertical-align: text-bottom;
    border-radius: 1px;
    background: currentColor;
    animation: conseiller-curseur-clignote 0.9s steps(1) infinite;
}

@keyframes conseiller-curseur-clignote {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.15; }
}
