/* =============================================================
   atlas-edn · Item 138 (Douleur chez la personne vulnérable)
   Matière Douleur & Anesthésie (mat-douleur)
   Variables CSS uniquement — pas de couleurs en dur.
   ============================================================= */

/* ---------- Mindmap : couleurs des familles ---------- */
.fam-def .node-accent      { fill: var(--accent, var(--spe-douleur)); }
.fam-facteurs .node-accent { fill: var(--accent-blue); }
.fam-trouble .node-accent  { fill: var(--spe-infectio); }
.fam-perso .node-accent    { fill: var(--accent-orange); }
.fam-depist .node-accent   { fill: var(--accent-green); }
.fam-ttt .node-accent      { fill: var(--accent-strong, var(--spe-douleur)); }

.node-sat.sat-danger .sat-bg {
  fill: var(--alert-red-soft);
  stroke: var(--alert-red);
  stroke-width: 1.5;
}
.node-sat.sat-danger .sat-title { fill: var(--alert-red); font-weight: 600; }

/* ---------- Vignette + Keypoints + Définitions ---------- */
.kp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.kp-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent, var(--spe-douleur));
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
}
.kp-card .kp-num {
  position: absolute;
  top: 10px; right: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.kp-card h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-strong, var(--spe-douleur));
  margin: 0 0 6px;
  padding-right: 24px;
}
.kp-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.def-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.def-card-mini {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.def-card-mini h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-strong, var(--spe-douleur));
  margin: 0 0 6px;
}
.def-card-mini p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Profil-cards génériques ---------- */
.profil-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profil-card-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--accent-strong, var(--spe-douleur));
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--accent-dash);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rang-mini {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: normal;
}
.profil-card .ludic-block {
  margin: 0;
}
.profil-card .ludic-block b {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.profil-card .ludic-block p,
.profil-card .ludic-block ul {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.profil-card .ludic-block ul {
  padding-left: 18px;
}
.profil-card .ludic-block li {
  margin-bottom: 3px;
}
.profil-card .ludic-block.point-cle {
  background: var(--accent-soft, var(--bg-card));
  border-left: 3px solid var(--accent-strong, var(--spe-douleur));
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.profil-card .ludic-block.point-cle b {
  color: var(--accent-strong, var(--spe-douleur));
}

/* ---------- Onglet 03 : Vue d'ensemble ---------- */
.vg-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong, var(--spe-douleur));
  background: var(--accent-soft, var(--bg-card));
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.vignette {
  background: var(--accent-soft, var(--bg-card));
  border-left: 4px solid var(--accent, var(--spe-douleur));
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 12px 0 16px;
  font-size: 13.5px;
  line-height: 1.55;
}
.vignette p { margin: 0; }

/* Schémas SVG natifs (composantes, mécanismes, peur-évitement, BPS, auto-hétéro) */
.schema-fig {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  text-align: center;
}
.schema-svg {
  width: 100%;
  height: auto;
  max-width: 760px;
  display: block;
  margin: 0 auto;
  color: var(--ink);
}
.schema-fig figcaption {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 10px;
  line-height: 1.4;
}

/* Schéma 1 — 4 composantes */
.cx-noyau { fill: var(--accent, var(--spe-douleur)); }
.cx-noyau-t { fill: var(--bg-card); }
.cx-card rect {
  fill: var(--bg-cream);
  stroke: var(--accent, var(--spe-douleur));
  stroke-width: 1.5;
}
.cx-sensori rect { stroke: var(--accent, var(--spe-douleur)); }
.cx-affect rect  { stroke: var(--accent-orange); }
.cx-cogn rect    { stroke: var(--spe-neuro); }
.cx-comp rect    { stroke: var(--accent-green); }
.cx-card text { fill: var(--ink); }
.cx-link {
  stroke: var(--accent, var(--spe-douleur));
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  fill: none;
}

/* Schéma 2 — 4 mécanismes */
.mc-card rect {
  fill: var(--bg-cream);
  stroke: var(--accent-border);
  stroke-width: 1.5;
}
.mc-card text { fill: var(--ink); }
.mc-noci rect   { stroke: var(--accent, var(--spe-douleur)); }
.mc-neuro rect  { stroke: var(--accent-blue); }
.mc-nocipl rect { stroke: var(--accent-orange); stroke-width: 2.5; fill: var(--accent-orange-soft); }
.mc-psy rect    { stroke: var(--spe-neuro); }
.mc-sep {
  stroke: var(--accent-dash);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}
.mc-bandeau {
  fill: var(--alert-red-soft);
  stroke: var(--alert-red);
  stroke-width: 1.5;
}
.mc-bandeau-t { fill: var(--alert-red); }

/* Schéma 3 — Cercle vicieux peur-évitement */
.cv-node ellipse {
  fill: var(--bg-cream);
  stroke: var(--alert-red);
  stroke-width: 1.5;
}
.cv-node text { fill: var(--ink); }
.cv-link {
  stroke: var(--alert-red);
  stroke-width: 1.8;
  fill: none;
}
.cv-arrow { fill: var(--alert-red); }
.cv-legend { fill: var(--ink-muted); }

/* Schéma 4 — Bio-psycho-social (Venn) */
.bps-circle {
  fill-opacity: 0.22;
  stroke-width: 2;
}
.bps-bio {
  fill: var(--accent, var(--spe-douleur));
  stroke: var(--accent-strong, var(--spe-douleur));
}
.bps-psy {
  fill: var(--accent-blue);
  stroke: var(--accent-blue);
}
.bps-soc {
  fill: var(--accent-green);
  stroke: var(--accent-green-strong);
}
.bps-label { fill: var(--ink); }
.bps-center {
  fill: var(--bg-cream);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.bps-center-t { fill: var(--ink); }

/* Schéma 5 — Auto vs hétéro-évaluation */
.ah-root {
  fill: var(--accent-soft, var(--bg-card));
  stroke: var(--accent-strong, var(--spe-douleur));
  stroke-width: 1.5;
}
.ah-root + text, .ah-root ~ text { fill: var(--ink); }
.ah-edge {
  stroke-width: 2;
  fill: none;
}
.ah-yes { stroke: var(--accent-green-strong); }
.ah-no  { stroke: var(--accent-orange); }
.ah-edge-yes { fill: var(--accent-green-strong); }
.ah-edge-no  { fill: var(--accent-orange); }
.ah-card {
  fill: var(--bg-cream);
  stroke-width: 1.5;
}
.ah-auto   { stroke: var(--accent-green-strong); }
.ah-hetero { stroke: var(--accent-orange); }
.ah-sep {
  stroke: var(--accent-dash);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}
.schema-autohet text { fill: var(--ink); }

/* ---------- Tableau natif (commun à tous les onglets) ---------- */
.natif-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 18px;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 13px;
}
.natif-table thead {
  background: color-mix(in oklab, var(--accent, var(--spe-douleur)) 12%, var(--bg-card));
}
.natif-table th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong, var(--spe-douleur));
  border-bottom: 1px solid var(--accent-border);
}
.natif-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--accent-border);
  vertical-align: top;
  line-height: 1.5;
}
.natif-table tr:last-child td { border-bottom: none; }
.natif-table tr:hover td {
  background: color-mix(in oklab, var(--accent-soft, var(--bg-cream)) 30%, var(--bg-card));
}

