/* v 20261126c (Raph 26/11, varnish2) : CADRE COMMUN aux 3 fenetres (ecran de choix, conseiller, assistant IA) :
   ordinateur / tablette (>= 601 px) : 430 px de large, 640 px de haut au plus, ancree a droite (20 px) AU-DESSUS de la bulle
   (bas 101 px) ; la bulle et le bouton « descendre » restent a leur place et visibles (la bulle sert a refermer).
   Telephone (<= 600 px) : plein ecran, bulle masquee. Avant : fenetre posee en bas (20 px) par-dessus le bouton « descendre »
   et bulle deplacee a gauche de la fenetre (right 462 px). Retour arriere : remettre 99-gfc-chat-commercial-20261125b.css. */
/* Chat commercial GFC (module gfcchatcommercial) — 05/11/2026 ; pièces jointes 06/11/2026 (20261106a). Fenêtre bas à droite, plein écran sur mobile. */
#gfc-chat, #gfc-chat * { box-sizing: border-box; }
#gfc-chat [hidden] { display: none !important; }
#gfc-chat {
    position: fixed; right: 20px; bottom: 101px; z-index: 2147483000;
    width: 360px; height: 520px; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    background: #fff; color: #222; border-radius: 14px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
    font: 14px/1.4 "Open Sans", Arial, sans-serif;
}
#gfc-chat .gfc-chat-tete {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: #222; color: #fff;
}
#gfc-chat .gfc-chat-avatar {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
    background: #f39200; color: #fff; font-weight: 700; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
#gfc-chat .gfc-chat-qui { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#gfc-chat .gfc-chat-nom { font-size: 15px; }
#gfc-chat .gfc-chat-statut { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #ddd; }
#gfc-chat .gfc-chat-pastille {
    flex: 0 0 9px; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #9a9a9a;
}
#gfc-chat .gfc-chat-pastille.gfc-chat-on { background: #2ecc40; box-shadow: 0 0 0 3px rgba(46, 204, 64, .25); }
#gfc-chat .gfc-chat-x {
    flex: 0 0 auto; border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1;
    cursor: pointer; padding: 0 4px;
}
#gfc-chat .gfc-chat-fil {
    flex: 1 1 auto; overflow-y: auto; padding: 12px; background: #f4f4f4;
    display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch;
}
#gfc-chat .gfc-chat-vide { margin: auto 10px; text-align: center; color: #777; }
#gfc-chat .gfc-chat-msg { max-width: 82%; display: flex; flex-direction: column; }
#gfc-chat .gfc-chat-moi { align-self: flex-end; align-items: flex-end; }
#gfc-chat .gfc-chat-lui { align-self: flex-start; align-items: flex-start; }
#gfc-chat .gfc-chat-bulle {
    padding: 8px 11px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
#gfc-chat .gfc-chat-moi .gfc-chat-bulle { background: #f39200; color: #fff; border-bottom-right-radius: 4px; }
#gfc-chat .gfc-chat-lui .gfc-chat-bulle { background: #fff; color: #222; border: 1px solid #e2e2e2; border-bottom-left-radius: 4px; }
#gfc-chat .gfc-chat-meta { font-size: 11px; color: #888; margin-top: 2px; }
#gfc-chat .gfc-chat-ident { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #e5e5e5; }
#gfc-chat .gfc-chat-ident-titre { margin: 0; font-size: 12px; color: #555; }
#gfc-chat input, #gfc-chat textarea {
    width: 100%; border: 1px solid #ccc; border-radius: 8px; padding: 8px 10px;
    font: inherit; color: #222; background: #fff; margin: 0;
}
#gfc-chat input:focus, #gfc-chat textarea:focus { outline: 2px solid #f39200; outline-offset: -1px; border-color: #f39200; }
#gfc-chat .gfc-chat-form { display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; }
#gfc-chat .gfc-chat-saisie { resize: none; height: 54px; }
#gfc-chat .gfc-chat-envoyer {
    flex: 0 0 auto; height: 40px; padding: 0 14px; border: 0; border-radius: 8px;
    background: #f39200; color: #fff; font-weight: 700; cursor: pointer;
}
#gfc-chat .gfc-chat-envoyer:disabled { opacity: .6; cursor: wait; }
#gfc-chat .gfc-chat-compteur { display: block; padding: 0 12px; font-size: 11px; color: #888; text-align: right; }
#gfc-chat .gfc-chat-compteur:empty { display: none; }
#gfc-chat .gfc-chat-err { margin: 0 12px 10px; color: #c0392b; font-size: 12px; }

