/*
 * 1218 — discussion.css
 * Styles exclusivement liés au composant Discussion.
 * Nettoyé lors de l'extraction depuis style.css.
 */

.conversation { overflow: auto; padding: 32px clamp(22px, 5vw, 64px); scroll-behavior: smooth; }


    .message-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 28px; }

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


    .mini-avatar {
      width: 64px;
      height: 64px;
      flex: 0 0 auto;
      border-radius: 50%;
      background-image: url('/assets/images/sophie-avatar-panel.png');
      /* Cadre plus large sur le visage : yeux, nez, bouche et menton visibles. */
      background-size: 190%;
      background-position: 50% 18%;
      border: 3px solid #d8e4f8;
    }


    .message-wrap { max-width: min(590px, 76%); }


    .bubble {
      padding: 22px 26px;
      border-radius: 18px;
      font-size: clamp(17px, 2vw, 21px);
      line-height: 1.55;
      box-shadow: 0 8px 22px rgba(36, 52, 80, .09);
      white-space: pre-line;
    }


    .assistant .bubble { background: #fff; border: 1px solid #e8ecf2; border-top-left-radius: 5px; }

    .user .bubble { background: var(--bleu-clair); border-top-right-radius: 5px; }

    .bubble strong { color: var(--bleu); }

    
    .time { margin-top: 7px; color: #7b8799; font-size: 14px; }

    .user .time { text-align: right; }


    .typing-dots { display: inline-flex; gap: 5px; align-items: center; min-width: 42px; }

    .typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: #8190a5; animation: dot 1s infinite ease-in-out; }

    .typing-dots span:nth-child(2) { animation-delay: .15s; }

    .typing-dots span:nth-child(3) { animation-delay: .3s; }


    .choices {
      width: min(540px, calc(100% - 62px));
      margin: -4px 0 28px 62px;
      display: grid;
      gap: 12px;
    }


    .choice {
      width: 100%;
      min-height: 68px;
      padding: 14px 18px;
      display: grid;
      grid-template-columns: 42px 1fr 26px;
      align-items: center;
      gap: 12px;
      border: 1px solid #dce3ee;
      border-radius: 14px;
      background: #fff;
      color: var(--texte);
      box-shadow: 0 5px 16px rgba(30, 45, 70, .06);
      font-weight: 700;
      text-align: left;
      cursor: pointer;
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    }


    .choice:hover { transform: translateY(-2px); border-color: #9ebcf2; box-shadow: 0 10px 25px rgba(35, 80, 160, .12); }

    .choice:disabled { cursor: default; opacity: .55; transform: none; }

    .choice-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bleu); color: var(--bleu); font-size: 18px; }


    .composer {
      padding: 22px 28px;
      background: #fff;
      border-top: 1px solid #e7ebf2;
      display: grid;
      grid-template-columns: auto 1fr 62px;
      gap: 12px;
      align-items: center;
    }


    .micro {
      width: 52px;
      height: 52px;
      border: 1px solid #d8e0eb;
      border-radius: 50%;
      background: #fff;
      cursor: pointer;
      font-size: 21px;
    }


    .composer input,
    .composer textarea {
      width: 100%;
      min-height: 58px;
      padding: 0 20px;
      border: 1px solid #d8e0eb;
      border-radius: 16px;
      font-size: 17px;
      outline: none;
    }


    .composer input:focus,
    .composer textarea:focus { border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(33,102,216,.1); }


    .composer textarea {
      min-height: 120px;
      padding: 16px 20px;
      resize: vertical;
      line-height: 1.45;
    }


    .composer .champ-cache { display: none; }

    .composer.mode-textarea { align-items: end; }


    .send {
      width: 62px;
      height: 62px;
      border: 0;
      border-radius: 50%;
      background: var(--bleu);
      color: #fff;
      font-size: 25px;
      cursor: pointer;
      box-shadow: 0 10px 24px rgba(33,102,216,.28);
    }


    .send:disabled, .micro:disabled { opacity: .45; cursor: default; }


    @media (max-width: 560px) {
      .assistant-panel { min-height: 360px; padding: 20px; }
      .assistant-card { margin-bottom: 20px; padding: 15px; grid-template-columns: 38px 1fr; }
      .assistant-card strong { font-size: 16px; }
      .assistant-card span { font-size: 14px; }
      .assistant-actions { gap: 28px; }
      .round-action { font-size: 13px; }
      .topbar { min-height: 88px; padding: 16px 18px; }
      .logo { font-size: 38px; }
      .brand h1 { font-size: 19px; }
      .brand p { font-size: 13px; }
      .top-actions button:first-child { display: none; }
      .conversation { padding: 22px 14px; }
      .mini-avatar { width: 52px; height: 52px; background-size: 190%; background-position: 50% 18%; }
      .message-row { gap: 9px; }
      .message-wrap { max-width: calc(100% - 61px); }
      .bubble { padding: 16px 17px; font-size: 16px; }
      .choices { width: calc(100% - 61px); margin-left: 61px; }
      .choice { min-height: 60px; font-size: 15px; }
      .composer { padding: 14px; grid-template-columns: 46px 1fr 54px; gap: 8px; }
      .micro { width: 46px; height: 46px; }
      .send { width: 54px; height: 54px; }
    }

   
       @media (min-width: 769px) {

    body {
        padding-top: 2cm !important;
    }

    html, body {
        height: 100%;
        overflow: hidden;
    }

    .app {
        height: calc(100dvh - 10px) !important;
        min-height: calc(100dvh - 10px) !important;
        overflow: hidden;
    }

      .assistant-panel {
        height: 100vh;
        position: sticky;
        top: 0;
        overflow: hidden;
        
      }

      .chat-panel {
        height: 100vh;
        min-height: 0;
        overflow: hidden;
      }

      .conversation {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
      }
    }


    @media (max-width: 768px) {
      html, body {
        height: auto;
        overflow: auto;
      }

      .app,
      .assistant-panel,
      .chat-panel {
        height: auto;
        overflow: visible;
      }

      .assistant-panel {
        position: relative;
        top: auto;
      }

      .conversation {
        overflow-y: visible;
      }
    }


    .message-row.user .edit-answer {
      display: flex !important;
      align-items: center;
      justify-content: center;
      flex: 0 0 38px;
      width: 38px;
      height: 38px;
      margin-top: 8px;
      border: 2px solid #2f5f9f;
      background: #ffffff;
      color: #2f5f9f;
      cursor: pointer;
      font-size: 23px;
      font-weight: 700;
      line-height: 1;
      padding: 0;
      border-radius: 50%;
      opacity: 1 !important;
      visibility: visible !important;
      box-shadow: 0 3px 10px rgba(36, 52, 80, .18);
      z-index: 5;
    }

    .message-row.user .edit-answer:hover { transform: scale(1.06); }

    }


    /* V75 : après démarrage sur GSM, la photo se réduit pour faire remonter la conversation. */
    @media (max-width: 768px) {
     .assistant-panel.conversation-active {
    height: 50svh !important;
    min-height: 320px !important;
    transition:
        height .45s ease,
        min-height .45s ease;
}

      .assistant-panel.conversation-active .assistant-photo {
        object-position: center 8%;
      }

      .assistant-panel.conversation-active .start-overlay {
        display: none !important;
      }

      .assistant-panel.conversation-active + .chat-panel {
        margin-top: 0;
      }
    }

