/* ZIC Chat — styles des fonctionnalités enrichies (partagé admin + landing)
 * S'appuie sur les variables de thème du panneau chat (#ac-root) :
 *   --ac-primary, --ac-primary-dark, --ac-slate50, --ac-radius, --ac-msg-radius
 * avec fallbacks pour fonctionner hors contexte.
 */

#ac-root {
  --acr-primary: var(--ac-primary, #6366f1);
  --acr-primary-dark: var(--ac-primary-dark, #4f46e5);
  --acr-border: var(--ac-border, var(--pp-border, #e7e5f0));
  --acr-surface: var(--pp-card, #ffffff);
  --acr-soft: var(--ac-slate50, var(--pp-bg-soft, #f8fafc));
  --acr-text: var(--ac-text, var(--pp-text, #1f1340));
  --acr-muted: var(--ac-muted, var(--pp-text-muted, #6b7280));
  --acr-green: #22c55e;
  --acr-red: #ef4444;
}

/* ── Pièces jointes ───────────────────────────────────────────────────────── */
.acr-media-wrap { display: flex; flex-direction: column; gap: 6px; max-width: min(78%, 320px); }
.ac-msg-row.is-mine .acr-media-wrap { align-items: flex-end; }
.acr-attachments { display: flex; flex-direction: column; gap: 6px; }
.acr-att-img { display: block; border-radius: 14px; overflow: hidden; max-width: 280px; }
.acr-att-img img { display: block; width: 100%; height: auto; border-radius: 14px; }
.acr-att-video { max-width: 280px; border-radius: 14px; background: #000; }
.acr-att-audio { width: 260px; max-width: 100%; }
.acr-att-file {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 10px 12px; background: var(--acr-surface); border: 1px solid var(--acr-border);
  border-radius: 14px; color: var(--acr-text); max-width: 280px;
}
.acr-att-file:hover { background: var(--acr-soft); }
.acr-att-file-ic { font-size: 24px; flex-shrink: 0; }
.acr-att-file-meta { display: flex; flex-direction: column; min-width: 0; }
.acr-att-file-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acr-att-file-size { font-size: 11px; color: var(--acr-muted); }

/* ── Carte générique (sondage / quiz / événement / contact) ───────────────── */
.acr-card {
  background: var(--acr-surface); border: 1px solid var(--acr-border);
  border-radius: 16px; padding: 14px 16px; max-width: min(80%, 360px);
  box-shadow: 0 1px 3px var(--pp-shadow-soft, rgba(31, 19, 64, 0.05));
}
.ac-msg-row.is-mine .acr-card { border-color: color-mix(in srgb, var(--acr-primary) 30%, var(--acr-border)); }
.acr-pinned { outline: 2px solid color-mix(in srgb, var(--acr-primary) 45%, transparent); outline-offset: 1px; }

/* Sondage / quiz */
.acr-poll-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.acr-poll-ic { font-size: 16px; }
.acr-poll-q { font-weight: 700; font-size: 14px; color: var(--acr-text); }
.acr-poll-opts { display: flex; flex-direction: column; gap: 7px; }
.acr-opt {
  position: relative; text-align: left; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--acr-border); background: var(--acr-surface);
  cursor: pointer; overflow: hidden; width: 100%; font: inherit;
}
.acr-opt:not([disabled]):hover { border-color: var(--acr-primary); }
.acr-opt[disabled] { cursor: default; }
.acr-opt.is-mine { border-color: var(--acr-primary); }
.acr-opt.is-correct { border-color: var(--acr-green); }
.acr-opt-bar {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  background: color-mix(in srgb, var(--acr-primary) 12%, transparent); z-index: 0;
}
.acr-opt.is-correct .acr-opt-bar { background: color-mix(in srgb, var(--acr-green) 16%, transparent); }
.acr-opt-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.acr-opt-txt { flex: 1; font-size: 12.5px; color: var(--acr-text); }
.acr-opt.is-mine .acr-opt-txt { font-weight: 700; }
.acr-opt-pct { font-weight: 700; font-size: 12px; color: var(--acr-muted); }
.acr-poll-foot { margin-top: 8px; font-size: 11px; color: var(--acr-muted); }

/* Événement */
.acr-event-head { display: flex; gap: 12px; align-items: flex-start; }
.acr-event-ic { font-size: 26px; flex-shrink: 0; }
.acr-event-title { font-weight: 800; font-size: 15px; color: var(--acr-text); }
.acr-event-when { font-size: 12px; color: var(--acr-muted); margin-top: 2px; }
.acr-rsvp { display: flex; gap: 7px; margin-top: 12px; }
.acr-rsvp-btn {
  flex: 1; padding: 8px 6px; border-radius: 9px; border: 1px solid var(--acr-border);
  background: var(--acr-surface); cursor: pointer; font-weight: 700; font-size: 12px; color: var(--acr-text);
}
.acr-rsvp-btn:hover { background: var(--acr-soft); }
.acr-rsvp-btn.is-on.acr-rsvp-yes { background: var(--acr-green); border-color: var(--acr-green); color: #fff; }
.acr-rsvp-btn.is-on.acr-rsvp-maybe { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.acr-rsvp-btn.is-on.acr-rsvp-no { background: var(--acr-red); border-color: var(--acr-red); color: #fff; }

/* Contact */
.acr-contact { display: flex; align-items: center; gap: 12px; }
.acr-contact-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.acr-contact-av--fb {
  display: flex; align-items: center; justify-content: center; background: var(--pp-card-light, #e5e7eb);
  color: var(--pp-text-soft, #9ca3af); font-weight: 700; font-size: 14px;
}
.acr-contact-name { font-weight: 700; font-size: 14px; color: var(--acr-text); }
.acr-contact-handle { font-size: 12px; color: var(--acr-muted); }

/* Sticker */
.acr-sticker { font-size: 60px; line-height: 1; }

/* ── Citation (reply) ──────────────────────────────────────────────────────── */
.acr-quote {
  display: flex; flex-direction: column; gap: 1px; padding: 5px 10px; margin-bottom: 3px;
  border-left: 3px solid var(--acr-primary); background: var(--acr-soft);
  border-radius: 6px; max-width: 80%; font-size: 12px;
}
.acr-quote-who { font-weight: 700; color: var(--acr-primary); }
.acr-quote-text { color: var(--acr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Réactions ─────────────────────────────────────────────────────────────── */
.acr-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ac-msg-row.is-mine .acr-reactions { justify-content: flex-end; }
.acr-rx-chip {
  border: 1px solid var(--acr-border); background: var(--acr-surface); border-radius: 999px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; line-height: 1.4;
}
.acr-rx-chip.is-mine { background: color-mix(in srgb, var(--acr-primary) 14%, transparent); border-color: var(--acr-primary); }
.acr-rx-pop {
  display: flex; gap: 2px; padding: 6px 8px; background: var(--pp-menu-bg, #fff); border: 1px solid var(--acr-border);
  border-radius: 999px; box-shadow: 0 12px 30px var(--pp-shadow-soft, rgba(31, 19, 64, 0.18));
}
.acr-rx-pop button { border: none; background: transparent; font-size: 20px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.acr-rx-pop button:hover { background: var(--acr-soft); }

/* ── Composer enrichi ──────────────────────────────────────────────────────── */
.ac-composer { position: relative; }
/* Ces éléments sont pilotés par l'attribut [hidden] depuis le JS. Comme ils
   portent un display explicite (grid/flex) qui l'emporterait sur la règle UA
   [hidden]{display:none}, on rétablit le masquage avec une spécificité supérieure. */
.acr-attach-menu[hidden],
.acr-emoji-panel[hidden],
.acr-reply[hidden] { display: none !important; }
.acr-cbtn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--acr-border);
  background: var(--acr-soft); color: var(--acr-text); font-size: 19px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.acr-cbtn:hover { background: var(--pp-card, #fff); border-color: var(--acr-primary); }
.acr-cbtn.is-on { background: var(--acr-primary); border-color: var(--acr-primary); color: #fff; }

.acr-attach-menu, .acr-emoji-panel {
  position: absolute; bottom: calc(100% + 6px); z-index: 30; background: var(--pp-menu-bg, #fff);
  border: 1px solid var(--acr-border); border-radius: 14px;
  box-shadow: 0 14px 40px var(--pp-shadow-soft, rgba(31, 19, 64, 0.18));
}
.acr-attach-menu { left: 12px; width: 232px; padding: 6px; }
.acr-attach-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 11px;
  background: transparent; border: none; border-radius: 9px; cursor: pointer; text-align: left;
}
.acr-attach-item:hover { background: var(--acr-soft); }
.acr-attach-ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.acr-attach-lbl { font-size: 13px; font-weight: 600; color: var(--acr-text); }

.acr-emoji-panel {
  left: 60px; width: 268px; max-height: 220px; overflow-y: auto; padding: 10px;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.acr-emoji { background: transparent; border: none; font-size: 20px; cursor: pointer; padding: 4px 0; border-radius: 7px; }
.acr-emoji:hover { background: var(--acr-soft); }

/* Barre de réponse au-dessus de la saisie */
.acr-reply {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-top: 1px solid var(--acr-border); background: var(--acr-soft);
}
.acr-reply-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acr-reply-label { font-size: 11px; font-weight: 700; color: var(--acr-primary); }
.acr-reply-text { font-size: 12px; color: var(--acr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acr-reply-x { border: none; background: transparent; color: var(--acr-muted); cursor: pointer; font-size: 14px; }

/* ── Modals ────────────────────────────────────────────────────────────────── */
.acr-modal {
  position: fixed; inset: 0; z-index: 1200; background: var(--pp-scrim, rgba(31, 19, 64, 0.45));
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.acr-modal-panel {
  background: var(--pp-card, #fff); border-radius: 16px; width: 100%; max-width: 440px; max-height: 84vh;
  overflow-y: auto; box-shadow: 0 24px 60px var(--pp-shadow, rgba(31, 19, 64, 0.3)); padding: 0 0 16px;
}
.acr-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--acr-border); position: sticky; top: 0; background: var(--pp-card, #fff); border-radius: 16px 16px 0 0;
}
.acr-modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--acr-text); }
.acr-modal-x { width: 30px; height: 30px; border-radius: 8px; border: none; background: var(--acr-primary); color: #fff; font-size: 15px; cursor: pointer; }
.acr-modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 4px 20px 0; }

.acr-input {
  width: 100%; box-sizing: border-box; padding: 11px 13px; margin: 10px 20px 0; width: calc(100% - 40px);
  background: var(--acr-soft); border: 1px solid var(--acr-border); border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--acr-text); outline: none;
}
.acr-input:focus { border-color: var(--acr-primary); }
.acr-row2 { display: flex; gap: 8px; }
.acr-row2 .acr-input { margin-right: 0; }
.acr-row2 .acr-input:first-child { margin-left: 20px; }
.acr-row2 .acr-input:last-child { margin-right: 20px; width: auto; flex-shrink: 0; }

.acr-opts-wrap { display: flex; flex-direction: column; gap: 7px; padding: 10px 20px 0; }
.acr-opt-edit { display: flex; align-items: center; gap: 8px; }
.acr-opt-edit .acr-input { margin: 0; width: 100%; }
.acr-opt-input { flex: 1; }
.acr-correct {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--acr-border);
  background: var(--pp-card, #fff); color: #fff; cursor: pointer; flex-shrink: 0; font-size: 12px;
}
.acr-correct.is-on { background: var(--acr-green); border-color: var(--acr-green); }
.acr-opt-del { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--acr-border); background: transparent; color: var(--acr-red); cursor: pointer; flex-shrink: 0; }
.acr-add-opt {
  margin: 10px 20px 0; padding: 7px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--acr-primary) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--acr-primary) 45%, transparent);
  color: var(--acr-primary-dark); font-weight: 700; font-size: 12px; cursor: pointer;
}
.acr-hint { font-size: 11px; color: var(--acr-muted); padding: 8px 20px 0; }

.acr-btn { padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid transparent; }
.acr-btn-ghost { background: var(--pp-card, #fff); border-color: var(--acr-border); color: var(--acr-text); }
.acr-btn-primary { background: var(--acr-primary); color: #fff; }
.acr-btn-primary:hover { background: var(--acr-primary-dark); }

.acr-user-list { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 0; }
.acr-user-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; background: transparent; border: none; border-radius: 9px; cursor: pointer; text-align: left; }
.acr-user-row:hover { background: var(--acr-soft); }
.acr-user-row small { display: block; color: var(--acr-muted); }

.acr-sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 14px 20px; }
.acr-sticker-pick { background: var(--acr-soft); border: none; border-radius: 12px; font-size: 30px; cursor: pointer; padding: 8px 0; }
.acr-sticker-pick:hover { background: color-mix(in srgb, var(--acr-primary) 12%, transparent); }

/* ── Drawer profil ZIC ─────────────────────────────────────────────────────── */
.acr-drawer { position: fixed; inset: 0; z-index: 1200; background: var(--pp-scrim, rgba(31, 19, 64, 0.4)); display: flex; justify-content: flex-end; }
.acr-drawer-panel { width: 360px; max-width: 92vw; height: 100%; background: var(--pp-card, #fff); box-shadow: -10px 0 40px var(--pp-shadow-soft, rgba(31, 19, 64, 0.18)); display: flex; flex-direction: column; }
.acr-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--acr-border); font-weight: 800; color: var(--acr-text); }
.acr-prof-id { padding: 24px 20px; text-align: center; }
.acr-prof-av { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; }
.acr-prof-av--fb { display: flex; align-items: center; justify-content: center; background: var(--pp-card-light, #e5e7eb); color: var(--pp-text-soft, #9ca3af); font-weight: 800; font-size: 28px; }
.acr-prof-name { font-weight: 800; font-size: 20px; color: var(--acr-text); }
.acr-prof-handle { font-size: 12.5px; color: var(--acr-muted); margin-top: 2px; }
.acr-prof-link { display: inline-block; margin-top: 14px; padding: 9px 18px; background: var(--acr-primary); color: #fff; border-radius: 999px; font-weight: 700; font-size: 12.5px; text-decoration: none; }

/* Drawer profil : corps scrollable, titre cœur, en-ligne, stats, activité, actions */
.acr-drawer-body { flex: 1; overflow-y: auto; }
.acr-drawer-title { display: inline-flex; align-items: center; gap: 8px; color: var(--acr-primary); }
.acr-drawer-title span { color: var(--acr-text); }
.acr-prof-av-wrap { position: relative; width: 84px; height: 84px; margin: 0 auto 12px; }
.acr-prof-av-wrap .acr-prof-av { margin: 0; }
.acr-prof-online { position: absolute; bottom: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--acr-green); border: 3px solid var(--pp-card, #fff); }

.acr-prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--acr-border); }
.acr-prof-stat { background: var(--acr-soft); border-radius: 10px; padding: 12px 8px; text-align: center; min-height: 56px; }
.acr-prof-stat-v { font-weight: 800; font-size: 18px; color: var(--acr-text); }
.acr-prof-stat-l { font-size: 10px; color: var(--acr-muted); font-weight: 700; letter-spacing: .4px; text-transform: uppercase; margin-top: 3px; }

.acr-prof-section { padding: 16px 20px; border-bottom: 1px solid var(--acr-border); }
.acr-prof-section-title { font-weight: 800; font-size: 12px; letter-spacing: .3px; text-transform: uppercase; color: var(--acr-text); margin-bottom: 12px; }
.acr-prof-empty { color: var(--acr-muted); font-size: 12.5px; text-align: center; padding: 12px 0; }
.acr-prof-act { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.acr-prof-act-ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.acr-prof-act-drop { background: color-mix(in srgb, var(--acr-primary) 14%, transparent); }
.acr-prof-act-product { background: #fef3c7; }
.acr-prof-act-body { min-width: 0; }
.acr-prof-act-label { font-weight: 600; font-size: 12.5px; color: var(--acr-text); }
.acr-prof-act-detail { font-size: 11px; color: var(--acr-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.acr-prof-actions { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.acr-prof-action { text-align: left; padding: 12px 14px; background: var(--pp-card, #fff); border: 1px solid var(--acr-border); border-radius: 10px; font-weight: 600; font-size: 12.5px; color: var(--acr-text); cursor: pointer; }
.acr-prof-action:hover { background: var(--acr-soft); }
.acr-prof-danger { color: var(--acr-red); }
.acr-prof-danger[data-blocked="1"] { color: var(--acr-primary); }

.acr-skel { position: relative; overflow: hidden; background: var(--acr-soft); }
.acr-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: acrSkel 1.2s infinite; }
@keyframes acrSkel { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Drawer « Membres du groupe » + en-tête de groupe cliquable */
.acr-peer-clickable { cursor: pointer; }
.acr-members-count { padding: 14px 20px 0; font-size: 12px; color: var(--acr-muted); }
.acr-members-add { padding: 12px 20px 0; }
.acr-members-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.acr-member-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 9px; }
.acr-member-row:hover { background: var(--acr-soft); }
.acr-member-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.acr-member-av--fb { display: flex; align-items: center; justify-content: center; background: var(--pp-card-light, #e5e7eb); color: var(--pp-text-soft, #9ca3af); font-weight: 700; font-size: 13px; }
.acr-member-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.acr-member-name { font-weight: 600; font-size: 13.5px; color: var(--acr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acr-member-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--acr-primary-dark); background: color-mix(in srgb, var(--acr-primary) 14%, transparent); padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }
.acr-member-you { font-size: 11px; color: var(--acr-muted); flex-shrink: 0; }
.acr-member-remove { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--acr-border); background: var(--pp-card, #fff); color: var(--acr-red); cursor: pointer; flex-shrink: 0; }
.acr-member-remove:hover { background: color-mix(in srgb, var(--acr-red) 10%, transparent); }

/* ── Appels audio/vidéo (LiveKit) ──────────────────────────────────────────── */
.acr-call-overlay { position: fixed; inset: 0; z-index: 1300; background: #0f1117; display: flex; flex-direction: column; }
.acr-call-head { padding: 16px; text-align: center; }
.acr-call-status { font-size: 14px; color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.acr-call-grid { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 12px; grid-auto-rows: 1fr; overflow: auto; }
.acr-call-grid[data-count="1"] { grid-template-columns: 1fr; }
.acr-call-grid[data-count="2"],
.acr-call-grid[data-count="3"],
.acr-call-grid[data-count="4"] { grid-template-columns: 1fr 1fr; }
.acr-call-grid[data-count="5"],
.acr-call-grid[data-count="6"],
.acr-call-grid[data-count="7"],
.acr-call-grid[data-count="8"],
.acr-call-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
.acr-call-grid[data-count="many"] { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.acr-call-tile { position: relative; background: #1b1f2a; border-radius: 14px; overflow: hidden; min-height: 0; display: flex; align-items: center; justify-content: center; }
.acr-call-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Self-view en miroir (convention Meet/WhatsApp) — n'affecte que l'affichage local */
.acr-call-video--self { transform: scaleX(-1); }
.acr-call-tile.has-video .acr-call-av { display: none; }
/* Caméra coupée (logique WhatsApp) : on masque la vidéo et on montre l'avatar */
.acr-call-tile.cam-off .acr-call-video { display: none; }
.acr-call-tile.cam-off .acr-call-av { display: flex; }
/* Micro coupé : badge rouge micro barré */
.acr-call-mic { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: rgba(239, 68, 68, 0.92); color: #fff; display: none; align-items: center; justify-content: center; }
.acr-call-tile.mic-off .acr-call-mic { display: flex; }
.acr-call-av { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.acr-call-av--fb { display: flex; align-items: center; justify-content: center; background: #2a3142; color: #cbd5e1; font-weight: 700; font-size: 26px; }
.acr-call-name { position: absolute; left: 10px; bottom: 8px; z-index: 1; color: #fff; font-size: 12px; font-weight: 600; background: rgba(0, 0, 0, 0.45); padding: 2px 8px; border-radius: 999px; }
.acr-call-controls { display: flex; gap: 14px; justify-content: center; padding: 18px; }
.acr-call-ctl { width: 56px; height: 56px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s ease; }
.acr-call-ctl svg { width: 24px; height: 24px; display: block; }
.acr-call-ctl:hover { background: rgba(255, 255, 255, 0.24); }
.acr-call-ctl.is-off { background: #ea4335; color: #fff; }
.acr-call-ctl.is-off:hover { background: #d33b2c; }
/* Bouton actif (ex. flou d'arrière-plan activé) */
.acr-call-ctl.is-on { background: rgba(96, 165, 250, 0.95); color: #fff; }
.acr-call-ctl.is-on:hover { background: rgba(59, 130, 246, 0.95); }
.acr-call-hang { background: #ea4335; }
.acr-call-hang:hover { background: #d33b2c; }

.acr-call-incoming { align-items: center; justify-content: center; background: rgba(15, 17, 23, 0.97); }
.acr-call-incoming-card { text-align: center; color: #fff; }
.acr-call-incoming .acr-call-av--fb { width: 96px; height: 96px; font-size: 34px; margin: 0 auto 16px; animation: acrCallPulse 1.4s ease-in-out infinite; }
.acr-call-incoming-name { font-size: 22px; font-weight: 800; }
.acr-call-incoming-sub { font-size: 14px; color: rgba(255, 255, 255, 0.7); margin-top: 6px; }
.acr-call-incoming-actions { display: flex; gap: 24px; justify-content: center; margin-top: 32px; }
.acr-call-accept, .acr-call-decline { border: none; border-radius: 999px; padding: 14px 26px; font-weight: 700; font-size: 15px; cursor: pointer; color: #fff; }
.acr-call-accept { background: #22c55e; }
.acr-call-decline { background: #ef4444; }
@keyframes acrCallPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Message « appel » dans le fil */
.acr-callmsg { display: flex; align-items: center; gap: 12px; max-width: min(74%, 340px); }
.acr-callmsg-ic { font-size: 22px; flex-shrink: 0; }
.acr-callmsg-body { min-width: 0; }
.acr-callmsg-label { font-weight: 700; font-size: 13.5px; color: var(--acr-text); }
.acr-callmsg.is-missed .acr-callmsg-label { color: var(--acr-red); }
.acr-callmsg-detail { font-size: 11.5px; color: var(--acr-muted); }
.acr-callmsg-join { margin-left: auto; padding: 6px 12px; border-radius: 999px; border: none; background: var(--acr-green); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; flex-shrink: 0; }

/* ── Onglets du modal nouvelle conversation ───────────────────────────────── */
.acr-tabs { display: flex; gap: 8px; padding: 14px 20px 0; }
.acr-tab {
  flex: 1; padding: 9px; border-radius: 9px; border: none; cursor: pointer;
  background: var(--acr-soft); color: var(--acr-text); font-weight: 700; font-size: 12.5px;
}
.acr-tab.is-on { background: var(--acr-primary); color: #fff; }
.acr-member-count { margin-right: auto; font-size: 12px; color: var(--acr-muted); align-self: center; }
.acr-call { width: 34px; height: 34px; font-size: 15px; }

/* Cœur « Profil ZIC » + badge groupe dans le header de conversation */
.acr-peer-name-row { display: flex; align-items: center; gap: 8px; }
.acr-peer-heart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; flex-shrink: 0; padding: 0;
  background: color-mix(in srgb, var(--acr-primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--acr-primary) 26%, transparent);
  color: var(--acr-primary);
}
.acr-peer-heart:hover { background: color-mix(in srgb, var(--acr-primary) 20%, transparent); }
.acr-peer-heart svg { width: 15px; height: 15px; display: block; }
.acr-peer-badge {
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--acr-primary) 14%, transparent); color: var(--acr-primary-dark);
  white-space: nowrap; flex-shrink: 0;
}
/* Contraint le bloc nom/statut pour qu'il tronque au lieu de déborder sous les
   actions (le statut « Hors ligne — Dernière connexion : … » est très long). */
.ac-main-peer > div { min-width: 0; }
.ac-main-peer > div > div { min-width: 0; }
.acr-peer-name-row { min-width: 0; }
.acr-peer-name-row .ac-peer-name {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-peer-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sélection multi (mode groupe) : case à cocher posée par le JS hôte */
.acr-user-check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid var(--acr-border); background: var(--pp-card, #fff); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.acr-user-row.is-selected .acr-user-check { background: var(--acr-primary); border-color: var(--acr-primary); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.acr-toast {
  position: absolute; bottom: 78px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--acr-text); color: var(--pp-bg, #fff); padding: 8px 16px; border-radius: 999px; font-size: 12.5px;
  box-shadow: 0 8px 24px var(--pp-shadow-soft, rgba(31, 19, 64, 0.25));
}

/* ── Responsive : tablette / mobile ────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Appels : 1 colonne jusqu'à 2 participants, 2 colonnes au-delà ; contrôles compacts. */
  .acr-call-grid[data-count="1"],
  .acr-call-grid[data-count="2"] { grid-template-columns: 1fr; }
  .acr-call-grid[data-count="3"],
  .acr-call-grid[data-count="4"],
  .acr-call-grid[data-count="5"],
  .acr-call-grid[data-count="6"],
  .acr-call-grid[data-count="7"],
  .acr-call-grid[data-count="8"],
  .acr-call-grid[data-count="9"],
  .acr-call-grid[data-count="many"] { grid-template-columns: 1fr 1fr; }
  .acr-call-ctl { width: 50px; height: 50px; font-size: 20px; }
  /* Header de conversation compact : appels plus petits, actions resserrées,
     statut/nom tronqués pour ne pas chevaucher les boutons. */
  .ac-main-head { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .acr-call { width: 30px; height: 30px; font-size: 13px; }
  .ac-main-actions { gap: 4px; }
  .ac-main-actions .ac-textbtn { padding: 4px 5px; font-size: 11.5px; }
  .acr-peer-heart { width: 24px; height: 24px; }
  .acr-card, .acr-media-wrap { max-width: 86%; }
  .acr-att-img, .acr-att-video, .acr-att-file { max-width: 78vw; }
  .acr-modal { padding: 0; align-items: flex-end; }
  .acr-modal-panel { max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .acr-emoji-panel { left: 8px; right: 8px; width: auto; }
  .acr-attach-menu { left: 8px; }
  .acr-drawer-panel { width: 100%; max-width: 100%; }
  .acr-sticker { font-size: 52px; }
}