/* --- 06/11/2026 : pièces jointes --- */
#gfc-chat .gfc-chat-pj {
    flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid #ccc; border-radius: 8px;
    background: #fff; color: #555; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
}
#gfc-chat .gfc-chat-pj:hover { color: #f39200; border-color: #f39200; }
#gfc-chat .gfc-chat-pj:disabled { opacity: .5; cursor: wait; }
#gfc-chat .gfc-chat-attente { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; border-top: 1px solid #e5e5e5; }
#gfc-chat .gfc-chat-puce {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
    background: #fff4e5; border: 1px solid #f7c98a; border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 12px;
}
#gfc-chat .gfc-chat-puce-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
#gfc-chat .gfc-chat-puce-x { border: 0; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; color: #a05a00; padding: 0 4px; }
#gfc-chat .gfc-chat-depot {
    position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
    background: rgba(243, 146, 0, .14); border: 3px dashed #f39200; border-radius: 14px;
    color: #a05a00; font-weight: 700; font-size: 16px; pointer-events: none;
}
#gfc-chat .gfc-chat-bulle-pj { padding: 5px; }
#gfc-chat .gfc-chat-pj-lien { display: block; color: inherit; text-decoration: none; }
#gfc-chat .gfc-chat-pj-image img {
    display: block; max-width: 220px; max-height: 260px; width: auto; height: auto;
    border-radius: 8px; background: #eee; object-fit: contain;
}
#gfc-chat .gfc-chat-pj-doc {
    display: flex; align-items: center; gap: 9px; padding: 5px 8px 5px 5px; min-width: 170px; max-width: 240px;
}
#gfc-chat .gfc-chat-pj-icone {
    flex: 0 0 38px; height: 44px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: #fff; background: #777; letter-spacing: .5px;
}
#gfc-chat .gfc-chat-pj-i-pdf { background: #d93025; }
#gfc-chat .gfc-chat-pj-i-xls { background: #1e7e45; }
#gfc-chat .gfc-chat-pj-i-doc { background: #2b5bb8; }
#gfc-chat .gfc-chat-pj-txt { display: flex; flex-direction: column; min-width: 0; }
#gfc-chat .gfc-chat-pj-nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gfc-chat .gfc-chat-pj-taille { font-size: 11px; opacity: .8; }
#gfc-chat .gfc-chat-pj-lien:hover .gfc-chat-pj-nom { text-decoration: underline; }
#gfc-chat .gfc-chat-pj-legende { padding: 6px 6px 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 600px) {
    #gfc-chat { right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; }
    html.gfc-chat-ouvert, html.gfc-chat-ouvert body { overflow: hidden; }
    #gfc-chat input, #gfc-chat textarea { font-size: 16px; } /* évite le zoom auto d'iOS */
}
/* --- 18/11/2026 : traduction (lien « Traduire » / « Voir l'original » sous les messages du commercial) --- */
#gfc-chat .gfc-chat-trad { margin-top: 3px; max-width: 100%; font-size: 12px; line-height: 1.35; color: #777; }
#gfc-chat .gfc-chat-trad-lien { border: 0; background: transparent; padding: 2px 0; margin: 0; color: #c46f00; font-size: 12px; font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 0; height: auto; line-height: 1.35; box-shadow: none; }
#gfc-chat .gfc-chat-trad-lien:hover, #gfc-chat .gfc-chat-trad-lien:focus { color: #8f5100; background: transparent; }
#gfc-chat .gfc-chat-trad-note { color: #888; }
#gfc-chat .gfc-chat-trad-texte { margin-top: 3px; padding: 6px 9px; border-left: 3px solid #f0c27a; background: #fff8ec; border-radius: 0 8px 8px 0; color: #444; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
#gfc-chat .gfc-chat-trad [hidden] { display: none !important; }
/* --- 25/11/2026 (Raph, varnish2) : flèche retour + écran de choix de l'interlocuteur (service puis personne) --- */
#gfc-chat .gfc-chat-retour {
    flex: 0 0 40px; width: 40px; height: 40px; margin: -4px 0 -4px -6px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; min-height: 0; box-shadow: none;
    display: flex; align-items: center; justify-content: center;
}
#gfc-chat .gfc-chat-retour:hover { background: rgba(255, 255, 255, .28); }
#gfc-chat .gfc-chat-retour svg { display: block; }
#gfc-chat .gfc-chat-retour:focus-visible, #gfc-chat .gfc-chat-x:focus-visible { outline: 2px solid #f39200; outline-offset: 2px; }
#gfc-chat .gfc-chat-x { min-width: 36px; min-height: 36px; border-radius: 50%; box-shadow: none; }
#gfc-chat .gfc-chat-x:hover { background: rgba(255, 255, 255, .2); }
#gfc-chat .gfc-chat-nom { color: #fff; line-height: 1.25; }
#gfc-chat .gfc-chat-nom-serv { font-weight: 400; font-size: 12px; color: #ddd; }
#gfc-chat .gfc-chat-choix-corps {
    flex: 1 1 auto; overflow-y: auto; padding: 12px; background: #f4f4f4; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; gap: 10px;
}
#gfc-chat .gfc-chat-choix-equipe { margin: 2px 2px 0; font-size: 12px; color: #666; }
#gfc-chat .gfc-chat-choix-rang { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
#gfc-chat .gfc-chat-choix-label { flex: 0 0 auto; margin: 0; font-size: 13px; font-weight: 700; color: #222; }
#gfc-chat select.gfc-chat-service {
    flex: 1 1 auto; min-width: 0; width: auto !important; height: 42px !important; margin: 0; padding: 0 34px 0 12px !important;
    border: 2px solid #f39200 !important; border-radius: 8px !important; background-color: #fff !important; color: #222 !important;
    font: 600 14px/1.2 "Open Sans", Arial, sans-serif !important; cursor: pointer; box-shadow: none !important;
    -webkit-appearance: none; -moz-appearance: none; appearance: none; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E07F0A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 10px center !important; background-size: 16px 16px !important;
}
#gfc-chat select.gfc-chat-service:focus-visible { outline: 3px solid rgba(243, 146, 0, .45); outline-offset: 1px; }
#gfc-chat .gfc-chat-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
#gfc-chat .gfc-chat-liste li { margin: 0; padding: 0; list-style: none; background: none; }
#gfc-chat .gfc-chat-liste li.gfc-chat-liste-vide { padding: 14px; text-align: center; color: #666; font-size: 13px; }
#gfc-chat .gfc-chat-personne, #gfc-chat .gfc-chat-choix-ia {
    display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 10px 12px; min-height: 60px; height: auto;
    border: 1px solid #e2e2e2; border-radius: 10px; background: #fff; color: #222; text-align: left; cursor: pointer;
    font: inherit; box-shadow: none; white-space: normal; flex: 0 0 auto;
}
#gfc-chat .gfc-chat-personne:hover, #gfc-chat .gfc-chat-choix-ia:hover { border-color: #f39200; background: #fff8ec; }
#gfc-chat .gfc-chat-personne:focus-visible, #gfc-chat .gfc-chat-choix-ia:focus-visible { outline: 3px solid rgba(243, 146, 0, .55); outline-offset: 1px; border-color: #f39200; }
#gfc-chat .gfc-chat-ia-ico { flex: 0 0 38px; width: 38px; font-size: 26px; line-height: 1; text-align: center; }
#gfc-chat .gfc-chat-p-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#gfc-chat .gfc-chat-p-nom { font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#gfc-chat .gfc-chat-p-badge { background: #d93025; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
#gfc-chat .gfc-chat-p-encours { background: #fff4e5; color: #a05a00; border: 1px solid #f7c98a; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 7px; }
#gfc-chat .gfc-chat-p-serv { font-size: 12px; color: #555; }
#gfc-chat .gfc-chat-p-langs { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: #555; }
#gfc-chat .gfc-chat-p-lg { display: inline-flex; align-items: center; gap: 4px; }
#gfc-chat .gfc-chat-p-lg img { display: block; width: 16px; height: 11px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
#gfc-chat .gfc-chat-p-etat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; }
#gfc-chat .gfc-chat-p-etat .gfc-chat-pastille { margin-top: 0; background: #b5b5b5; }
#gfc-chat .gfc-chat-p-on .gfc-chat-p-etat { color: #1b7a2c; font-weight: 600; }
#gfc-chat .gfc-chat-p-on .gfc-chat-p-etat .gfc-chat-pastille { background: #2ecc40; box-shadow: 0 0 0 3px rgba(46, 204, 64, .25); }
#gfc-chat .gfc-chat-p-chevron { flex: 0 0 auto; font-size: 22px; line-height: 1; color: #f39200; }
@media (max-width: 600px) {
    /* plein écran : l'en-tête (flèche retour, croix) reste en haut, sous l'encoche des téléphones */
    #gfc-chat .gfc-chat-tete { padding-top: calc(12px + env(safe-area-inset-top, 0px)); flex: 0 0 auto; }
    #gfc-chat .gfc-chat-retour { flex-basis: 44px; width: 44px; height: 44px; }
    #gfc-chat .gfc-chat-x { min-width: 44px; min-height: 44px; }
    #gfc-chat select.gfc-chat-service { font-size: 16px !important; height: 46px !important; }
}
/* --- 25/11/2026 (v 20261125b, Raph : « agrandir la fenetre de tchat ») : ordinateur et tablette seulement ---
   430 x 660 px (avant 360 x 520), bornee par la hauteur de l'ecran en laissant l'en-tete collant visible ; textes a 15 px.
   Telephone (<= 600 px) : plein ecran, inchange. */
