/* L'espace de Khouloud : l'histoire du PV et ses réunions (espace-reunions.js, contrat C3). Tout est préfixé par
   .espace-reunions : rien ne change ailleurs. Les jetons, boutons et étiquettes sont ceux de portail.css. */

/* Dans un conteneur à lui, il le remplit et défile ; posé dans #espace, il prend le milieu, comme l'agent Revit. */
.espace-reunions { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; overflow: auto;
  overscroll-behavior: contain; scrollbar-gutter: stable; }
.espace-reunions.espace-reunions-milieu { left: 360px; right: 384px; width: auto; overflow: auto; }
@media (max-width: 1180px) and (min-width: 861px) { .espace-reunions.espace-reunions-milieu { left: 24px; } }
.espace-reunions > * { flex: none; }
.espace-reunions h2 { font-size: 13px; font-weight: 600; color: var(--texte-2); font-family: var(--mono); letter-spacing: .02em; }
.espace-reunions b { font-weight: 650; }

/* ---------- Le guide « L'histoire du PV » : cinq étapes sur un rail, puis les deux raisons ---------- */
.espace-reunions .er-guide { border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface-2); }
.espace-reunions .er-guide summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer;
  list-style: none; border-radius: var(--rayon); }
.espace-reunions .er-guide summary::-webkit-details-marker { display: none; }
.espace-reunions .er-guide summary::before { content: ""; flex: none; width: 7px; height: 7px; align-self: center;
  border-right: 1.5px solid var(--texte-2); border-bottom: 1.5px solid var(--texte-2); transform: rotate(-45deg);
  transition: transform 160ms var(--ease-out); }
.espace-reunions .er-guide[open] summary::before { transform: rotate(45deg) translate(-2px, -1px); }
.espace-reunions .er-guide-titre { font-weight: 650; font-size: 15px; }
.espace-reunions .er-guide-suite { color: var(--texte-2); font-size: 13px; }
@media (hover: hover) and (pointer: fine) { .espace-reunions .er-guide summary:hover .er-guide-suite { color: var(--texte); } }

.espace-reunions .er-etapes { counter-reset: etape; display: grid; padding: 2px 14px 4px; }
.espace-reunions .er-etapes li { counter-increment: etape; position: relative; display: grid; gap: 3px;
  padding: 0 0 14px 38px; font-size: 14px; line-height: 1.5; }
/* Le numéro dans son rond, et le rail qui relie les étapes jusqu'à la dernière. */
.espace-reunions .er-etapes li::before { content: counter(etape); position: absolute; left: 0; top: -1px; width: 24px; height: 24px;
  display: grid; place-items: center; border: 1px solid var(--ligne-forte); border-radius: 50%; background: var(--surface);
  font: 600 12px/1 var(--mono); color: var(--texte); }
.espace-reunions .er-etapes li::after { content: ""; position: absolute; left: 12px; top: 25px; bottom: 1px; width: 1px;
  background: var(--ligne-forte); }
.espace-reunions .er-etapes li:last-child { padding-bottom: 6px; }
.espace-reunions .er-etapes li:last-child::after { display: none; }
.espace-reunions .er-etapes li:last-child::before { border-color: var(--ok); color: var(--ok); }
.espace-reunions .er-etapes span { color: var(--texte-2); }
.espace-reunions .er-exemple { display: grid; gap: 2px; margin-top: 4px; padding: 8px 10px; border-left: 2px solid var(--cable);
  background: var(--surface); border-radius: var(--rayon); }
.espace-reunions .er-exemple code { font: 12.5px/1.5 var(--mono); color: var(--texte); overflow-wrap: anywhere; }

.espace-reunions .er-pourquoi { display: grid; gap: 8px; padding: 0 14px 14px; }
.espace-reunions .er-pourquoi p { padding: 9px 12px; border-left: 2px solid var(--ligne-forte); background: var(--surface);
  border-radius: var(--rayon); font-size: 13.5px; line-height: 1.5; color: var(--texte-2); }
.espace-reunions .er-pourquoi p b { color: var(--texte); }
.espace-reunions .er-pourquoi p[data-ton="attente"] { border-left-color: var(--attend); }

