/* ===================================================
   Manifst Mydoc : Styles spécifiques documentation
   Hérite de : ../../../assets/css/style.css (Bootstrap 5 + Inter)
   =================================================== */

/* ---- Variables Mydoc ----------------------------- */
:root {
  --doc-sidebar-w: 280px;
  --doc-toc-w:     240px;
}

/* ---- Selects : gouttière du chevron --------------
   style.css impose `padding: 8px 12px` à .form-control/.form-select et écrase
   donc le padding-right de 2.25rem que Bootstrap réserve au chevron : celui-ci
   se superpose au libellé. Même correctif qu'ailleurs dans l'app
   (.kanban-topbar .form-select, .risk-filter-select). */
.form-select { padding-right: 36px; }

/* ---- Layout 3 colonnes : nav-espace | éditeur | TOC ---- */
.doc-layout {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  transition: margin-left .22s ease;
}

.doc-nav {
  width: var(--doc-sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  left: var(--sidebar-w);
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb, #cbd5e1) transparent;
  transition: left .22s ease;
}

/* Sidebar principale réduite (64px) sur desktop */
@media (min-width: 901px) {
  .doc-layout { margin-left: var(--sidebar-w-collapsed); }
  .doc-nav    { left: var(--sidebar-w-collapsed); }
}

/* Sidebar épinglée → revient à la largeur complète. `html.sb-pinned` est posé
   dans le <head> (cf. style.css, « Sidebar épinglée ») : le sommaire est placé
   d'emblée, sans glisser à chaque page. Desktop seulement, comme la sidebar :
   en ≤900px le sommaire est empilé (margin-left: 0, plus bas). */
@media (min-width: 901px) {
  :root.sb-pinned .doc-layout { margin-left: var(--sidebar-w); }
  :root.sb-pinned .doc-nav    { left: var(--sidebar-w); }
}

.doc-main {
  flex: 1;
  margin-left: var(--doc-sidebar-w);
  margin-right: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.doc-toc {
  width: var(--doc-toc-w);
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 24px 16px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
  font-size: 12.5px;
}

/* ---- Doc Nav (arborescence de pages) ------------- */
.doc-nav-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-nav-space-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; flex-shrink: 0;
}
.doc-nav-space-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}

.doc-nav-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.doc-nav-search input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
}
.doc-nav-search input:focus { border-color: var(--primary); }

.doc-nav-tree {
  padding: 8px 6px;
  flex: 1;
}

.tree-item {
  position: relative;
}
.tree-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .1s, color .1s;
  min-height: 28px;
  position: relative;
}
.tree-link:hover { background: var(--bg); color: var(--text-primary); }
.tree-link.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.tree-link .tree-emoji { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.tree-link .tree-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-link .tree-toggle {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; border-radius: 3px; flex-shrink: 0;
  transition: transform .15s;
}
.tree-link .tree-toggle.open { transform: rotate(90deg); }
.tree-link .tree-add-btn {
  width: 18px; height: 18px;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 3px; color: var(--text-muted);
  cursor: pointer;
}
.tree-link:hover .tree-add-btn { display: flex; }
.tree-link:hover .tree-add-btn:hover { background: var(--border); color: var(--primary); }
.tree-children { padding-left: 16px; }
.tree-children.hidden { display: none; }

/* ---- Espace : page principale -------------------- */
.doc-page-header {
  padding: 20px 40px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.doc-breadcrumb {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.doc-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.doc-breadcrumb a:hover { color: var(--primary); }
.doc-breadcrumb-sep { color: var(--border); }

.doc-page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 40px 4px;
}
.doc-page-emoji-btn {
  font-size: 28px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
  transition: background .15s;
  user-select: none;
  min-width: 40px;
  text-align: center;
}
.doc-page-emoji-btn:hover { background: var(--bg); }
.doc-page-title-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  background: transparent;
  line-height: 1.2;
  letter-spacing: -0.5px;
  font-family: 'Inter', sans-serif;
}
.doc-page-title-input::placeholder { color: var(--text-muted); }

/* ---- Éditeur Quill ------------------------------- */
.doc-editor-wrap {
  padding: 20px 40px 80px;
  max-width: 900px;
  min-height: 600px;
}

.ql-container {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  border: none !important;
  line-height: 1.7;
}
.ql-toolbar {
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--surface);
  padding: 6px 40px !important;
  position: sticky;
  top: 57px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.ql-toolbar .ql-formats { margin-right: 8px !important; }

/* Aligner les color pickers verticalement avec les autres boutons */
.ql-toolbar .ql-color-picker {
  vertical-align: middle;
}
.ql-toolbar .ql-color-picker .ql-picker-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  height: 24px;
  width: 24px;
}

