/* ── Editor core — topbar + rail ────────────────────────────────────────── */
.editor-wrap { display:flex; flex-direction:column; height:100%; background:var(--bg); overflow:hidden; }
.editor-topbar { background:var(--surface); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border-bottom:1px solid var(--border); padding:0 16px; height:52px; display:flex; align-items:center; gap:10px; flex-shrink:0; z-index:2; }
.editor-topbar-sep { width:1px; height:20px; background:var(--border); }
.editor-topbar-title { font-size:13px; font-weight:600; color:var(--text); letter-spacing:-.2px; }
.editor-topbar-actions { margin-left:auto; display:flex; gap:6px; align-items:center; }
.editor-btn-back { display:inline-flex; align-items:center; gap:5px; padding:5px 11px; border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text2); font-size:12px; font-weight:500; cursor:pointer; transition:all .15s; }
.editor-btn-back:hover { background:var(--surface2); color:var(--text); }
.editor-add-node-btn { padding:5px 10px; border-radius:7px; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap; transition:all .15s; }
.editor-undo-group { display:flex; gap:2px; background:var(--surface3); border-radius:8px; padding:3px; }
.editor-undo-btn { padding:4px 7px; border:none; border-radius:6px; background:none; cursor:pointer; color:var(--text3); display:flex; align-items:center; transition:all .15s; }
.editor-undo-btn:disabled { opacity:0.3; cursor:not-allowed; }
.editor-view-btn { padding:5px 11px; border:1px solid var(--border); border-radius:8px; font-size:11px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:all .15s; background:transparent; color:var(--text2); }
.editor-view-btn:hover { background:var(--surface2); color:var(--text); }
.editor-io-btn { display:inline-flex; align-items:center; gap:5px; padding:5px 10px; border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text2); font-size:11.5px; font-weight:500; cursor:pointer; transition:all .15s; }
.editor-io-btn:hover { background:var(--surface2); color:var(--text); border-color:var(--border2); }
.editor-save-btn { padding:5px 14px; border:none; border-radius:8px; background:#3B82F6; color:white; font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; }
.editor-save-btn:hover { background:#2563EB; }
.editor-cancel-btn { padding:5px 12px; border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text2); font-size:12px; font-weight:500; cursor:pointer; transition:all .15s; }
.editor-cancel-btn:hover { background:var(--surface2); color:var(--text); }
.editor-autosave { font-size:11px; color:var(--text3); display:none; align-items:center; gap:4px; }
.editor-body { flex:1; display:flex; overflow:hidden; }
.editor-rail { width:158px; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; overflow:hidden; flex-shrink:0; }
.editor-rail-header { padding:12px 12px 8px; border-bottom:1px solid var(--border); }
.editor-rail-label { font-size:9.5px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; margin-bottom:2px; }
.editor-rail-sub { font-size:10.5px; color:var(--text2); }
.editor-rail-list { flex:1; overflow-y:auto; padding:8px 8px 4px; }
.editor-rail-add { padding:8px; border-top:1px solid var(--border); }
.editor-rail-add-btn { width:100%; padding:8px; border:1.5px dashed var(--border2); border-radius:9px; background:none; color:var(--text3); font-size:11.5px; font-weight:500; cursor:pointer; transition:all .15s; display:flex; align-items:center; justify-content:center; gap:5px; }
.editor-rail-add-btn:hover { border-color:#3B82F6; color:#3B82F6; background:rgba(59,130,246,.08); }
.editor-tree-card { position:relative; padding:11px 12px; border-radius:10px; cursor:pointer; transition:all .15s; margin-bottom:4px; }
.editor-tree-card-strip { position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; }
.editor-tree-card-title { font-size:12px; margin-left:6px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.editor-tree-card-meta { display:flex; align-items:center; gap:5px; margin-left:6px; }
.editor-tree-del-btn { position:absolute; top:6px; right:6px; width:18px; height:18px; border:none; border-radius:5px; background:rgba(239,68,68,.12); color:#EF4444; font-size:10px; cursor:pointer; display:none; align-items:center; justify-content:center; line-height:1; }
.editor-canvas-wrap { flex:1; position:relative; overflow:hidden; cursor:default; background:var(--bg); }
.editor-form-wrap { flex:1; overflow-y:auto; background:var(--bg); scroll-behavior:smooth; }
.editor-form-inner { max-width:920px; margin:0 auto; padding:20px 24px 60px; }
.editor-panel { width:290px; background:var(--surface); border-left:1px solid var(--border); display:flex; flex-direction:column; overflow-y:auto; flex-shrink:0; }

/* ── Form Builder Modernisé ──────────────────────────────────────────────── */
.wfb-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; background:var(--surface); padding:10px 14px; border-radius:var(--radius-lg); border:1px solid var(--border); box-shadow:var(--shadow-sm); }
.wfb-search-wrap { display:flex; align-items:center; gap:8px; background:var(--surface2); border:1px solid var(--border); border-radius:8px; padding:6px 10px; min-width:240px; flex:1; max-width:340px; }
.wfb-search-wrap input { border:none; background:none; font-size:12.5px; color:var(--text); width:100%; outline:none; font-family:inherit; }
.wfb-filters { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.wfb-pill { display:inline-flex; align-items:center; gap:4px; padding:4px 9px; border-radius:20px; font-size:11.5px; font-weight:500; cursor:pointer; background:var(--surface2); color:var(--text2); border:1px solid var(--border); transition:all .15s; user-select:none; }
.wfb-pill:hover { background:var(--surface3); color:var(--text); }
.wfb-pill.active { background:var(--blue-light); color:var(--blue); border-color:rgba(0,113,227,0.3); font-weight:600; }
.wfb-pill.pill-warn { color:var(--amber); }
.wfb-pill.pill-warn.active { background:var(--amber-light); border-color:rgba(255,149,0,0.4); }
.wfb-btn-toggle-all { padding:5px 10px; font-size:11.5px; font-weight:500; border-radius:7px; border:1px solid var(--border); background:var(--surface2); color:var(--text2); cursor:pointer; transition:all .15s; font-family:inherit; }
.wfb-btn-toggle-all:hover { background:var(--surface3); color:var(--text); }

.wfb-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; margin-bottom:8px; transition:all .18s cubic-bezier(0.16, 1, 0.3, 1); box-shadow:var(--shadow-sm); position:relative; border-left:4px solid #AEAEB2; overflow:hidden; }
.wfb-card:hover { border-color:var(--border2); box-shadow:var(--shadow); }
.wfb-card.open { border-color:var(--border2); box-shadow:var(--shadow); }
.wfb-card.type-start { border-left-color:#3B82F6; }
.wfb-card.type-question { border-left-color:#F59E0B; }
.wfb-card.type-action { border-left-color:#10B981; }
.wfb-card.type-end { border-left-color:#EF4444; }
.wfb-card.wfb-highlight { animation:wfbPulse 1.6s ease; }
@keyframes wfbPulse {
  0% { box-shadow:0 0 0 0 rgba(0,113,227,0.5); }
  50% { box-shadow:0 0 0 6px rgba(0,113,227,0.25); border-color:var(--blue); }
  100% { box-shadow:var(--shadow); }
}

.wfb-hd { display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; user-select:none; }
.wfb-num { width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; flex-shrink:0; background:var(--surface2); color:var(--text2); }
.wfb-num.open { background:var(--text); color:var(--surface); }
.wfb-num.done { background:var(--green-light); color:var(--green); }
.wfb-badge { font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:6px; flex-shrink:0; }
.wfb-prev { font-size:13px; font-weight:500; color:var(--text); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wfb-tags { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.wfb-tag { font-size:10px; font-weight:600; padding:2px 7px; border-radius:5px; display:inline-flex; align-items:center; gap:3px; }
.wfb-tag-warn { background:var(--amber-light); color:var(--amber); border:1px solid rgba(255,149,0,0.25); }
.wfb-tag-err { background:var(--red-light); color:var(--red); border:1px solid rgba(239,68,68,0.25); }
.wfb-tag-info { background:var(--blue-light); color:var(--blue); }

.wfb-hd-actions { display:flex; align-items:center; gap:3px; margin-left:4px; opacity:0.6; transition:opacity .15s; }
.wfb-card:hover .wfb-hd-actions { opacity:1; }
.wfb-icon-btn { width:26px; height:26px; border-radius:6px; border:1px solid transparent; background:transparent; color:var(--text3); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all .12s; font-size:12px; font-family:inherit; }
.wfb-icon-btn:hover { background:var(--surface2); color:var(--text); border-color:var(--border); }
.wfb-icon-btn.btn-del:hover { background:var(--red-light); color:var(--red); border-color:rgba(239,68,68,0.25); }
.wfb-chevron { width:13px; height:13px; color:var(--text3); transition:transform .18s; }
.wfb-card.open .wfb-chevron { transform:rotate(180deg); color:var(--text); }

.wfb-insert-divider { height:18px; display:flex; align-items:center; justify-content:center; position:relative; margin:-5px 0; z-index:2; opacity:0; transition:opacity .15s; }
.wfb-insert-divider:hover { opacity:1; height:32px; }
.wfb-insert-box { display:flex; align-items:center; gap:5px; background:var(--surface); border:1px solid var(--border2); box-shadow:var(--shadow-sm); border-radius:20px; padding:2px 8px; }
.wfb-insert-label { font-size:10px; font-weight:600; color:var(--text3); margin-right:2px; }
.wfb-insert-btn { font-size:10.5px; font-weight:600; padding:2px 7px; border-radius:10px; border:none; cursor:pointer; background:transparent; transition:all .12s; font-family:inherit; }
.wfb-insert-btn:hover { transform:scale(1.05); }

.wfb-body { padding:0 16px 16px; border-top:1px solid var(--border); }
.wfb-label { font-size:11px; font-weight:600; color:var(--text2); margin:12px 0 5px; display:flex; align-items:center; justify-content:space-between; }
.wfb-inp, .wfb-sel, .wfb-ta { width:100%; border:1px solid var(--border); border-radius:8px; padding:7px 10px; font-size:13px; color:var(--text); background:var(--surface2); outline:none; font-family:inherit; transition:all .15s; box-sizing:border-box; }
.wfb-inp:focus, .wfb-sel:focus, .wfb-ta:focus { border-color:var(--blue); background:var(--surface); box-shadow:0 0 0 3px rgba(0,113,227,0.12); }

.wfb-rte-wrap { border:1px solid var(--border); border-radius:8px; overflow:hidden; background:var(--surface); }
.wfb-rte-bar { display:flex; flex-wrap:wrap; gap:2px; padding:4px 6px; background:var(--surface2); border-bottom:1px solid var(--border); align-items:center; }
.wfb-rte-btn { width:26px; height:26px; border:none; border-radius:5px; background:transparent; cursor:pointer; font-size:12px; color:var(--text); display:inline-flex; align-items:center; justify-content:center; transition:background .1s; font-family:inherit; }
.wfb-rte-btn:hover { background:var(--surface3); }
.wfb-rte-sep { width:1px; height:18px; background:var(--border2); margin:2px; }
.wfb-rte-content { min-height:90px; max-height:300px; overflow-y:auto; padding:10px 12px; font-size:13px; color:var(--text); line-height:1.6; outline:none; word-break:break-word; background:var(--surface); }
.wfb-rte-content img { max-width:100%; border-radius:6px; margin:6px 0; display:block; cursor:zoom-in; transition:opacity .15s; }
.wfb-rte-content img:hover { opacity:0.95; }
.wfb-rte-footer { font-size:10.5px; color:var(--text3); padding:5px 10px; background:var(--surface2); border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }

.wfb-presets-bar { display:flex; align-items:center; gap:6px; margin:4px 0 10px; flex-wrap:wrap; }
.wfb-preset-btn { font-size:11px; font-weight:500; padding:3px 9px; border-radius:6px; border:1px dashed var(--border2); background:var(--surface); color:var(--text2); cursor:pointer; transition:all .12s; font-family:inherit; }
.wfb-preset-btn:hover { background:var(--surface2); color:var(--blue); border-color:var(--blue); }

.wfb-ans-row { display:flex; gap:6px; align-items:center; margin-bottom:6px; background:var(--surface2); padding:6px 8px; border-radius:8px; border:1px solid var(--border); }
.wfb-ans-num { font-size:11px; font-weight:700; color:var(--text3); min-width:16px; text-align:center; }
.wfb-jump-btn { width:28px; height:28px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--blue); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0; transition:all .12s; font-family:inherit; }
.wfb-jump-btn:hover { background:var(--blue-light); border-color:rgba(0,113,227,0.3); }

.wfb-btn-close { padding:5px 12px; font-size:11.5px; font-weight:500; border-radius:7px; border:1px solid var(--border); background:var(--surface2); color:var(--text2); cursor:pointer; transition:all .15s; font-family:inherit; }
.wfb-btn-close:hover { background:var(--surface3); color:var(--text); }
.wfb-btn-create-q { padding:4px 8px; border:1px dashed var(--amber); border-radius:6px; background:var(--amber-light); color:#B45309; font-size:11px; cursor:pointer; font-weight:600; font-family:inherit; transition:all .15s; }
.wfb-btn-create-q:hover { filter:brightness(1.08); }
.wfb-btn-create-a { padding:4px 8px; border:1px dashed var(--green); border-radius:6px; background:var(--green-light); color:#065F46; font-size:11px; cursor:pointer; font-weight:600; font-family:inherit; transition:all .15s; }
.wfb-btn-create-a:hover { filter:brightness(1.08); }
.wfb-btn-create-f { padding:4px 8px; border:1px dashed var(--red); border-radius:6px; background:var(--red-light); color:#991B1B; font-size:11px; cursor:pointer; font-weight:600; font-family:inherit; transition:all .15s; }
.wfb-btn-create-f:hover { filter:brightness(1.08); }

.wfb-card-footer { display:flex; align-items:center; justify-content:space-between; margin-top:14px; padding-top:10px; border-top:1px solid var(--border); font-size:11.5px; color:var(--text3); }
.wfb-status-save { display:inline-flex; align-items:center; gap:5px; color:var(--green); font-size:11px; font-weight:500; }

/* Lightbox */
.wfb-lightbox { position:fixed; inset:0; background:rgba(0,0,0,0.75); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); z-index:10005; display:flex; align-items:center; justify-content:center; padding:20px; animation:fadeUp .15s ease; }
.wfb-lightbox img { max-width:92vw; max-height:88vh; object-fit:contain; border-radius:8px; box-shadow:0 24px 64px rgba(0,0,0,0.5); }
.wfb-lightbox-close { position:absolute; top:20px; right:24px; width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,0.2); border:none; color:#fff; font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s; }
.wfb-lightbox-close:hover { background:rgba(255,255,255,0.35); }

/* Sidebar table of contents */
.wfb-sb-summary { background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:10px 12px; margin-bottom:12px; }
.wfb-sb-item { display:flex; align-items:center; gap:8px; padding:7px 9px; border-radius:7px; cursor:pointer; transition:background .12s; margin-bottom:2px; font-size:12px; color:var(--text); border:1px solid transparent; }
.wfb-sb-item:hover { background:var(--surface2); }
.wfb-sb-item.active { background:var(--blue-light); color:var(--blue); font-weight:600; border-color:rgba(0,113,227,0.25); }
.wfb-sb-num { font-size:10.5px; font-weight:700; width:18px; text-align:center; color:var(--text3); }
.wfb-sb-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.wfb-sb-lbl { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wfb-sb-stat { font-size:10px; }
.editor-canvas-legend { position:absolute; bottom:12px; right:14px; font-size:10px; color:#C7C7CC; pointer-events:none; user-select:none; }
.editor-canvas-types { position:absolute; bottom:12px; left:14px; display:flex; gap:12px; pointer-events:none; }
.editor-canvas-type-item { display:flex; align-items:center; gap:5px; font-size:10px; color:#AEAEB2; }
.editor-canvas-type-dot { width:6px; height:6px; border-radius:50%; }
.editor-fitview-btn { padding:5px 9px; border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text3); font-size:13px; cursor:pointer; transition:all .15s; }
.editor-fitview-btn:hover { color:var(--text); background:var(--surface2); }

/* ── Editor panel ────────────────────────────────────────────────────────── */
.ep-section { padding:14px; border-bottom:1px solid var(--border); }
.ep-section-label { font-size:9.5px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; margin-bottom:10px; }
.ep-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:7px; }
.ep-grid-label-color { display:grid; grid-template-columns:1fr auto; gap:6px; align-items:center; }
.ep-color-input { width:32px; height:32px; border:1px solid var(--border); border-radius:7px; padding:2px; cursor:pointer; background:var(--surface2); }
.ep-node-header { display:flex; align-items:center; gap:7px; margin-bottom:14px; }
.ep-node-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.ep-node-type-lbl { font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; }
.ep-node-del-btn { margin-left:auto; padding:3px 9px; border:none; border-radius:6px; background:rgba(239,68,68,.12); color:#EF4444; font-size:11px; cursor:pointer; transition:all .15s; }
.ep-node-del-btn:hover { background:rgba(239,68,68,.22); }
.ep-field { margin-bottom:9px; }
.ep-connections { margin-top:12px; }
.ep-connections-label { font-size:9.5px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; margin-bottom:8px; }
.ep-answer-card { background:var(--surface2); border:1px solid var(--border); border-radius:8px; padding:9px 10px; margin-bottom:6px; }
.ep-answer-footer { display:flex; align-items:center; gap:5px; }
.ep-answer-arrow { font-size:10px; color:var(--text3); flex-shrink:0; }
.ep-answer-del-btn { width:26px; height:26px; border:none; border-radius:6px; background:rgba(239,68,68,.12); color:#EF4444; cursor:pointer; font-size:12px; flex-shrink:0; }
.ep-add-answer-btn { width:100%; padding:7px; border:1px dashed var(--border2); border-radius:7px; background:none; color:var(--text3); font-size:11px; cursor:pointer; transition:all .15s; }
.ep-add-answer-btn:hover { border-color:var(--blue); color:var(--blue); }
.ep-next-wrap { margin-top:12px; }
.ep-next-label { font-size:9.5px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; margin-bottom:6px; }
.ep-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; text-align:center; color:var(--text2); }
.ep-empty-icon { margin-bottom:12px; opacity:.4; }
.ep-empty-title { font-size:12px; font-weight:600; color:var(--text2); margin-bottom:4px; }
.ep-empty-sub { font-size:11px; color:var(--text3); line-height:1.5; }
.ep-rte-wrap { border:1px solid var(--border2); border-radius:8px; overflow:hidden; background:var(--surface); }
.ep-rte-toolbar { display:flex; flex-wrap:wrap; gap:2px; padding:5px 6px; background:var(--surface2); border-bottom:1px solid var(--border); }
.ep-rte-btn { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border:none; border-radius:5px; background:none; cursor:pointer; font-size:12px; color:var(--text); transition:background .1s; }
.ep-rte-btn:hover { background:var(--surface3); }
.ep-rte-sep { width:1px; height:18px; background:var(--border); margin:2px; }
.ep-rte-body { min-height:90px; max-height:220px; overflow-y:auto; padding:8px 10px; font-size:12.5px; color:var(--text); background:var(--surface); line-height:1.6; outline:none; word-break:break-word; }
.ep-rte-hint { font-size:10px; color:var(--text3); padding:4px 10px; background:var(--surface2); border-top:1px solid var(--border); }


/* ── Blueprint In-Situ Expanded Node ─────────────────────────────────────── */
.bp-node {
  position: absolute;
  background: var(--surface);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  overflow: visible;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s, box-shadow 0.15s;
  pointer-events: auto;
}
.bp-node-selected {
  z-index: 25 !important;
}
.bp-node.is-resizing {
  transition: none !important;
}
.bp-node-expanded {
  z-index: 45 !important;
  cursor: default !important;
  border-radius: 12px;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
}
.bp-node-expanded .bp-node-header {
  cursor: grab;
  flex-shrink: 0;
}
.bp-node-expanded .bp-node-header:active {
  cursor: grabbing;
}
.bp-node-body-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  gap: 8px;
  overflow: hidden;
  box-sizing: border-box;
}
.bp-node-expanded .bp-rte-section {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.bp-node-expanded .ep-rte-wrap {
  flex: 1;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-sizing: border-box;
}
.bp-node-expanded .ep-rte-toolbar {
  flex-shrink: 0;
}
.bp-node-expanded .ep-rte-body {
  flex: 1;
  min-height: 80px;
  max-height: none !important;
  overflow-y: auto;
  padding: 8px 10px;
  box-sizing: border-box;
}
.bp-node-expanded .ep-rte-hint {
  flex-shrink: 0;
}
.bp-node-expanded .bp-connections-section {
  flex-shrink: 0;
  margin-top: 4px;
}
.bp-node-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: nwse-resize;
  color: var(--text3);
  opacity: 0.6;
  z-index: 25;
  transition: opacity 0.15s, color 0.15s, transform 0.1s;
}
.bp-node-resize-handle:hover {
  opacity: 1;
  color: var(--blue);
  transform: scale(1.15);
}
.bp-node-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text2);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.bp-node-collapse-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

/* ══════════════════════════════════════════════════════════════════════════════
   ENHANCED RICH TEXT EDITOR (RTE) — TOOLBAR, FULLSCREEN, DIALOGS
   ══════════════════════════════════════════════════════════════════════════════ */

.tf-rte-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.tf-rte-btn {
  height: 26px;
  min-width: 26px;
  padding: 0 5px;
  border: none;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  font-family: inherit;
  position: relative;
}
.tf-rte-btn:hover {
  background: var(--surface3);
  color: var(--text);
}
.tf-rte-btn.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 700;
}
.tf-rte-sep {
  width: 1px;
  height: 18px;
  background: var(--border2);
  margin: 0 3px;
  flex-shrink: 0;
}
.tf-rte-select {
  height: 24px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border2);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 0 4px;
  outline: none;
  cursor: pointer;
}

/* Modales & Popups de l'éditeur RTE */
.tf-rte-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.24);
  padding: 18px 20px;
  z-index: 10006;
  min-width: 320px;
  max-width: 460px;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  animation: fadeUp .15s ease;
}
.tf-rte-popup-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tf-rte-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.tf-rte-popup-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .12s;
}
.tf-rte-popup-option:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

/* Modal Plein Écran (Focus Mode) */
.tf-rte-fs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10004;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeUp .15s ease;
}
.tf-rte-fs-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 1020px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tf-rte-fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.tf-rte-fs-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  outline: none;
  background: var(--surface);
}
.tf-rte-fs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text3);
}

/* ── Barre d'actions contextuelle pour les tableaux (RTE) ─────────────────── */
.tf-table-floating-bar {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  z-index: 10003;
  animation: fadeUp .12s ease;
  user-select: none;
}
.tf-table-floating-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tf-table-floating-sep {
  width: 1px;
  height: 18px;
  background: var(--border2);
  margin: 0 4px;
}
.tf-table-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
  white-space: nowrap;
}
.tf-table-btn:hover {
  background: var(--surface3);
  border-color: var(--border2);
}
.tf-table-btn .tf-icon {
  font-weight: 700;
  color: var(--blue);
}
.tf-table-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.tf-table-btn-danger .tf-icon {
  color: #EF4444;
}
.tf-table-btn-del-table {
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.25);
  font-weight: 600;
}
.tf-table-btn-del-table:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* Indicateur visuel de cellule active dans l'éditeur */
.wfb-rte-content table td:focus, .wfb-rte-content table th:focus,
.ep-rte-body table td:focus, .ep-rte-body table th:focus,
.tf-rte-fs-body table td:focus, .tf-rte-fs-body table th:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  background: rgba(0, 113, 227, 0.06);
}
