/* Assistante publique du site (Léa par défaut) */
.lea-sprite-def {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.lea-widget-root {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9000;
    font-family: system-ui, -apple-system, sans-serif;
}

.lea-bust {
    width: 100%;
    height: 100%;
    display: block;
}

.lea-fab {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #fff 0%, #f7f4ef 100%);
    cursor: pointer;
    box-shadow:
        0 8px 28px rgba(168, 144, 95, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 5px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lea-fab:hover {
    transform: scale(1.04);
    box-shadow:
        0 12px 32px rgba(168, 144, 95, 0.42),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.lea-panel {
    position: absolute;
    bottom: calc(100% + 0.85rem);
    right: 0;
    width: min(400px, calc(100vw - 2rem));
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.lea-panel:not(.lea-panel--closed) {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lea-panel-shell {
    display: flex;
    flex-direction: column;
    max-height: min(620px, calc(100dvh - 120px));
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 28px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.14),
        0 8px 24px rgba(168, 144, 95, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
}

.lea-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
    background: linear-gradient(135deg, rgba(168, 144, 95, 0.12) 0%, rgba(138, 144, 112, 0.08) 100%);
    border-bottom: 1px solid rgba(168, 144, 95, 0.15);
}

.lea-hero-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff, #f5f0e8);
    box-shadow:
        0 4px 16px rgba(168, 144, 95, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.lea-hero-text {
    flex: 1;
    min-width: 0;
}

.lea-hero-name {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c2824;
    letter-spacing: -0.02em;
}

.lea-hero-status {
    display: block;
    font-size: 0.78rem;
    color: #8a9070;
    margin-top: 2px;
}

.lea-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #555;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.lea-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.lea-consent {
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    color: #666;
    background: rgba(255, 248, 230, 0.55);
    border-bottom: 1px solid rgba(168, 144, 95, 0.1);
    line-height: 1.4;
}

.lea-consent label {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    cursor: pointer;
}

.lea-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 180px;
    max-height: 280px;
    scroll-behavior: smooth;
}

.lea-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 100%;
}

.lea-row--user {
    justify-content: flex-end;
}

.lea-row--bot {
    justify-content: flex-start;
}

.lea-msg-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff, #f8f5f0);
    box-shadow: 0 2px 8px rgba(168, 144, 95, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    overflow: hidden;
}

.lea-bubble {
    max-width: 82%;
    padding: 11px 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    border-radius: 20px;
    word-wrap: break-word;
}

.lea-bubble--user {
    background: linear-gradient(135deg, #a8905f 0%, #8a9070 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(168, 144, 95, 0.3);
}

.lea-bubble--bot {
    background: rgba(255, 255, 255, 0.95);
    color: #2c2824;
    border: 1px solid rgba(168, 144, 95, 0.12);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lea-bubble--typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    min-width: 56px;
}

.lea-bubble--typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a8905f;
    opacity: 0.5;
    animation: lea-dot 1.2s infinite ease-in-out;
}

.lea-bubble--typing span:nth-child(2) { animation-delay: 0.15s; }
.lea-bubble--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes lea-dot {
    0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

.lea-cta {
    padding: 0 1rem 0.5rem;
}

.lea-cta a {
    display: block;
    text-align: center;
    padding: 0.55rem;
    border-radius: 10px;
    background: #faf6ef;
    color: #6b5c45;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #e8dcc8;
}

.lea-cta a:hover {
    background: #f0e8d8;
}

.lea-form {
    padding: 0.75rem 0.85rem 0.85rem;
    border-top: 1px solid rgba(168, 144, 95, 0.12);
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
}

.lea-form input {
    flex: 1;
    border: 1px solid rgba(168, 144, 95, 0.2);
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    font: inherit;
    font-size: 0.88rem;
    background: #fff;
}

.lea-send {
    border: none;
    background: linear-gradient(135deg, #a8905f, #8a9070);
    color: #fff;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(168, 144, 95, 0.35);
}

.lea-send:hover {
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .lea-widget-root {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .lea-fab {
        width: 54px;
        height: 54px;
    }

    .lea-panel {
        width: calc(100vw - 1.5rem);
    }

    .lea-panel-shell {
        border-radius: 24px;
    }
}
