/* Bloc-notes en ligne */
.o-bloc-notes { display: flex; flex-direction: column; gap: 14px; }
.o-bloc-notes-alerte { margin: 0; padding: 10px 14px; border-radius: var(--rayon-petit); background: var(--erreur-fond); color: var(--erreur-texte); font-weight: 600; }
.o-bloc-notes-alerte[hidden], .o-bloc-notes-confirmer[hidden] { display: none; }
.o-bloc-notes-corps { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.o-bloc-notes-volet { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.o-bloc-notes-tete { display: flex; gap: 8px; }
.o-bloc-notes-tete .btn { flex: 1; min-height: 42px; }
.o-bloc-notes .o-bloc-notes-ouvrir { display: none; }
.o-bloc-notes-tiroir { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.o-bloc-notes-cherche { display: block; margin: 0; }
.o-bloc-notes-cherche input { display: block; width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte); font: inherit; }
.o-bloc-notes-bilan { margin: 0; color: var(--texte-2); font-size: .85rem; }
.o-bloc-notes-bilan:empty { display: none; }
.o-bloc-notes-notes { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; max-height: 440px; overflow-y: auto; }
.o-bloc-notes-notes button { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; border: 1px solid var(--bord); border-left: 4px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte); font: inherit; text-align: left; cursor: pointer; }
.o-bloc-notes-notes button:hover { background: var(--surface-2); }
.o-bloc-notes-notes button[aria-current="true"] { border-left-color: var(--marque); background: var(--surface-2); }
.o-bloc-notes-titre { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-bloc-notes-date { color: var(--texte-2); font-size: .8rem; }
.o-bloc-notes-editeur { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.o-bloc-notes textarea { min-height: 440px; padding: 14px 16px; font-family: var(--police); font-size: 1rem; line-height: 1.6; tab-size: 4; }
.o-bloc-notes[data-taille="2"] textarea { font-size: 1.15rem; }
.o-bloc-notes[data-taille="3"] textarea { font-size: 1.35rem; }
.o-bloc-notes textarea.mono { font-family: var(--mono); }
.o-bloc-notes textarea.sans-retour { white-space: pre; overflow-x: auto; }
.o-bloc-notes textarea:focus-visible, .o-bloc-notes select:focus-visible, .o-bloc-notes-cherche input:focus-visible, .o-bloc-notes-notes button:focus-visible { outline: 3px solid var(--marque); outline-offset: 0; }
.o-bloc-notes-etat { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; color: var(--texte-2); font-size: .88rem; }
.o-bloc-notes-etat strong { color: var(--texte); font-variant-numeric: tabular-nums; }
.o-bloc-notes-sauve { margin-left: auto; color: var(--ok-texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.o-bloc-notes-sauve.erreur { color: var(--erreur-texte); }
.o-bloc-notes-actions, .o-bloc-notes-sauvegarde, .o-bloc-notes-confirmer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.o-bloc-notes-actions .btn, .o-bloc-notes-sauvegarde .btn, .o-bloc-notes-confirmer .btn { min-height: 42px; }
.atelier .o-bloc-notes .btn-outline.o-bloc-notes-danger { color: var(--erreur-texte); }
.o-bloc-notes-actions .o-bloc-notes-danger { margin-left: auto; }
.o-bloc-notes-confirmer { padding: 10px 14px; border-radius: var(--rayon-petit); background: var(--erreur-fond); }
.o-bloc-notes-confirmer p { flex: 1 1 220px; margin: 0; color: var(--erreur-texte); font-weight: 600; overflow-wrap: anywhere; }
.o-bloc-notes-message { display: block; font-size: .95rem; }
.o-bloc-notes-message.erreur { color: var(--erreur-texte); }
.o-bloc-notes-reglages label.case { align-self: end; line-height: 1.3; }
.o-bloc-notes-reglages label.case input { flex: none; }
.o-bloc-notes-sauvegarde { padding-top: 14px; border-top: 1px solid var(--bord); }
.o-bloc-notes-sauvegarde strong { color: var(--texte-2); font-size: .9rem; font-weight: 600; margin-right: 4px; }
.o-bloc-notes-note { margin: 0; padding: 10px 14px; border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--texte-2); font-size: .9rem; line-height: 1.5; }
.o-bloc-notes-impression { display: none; }

/* Plein écran : il ne reste que la note, son état et ses boutons */
.o-bloc-notes.plein { background: var(--surface); padding: 16px; overflow: auto; }
.o-bloc-notes.plein-fixe { position: fixed; inset: 0; z-index: 1000; }
.o-bloc-notes.plein .o-bloc-notes-volet, .o-bloc-notes.plein .o-bloc-notes-reglages, .o-bloc-notes.plein .o-bloc-notes-sauvegarde, .o-bloc-notes.plein .o-bloc-notes-note, .o-bloc-notes.plein .tirage-astuce { display: none; }
.o-bloc-notes.plein .o-bloc-notes-corps { display: flex; flex: 1; min-height: 0; align-items: stretch; }
.o-bloc-notes.plein .o-bloc-notes-editeur { flex: 1; }
.o-bloc-notes.plein textarea { flex: 1; min-height: 160px; resize: none; }

@media (max-width: 760px) {
  .o-bloc-notes-corps { grid-template-columns: minmax(0, 1fr); }
  .o-bloc-notes .o-bloc-notes-ouvrir { display: inline-flex; }
  .o-bloc-notes-tiroir { display: none; }
  .o-bloc-notes-tiroir.ouvert { display: flex; }
  .o-bloc-notes-notes { max-height: 260px; }
  .o-bloc-notes textarea { min-height: 300px; }
  .o-bloc-notes-actions .btn { flex: 1 1 auto; }
  .o-bloc-notes-actions .o-bloc-notes-danger { margin-left: 0; }
  .o-bloc-notes-sauve { margin-left: 0; }
}

/* Impression : seule la note sort sur le papier */
@media print {
  body > *:not(.o-bloc-notes-impression) { display: none !important; }
  body > .o-bloc-notes-impression { display: block; margin: 0; padding: 0; border: 0; background: #fff; color: #000; font: 12pt/1.5 Georgia, 'Times New Roman', serif; white-space: pre-wrap; overflow-wrap: anywhere; }
}