.ql-editor {
  min-height: 500px;
  padding: 12px 0 !important;
  outline: none;
}
.ql-editor h1 { font-size: 26px; font-weight: 800; margin: 24px 0 8px; letter-spacing: -0.4px; }
.ql-editor h2 { font-size: 20px; font-weight: 700; margin: 20px 0 6px; }
.ql-editor h3 { font-size: 16px; font-weight: 600; margin: 16px 0 6px; }
.ql-editor p  { margin: 0 0 8px; }
.ql-editor blockquote {
  border-left: 4px solid var(--primary);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--primary-light);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}
.ql-editor pre.ql-syntax {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  overflow-x: auto;
}
.ql-editor table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.ql-editor td, .ql-editor th {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 13.5px;
}
.ql-editor th { background: var(--bg); font-weight: 600; }
.ql-editor img { max-width: 100%; border-radius: 6px; margin: 8px 0; }

/* Quill link tooltip : force visible above doc-nav, never negative left */
.ql-snow .ql-tooltip {
  z-index: 200;
  left: 0 !important;
}

/* Dark mode */
[data-theme="dark"] .ql-toolbar { background: var(--surface); }
[data-theme="dark"] .ql-editor { color: var(--text-primary); }
[data-theme="dark"] .ql-snow .ql-stroke { stroke: var(--text-secondary); }
[data-theme="dark"] .ql-snow .ql-fill { fill: var(--text-secondary); }

/* ---- Présence (avatars collaborateurs) ----------- */
.doc-presence-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.presence-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  border: 2px solid var(--surface);
  margin-left: -5px;
  position: relative;
  cursor: default;
}
.presence-avatar:first-child { margin-left: 0; }

/* ---- Statut de sauvegarde ----------------------- */
.doc-save-status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.doc-save-status.saving { color: var(--warning); }
.doc-save-status.saved  { color: var(--success); }
.doc-save-status.error  { color: var(--danger); }

/* ---- Table des matières (TOC) ------------------- */
.doc-toc-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.doc-toc-list { list-style: none; padding: 0; margin: 0; }
.doc-toc-list li { margin-bottom: 4px; }
.doc-toc-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12.5px;
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .1s, background .1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-toc-list a:hover { color: var(--primary); background: var(--primary-light); }
.doc-toc-list a.active { color: var(--primary); font-weight: 600; }
.doc-toc-list .toc-h2 { padding-left: 12px; }
.doc-toc-list .toc-h3 { padding-left: 22px; font-size: 12px; }

/* ---- Panneau commentaires inline ---------------- */
.doc-comments-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 150;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateX(100%);
  transition: transform .2s ease, opacity .2s ease, visibility .2s;
}
.doc-comments-panel.open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}
.doc-comments-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.doc-comments-panel-body { flex: 1; overflow-y: auto; padding: 12px; }