.message-erreur-date {
    display: none;
    margin: 5px 0 0;
    color: #b42318;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}


.message-erreur-date.visible {
    display: block;
}


.piece-jointe-bloc {
    width: 100%;
    padding: 18px;
    border: 1px solid #dce3ee;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(30, 45, 70, .08);
}


.piece-jointe-input {
    display: none;
}


.piece-jointe-entete {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}


.piece-jointe-entete strong {
    display: block;
    color: var(--texte);
    font-size: 16px;
    font-weight: 700;
}


.piece-jointe-entete small {
    display: block;
    margin-top: 3px;
    color: var(--gris);
    font-size: 13px;
}


.piece-jointe-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(33, 102, 216, .10);
    font-size: 21px;
}


.piece-jointe-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px;
    border: 2px dashed #b9c7da;
    border-radius: 15px;
    background: #f8faff;
    text-align: center;
    cursor: pointer;
    transition:
        border-color .2s ease,
        background .2s ease,
        transform .2s ease;
}


.piece-jointe-zone:hover,
.piece-jointe-zone:focus {
    border-color: var(--bleu);
    background: #f1f6ff;
    outline: none;
    transform: translateY(-1px);
}


.piece-jointe-zone.drag-actif {
    border-color: var(--bleu);
    background: rgba(33, 102, 216, .08);
}


.piece-jointe-zone-icone {
    margin-bottom: 10px;
    color: var(--bleu);
    font-size: 30px;
}


.piece-jointe-zone-texte {
    color: var(--texte);
    font-size: 15px;
    font-weight: 700;
}


.piece-jointe-ou {
    margin: 8px 0;
    color: var(--gris);
    font-size: 13px;
}


.piece-jointe-bouton {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    background: var(--bleu);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}


.piece-jointe-selection {
    padding: 16px;
    border: 1px solid #dce3ee;
    border-radius: 14px;
    background: #f8faff;
}


.piece-jointe-fichier {
    display: flex;
    align-items: center;
    gap: 12px;
}


.piece-jointe-fichier-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(33, 102, 216, .10);
    font-size: 23px;
}


.piece-jointe-fichier-infos {
    min-width: 0;
}


