/* L'ÉDITEUR DES NOTES, repris de Rich Circles le 15/10/2026 (`editeur.css` de
   reachcircles-app, classes « rc-ed » renommées « edn »). `static/js/editeur-note.js`.
   Ce qu'il écrit est le markdown de `md_safe.render_note_riche`. */
.edn { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); background: var(--background); overflow: hidden; }
.edn:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.edn-barre { display: flex; align-items: center; gap: 2px; padding: 5px 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); background: var(--card); }
.edn-barre button { min-width: 30px; height: 30px; padding: 0 7px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--muted-foreground); font: inherit; font-size: var(--text-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.edn-barre button:hover { background: var(--muted); color: var(--foreground); }
.edn-barre button.edn-actif { background: var(--muted); color: var(--foreground); }
.edn-barre button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.edn-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.edn-droite { margin-left: auto; }
.edn-zone, .edn-source { min-height: 180px; max-height: 60vh; overflow: auto; padding: 14px 16px;
  font-size: var(--text-base); line-height: 1.6; color: var(--foreground); outline: none; }
.edn-source { width: 100%; border: 0; resize: vertical; background: var(--background);
  font-family: var(--font-code); font-size: var(--text-sm); }
.edn-zone > :first-child { margin-top: 0; }
.edn-zone p { margin: 0 0 8px; }
.edn-zone h1, .edn-zone h2, .edn-zone h3 { margin: 12px 0 6px; line-height: 1.3; font-weight: 600; }
.edn-zone h1 { font-size: var(--text-xl); }
.edn-zone h2 { font-size: var(--text-lg); }
.edn-zone h3 { font-size: var(--text-md); }
.edn-zone ul, .edn-zone ol { margin: 0 0 8px; padding-left: 22px; }
.edn-zone blockquote { margin: 0 0 8px; padding: 2px 0 2px 12px; border-left: 3px solid var(--border-strong);
  color: var(--muted-foreground); }
.edn-zone a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.edn-zone hr { border: 0; border-top: 1px solid var(--border-strong); margin: 12px 0; }
.edn-zone ul[data-cases] { list-style: none; padding-left: 4px; }
.edn-zone ul[data-cases] > li { position: relative; padding-left: 26px; cursor: text; }
.edn-zone ul[data-cases] > li::before { content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px;
  border: 1.5px solid var(--muted-foreground); border-radius: 4px; cursor: pointer; }
.edn-zone ul[data-cases] > li[data-coche="1"]::before { background: var(--success); border-color: var(--success);
  box-shadow: inset 0 0 0 2px var(--background); }
.edn-zone ul[data-cases] > li[data-coche="1"] { color: var(--muted-foreground); text-decoration: line-through; }
.edn--note .edn-zone { min-height: 52px; padding: 12px 14px; }
/* ⚠️ Écrite, la note GARDE sa barre et sa hauteur hors du focus : sans cela,
   cliquer « Ajouter la note » faisait perdre le focus, la barre disparaissait,
   le bouton remontait sous le doigt et le clic tombait à côté (2 octobre 2026). */
.edn--note:focus-within .edn-zone, .edn--note:not(.edn--vide) .edn-zone { min-height: 110px; }
.edn--note .edn-barre { display: none; gap: 2px; padding: 4px 6px; border-bottom: 0; border-top: 1px solid var(--border); }
.edn--note:focus-within .edn-barre, .edn--note:not(.edn--vide) .edn-barre, .edn--grand .edn-barre { display: flex; }
.edn--note .edn-barre button { min-width: 32px; height: 32px; padding: 0 7px; font-size: var(--text-base); }
.edn--note .edn-lettre { font-family: var(--font-sans); font-size: calc(15px * var(--echelle-texte)); font-weight: 500; }
.edn-plus { color: var(--accent) !important; }
.edn-ico-reduire, .edn--grand .edn-ico-grand { display: none; }
.edn--grand .edn-ico-reduire { display: inline-flex; }
/* L'indication d'une zone vide (le script pose `edn-zone--vide`). */
.edn-zone[data-indication] { position: relative; }
.edn-zone--vide[data-indication]::after { content: attr(data-indication); position: absolute; top: 12px; left: 14px;
  right: 14px; color: var(--disabled-foreground); pointer-events: none; }
.edn--note:not(:focus-within) .edn-zone--vide[data-indication]::after { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Le menu « / » (et « + ») : posé dans la page, ou dans la fenêtre qui porte l'éditeur. */
.edn-menu { position: absolute; z-index: 60; width: 300px; max-height: 330px; overflow-y: auto; padding: 6px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.edn-menu-choix { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0;
  border-radius: var(--radius-sm); background: none; color: var(--foreground); font: inherit; text-align: left; cursor: pointer; }
.edn-menu-choix:hover, .edn-menu-choix--vu { background: var(--muted); }
.edn-menu-choix > b { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--background); color: var(--muted-foreground);
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 600; }
.edn-menu-choix > span { display: flex; flex-direction: column; min-width: 0; font-size: var(--text-sm); }
.edn-menu-choix small { color: var(--muted-foreground); font-size: var(--text-xs); }
.edn-menu-choix small:empty { display: none; }
.edn-menu-rien { margin: 6px 8px; font-size: var(--text-sm); color: var(--muted-foreground); }
/* « Écrire en grand » : la note prend la fenêtre (Échap pour revenir). */
.edn--grand { position: fixed; inset: 24px; z-index: 80; box-shadow: 0 30px 80px rgba(0,0,0,.65); }
.edn--grand .edn-zone { flex: 1; max-height: none; }
/* Dans la carte de l'appel (le volet) : la zone fait partie de la carte. */
.av-echange .edn { border: 0; border-radius: 0; background: transparent; }
.av-echange .edn:focus-within { box-shadow: none; }
.av-echange .edn-zone { min-height: 150px; padding: 12px 14px; font-size: var(--text-sm); }
/* Les cases et les titres d'une note RENDUE (l'historique, la fiche). */
.note-riche h3 { margin: 6px 0 4px; font-size: var(--text-sm); font-weight: 600; color: var(--foreground); }
.note-riche p { margin: 0 0 4px; }
.note-riche ul, .note-riche ol { margin: 0 0 4px; padding-left: 18px; }
.note-riche blockquote { margin: 0 0 4px; padding-left: 10px; border-left: 3px solid var(--border-strong); }
.note-riche hr { border: 0; border-top: 1px solid var(--border-strong); margin: 6px 0; }
.note-riche .note-cases { list-style: none; padding-left: 2px; }
.note-riche .note-cases li { display: flex; gap: 7px; align-items: baseline; }
.note-riche .note-case { flex: none; width: 12px; height: 12px; border: 1.5px solid var(--border-strong); border-radius: 3px; transform: translateY(1px); }
.note-riche li[data-coche="1"] { color: var(--muted-foreground); text-decoration: line-through; }
.note-riche li[data-coche="1"] .note-case { background: var(--success); border-color: var(--success); }
