:root{
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #d7dbe6;
  --text: #1b1f2a;
  --muted: #5b6476;
  --shadow: 0 6px 18px rgba(16,24,40,.10);

  --nodeRadius: 14px;
  --nodePadY: 12px;
  --nodePadX: 14px;

  --gapY: 34px;

  --line: #7a8399;
  --lineWidth: 2.4px;
}

*{ box-sizing:border-box; }

body{
  margin:16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar{ margin-bottom: 10px; }
.topbar h1{ margin:0; font-size: 16px; }

/* ORGANIGRAMME EN HAUT FULL WIDTH */
.stage{
  width: 100%;
  border:1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(#fbfcff, #f6f7fb);
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: hidden; /* important */
}

.chartTitle{
  font-weight: 800;
  font-size: 16px;
  margin: 4px 6px 12px;
}

/* conteneur export + rendu */
.chartWrap{
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;              /* pas de scroll horizontal */
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.65);
  border:1px solid rgba(215,219,230,.8);
}

/* Surface organigramme : TOUJOURS largeur 100% */
.nodes{
  position: relative;
  width: 100%;
  min-height: 420px;
}

.node{
  position:absolute;
  padding: 12px 14px;
  border-radius: var(--nodeRadius);
  box-shadow: 0 8px 16px rgba(0,0,0,.10);
  border: 1px solid rgba(255,255,255,.55);
  backdrop-filter: blur(2px);

  /* IMPORTANT: ne coupe plus le texte */
  overflow: visible;              /* <-- au lieu de hidden */
}


.nodeTitle{
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1.2;
  margin-bottom: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nodeLines{
  font-size: 12.5px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nodeTitle, .nodeLines{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nodeLines .bullet{
  display:block;
  padding-left: 0;
}


.links{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}

/* SAISIE EN BAS */
.editor{
  margin-top: 14px;
  width: 100%;
  border:1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  padding: 14px;
}

#input{
  width:100%;
  height: 240px;
  resize: vertical;
  padding: 12px;
  border:1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.35;
}

.toolbar{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items:center;
  margin-top: 10px;
}
.toolbar button{
  border:1px solid var(--border);
  background: var(--panel);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.toolbar button:hover{ background:#fbfbff; }
.toolbar .spacer{ flex: 1; }

.hint{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* NODES */
.node{
  position:absolute;
  padding: var(--nodePadY) var(--nodePadX);
  border-radius: var(--nodeRadius);
  box-shadow: 0 8px 16px rgba(0,0,0,.10);
  border: 1px solid rgba(255,255,255,.55);
  backdrop-filter: blur(2px);
  transform-origin: top left;
}

.nodeTitle{ font-weight: 800; font-size: 13.5px; }
/* .nodeSub{ font-size: 12px; opacity:.9; margin-top: 2px; } */

/* Couleurs par niveau */
.level-0{ background: linear-gradient(180deg, #4e86ff, #2e66ea); color:#fff; }
.level-1{ background: linear-gradient(180deg, #ffb36b, #ff8f4d); color:#2b1a0d; }
.level-2{ background: linear-gradient(180deg, #ffd6a5, #ffbe78); color:#2b1a0d; }
.level-3{ background: linear-gradient(180deg, #d8f0ff, #b6dcff); color:#0b1b2d; }
.level-4{ background: linear-gradient(180deg, #e7e2ff, #cbc3ff); color:#1a1230; }
.level-5{ background: linear-gradient(180deg, #dcffe9, #bff5d2); color:#0f2a1a; }


