/* =========================================================
   TI GOYAV — assistant flottant
   ========================================================= */
.tg {
  position: fixed; right: clamp(.8rem, 2vw, 1.6rem); bottom: clamp(.8rem, 2vw, 1.6rem);
  z-index: 700;
  display: flex; flex-direction: column; align-items: flex-end; gap: .7rem;
  font-family: var(--f-texte);
  transition: opacity .4s var(--ease-doux), transform .4s var(--ease-doux);
}
.tg--masque { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; }

/* ---- le bouton ---- */
.tg__bouton {
  position: relative; order: 2;
  display: flex; align-items: center; gap: .55rem;
  padding: .4rem 1.1rem .4rem .45rem;
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: linear-gradient(140deg, #4b8070, var(--c-vert));
  color: #fff; font-weight: 600; font-size: var(--fs-sm);
  box-shadow: 0 12px 30px rgba(12,40,32,.36);
  transition: transform .3s var(--ease-doux), box-shadow .3s var(--ease-doux);
}
.tg__bouton:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(12,40,32,.44); }
.tg__bouton img {
  width: 46px; height: 46px; object-fit: contain; flex: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.3));
  animation: tgCoucou 5.5s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes tgCoucou {
  0%, 78%, 100% { transform: rotate(0) translateY(0); }
  84%           { transform: rotate(-9deg) translateY(-4px); }
  90%           { transform: rotate(7deg) translateY(-2px); }
}
.tg.ouvert .tg__bouton img { animation: none; }
.tg__pastille {
  position: absolute; top: 2px; right: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--c-orange); box-shadow: 0 0 0 3px rgba(239,177,66,.32);
  animation: tgPulse 2.4s ease-in-out infinite;
}
@keyframes tgPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(239,177,66,.32); } 50% { box-shadow: 0 0 0 8px rgba(239,177,66,0); } }
@media (max-width: 560px) { .tg__libelle { display: none; } .tg__bouton { padding: .35rem; } }

/* ---- le panneau ---- */
/* `display:flex` l'emporterait sur l'attribut `hidden` du navigateur :
   sans cette règle, le panneau refuse de se fermer. */
.tg__panneau[hidden] { display: none !important; }

.tg__panneau {
  order: 1;
  width: min(92vw, 380px);
  max-height: min(70svh, 560px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(12,40,32,.3);
  animation: tgOuvre .35s cubic-bezier(.2,1.2,.4,1);
  transform-origin: 100% 100%;
}
@keyframes tgOuvre { from { opacity: 0; transform: scale(.9) translateY(12px); } }

.tg__tete {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1rem;
  background: linear-gradient(120deg, var(--c-vert), #35604f);
  color: #fff;
}
.tg__tete img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.tg__tete b { display: block; font-size: var(--fs-base); line-height: 1.15; }
.tg__tete small { display: block; font-size: .7rem; opacity: .72; }
.tg__fermer {
  margin-left: auto; width: 36px; height: 36px; flex: none;
  position: relative; z-index: 2;
  display: grid; place-items: center;
  background: rgba(255,255,255,.15); border: 0; border-radius: 50%;
  color: #fff; cursor: pointer; transition: background-color .22s;
}
.tg__fermer:hover { background: rgba(255,255,255,.3); }

.tg__fil {
  flex: 1; overflow-y: auto;
  padding: 1rem; display: flex; flex-direction: column; gap: .6rem;
  background: var(--bg-alt);
}
.tg__bulle {
  max-width: 88%; padding: .7rem .9rem;
  border-radius: 16px; font-size: var(--fs-sm); line-height: 1.5;
  animation: tgBulle .3s var(--ease-doux);
}
@keyframes tgBulle { from { opacity: 0; transform: translateY(8px); } }
.tg__bulle p { margin: 0; }
.tg__bulle--tg  { background: var(--surface); border: 1px solid var(--trait); border-bottom-left-radius: 5px; align-self: flex-start; }
.tg__bulle--moi { background: var(--c-vert); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }

.tg__liens { display: grid; gap: .35rem; margin-top: .6rem; }
.tg__liens a, .tg__aller {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .7rem; border-radius: 11px;
  background: var(--bg-alt); border: 1px solid var(--trait);
  color: var(--accent); text-decoration: none;
  font-size: var(--fs-xs); font-weight: 600; text-align: left;
  cursor: pointer; width: 100%;
  transition: background-color .22s, border-color .22s, transform .22s;
}
.tg__liens a:hover, .tg__aller:hover { background: var(--c-anis); color: #2b3005; border-color: var(--c-anis); transform: translateX(3px); }
.tg__aller { background: var(--c-vert); color: #fff; border-color: var(--c-vert); justify-content: center; }

.tg__puces { display: flex; flex-wrap: wrap; gap: .35rem; }
.tg__puces button {
  background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--r-pill); padding: .35rem .8rem;
  font-size: var(--fs-xs); font-weight: 500; color: var(--texte-doux);
  cursor: pointer; transition: border-color .22s, color .22s, background-color .22s;
}
.tg__puces button:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-alt); }

.tg__points { display: inline-flex; gap: 4px; padding: .15rem 0; }
.tg__points i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--texte-doux);
  animation: tgPoint 1.1s ease-in-out infinite;
}
.tg__points i:nth-child(2) { animation-delay: .16s; }
.tg__points i:nth-child(3) { animation-delay: .32s; }
@keyframes tgPoint { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.tg__saisie {
  display: flex; gap: .45rem; align-items: center;
  padding: .6rem .7rem; background: var(--surface);
  border-top: 1px solid var(--trait);
}
.tg__saisie input {
  flex: 1; border: 1px solid var(--trait); border-radius: var(--r-pill);
  padding: .55rem .9rem; font: inherit; font-size: var(--fs-sm);
  background: var(--bg-alt); color: var(--texte); outline: 0;
  transition: border-color .22s;
}
.tg__saisie input:focus { border-color: var(--accent); }
.tg__saisie button {
  width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%;
  background: var(--c-vert); color: #fff; display: grid; place-items: center;
  cursor: pointer; transition: transform .22s, background-color .22s;
}
.tg__saisie button:hover { transform: scale(1.07); background: var(--c-vert-700); }
.tg__mentions {
  margin: 0; padding: .45rem .9rem .6rem;
  background: var(--surface); color: var(--texte-doux);
  font-size: .66rem; line-height: 1.35; text-align: center;
}