/* ---------- Onglet 04 : Bases & facteurs psy (6 blocs) ---------- */
.bases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.bases-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
}
.bases-card.tone-rang-a { border-left: 4px solid var(--accent, var(--spe-douleur)); }
.bases-card.tone-rang-b { border-left: 4px solid var(--accent-orange); }
.bases-rang {
  position: absolute;
  top: 10px; right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.bases-card h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
  padding-right: 60px;
  color: var(--accent-strong, var(--spe-douleur));
}
.bases-card.tone-rang-b h4 { color: var(--accent-orange); }
.bases-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.bases-card li { margin-bottom: 4px; }

/* ---------- Onglets 05, 06, 07, 09 : trouble-cards ---------- */
.trouble-card {
  margin: 12px 0;
}
.trouble-card.tone-rang-a { border-left: 4px solid var(--accent, var(--spe-douleur)); }
.trouble-card.tone-rang-b { border-left: 4px solid var(--accent-orange); }
.trouble-card.tone-rang-a .profil-card-title { color: var(--accent-strong, var(--spe-douleur)); }
.trouble-card.tone-rang-b .profil-card-title { color: var(--accent-orange); }

/* ---------- Onglet 08 : 6 cards-personnalité (grille 3×2) ---------- */
#perso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.perso-card {
  border-left: 4px solid var(--accent-orange);
  padding: 14px 16px;
}
.perso-card .profil-card-title {
  font-size: 16px;
  color: var(--accent-orange);
}

/* ---------- Onglet 10 : Dépistage (3 cards opérationnelles) ---------- */
.dep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.dep-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.dep-card.tone-safe   { border-left: 4px solid var(--accent-green-strong); }
.dep-card.tone-rang-a { border-left: 4px solid var(--accent, var(--spe-douleur)); }
.dep-card.tone-caution { border-left: 4px solid var(--accent-orange); }
.dep-card h4 {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 500;
  margin: 0 0 8px;
}
.dep-card.tone-safe h4    { color: var(--accent-green-strong); }
.dep-card.tone-rang-a h4  { color: var(--accent-strong, var(--spe-douleur)); }
.dep-card.tone-caution h4 { color: var(--accent-orange); }
.dep-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.dep-card li { margin-bottom: 4px; }

/* ---------- Onglet 11 : Échelles (piège + règle d'or) ---------- */
.piege-mini {
  background: var(--alert-red-soft);
  border-left: 4px solid var(--alert-red);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
}
.piege-mini h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--alert-red);
}
.piege-mini p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.regle-or {
  background: var(--accent-soft, var(--bg-card));
  border-left: 4px solid var(--accent, var(--spe-douleur));
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
}
.regle-or h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--accent-strong, var(--spe-douleur));
}
.regle-or p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- Onglet 12 : Traitements (4 cards) ---------- */
.tt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.tt-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
}
.tt-card.tone-safe    { border-left: 4px solid var(--accent-green-strong); }
.tt-card.tone-rang-a  { border-left: 4px solid var(--accent, var(--spe-douleur)); }
.tt-card.tone-danger  { border-left: 4px solid var(--alert-red); background: var(--alert-red-soft); }
.tt-rang {
  position: absolute;
  top: 10px; right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.tt-card h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
  padding-right: 60px;
}
.tt-card.tone-safe h4    { color: var(--accent-green-strong); }
.tt-card.tone-rang-a h4  { color: var(--accent-strong, var(--spe-douleur)); }
.tt-card.tone-danger h4  { color: var(--alert-red); }
.tt-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.tt-card li { margin-bottom: 4px; }

/* ---------- Bloc soft (cadres réglementaires, notes) ---------- */
.bg-soft {
  background: var(--accent-soft, var(--bg-card));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
}
.bg-soft h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--accent-strong, var(--spe-douleur));
}
.bg-soft p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}
.bg-soft ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.bg-soft li { margin-bottom: 3px; }

/* ---------- Alertes rouges (commun) ---------- */
.alerte-rouge {
  background: var(--alert-red-soft);
  border-left: 4px solid var(--danger, var(--alert-red));
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 14px 0;
}
.alerte-rouge h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--danger, var(--alert-red));
}
.alerte-rouge p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}