@media (min-width: 601px) {
    #gfc-chat { width: 430px; max-width: calc(100vw - 40px); height: 640px; max-height: calc(100vh - 121px); font-size: 15px; }
    #gfc-chat .gfc-chat-nom { font-size: 16px; }
    #gfc-chat .gfc-chat-nom-serv, #gfc-chat .gfc-chat-statut { font-size: 13px; }
    #gfc-chat .gfc-chat-meta { font-size: 12px; }
    #gfc-chat .gfc-chat-saisie { height: 62px; }
    #gfc-chat .gfc-chat-envoyer { height: 44px; padding: 0 18px; font-size: 15px; }
    #gfc-chat .gfc-chat-pj { width: 44px; height: 44px; }
    #gfc-chat .gfc-chat-ident-titre, #gfc-chat .gfc-chat-trad, #gfc-chat .gfc-chat-trad-lien { font-size: 13px; }
    #gfc-chat .gfc-chat-choix-corps { padding: 14px; }
    #gfc-chat .gfc-chat-choix-label { font-size: 14px; }
    #gfc-chat select.gfc-chat-service { font-size: 15px !important; height: 44px !important; }
    #gfc-chat .gfc-chat-p-nom { font-size: 16px; }
    #gfc-chat .gfc-chat-p-serv, #gfc-chat .gfc-chat-p-langs, #gfc-chat .gfc-chat-p-etat, #gfc-chat .gfc-chat-choix-equipe { font-size: 13px; }
    #gfc-chat .gfc-chat-personne .gfc-chat-avatar, #gfc-chat .gfc-chat-tete .gfc-chat-avatar { flex-basis: 44px; width: 44px; height: 44px; font-size: 20px; }
    /* v 20261126c : la bulle NE BOUGE PLUS ; elle reste visible a sa place, sous la fenetre (elle sert a la refermer) */
    html.gfc-chat-ouvert body #gfc-bulle-tchat { display: flex !important; }
}