.comment-thread {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.comment-thread.resolved { opacity: 0.6; }
.comment-thread-anchor {
  padding: 8px 12px;
  background: #fef9c3;
  border-bottom: 1px solid #fde68a;
  font-size: 12px;
  color: #92400e;
  font-style: italic;
  display: flex; align-items: flex-start; gap: 6px;
}
[data-theme="dark"] .comment-thread-anchor { background: #292524; border-color: #44403c; color: #d97706; }
/* Scope sous .comment-thread pour neutraliser les règles globales
   de assets/css/style.css (.comment-item { display:flex } etc.) */
.comment-thread .comment-body { padding: 10px 12px; flex: none; min-width: 0; }
.comment-thread .comment-item {
  display: block;
  padding: 6px 0;
  border-bottom: none;
  gap: 0;
}
.comment-thread .comment-item + .comment-item { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.comment-thread .comment-item-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.comment-thread .comment-author-av {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.comment-thread .comment-author-name { font-size: 12px; font-weight: 600; min-width: 0; }
.comment-thread .comment-date { font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap; flex-shrink: 0; }
.comment-thread .comment-content {
  font-size: 13px; line-height: 1.5; white-space: pre-wrap;
  word-break: break-word; color: var(--text-primary);
  padding-left: 28px; /* aligne sous le nom, après l'avatar (22px + 6px gap) */
}

.comment-thread-actions {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex; gap: 6px;
}
.comment-reply-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  resize: none;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}
.comment-reply-input:focus { border-color: var(--primary); }

/* ---- Liste espaces (index.html) ----------------- */
.spaces-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.space-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: pointer;
}
.space-list-item:last-child { border-bottom: none; }
.space-list-item:hover { background: var(--bg); }

/* ---- Labels badges ------------------------------ */
.label-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Versions panel ----------------------------- */
.version-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.version-item:last-child { border-bottom: none; }
.version-num {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---- Template picker ---------------------------- */
.template-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
}
.template-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,.08); }
.template-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--primary); flex-shrink: 0;
}
.template-card-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.template-card-desc { font-size: 12px; color: var(--text-secondary); }

/* ---- Responsive --------------------------------- */
@media (min-width: 1201px) {
  /* Reserve space for the fixed TOC panel so content never hides behind it */
  .doc-main:not(.doc-main--notoc) { margin-right: var(--doc-toc-w); }
}
@media (max-width: 1200px) {
  .doc-toc { display: none; }
}
@media (max-width: 900px) {
  /* Empilé au-dessus du contenu : tous les projets ne doivent pas repousser
     la page hors de l'écran. */
  .doc-nav { position: static; width: 100%; height: auto; max-height: 45vh; }
  .doc-layout { flex-direction: column; margin-left: 0; }
  .doc-main { margin-left: 0; }
  .doc-editor-wrap { padding: 16px 16px 60px; }
  .doc-page-header { padding: 12px 16px; }
  .doc-page-title-row { padding: 8px 16px 4px; }
  .ql-toolbar { padding: 6px 16px !important; }
}

/* ---- Modales ------------------------------------
   Aucune surcharge : celles de style.css (en-tête, pied, mode sombre), comme
   partout dans Manifst. MyDoc arrondissait et ombrait ses modales à part. */
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }

