/* Messagerie avec l'équipe : liste des conversations, fil façon messagerie instantanée, réglages */
.ms-bandeau { text-decoration: none; margin-bottom: 16px; }
.ms-cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; margin-left: 6px; }

/* Liste des conversations */
.ms-convs { display: flex; flex-direction: column; }
.ms-conv { display: flex; align-items: center; gap: 11px; padding: 10px 14px; color: inherit; text-decoration: none;
  border-top: 1px solid var(--line); transition: background var(--t-rapide); }
.ms-conv:first-child { border-top: 0; }
.ms-conv:hover { background: color-mix(in srgb, var(--or) 7%, var(--surface)); }
.ms-conv.actif { background: color-mix(in srgb, var(--or) 14%, var(--surface)); }
.ms-conv.grande { padding: 13px 16px; }
.ms-conv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ms-conv-txt > span:not(.ms-conv-haut):not(.ms-extrait) { font-size: 12px; color: var(--fg-3); }
.ms-conv-haut { display: flex; align-items: baseline; gap: 8px; }
.ms-heure { margin-left: auto; white-space: nowrap; }
.ms-extrait { font-size: 14px; color: color-mix(in srgb, var(--fg) 70%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-extrait.non-lu { color: var(--fg); font-weight: 600; }
.ms-astuces { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }

/* Écran de conversation */
.ms-cadre { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; height: calc(100vh - 120px); min-height: 480px; }
.ms-liste { overflow-y: auto; }
.ms-discussion { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ms-tete { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ms-nom { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.ms-retour { display: none; color: inherit; font-size: 22px; }
.ms-defile { flex: 1; overflow-y: auto; padding: 16px; background:
  radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--or) 6%, transparent), transparent 40%), var(--bg); }
.ms-fil { display: flex; flex-direction: column; gap: 8px; }
.ms-jour { text-align: center; margin: 8px 0; }
.ms-jour span { font-size: 12px; font-weight: 600; color: var(--fg-3); background: var(--surface); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.ms-bulle { display: flex; gap: 8px; align-items: flex-end; max-width: min(78%, 620px); }
.ms-bulle .ms-texte { white-space: pre-line; padding: 9px 13px; font-size: 15px; line-height: 1.4; border-radius: 16px; box-shadow: 0 1px 1px rgba(42, 35, 24, .08); overflow-wrap: anywhere; }
.ms-bulle.eux .ms-texte { background: var(--surface); border-bottom-left-radius: 4px; }
.ms-bulle.moi { align-self: flex-end; flex-direction: column; align-items: flex-end; }
.ms-bulle.moi .ms-texte { background: #2a2318; color: #fff7e4; border-bottom-right-radius: 4px; }
.ms-meta { font-size: 11px; color: var(--fg-3); margin: 3px 6px 0; }
.ms-meta a { color: var(--accent-fg); font-weight: 600; text-decoration: none; }
.ms-av { box-shadow: none; margin-bottom: 16px; }
.ms-vide { padding-top: 60px; }
.ms-vide p { font-style: italic; }
.ms-suggestions { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; }
.ms-sugg { flex: none; border: 1px solid color-mix(in srgb, var(--or) 45%, var(--line)); background: color-mix(in srgb, var(--or) 10%, var(--surface));
  color: inherit; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ms-sugg:hover { border-color: var(--or); }
.ms-saisie { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; }
.ms-saisie textarea { flex: 1; resize: none; max-height: 140px; border-radius: 20px; padding: 10px 16px; font: inherit; font-size: 15px; line-height: 1.35; }
.ms-saisie .btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; justify-content: center; }
.ms-ecrit { position: absolute; top: -18px; left: 20px; display: none; }
.ms-saisie.htmx-request .ms-ecrit { display: block; }
.ms-saisie.htmx-request .ms-ecrit::after { content: ""; animation: ms-points 1.2s steps(4) infinite; }
@keyframes ms-points { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Réglages */
.ms-h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 19px; margin: 0 0 8px; }
.ms-h2 .badge { margin-left: auto; }
.ms-etapes { margin: 8px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ms-form-cle { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ms-form-cle input { flex: 1; min-width: 220px; }
.ms-appairage { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 10px 0; }
.ms-code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; font-weight: 800; letter-spacing: .15em; color: var(--fg); background: color-mix(in srgb, var(--or) 14%, var(--surface)); padding: 2px 10px; border-radius: 8px; }
.ms-qui { display: flex; flex-direction: column; }
.ms-qui-ligne { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.ms-qui-ligne:first-child { border-top: 0; }
.ms-qui-ligne > span { flex: 1; }

@media (max-width: 860px) {
  .ms-cadre { grid-template-columns: 1fr; height: calc(100dvh - 150px); }
  .ms-liste { display: none; }
  .ms-retour { display: inline-flex; }
  .ms-bulle { max-width: 88%; }
}

/* Un bot par collègue */
.ms-bots { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ms-bot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--bord, #e5e1d8); }
.ms-bot:first-child { border-top: 0; }
.ms-bot-nom { flex: 1 1 200px; min-width: 0; }
.ms-bot .ms-form-cle { flex: 1 1 260px; margin: 0; }
.ms-bot form { margin: 0; }
.ms-details { margin: 8px 0; }
.ms-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.ms-bot .ms-form-cle { flex-wrap: nowrap; }
.ms-bot .ms-form-cle input { min-width: 0; }

/* Les voix */
.ms-voix-ligne { display: flex; align-items: center; gap: 8px; }
.ms-voix-ligne > span { flex: 0 0 64px; }
.ms-voix-ligne select { flex: 1; min-width: 0; }
