/* Afrydo Support — widget flottant. Tout est scopé sous .afrydo-tk pour ne pas entrer en conflit avec Astra / Elementor. */
.afrydo-tk{--tk-violet:#7c3aed;--tk-violet2:#8348F9;--tk-ink:#0f0a1e;--tk-gold:#d4a843;--tk-cream:#faf8f4;--tk-line:#eee6d8;--tk-muted:#8a8499;
  position:fixed;bottom:var(--afsup-bottom,20px);z-index:99990;font-family:'DM Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;font-size:15px;line-height:1.4;color:var(--tk-ink);text-align:left}
.afrydo-tk *,.afrydo-tk *::before,.afrydo-tk *::after{box-sizing:border-box}
.afrydo-tk--right{right:20px}
.afrydo-tk--left{left:20px}

/* Reset des boutons/champs du thème */
.afrydo-tk button,.afrydo-tk textarea,.afrydo-tk input{font:inherit;letter-spacing:normal;text-transform:none;box-shadow:none;margin:0}
.afrydo-tk button{cursor:pointer}
.afrydo-tk svg{display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Bulle */
.afrydo-tk .afrydo-tk__bubble{width:58px;height:58px;padding:0;border:0;border-radius:50%;background:linear-gradient(135deg,#8348F9,#6d28d9);color:#fff;
  display:flex;align-items:center;justify-content:center;position:relative;box-shadow:0 8px 24px rgba(124,58,237,.45);transition:transform .15s ease}
.afrydo-tk .afrydo-tk__bubble:hover{transform:scale(1.06);background:linear-gradient(135deg,#8348F9,#6d28d9);color:#fff}
.afrydo-tk .afrydo-tk__bubble svg{width:26px;height:26px}
.afrydo-tk__badge{position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:#e11d48;color:#fff;font-size:12px;font-weight:700;
  display:flex;align-items:center;justify-content:center;border:2px solid #fff}
.afrydo-tk__badge[hidden]{display:none}

/* Panneau */
.afrydo-tk__panel{position:absolute;bottom:72px;width:380px;height:min(600px,calc(100vh - var(--afsup-bottom,20px) - 100px));background:var(--tk-cream);
  border-radius:18px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 18px 60px rgba(15,10,30,.35);border:1px solid var(--tk-line)}
.afrydo-tk--right .afrydo-tk__panel{right:0}
.afrydo-tk--left .afrydo-tk__panel{left:0}
.afrydo-tk__panel[hidden]{display:none}

.afrydo-tk__head{flex:none;display:flex;align-items:center;gap:10px;padding:14px 14px 14px 16px;background:var(--tk-ink);color:#fff}
.afrydo-tk__head-txt{flex:1;min-width:0}
.afrydo-tk__title{font-family:'Playfair Display',Georgia,serif;font-size:18px;font-weight:700;color:#fff;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.afrydo-tk__sub{font-size:12px;color:#c9c2dc;margin:2px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.afrydo-tk .afrydo-tk__iconbtn{flex:none;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:#fff;display:flex;align-items:center;justify-content:center}
.afrydo-tk .afrydo-tk__iconbtn:hover{background:rgba(255,255,255,.2);color:#fff}
.afrydo-tk .afrydo-tk__iconbtn[hidden]{display:none}
.afrydo-tk .afrydo-tk__iconbtn svg{width:18px;height:18px}

.afrydo-tk__body{flex:1;min-height:0;display:flex;flex-direction:column;position:relative}
.afrydo-tk__toast{position:absolute;left:12px;right:12px;top:10px;z-index:5;background:#e11d48;color:#fff;padding:9px 12px;border-radius:10px;font-size:13px;box-shadow:0 6px 18px rgba(0,0,0,.2)}
.afrydo-tk__toast[hidden]{display:none}

/* Liste des conversations */
.afrydo-tk__list{flex:1;overflow-y:auto;padding:8px}
.afrydo-tk__item{width:100%;display:flex;gap:10px;align-items:center;padding:10px;border:0;border-radius:12px;background:transparent;text-align:left;color:var(--tk-ink)}

.afrydo-tk__avatar{flex:none;width:42px;height:42px;border-radius:50%;background:linear-gradient(135deg,#8348F9,#6d28d9);color:var(--tk-gold);display:flex;align-items:center;justify-content:center;font-family:'Playfair Display',Georgia,serif;font-weight:700;font-size:18px}
.afrydo-tk__item-main{flex:1;min-width:0}
.afrydo-tk__item-top{display:flex;justify-content:space-between;gap:8px}
.afrydo-tk__item-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.afrydo-tk__item-time{flex:none;font-size:11px;color:var(--tk-muted)}
.afrydo-tk__item-prev{font-size:13px;color:var(--tk-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.afrydo-tk__item.is-unread .afrydo-tk__item-title,.afrydo-tk__item.is-unread .afrydo-tk__item-prev{color:var(--tk-ink);font-weight:700}
.afrydo-tk__dot{flex:none;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--tk-violet);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center}
.afrydo-tk__chip{display:inline-block;margin-top:3px;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;background:#efe9fd;color:var(--tk-violet)}
.afrydo-tk__chip.is-resolved{background:#e8f6ee;color:#15803d}
.afrydo-tk__chip.is-pending{background:#fbf3dc;color:#8a6a10}

.afrydo-tk__empty{padding:28px 20px;text-align:center}
.afrydo-tk__empty p{margin:0 0 16px;color:var(--tk-ink)}

.afrydo-tk__foot{flex:none;padding:12px;border-top:1px solid var(--tk-line);background:#fff}
.afrydo-tk .afrydo-tk__btn{width:100%;padding:12px 18px;border:0;border-radius:999px;background:var(--tk-violet);color:#fff;font-weight:700;text-align:center;text-decoration:none;display:inline-block}
.afrydo-tk .afrydo-tk__btn:hover{background:#6d28d9;color:#fff}

/* Conversation */
.afrydo-tk__msgs{flex:1;overflow-y:auto;padding:14px 12px 6px;display:flex;flex-direction:column;gap:6px;scroll-behavior:smooth}
.afrydo-tk__day{align-self:center;margin:8px 0 2px;font-size:11px;color:var(--tk-muted);text-transform:capitalize}
.afrydo-tk__msg{max-width:82%;display:flex;flex-direction:column}
.afrydo-tk__msg.mine{align-self:flex-end;align-items:flex-end}
.afrydo-tk__msg.theirs{align-self:flex-start;align-items:flex-start}
.afrydo-tk__bub{padding:9px 13px;border-radius:18px;word-wrap:break-word;overflow-wrap:anywhere;white-space:pre-wrap;font-size:14.5px}
.afrydo-tk__msg.mine .afrydo-tk__bub{background:var(--tk-violet);color:#fff;border-bottom-right-radius:5px}
.afrydo-tk__msg.theirs .afrydo-tk__bub{background:#fff;border:1px solid var(--tk-line);border-bottom-left-radius:5px}
.afrydo-tk__imgs{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:4px;justify-content:inherit}
.afrydo-tk__imgs img{display:block;max-width:190px;max-height:190px;border-radius:12px;cursor:zoom-in;background:#ece7f7;object-fit:cover}
.afrydo-tk__time{font-size:11px;color:var(--tk-muted);margin:2px 4px 0}
.afrydo-tk__seen{font-size:11px;color:var(--tk-violet);margin:0 4px;font-weight:600}
.afrydo-tk__note{margin:6px 12px;padding:9px 12px;border-radius:10px;background:#e8f6ee;color:#15803d;font-size:13px;text-align:center}
.afrydo-tk__loading{margin:auto;color:var(--tk-muted);font-size:13px}

/* Composer */
.afrydo-tk__composer{flex:none;background:#fff;border-top:1px solid var(--tk-line);padding:8px 10px 10px}
.afrydo-tk__files{display:flex;gap:8px;padding:2px 2px 8px;flex-wrap:wrap}
.afrydo-tk__files:empty{display:none}
.afrydo-tk__thumb{position:relative;width:56px;height:56px}
.afrydo-tk__thumb img{width:56px;height:56px;object-fit:cover;border-radius:10px;display:block}
.afrydo-tk .afrydo-tk__thumb button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:var(--tk-ink);color:#fff;font-size:13px;line-height:20px;text-align:center}
.afrydo-tk__row{display:flex;align-items:flex-end;gap:6px}
.afrydo-tk textarea.afrydo-tk__ta{flex:1;min-height:40px;max-height:120px;resize:none;padding:10px 14px;border:1px solid var(--tk-line);border-radius:20px;background:var(--tk-cream);color:var(--tk-ink);outline:none;line-height:1.35}
.afrydo-tk textarea.afrydo-tk__ta:focus{border-color:var(--tk-violet)}
.afrydo-tk .afrydo-tk__round{flex:none;width:40px;height:40px;padding:0;border:0;border-radius:50%;display:flex;align-items:center;justify-content:center;background:transparent;color:var(--tk-violet)}
.afrydo-tk .afrydo-tk__round:hover{background:#efe9fd;color:var(--tk-violet)}
.afrydo-tk .afrydo-tk__round.send{background:var(--tk-violet);color:#fff}
.afrydo-tk .afrydo-tk__round.send:hover{background:#6d28d9;color:#fff}
.afrydo-tk .afrydo-tk__round.send:disabled{opacity:.5;cursor:default}
.afrydo-tk .afrydo-tk__round svg{width:20px;height:20px}

/* Invité */
.afrydo-tk__login{padding:32px 24px;text-align:center}
.afrydo-tk__login h3{font-family:'Playfair Display',Georgia,serif;font-size:20px;margin:0 0 8px;color:var(--tk-ink)}
.afrydo-tk__login p{margin:0 0 20px;color:var(--tk-muted)}

/* Zoom image */
.afrydo-tk__zoom{position:fixed;inset:0;z-index:99999;background:rgba(15,10,30,.88);display:flex;align-items:center;justify-content:center;padding:20px;cursor:zoom-out}
.afrydo-tk__zoom[hidden]{display:none}
.afrydo-tk__zoom img{max-width:100%;max-height:100%;border-radius:8px}

/* Mobile : plein écran */
@media (max-width:520px){
  .afrydo-tk--right{right:14px}
  .afrydo-tk--left{left:14px}
  .afrydo-tk.is-open .afrydo-tk__bubble{display:none}
  .afrydo-tk__panel{position:fixed;inset:0;bottom:0;width:100%;height:100%;border-radius:0;border:0}
  .afrydo-tk__msg{max-width:88%}
}
@media (prefers-reduced-motion:reduce){
  .afrydo-tk .afrydo-tk__bubble{transition:none}
  .afrydo-tk__msgs{scroll-behavior:auto}
}

/* Blindage contre les styles de boutons du thème (hover / focus / active) */
.afrydo-tk .afrydo-tk__item,
.afrydo-tk .afrydo-tk__item:hover,
.afrydo-tk .afrydo-tk__item:focus,
.afrydo-tk .afrydo-tk__item:active{background:transparent !important;color:var(--tk-ink) !important;border:0 !important;box-shadow:none !important;outline:none}
.afrydo-tk .afrydo-tk__item:hover,
.afrydo-tk .afrydo-tk__item:focus,
.afrydo-tk .afrydo-tk__item:active{background:#fff !important}
.afrydo-tk .afrydo-tk__item.is-unread,
.afrydo-tk .afrydo-tk__item.is-unread:hover,
.afrydo-tk .afrydo-tk__item.is-unread:focus,
.afrydo-tk .afrydo-tk__item.is-unread:active{background:#f4effd !important}
.afrydo-tk .afrydo-tk__item:focus-visible{box-shadow:0 0 0 2px var(--tk-violet) !important}
.afrydo-tk .afrydo-tk__item .afrydo-tk__item-prev{color:var(--tk-muted) !important}
.afrydo-tk .afrydo-tk__item.is-unread .afrydo-tk__item-prev{color:var(--tk-ink) !important}
.afrydo-tk .afrydo-tk__item .afrydo-tk__item-time{color:var(--tk-muted) !important}

.afrydo-tk .afrydo-tk__bubble:focus,.afrydo-tk .afrydo-tk__bubble:active{background:linear-gradient(135deg,#8348F9,#6d28d9) !important;color:#fff !important}
.afrydo-tk .afrydo-tk__btn:focus,.afrydo-tk .afrydo-tk__btn:active{background:#6d28d9 !important;color:#fff !important}
.afrydo-tk .afrydo-tk__iconbtn:focus,.afrydo-tk .afrydo-tk__iconbtn:active{background:rgba(255,255,255,.2) !important;color:#fff !important}
.afrydo-tk .afrydo-tk__round:focus,.afrydo-tk .afrydo-tk__round:active{background:#efe9fd !important;color:var(--tk-violet) !important}
.afrydo-tk .afrydo-tk__round.send:focus,.afrydo-tk .afrydo-tk__round.send:active{background:#6d28d9 !important;color:#fff !important}
.afrydo-tk .afrydo-tk__thumb button:focus,.afrydo-tk .afrydo-tk__thumb button:active{background:var(--tk-ink) !important;color:#fff !important}
