
.cfy-assistant__panel,
.cfy-assistant__panel * {
    border-radius: 0 !important;
}

.cfy-assistant__panel {
    --cfy-assistant-bg: #ffffff;
    --cfy-assistant-fg: #1f2b3a;
    --cfy-assistant-muted: #55637a;
    --cfy-assistant-row-bg: #eef0f5;
    --cfy-assistant-hover: rgba(244, 189, 14, 0.18);
    position: fixed;
    z-index: 10000;
    width: min(380px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 110px));
    background: var(--cfy-assistant-bg);
    color: var(--cfy-assistant-fg);
    border: 2px solid var(--bs-warning, #f4bd0e);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.dark-mode .cfy-assistant__panel,
[data-bs-theme='dark'] .cfy-assistant__panel {
    --cfy-assistant-bg: #101924;
    --cfy-assistant-fg: #e5e9f2;
    --cfy-assistant-muted: #97a4ba;
    --cfy-assistant-row-bg: #1f2b3a;
}

.cfy-assistant__panel[hidden] { display: none; }

/* ---------- Barre de titre (identique à .cfy-social-panel-title) ---------- */
.cfy-assistant__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #1f2b3a;
    border-bottom: none;
}

.cfy-assistant__header-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #101924;
    border: 2px solid var(--bs-warning, #f4bd0e);
    color: var(--bs-warning, #f4bd0e);
}

.cfy-assistant__header-avatar svg { width: 16px; height: 16px; }

.cfy-assistant__header-title {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex: 1;
    color: #ffffff;
}

.cfy-assistant__voice-toggle {
    display: flex;
    gap: 4px;
    background: transparent;
    padding: 0;
}

/* Permutation marine<->or au survol/actif -- même recette que .cfy-social-btn:hover /
   .cfy-social-group[aria-expanded='true']. */
.cfy-assistant__voice-btn {
    border: 2px solid var(--bs-warning, #f4bd0e);
    background: #1f2b3a;
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-warning, #f4bd0e);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cfy-assistant__voice-btn svg { width: 14px; height: 14px; }

.cfy-assistant__voice-btn:hover {
    background: var(--bs-warning, #f4bd0e);
    color: #1f2b3a;
}

.cfy-assistant__voice-btn[aria-pressed='true'] {
    background: var(--bs-warning, #f4bd0e);
    color: #1f2b3a;
}

.cfy-assistant__close {
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.cfy-assistant__close:hover { color: var(--bs-warning, #f4bd0e); }

/* ---------- Corps (fond propre au composant, jamais --bs-body-*) ---------- */
.cfy-assistant__messages {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--cfy-assistant-bg);
}

/* ---------- Messages : chaque réponse bot = une "ligne" façon panneau notifications
   (icône carrée marine + contenu), plutôt qu'une simple bulle colorée. ---------- */
.cfy-assistant__msg {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    word-break: break-word;
}

.cfy-assistant__msg--bot {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    padding: 8px;
    background: var(--cfy-assistant-row-bg);
}

.cfy-assistant__msg-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f2b3a;
    color: #ffffff;
}

.cfy-assistant__msg-icon svg { width: 16px; height: 16px; }

.cfy-assistant__msg-body {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--cfy-assistant-fg);
}

.cfy-assistant__msg--user {
    align-self: flex-end;
    max-width: 85%;
    padding: 8px 12px;
    background: var(--cfy-assistant-row-bg);
    color: var(--cfy-assistant-fg);
    border-inline-end: 2px solid var(--bs-warning, #f4bd0e);
}

.cfy-assistant__msg--greeting {
    align-self: center;
    max-width: 100%;
    padding: 8px 14px;
    background: #1f2b3a;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-align: center;
}

.cfy-assistant__msg--greeting-done {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

.cfy-assistant__msg-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* ---------- Actions (Écouter / YouTube) : pastilles bordées or, survol = teinte or --
   valeurs identiques à .cfy-social-panel-row:hover. ---------- */
.cfy-assistant__listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--bs-warning, #f4bd0e);
    background: transparent;
    color: var(--cfy-assistant-fg);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cfy-assistant__listen-btn:hover {
    background: var(--cfy-assistant-hover);
}

.cfy-assistant__listen-btn[data-playing='true'] {
    background: var(--bs-warning, #f4bd0e);
    color: #1f2b3a;
}

.cfy-assistant__youtube-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 1px solid var(--bs-warning, #f4bd0e);
    color: var(--cfy-assistant-fg);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cfy-assistant__youtube-chip:hover {
    background: rgba(232, 83, 71, 0.14);
    border-color: #e85347;
    color: #e85347;
}

/* ---------- Formulaire ---------- */
.cfy-assistant__form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--cfy-assistant-bg);
    border-top: 2px solid var(--bs-warning, #f4bd0e);
}

.cfy-assistant__mic-btn {
    border: 2px solid var(--cfy-assistant-muted);
    background: transparent;
    color: var(--cfy-assistant-muted);
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfy-assistant__mic-btn svg { width: 16px; height: 16px; }

.cfy-assistant__input {
    flex: 1;
    min-width: 0;
    border: 2px solid var(--cfy-assistant-row-bg);
    background: var(--cfy-assistant-row-bg);
    color: var(--cfy-assistant-fg);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 400;
    box-sizing: border-box;
}

.cfy-assistant__input:focus {
    outline: none;
    border-color: var(--bs-warning, #f4bd0e);
    background: var(--cfy-assistant-bg);
}

/* Bouton Envoyer : recette exacte .cfy-social-group (marine + bordure or + icône or, permutation
   marine<->or au survol) -- la signature visuelle la plus reconnaissable du panneau notifications. */
.cfy-assistant__send-btn {
    border: 2px solid var(--bs-warning, #f4bd0e);
    background: #1f2b3a;
    color: var(--bs-warning, #f4bd0e);
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cfy-assistant__send-btn svg { width: 16px; height: 16px; }

.cfy-assistant__send-btn:hover {
    background: var(--bs-warning, #f4bd0e);
    color: #1f2b3a;
}

/* Desktop : un peu plus de place, mêmes proportions. */
@media (min-width: 992px) {
    .cfy-assistant__panel {
        width: min(400px, calc(100vw - 48px));
        max-height: min(600px, calc(100vh - 140px));
    }

    .cfy-assistant__header-avatar,
    .cfy-assistant__msg-icon { width: 32px; height: 32px; }
    .cfy-assistant__header-avatar svg,
    .cfy-assistant__msg-icon svg { width: 18px; height: 18px; }
    .cfy-assistant__header-title { font-size: 0.85rem; }
    .cfy-assistant__msg { font-size: 15px; }
    .cfy-assistant__input { font-size: 15px; }
}

@media (max-width: 480px) {
    .cfy-assistant__panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 96px);
    }
}