.piece-jointe-fichier-infos strong {
    display: block;
    overflow: hidden;
    color: var(--texte);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.piece-jointe-fichier-infos small {
    display: block;
    margin-top: 3px;
    color: var(--gris);
    font-size: 13px;
}


.piece-jointe-statut {
    margin-top: 14px;
    color: #16834c;
    font-size: 14px;
    font-weight: 700;
}


.piece-jointe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}


.piece-jointe-actions button {
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    background: var(--bleu);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}


.piece-jointe-actions button.secondaire {
    background: #e9eef6;
    color: var(--texte);
}


@media (max-width: 560px) {
    .piece-jointe-bloc {
        padding: 14px;
    }

    .piece-jointe-zone {
        min-height: 155px;
        padding: 18px 12px;
    }
}


.resume-en-attente {
    color: #d97706;
    font-weight: 700;
    font-style: italic;
}


.conversation-destinataire {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 68px;
    padding: 10px 64px 10px 18px;

    background: #f8fbff;
    border-bottom: 1px solid #dce6f3;

    color: #17233a;
}


.conversation-destinataire-photo {
    display: block !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;

    flex: 0 0 48px !important;

    object-fit: cover !important;
    object-position: center top;

    border-radius: 50% !important;
    border: 1px solid #d7e3f4;

    background: #ffffff;
}


.conversation-destinataire-identite {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


.conversation-destinataire-identite span {
    font-size: 14px;
    color: #748198;
}


.conversation-destinataire-identite strong {
    margin-top: 2px;

    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;

    color: #17233a;
}


.conversation-destinataire-identite small {
    margin-top: 3px;

    font-size: 14px;
    line-height: 1.3;

    color: #748198;
}

@media (min-width: 769px) {
    .message-row.assistant .mini-avatar {
        width: 52px;
        height: 52px;
        min-width: 52px;
        flex: 0 0 52px;
    }
}


@media (max-width: 768px) {

    .conversation {
        padding-top: 18px;
        padding-left: 18px;
        padding-right: 18px;
        padding-bottom: 135px;
    }

    .message-row {
        margin-bottom: 18px;
    }

    .message-row.assistant .mini-avatar {
        width: 46px;
        height: 46px;
        min-width: 46px;
        flex: 0 0 46px;
    }

    .bubble {
        font-size: 17px;
        line-height: 1.45;
        padding: 16px 18px;
        border-radius: 18px;
    }

    .time {
        margin-top: 5px;
        font-size: 12px;
        line-height: 1.2;
        color: #8b97aa;
    }

    .choices {
        gap: 12px;
        margin-top: 12px;
        margin-bottom: 18px;
    }

    .choice {
        min-height: 70px;
        padding: 14px 18px;
        border-radius: 16px;
        font-size: 16px;
        line-height: 1.25;
        font-weight: 600;
    }

    .choice-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 22px;
    }

    .composer {
        padding: 12px 14px;
        gap: 10px;
    }

    #messageInput,
    #messageTextarea {
        min-height: 54px;
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.35;
        border-radius: 17px;
    }

    .micro {
        width: 54px;
        height: 54px;
        min-width: 54px;
        font-size: 22px;
    }

    .send {
        width: 56px;
        height: 56px;
        min-width: 56px;
        font-size: 22px;
    }

    .conversation-destinataire {
        min-height: 64px;
        padding: 8px 58px 8px 12px;
        gap: 10px;
    }

    .conversation-destinataire-photo {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        flex: 0 0 44px !important;
    }

    .conversation-destinataire-identite span {
        font-size: 11px;
        line-height: 1.15;
    }

    .conversation-destinataire-identite strong {
        margin-top: 1px;
        font-size: 14px;
        line-height: 1.15;
    }

    .conversation-destinataire-identite small {
        margin-top: 2px;
        font-size: 11px;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
}


@media (max-width: 900px) {
}

/* =========================================================
   1218 — DISCUSSION
   Composant unique : bandeau, messages, choix, saisie, pièces jointes
   ========================================================= */

.conversation-destinataire {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 10px 56px 10px 14px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.conversation-destinataire-photo {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    flex: 0 0 52px !important;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    border: 1px solid #d8e1ec;
    background: #fff;
}

.conversation-destinataire-identite {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.15;
}

.conversation-destinataire-identite span {
    font-size: 12px;
    color: #7a8799;
}

.conversation-destinataire-identite strong {
    margin-top: 2px;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    color: #17233a;
}

.conversation-destinataire-identite small {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.25;
    color: #7a8799;
}

@media (max-width: 768px) {
    .conversation-destinataire {
        min-height: 68px;
        padding: 8px 54px 8px 12px;
        gap: 10px;
    }

    .conversation-destinataire-photo {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        max-width: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        flex: 0 0 46px !important;
    }

    .conversation-destinataire-identite span {
        font-size: 11px;
    }

    .conversation-destinataire-identite strong {
        font-size: 15px;
    }

    .conversation-destinataire-identite small {
        font-size: 11px;
    }
}
