/* =========================================================
   Assistance en direct : bulle du visiteur et console des responsables.

   MARQUE BLANCHE — que des variables de charte (src/services/branding.js) :
   la bulle suit le theme clair, sombre ou conseil comme le reste du site.
   ========================================================= */

/* ------------------------------ bulle flottante --------------------------- */

.sup {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .7rem;
  font-size: .93rem;
}

.sup-bouton {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--btn-text);
  box-shadow: 0 6px 20px var(--btn-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .15s ease;
}
.sup-bouton:hover { transform: translateY(-2px); }
.sup-bouton svg { width: 26px; height: 26px; }

.sup-pastille {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--err);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--surface);
}

.sup-panneau {
  width: min(360px, calc(100vw - 2.4rem));
  max-height: min(560px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sup-tete {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .8rem 1rem;
  background: var(--panel-bg);
  color: var(--panel-text);
}
.sup-tete strong { display: block; font-size: .98rem; }
.sup-presence { display: block; font-size: .78rem; color: var(--panel-text-soft); }
.sup-presence.is-vide { opacity: .85; }
.sup-fermer {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--panel-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
}

.sup-corps {
  flex: 1;
  overflow-y: auto;
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  min-height: 120px;
}
.sup-vide { color: var(--muted); font-size: .88rem; margin: 0; }

.sup-msg { max-width: 88%; display: flex; flex-direction: column; gap: .15rem; }
.sup-msg p {
  margin: 0;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sup-msg-auteur { font-size: .72rem; color: var(--muted); }
.sup-msg-moi { align-self: flex-end; align-items: flex-end; }
.sup-msg-moi p { background: var(--accent); color: var(--btn-text); }
.sup-msg-eux { align-self: flex-start; }
.sup-msg-eux p { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); }

.sup-saisie {
  margin: 0;
  padding: .3rem 1rem .5rem;
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.sup-points { display: inline-flex; gap: 3px; }
.sup-points i {
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--accent);
  animation: sup-pulse 1.2s infinite ease-in-out;
}
.sup-points i:nth-child(2) { animation-delay: .18s; }
.sup-points i:nth-child(3) { animation-delay: .36s; }
@keyframes sup-pulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sup-points i { animation: none; opacity: .7; } }

.sup-terminee {
  margin: 0;
  padding: .5rem 1rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

.sup-contacts {
  padding: .7rem 1rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  font-size: .84rem;
}
.sup-contacts-titre { margin: 0 0 .4rem; font-weight: 600; color: var(--brand); }
.sup-contacts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.sup-contacts li { display: flex; flex-wrap: wrap; gap: .1rem .6rem; }
.sup-contacts li strong { flex-basis: 100%; font-weight: 600; }

.sup-erreur {
  margin: 0;
  padding: .5rem 1rem;
  background: var(--err-bg);
  color: var(--err);
  font-size: .84rem;
}

.sup-form {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  padding: .7rem 1rem .9rem;
  border-top: 1px solid var(--line);
}
.sup-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  font-size: .92rem;
  padding: .5rem .7rem;
}
.sup-form .btn { flex: none; }

@media print { .sup { display: none !important; } }
@media (max-width: 520px) {
  .sup { right: .8rem; bottom: .8rem; }
}

/* --------------------- console des responsables (/admin/support) ---------- */

.sc {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.sc-liste { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sc-liste-tete {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: .82rem;
  color: var(--muted);
}
.sc-fil {
  display: block;
  width: 100%;
  text-align: left;
  padding: .7rem .9rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.sc-fil:hover { background: var(--bg-soft); }
.sc-fil.is-actif { background: var(--bg-brand-soft); box-shadow: inset 3px 0 0 var(--accent); }
.sc-fil-nom { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.sc-fil-extrait { display: block; font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.sc-fil-meta { display: flex; gap: .5rem; align-items: center; margin-top: .3rem; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }

.sc-conv {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 460px;
}
.sc-conv-tete { padding: .8rem 1rem; border-bottom: 1px solid var(--line); display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.sc-conv-tete h2 { margin: 0; font-size: 1.05rem; }
.sc-conv-coord { font-size: .84rem; color: var(--muted); display: flex; gap: .8rem; flex-wrap: wrap; }
.sc-conv-actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.sc-conv-corps { flex: 1; overflow-y: auto; max-height: 420px; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.sc-conv-form { display: flex; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--line); align-items: flex-end; }
.sc-conv-form textarea { flex: 1; min-height: 56px; max-height: 160px; }

/* Avertissement : quelqu'un d'autre est deja en train de repondre. */
.sc-alerte-saisie {
  margin: 0;
  padding: .5rem 1rem;
  background: var(--warn-bg);
  color: var(--warn);
  border-top: 1px solid var(--warn-line);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.sc-presence { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .86rem; }
.sc-pastille-en-ligne {
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--ok); flex: none;
  box-shadow: 0 0 0 3px var(--ok-bg);
}
.sc-pastille-en-ligne.is-vide { background: var(--muted); box-shadow: 0 0 0 3px var(--bg-soft); }

@media (max-width: 900px) {
  .sc { grid-template-columns: minmax(0, 1fr); }
  .sc-conv-corps { max-height: 320px; }
}