/* ---- Dark mode overrides ------------------------ */
[data-theme="dark"] .doc-nav        { background: var(--surface); }
[data-theme="dark"] .doc-toc        { background: var(--surface); }
[data-theme="dark"] .doc-page-header{ background: var(--surface); }
[data-theme="dark"] .comment-thread-anchor { background: rgba(251,191,36,.07); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

/* ---- Space home content ------------------------- */
.card-title-sm {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Tree : bouton supprimer -------------------- */
.tree-link .tree-del-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 2px;
}
.tree-link:hover .tree-del-btn { display: flex; }
.tree-link:hover .tree-del-btn:hover { background: #fee2e2; color: #dc2626; }

/* ---- Sommaire multi-projets (assets/js/mydoc-nav.js) ----
   Projet → espaces → pages. MyDoc ne dépend pas du projet de l'en-tête :
   chaque projet ouvert à la personne a son nœud. */
.doc-nav-home {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1;
  text-decoration: none;
}
.mdoc-nav-home-icon { background: var(--primary); }
.tree-toggle-spacer { width: 18px; flex-shrink: 0; }
.mdoc-nav-empty {
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.mdoc-nav-loading { padding: 6px 8px; }

.mdoc-project + .mdoc-project { margin-top: 2px; }
.mdoc-project-row { color: var(--text-primary); font-weight: 600; }
.mdoc-project-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0 3px;
}
.mdoc-project-children { padding-left: 10px; }

.mdoc-space-icon {
  width: 18px; height: 18px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px; color: #fff;
}
.mdoc-space-icon-lg { width: 30px; height: 30px; border-radius: 7px; font-size: 14px; }
.mdoc-space-flag { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.tree-link .tree-more-btn {
  width: 18px; height: 18px;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 3px; color: var(--text-muted);
  flex-shrink: 0;
  cursor: pointer;
}
.tree-link:hover .tree-more-btn { display: flex; }
.tree-link:hover .tree-more-btn:hover { background: var(--border); color: var(--primary); }
/* Écran tactile : pas de survol, les actions restent visibles. */
@media (hover: none) {
  .tree-link .tree-add-btn,
  .tree-link .tree-more-btn,
  .tree-link .tree-del-btn { display: flex; }
}

/* Menu ⋯ d'un espace : posé sur <body> en position fixe (la colonne défile). */
.mdoc-nav-menu {
  position: fixed;
  margin: 0 !important;
  z-index: 1060;
}

/* « ● Projet › Espace » dans les modales : où l'on crée. */
.mdoc-sm-project {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.mdoc-sm-project:empty { display: none; }
.mdoc-where-name { font-weight: 600; color: var(--text-primary); }
.mdoc-where-sep { font-size: 9px; color: var(--text-muted); }
.mdoc-sm-preview {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 22px; color: #fff;
}
/* Couleurs : .raci-swatch (style.css). Icônes : même gabarit que les
   pastilles (30 px, coins 8 px), sélection en couleur primaire. */
.mdoc-icon-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.mdoc-icon-choice {
  width: 30px; height: 30px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.mdoc-icon-choice:hover { border-color: var(--primary); color: var(--primary); }
.mdoc-icon-choice.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
/* Onglets .settings-tabs dans une modale : moins d'air que sur une page. */
.mdoc-modal-tabs { margin-bottom: 16px; }
.mdoc-modal-tabs .settings-tab-btn { padding: 8px 14px; }
.mdoc-check-label { font-size: 13.5px; font-weight: 500; }
.mdoc-modal-text { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); }

.mdoc-perm-results {
  position: absolute; top: 100%; left: 0; right: 0;
  z-index: 200;
  margin-top: 4px;
  max-height: 220px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.mdoc-perm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.mdoc-perm-row:last-child { border-bottom: none; }
.mdoc-perm-av { width: 30px; height: 30px; font-size: 11px; flex-shrink: 0; }
.mdoc-perm-who { flex: 1; min-width: 0; }
.mdoc-perm-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdoc-perm-mail { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdoc-perm-select { width: 130px; flex-shrink: 0; }
.mdoc-perm-remove { flex-shrink: 0; }
.mdoc-perm-remove:hover { color: var(--danger); }
.template-card { cursor: pointer; }

/* Accueil MyDoc : un bloc par projet. */
.mdoc-home-project { max-width: 720px; margin-bottom: 24px; }
.mdoc-home-project-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.mdoc-home-project-name { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; min-width: 0; }
.mdoc-home-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Fil d'Ariane d'une page : le projet d'abord, l'en-tête ne le porte plus. */
.doc-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 14px 28px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.doc-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.doc-breadcrumb a:hover { color: var(--primary); }
.doc-breadcrumb .sep { font-size: 9px; color: var(--text-muted); }
.doc-breadcrumb .current { color: var(--text-primary); font-weight: 500; }
.doc-breadcrumb .mdoc-project-dot { margin: 0; }

/* ---- Quill cursors : flag toujours visible ---------- */
.ql-cursor-flag {
  opacity: 1 !important;
  display: flex !important;
}
.ql-cursor-name {
  opacity: 1 !important;
  font-size: 10px !important;
}

/* ---- Image resize overlay ----------------------- */
.img-resize-wrap {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--primary);
  border-radius: 2px;
}
.img-resize-handle {
  position: absolute;
  width: 10px; height: 10px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 50%;
  pointer-events: all;
}
.irh-nw { top: -5px;    left: -5px;   cursor: nw-resize; }
.irh-ne { top: -5px;    right: -5px;  cursor: ne-resize; }
.irh-sw { bottom: -5px; left: -5px;   cursor: sw-resize; }
.irh-se { bottom: -5px; right: -5px;  cursor: se-resize; }

/* ---- Toolbar tooltips --------------------------- */
#editor-toolbar [data-tooltip] { position: relative; }
#editor-toolbar [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 500;
}
#editor-toolbar [data-tooltip]:hover::after { opacity: 1; }