/* ---------- Le dépôt : un cadre en pointillé, comme celui du portail ---------- */
.espace-reunions .er-depot { display: grid; gap: 5px; padding: 16px; border: 1px dashed var(--ligne-forte);
  border-radius: var(--rayon); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.espace-reunions .er-depot-titre { font-weight: 650; font-size: 15px; }
.espace-reunions .er-depot-phrase { color: var(--texte-2); font-size: 13.5px; }
.espace-reunions .er-depot-sortes { font: 12px/1.4 var(--mono); color: var(--texte-2); }
.espace-reunions .er-depot[data-survol] { border-color: var(--cable); background: color-mix(in srgb, var(--cable) 8%, transparent); }
@media (hover: hover) and (pointer: fine) { .espace-reunions .er-depot:hover { border-color: var(--texte-2); } }
.espace-reunions .er-depot:has(:focus-visible) { outline: 2px solid var(--texte); outline-offset: 3px; }

/* Le son (23/11/2026) : son bouton sous le cadre, et la barre de l'envoi. */
.espace-reunions .er-son-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: -4px;
  font-size: 13.5px; color: var(--texte-2); }
.espace-reunions .er-son { cursor: pointer; }
.espace-reunions .er-son:has(:focus-visible) { outline: 2px solid var(--texte); outline-offset: 3px; }
.espace-reunions .er-envoi { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
.espace-reunions .er-envoi[hidden] { display: none; }
.espace-reunions .er-envoi-nom { grid-column: 1 / -1; font-size: 13.5px; overflow-wrap: anywhere; }
.espace-reunions .er-envoi-barre { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0;
  border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.espace-reunions .er-envoi-barre::-webkit-progress-bar { background: var(--surface-2); border-radius: 3px; }
.espace-reunions .er-envoi-barre::-webkit-progress-value { background: var(--cable); border-radius: 3px; transition: width 200ms linear; }
.espace-reunions .er-envoi-barre::-moz-progress-bar { background: var(--cable); border-radius: 3px; }
.espace-reunions .er-envoi-pct { font: 12px/1 var(--mono); color: var(--texte-2); min-width: 4ch; text-align: right; }

/* ---------- La carte « Compte Microsoft » ---------- */
.espace-reunions .er-ms { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--ligne);
  border-radius: var(--rayon); background: var(--surface-2); font-size: 13.5px; line-height: 1.5; }
.espace-reunions .er-ms[hidden] { display: none; }
.espace-reunions .er-ms-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.espace-reunions .er-ms-tete h3 { font-size: 15px; font-weight: 650; }
.espace-reunions .er-ms { --teinte: var(--texte-2); }
.espace-reunions .er-ms[data-etat="connecte"] { --teinte: var(--ok); }
.espace-reunions .er-ms[data-etat="code"] { --teinte: var(--attend); }
.espace-reunions .er-ms-etat { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--mono); color: var(--teinte);
  white-space: nowrap; }
.espace-reunions .er-ms-etat:not(:empty)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teinte); }
.espace-reunions .er-ms-corps { display: grid; gap: 10px; justify-items: start; }
.espace-reunions .er-ms-corps:empty { display: none; }
.espace-reunions .er-ms-phrase, .espace-reunions .er-ms-note { color: var(--texte-2); }
.espace-reunions .er-ms-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  justify-self: stretch; }
.espace-reunions .er-ms-compte { overflow-wrap: anywhere; min-width: 0; }
.espace-reunions .er-ms-droits { display: grid; justify-self: stretch; border-top: 1px solid var(--ligne); }
.espace-reunions .er-ms-droit { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--ligne); }
.espace-reunions .er-ms-droit-etat { flex: none; font: 600 12px/1.4 var(--mono); color: var(--attend); }
.espace-reunions .er-ms-droit[data-ok="oui"] .er-ms-droit-etat { color: var(--ok); }
.espace-reunions .er-ms-dossier code, .espace-reunions .er-ms-pas a { font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.espace-reunions .er-ms-pas { display: grid; gap: 6px; padding-left: 20px; list-style: decimal; }
.espace-reunions .er-ms-pas a { color: var(--texte); text-decoration: underline; text-underline-offset: 3px; }
.espace-reunions .er-ms-code { display: inline-block; margin-left: 4px; padding: 4px 10px; border: 1px solid var(--ligne-forte);
  border-radius: var(--rayon); background: var(--surface); font: 600 20px/1.3 var(--mono); letter-spacing: .08em;
  color: var(--texte); user-select: all; -webkit-user-select: all; }
.espace-reunions .er-ms-envoi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; cursor: pointer; }
.espace-reunions .er-ms-envoi input { width: 18px; height: 18px; margin: 0; accent-color: var(--texte); cursor: pointer; }
.espace-reunions .er-ms-envoi input:disabled { cursor: not-allowed; }
.espace-reunions .er-ms-essai { padding: 2px 7px; border: 1px solid var(--attend); border-radius: var(--rayon);
  font: 600 12px/1.4 var(--mono); color: var(--attend); }
