.mindmap-wrapper {
  background: radial-gradient(circle at center, #121624 0%, #090a0f 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  position: relative;
  height: 640px;
  user-select: none;
}
#mindmapParticles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#mindmapSvg {
  position: relative;
  z-index: 1;
}
.mindmap-legend {
  margin-top: 10px;
  padding: 8px 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.mindmap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 2px; display: inline-block; }

.glossary-term {
  font-weight: 700;
  border-bottom: 1px dashed currentColor;
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  cursor: help;
}
.glossary-term.has-link { cursor: pointer; }
.glossary-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 340px;
  background: #0d1018;
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  display: none;
}
.glossary-tooltip-title { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.glossary-tooltip-desc { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.glossary-tooltip-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.glossary-row {
  display: grid;
  grid-template-columns: 160px 1fr auto 190px 32px;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

[draggable="true"] { cursor: grab; }
[draggable="true"]:active { cursor: grabbing; }
.dnd-dragging { opacity: 0.42; }
.dnd-over-top { box-shadow: inset 0 2px 0 #38bdf8 !important; }
.dnd-over-bottom { box-shadow: inset 0 -2px 0 #38bdf8 !important; }
.dnd-over-inside {
  outline: 1.5px dashed #38bdf8 !important;
  background: rgba(56, 189, 248, 0.14) !important;
}

.cursor-popover-backdrop { position: fixed; inset: 0; z-index: 10000; background: rgba(2, 6, 23, 0.25); }
.cursor-popover {
  position: fixed; z-index: 10001; min-width: 250px; max-width: 340px;
  background: #0f172a; border: 1px solid #334155; border-radius: 10px;
  padding: 12px 14px; color: #f8fafc;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(56, 189, 248, 0.15);
  font-size: 13px; line-height: 1.45;
  animation: popIn 0.11s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.cursor-popover-input {
  width: 100%; margin-top: 8px; padding: 7px 9px; border-radius: 6px;
  border: 1px solid #334155; background: #1e293b; color: #f8fafc; font-size: 13px; outline: none;
}
.cursor-popover-input:focus { border-color: #38bdf8; }
.cursor-popover-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.cursor-popover-actions button { padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid #334155; background: #1e293b; color: #cbd5e1; }
.cursor-popover-actions button:hover { background: #334155; color: #fff; }
.cursor-popover-actions button.confirm-ok { background: #0284c7; border-color: #0284c7; color: #fff; }
.cursor-popover-actions button.confirm-ok:hover { background: #0369a1; }
.cursor-popover-actions button.confirm-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.cursor-popover-actions button.confirm-danger:hover { background: #b91c1c; }

.slideshow-stage {
  background: linear-gradient(145deg, #0d111a 0%, #131826 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.slideshow-stage:fullscreen {
  border-radius: 0;
  border: none;
  padding: 40px 64px;
  justify-content: space-between;
  background: radial-gradient(circle at top right, #161e31 0%, #090b10 100%);
}
.slide-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.slide-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 22px;
}
.slide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.22s ease;
}
.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.slide-body.layout-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 28px;
}
.slide-body.layout-cover {
  text-align: center;
  align-items: center;
}
.slide-kicker {
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.slide-heading {
  font-size: 32px;
  font-weight: 900;
  margin: 0;
  color: #fff;
  line-height: 1.2;
}
.slideshow-stage:fullscreen .slide-heading { font-size: 44px; }
.slide-content {
  font-size: 16.5px;
  line-height: 1.75;
  color: #e2e8f0;
}
.slideshow-stage:fullscreen .slide-content { font-size: 21px; }
.slide-content code {
  background: #1e2433;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #38bdf8;
}
.slide-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.slide-media img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  object-fit: contain;
  background: #07090e;
}
.slideshow-stage:fullscreen .slide-media img { max-height: 62vh; }
.slide-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.slide-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.slide-dot {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.slide-dot.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan);
  color: #fff;
}
/* Carte mentale en plein espace */
.content-scroll.mindmap-scroll { display: flex; flex-direction: column; padding: 16px 20px; }
.page-sheet.mindmap-full { max-width: none; width: 100%; margin: 0; padding-bottom: 0; flex: 1; display: flex; flex-direction: column; }
.mindmap-full > * { flex-shrink: 0; }
.mindmap-full .mindmap-wrapper { flex: 1 0 420px; height: 0; display: flex; }
.mindmap-full #mindmapSvg { margin: auto; flex-shrink: 0; }
.mindmap-full .mindmap-legend { margin-top: 10px; }

/* Recherche */
.search-card { margin: 0; flex-direction: column; align-items: stretch; gap: 8px; content-visibility: auto; contain-intrinsic-size: auto 160px; }
.search-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search-path { font-size: 11.5px; color: var(--cyan); margin-bottom: 2px; }
.search-title { font-weight: 800; font-size: 15.5px; color: #fff; margin-right: 8px; }
.search-count { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(59, 130, 246, 0.18); border: 1px solid rgba(59, 130, 246, 0.4); color: #93c5fd; white-space: nowrap; }
.search-open { color: #38bdf8; font-weight: 700; flex-shrink: 0; }
.search-rows { padding-left: 10px; border-left: 2px solid rgba(56, 189, 248, 0.28); display: flex; flex-direction: column; gap: 2px; }
.search-row { display: flex; align-items: flex-start; gap: 8px; padding-top: 5px; padding-bottom: 5px; }
.search-branch { color: var(--muted); font-family: monospace; font-size: 12px; flex-shrink: 0; user-select: none; }
.search-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.3); color: #38bdf8; flex-shrink: 0; margin-top: 1px; }
.search-snippet { font-size: 13px; color: var(--text); line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.search-row.is-heading .search-badge { background: rgba(168, 85, 247, 0.16); border-color: rgba(168, 85, 247, 0.4); color: #d8b4fe; }
.search-row.is-heading .search-snippet { color: #f8fafc; font-weight: 600; }
.search-mark { background: rgba(56, 189, 248, 0.32); color: #fff; padding: 1px 2px; border-radius: 4px; font-weight: 700; }
.search-more { font-size: 12px; color: var(--muted); padding: 4px 0; }