.espace-reunions .er-ms-erreur { color: var(--panne); overflow-wrap: anywhere; }
.espace-reunions .er-ms-message { justify-self: stretch; padding: 8px 10px; border-left: 2px solid var(--attend); background: var(--surface);
  border-radius: var(--rayon); overflow-wrap: anywhere; }

.espace-reunions .er-annonce { font-size: 13.5px; color: var(--texte); overflow-wrap: anywhere; }
.espace-reunions .er-annonce:empty { display: none; }
.espace-reunions .er-erreur { color: var(--panne); font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- La liste des PV : ce qui attend Khouloud d'abord ; le statut en couleur franche ---------- */
.espace-reunions .er-liste-titre { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 650;
  padding-top: 4px; }
.espace-reunions .er-compte { font: 600 12px/1 var(--mono); color: var(--attend); }
.espace-reunions .er-liste { display: grid; }
.espace-reunions .er-vide { padding: 12px 0; border-top: 1px solid var(--ligne); color: var(--texte-2); font-size: 13.5px; }
.espace-reunions .er-pv { --teinte: var(--texte-2); display: grid; gap: 4px; padding: 12px 0 12px 12px;
  border-top: 1px solid var(--ligne); position: relative; }
.espace-reunions .er-pv::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px;
  background: var(--teinte); border-radius: 1px; }
.espace-reunions .er-pv[data-statut="a_relire"] { --teinte: var(--attend); }
.espace-reunions .er-pv[data-statut="valide"] { --teinte: var(--ok); }
.espace-reunions .er-pv[data-statut="erreur"] { --teinte: var(--panne); }
.espace-reunions .er-pv-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.espace-reunions .er-pv-nom { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.espace-reunions .er-statut { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--mono);
  color: var(--teinte); white-space: nowrap; }
.espace-reunions .er-statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teinte); }
.espace-reunions .er-pv[data-statut="attente_accord_ia"] .er-statut,
.espace-reunions .er-pv[data-statut="inconnu"] .er-statut { color: var(--texte-2); }
.espace-reunions .er-pv[data-statut="transcription_en_cours"] { --teinte: var(--cable); }
.espace-reunions .er-pv[data-statut="transcription_en_cours"] .er-statut::before { animation: er-battement 1.6s ease-in-out infinite; }
@keyframes er-battement { 50% { opacity: .25; } }
.espace-reunions .er-pv-infos { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.espace-reunions .er-source { padding: 1px 6px; border: 1px solid var(--ligne-forte); border-radius: var(--rayon);
  font: 600 11.5px/1.4 var(--mono); color: var(--texte); }
.espace-reunions .er-pv-date, .espace-reunions .er-pv-participants { font: 12px/1.4 var(--mono); color: var(--texte-2); }
/* Après « Valider » (R2) : chaque suite sur sa ligne, une coche verte ou une croix rouge. */
.espace-reunions .er-suites { display: grid; gap: 2px; }
.espace-reunions .er-suite { position: relative; padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.espace-reunions .er-suite::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.espace-reunions .er-suite[data-ok="oui"]::before { content: "✓"; color: var(--ok); }
.espace-reunions .er-suite[data-ok="non"] { color: var(--panne); }
.espace-reunions .er-suite[data-ok="non"]::before { content: "✕"; color: var(--panne); }
.espace-reunions .er-pv-message { font-size: 13px; color: var(--texte-2); overflow-wrap: anywhere; white-space: pre-line; }
.espace-reunions .er-pv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.espace-reunions .er-pv-actions .btn { text-decoration: none; }
.espace-reunions .er-confirmer { display: grid; gap: 4px; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--ligne-forte);
  border-radius: var(--rayon); background: var(--surface-2); font-size: 13.5px; }
.espace-reunions .er-pv-erreur { color: var(--panne); font-size: 13px; }

/* Au téléphone : le panneau suit les autres, à pleine largeur. */
@media (max-width: 860px) {
  .espace-reunions.espace-reunions-milieu { left: auto; right: auto; }
  .espace-reunions { overflow: visible; }
  .espace-reunions .er-pv-tete { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .espace-reunions .er-depot, .espace-reunions .er-guide summary::before { transition: none; }
  .espace-reunions .er-envoi-barre::-webkit-progress-value { transition: none; }
  .espace-reunions .er-pv[data-statut="transcription_en_cours"] .er-statut::before { animation: none; }
}
