/* ==========================================================================
   Item 96 · Neuropathies périphériques diffuses
   Architecture multi-pathologies (Option B) · spé NEURO (aubergine)
   ========================================================================== */

:root {
  --paper:   var(--bg-card);
  --paper-2: #fffcf5;
  --rule:    #d7ccb4;
  --rule-2:  var(--accent-dash);
  --bg-2:    #ece5d6;
  --bg-3:    #e4dcc8;
  --ink-2:   #524a3e;
  --ink-3:   #8a8270;
  --ink-4:   #b2a98f;
  --danger:  #a52a1a;
  --warn:    #8a5a12;
  --ok:      #4e6a2f;
  --info:    #2f5e6b;
  --muted:   #8a8270;

  /* Familles thématiques de l'item 96 — clés mindmap + cartes */
  --fam-semio:    var(--info);          /* sémiologie · bleu */
  --fam-topo:     var(--spe-neuro);     /* topographie · aubergine */
  --fam-enmg:     var(--warn);          /* ENMG · orange (arbitre) */
  --fam-star:     var(--danger);        /* stratégie ⭐⭐⭐⭐ · rouge (record) */
  --fam-danger:   var(--danger);        /* urgences · rouge */
  --fam-galerie:  var(--muted);         /* galerie · gris */
}

/* Élargissement local de la zone de contenu */
.content { max-width: 1400px; }

/* Fade léger au changement d'onglet */
@keyframes npd-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.content-panel.active { animation: npd-fadeIn .35s ease-out; }

/* Utilitaires */
.muted   { color: var(--ink-3); }
.danger  { color: var(--danger); }
.warn    { color: var(--warn); }
.ok      { color: var(--ok); }
hr.soft  { border: none; border-top: 1px dashed var(--rule); margin: 20px 0; }

/* =========================================================
   Sous-titres de section (numéro · titre · règle · hint)
   ========================================================= */
.sec-title       { display: flex; align-items: baseline; gap: 16px; margin: 36px 0 18px; flex-wrap: wrap; }
.sec-num         { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; color: var(--ink-3); text-transform: uppercase; }
.sec-title h2    { font-family: var(--font-serif); font-weight: 500; font-size: 30px; letter-spacing: -.01em; margin: 0; line-height: 1; }
.sec-title .rule { flex: 1; height: 1px; background: var(--rule); margin-bottom: 8px; min-width: 40px; }
.sec-title .hint { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }

.rang-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px; border: 1px solid var(--rule-2);
  color: var(--ink-2); background: var(--paper);
  vertical-align: middle;
}
.rang-tag.rang-a { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 40%, var(--rule-2)); }
.rang-tag.rang-b { color: var(--ink-3); border-color: var(--rule-2); }

/* =========================================================
   Familles d'éléments (couleurs)
   ========================================================= */
.fam-semio   { --fam: var(--fam-semio);   --fam-bg: #cfdde0; }
.fam-topo    { --fam: var(--fam-topo);    --fam-bg: #ead8e4; }
.fam-enmg    { --fam: var(--fam-enmg);    --fam-bg: #f1e0c4; }
.fam-star    { --fam: var(--fam-star);    --fam-bg: #f3dccf; }
.fam-danger  { --fam: var(--fam-danger);  --fam-bg: #f3dccf; }
.fam-galerie { --fam: var(--fam-galerie); --fam-bg: var(--bg-2); }

/* =========================================================
   Mindmap radiale — SVG
   ========================================================= */
.mmwrap { position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 12px; margin-top: 8px; }
.mmwrap .canvas { display: block; width: 100%; height: 720px; cursor: grab; }
.mmwrap .canvas:active { cursor: grabbing; }
.mmwrap .zctl { position: absolute; top: 18px; right: 22px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.mmwrap .zctl button {
  width: 34px; height: 34px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  font-family: var(--font-mono); font-size: 16px; cursor: pointer; color: var(--ink);
}
.mmwrap .zctl button:hover { background: var(--bg-2); }
.mmwrap .zhint { position: absolute; bottom: 14px; left: 22px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }

#mm-svg .ring { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 5; opacity: .5; }
#mm-svg .link.main { fill: none; stroke: var(--ink-4); stroke-width: 1.5; opacity: .55; }
#mm-svg .link.sat  { fill: none; stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 4 3; opacity: .5; }
#mm-svg .link.subnode { fill: none; stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 2 4; opacity: .5; }

#mm-svg .root-circle { fill: var(--ink); stroke: var(--rule); stroke-width: 2; }
#mm-svg .root-text   { fill: var(--paper); font-family: var(--font-serif); }

#mm-svg .node-card { cursor: pointer; }
#mm-svg .node-card:hover .node-bg { stroke-width: 2; }
#mm-svg .node-bg     { fill: var(--paper); stroke: var(--rule); stroke-width: 1; }
#mm-svg .node-accent { fill: var(--fam, var(--ink)); }
#mm-svg .node-chip   { fill: var(--bg-2); }
#mm-svg .node-chip-t { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; fill: var(--ink-2); text-transform: uppercase; }
#mm-svg .node-title  { font-family: var(--font-serif); font-size: 18px; font-weight: 500; fill: var(--ink); }
#mm-svg .node-sub    { font-family: var(--font-sans); font-size: 11px; fill: var(--ink-2); }

#mm-svg .node-sub-chip { cursor: pointer; }
#mm-svg .node-sub-chip .sub-chip-bg { fill: var(--paper); stroke: var(--fam, var(--ink-3)); stroke-width: 1.2; transition: fill .15s ease, stroke-width .15s ease; }
#mm-svg .node-sub-chip:hover .sub-chip-bg { fill: var(--fam-bg, var(--bg-2)); stroke-width: 2; }
#mm-svg .node-sub-chip .sub-chip-t { font-family: var(--font-sans); font-size: 11px; fill: var(--ink); }

#mm-svg .node-sat { cursor: pointer; }
#mm-svg .node-sat:hover .sat-bg { fill: var(--bg-2); }
#mm-svg .node-sat .sat-bg { fill: var(--paper); stroke: var(--rule); stroke-width: 1; }
#mm-svg .node-sat .sat-title { font-family: var(--font-serif); font-size: 14px; font-weight: 500; fill: var(--ink); }
#mm-svg .node-sat .sat-sub   { font-family: var(--font-sans); font-size: 10.5px; fill: var(--ink-2); }

/* =========================================================
   Vignette + keypoints + définitions
   ========================================================= */
.vignette {
  background: var(--paper); border: 1px solid var(--rule);
  border-left: 4px solid var(--spe-neuro);
  border-radius: 4px; padding: 20px 24px; margin-bottom: 24px;
}
.vignette .vg-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--spe-neuro); margin-bottom: 8px; }
.vignette p { font-family: var(--font-serif); font-size: 15px; line-height: 1.55; color: var(--ink); margin: 0; }
.vignette p b { font-weight: 600; }
.vignette .vg-trap { margin-top: 14px; padding: 10px 14px; background: var(--bg-2); border-radius: 3px; font-family: var(--font-sans); font-size: 12.5px; font-style: italic; color: var(--ink-2); }

.keypoints { display: grid; gap: 10px; }
.kp { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 12px 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; }
.kp-n { font-family: var(--font-serif); font-weight: 500; font-size: 26px; color: var(--spe-neuro); line-height: 1; padding-top: 2px; }
.kp-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.kp-body b { color: var(--ink); }

.def-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.def-card { background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--spe-neuro); border-radius: 4px; padding: 16px 18px; }
.def-card .def-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.def-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 20px; letter-spacing: -.01em; margin: 0; color: var(--spe-neuro); }
.def-card .def-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.def-card p { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0 0 10px; }
.def-card p b { color: var(--ink); }
.def-card .def-pillar { margin-top: 10px; padding: 8px 11px; background: var(--bg-2); border-radius: 3px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; color: var(--ink); }
.def-card .def-pillar b { font-weight: 600; }

/* =========================================================
   Tableaux comparatifs (topo, ENMG, SLA, recap)
   ========================================================= */
.cmp-table {
  width: 100%; border-collapse: collapse;
  background: var(--paper); border: 1px solid var(--rule);
  font-size: 12.5px; line-height: 1.5;
}
.cmp-table th, .cmp-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp-table thead th { background: var(--bg-2); font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; border-bottom: 1px solid var(--rule-2); }
.cmp-table thead th.col-flag { color: var(--danger); background: #f6e4dc; }
.cmp-table tbody th.rowhead { font-family: var(--font-serif); font-weight: 500; font-size: 13px; color: var(--ink); border-right: 1px solid var(--rule); background: var(--paper-2); width: 18%; }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table tbody tr:hover td { background: #fff; }

.cmp-table .cell-danger { background: #f3dccf; color: var(--danger); }
.cmp-table .cell-pillar { background: #cfdde0; color: var(--info); }
.cmp-table .cell-ok     { background: #dde6ce; color: var(--ok); }
.cmp-table .cell-danger b, .cmp-table .cell-pillar b, .cmp-table .cell-ok b { color: inherit; }

/* =========================================================
   Sémiologie : 3 colonnes (négatif · positif · dysautonomie)
   ========================================================= */
.semio-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .semio-cols { grid-template-columns: 1fr; } }
.semio-col { background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--ink); border-radius: 3px; padding: 14px 16px; }
.semio-col--negative { border-top-color: var(--danger); }
.semio-col--positive { border-top-color: var(--warn); }
.semio-col--autonom  { border-top-color: var(--info); }
.semio-col-h { font-family: var(--font-serif); font-weight: 500; font-size: 16px; margin-bottom: 12px; color: var(--ink); }
.semio-item { padding: 8px 0; border-top: 1px dashed var(--rule); }
.semio-item:first-of-type { border-top: none; }
.semio-axe { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.semio-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.semio-body b { color: var(--ink); }

/* =========================================================
   Topographie — silhouettes
   ========================================================= */
.topo-schemas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 18px; }
@media (max-width: 1100px) { .topo-schemas { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .topo-schemas { grid-template-columns: 1fr 1fr; } }
.topo-fig { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 12px; margin: 0; text-align: center; color: var(--ink-3); }
.topo-fig svg.silhouette { width: 80px; height: 160px; }
.topo-fig figcaption { font-size: 11.5px; line-height: 1.4; color: var(--ink-2); }
.topo-fig figcaption b { color: var(--ink); }

/* =========================================================
   Schéma nerf (anatomie) + voie polyols + pied diabétique
   ========================================================= */
.nerve-fig, .schema-fig, .img-fig {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  padding: 14px 16px; margin: 14px 0;
}
.nerve-fig svg, .schema-fig svg { width: 100%; height: auto; max-height: 320px; display: block; margin-bottom: 8px; }
.nerve-fig figcaption, .schema-fig figcaption, .img-fig figcaption { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.diab-schemas { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .diab-schemas { grid-template-columns: 1fr; } }

.img-fig { max-width: 600px; }
.img-fig img { width: 100%; height: auto; display: block; border-radius: 3px; margin-bottom: 8px; }

/* =========================================================
   Bilan minimal (encadré)
   ========================================================= */
.bilan-min {
  background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--info);
  border-radius: 4px; padding: 16px 20px; margin: 14px 0;
}
.bilan-min-h { font-family: var(--font-serif); font-weight: 500; font-size: 16px; color: var(--info); margin-bottom: 8px; }
.bilan-min ul { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* =========================================================
   Cartes-entités (galeries onglets 09, 10, 11, 12, 13)
   Gabarit identique à 8 champs.
   ========================================================= */
.entite-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .entite-gallery { grid-template-columns: 1fr; } }

.entite-card {
  background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--spe-neuro);
  border-radius: 4px; padding: 14px 18px;
}
.entite-card--alert { border-top-color: var(--danger); background: #fcf3ee; }
.entite-card__head { margin-bottom: 10px; }
.entite-card__head h4 { font-family: var(--font-serif); font-weight: 500; font-size: 17px; margin: 0; color: var(--ink); }
.entite-card .card-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: block; margin-top: 2px; }
.entite-card .card-renvoi { font-style: italic; color: var(--ink-3); font-size: 12px; margin-bottom: 8px; }
.entite-card .card-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px;
  padding: 8px 0; border-top: 1px dashed var(--rule);
}
.entite-card .card-row:first-of-type { border-top: none; }
.entite-card .card-key { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.entite-card .card-val { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.entite-card .card-val b { color: var(--ink); }
.entite-card .card-val ul { margin: 4px 0; padding-left: 18px; }
.entite-card .card-val ul li { margin: 4px 0; }
.entite-card .card-piege { background: #f9efe6; border-radius: 3px; padding: 6px 10px; }
.entite-card .card-warn { background: #f3dccf; border: 1px solid var(--danger); border-radius: 3px; padding: 8px 12px; margin: 8px 0 0; font-size: 12px; color: var(--danger); font-weight: 500; }

.entite-card .cat-block { margin: 6px 0 0; padding: 6px 10px; background: var(--bg-2); border-radius: 3px; }
.entite-card .cat-block .cat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.entite-card .cat-block ul { margin: 2px 0 0; padding-left: 18px; font-size: 12px; }

/* =========================================================
   Diabète (focus dense) — sections empilées
   ========================================================= */
.diab-section {
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--spe-neuro);
  border-radius: 3px; padding: 14px 18px; margin-bottom: 12px;
}
.diab-section-h { font-family: var(--font-serif); font-weight: 500; font-size: 17px; color: var(--ink); margin: 0 0 10px; }
.diab-section ul { margin: 4px 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.diab-section ul li { margin: 4px 0; }
.diab-section .cat-block { margin: 8px 0 4px; padding: 8px 12px; background: var(--bg-2); border-radius: 3px; }
.diab-section .cat-block .cat-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }

.diab-images { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 800px) { .diab-images { grid-template-columns: 1fr; } }

/* =========================================================
   Alertes cliniques (encadrés rouges)
   ========================================================= */
.alert-clinical {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start;
  background: #f3dccf; border: 1px solid var(--danger); border-left: 4px solid var(--danger);
  border-radius: 4px; padding: 14px 16px; margin: 16px 0;
}
.alert-clinical--top { background: #fcf3ee; }
.alert-clinical .alert-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--danger); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 600; font-size: 22px;
}
.alert-clinical h4 { font-family: var(--font-serif); font-weight: 600; font-size: 16px; color: var(--danger); margin: 0 0 6px; }
.alert-clinical ul { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.alert-clinical ul li { margin: 3px 0; }
.alert-clinical p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }

/* =========================================================
   Pièges / DD / sources
   ========================================================= */
.traps           { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .traps { grid-template-columns: 1fr; } }
.trap            { background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--danger); border-radius: 3px; padding: 14px 16px; }
.trap .tn        { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--danger); text-transform: uppercase; margin-bottom: 4px; }
.trap h5         { font-family: var(--font-serif); font-weight: 500; font-size: 15.5px; margin: 0 0 4px; }
.trap p          { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.trap p b        { color: var(--ink); }

.lim-h { font-family: var(--font-serif); font-weight: 500; font-size: 17px; margin: 22px 0 8px; color: var(--ink); }

#sources-list ul { margin: 8px 0; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* =========================================================
   SLA / NMMBC : grille deux cartes côte-à-côte
   ========================================================= */
.sla-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .sla-pair { grid-template-columns: 1fr; } }

/* =========================================================
   Mode nuit — overrides
   ========================================================= */
body.dark-mode .vignette,
body.dark-mode .keypoints .kp,
body.dark-mode .def-card,
body.dark-mode .cmp-table,
body.dark-mode .semio-col,
body.dark-mode .topo-fig,
body.dark-mode .nerve-fig,
body.dark-mode .schema-fig,
body.dark-mode .img-fig,
body.dark-mode .bilan-min,
body.dark-mode .entite-card,
body.dark-mode .diab-section,
body.dark-mode .trap,
body.dark-mode .mmwrap {
  background: #2a2521; border-color: #3d3530; color: #e9e2d3;
}
body.dark-mode .cmp-table thead th { background: #34302a; color: #e9e2d3; }
body.dark-mode .cmp-table tbody th.rowhead { background: #2f2a25; color: #e9e2d3; }
body.dark-mode .cmp-table tbody tr:hover td { background: #34302a; }
body.dark-mode .vignette p,
body.dark-mode .kp-body,
body.dark-mode .def-card p,
body.dark-mode .semio-body,
body.dark-mode .diab-section ul,
body.dark-mode .entite-card .card-val,
body.dark-mode .alert-clinical p,
body.dark-mode .alert-clinical ul,
body.dark-mode .trap p { color: #d8cfba; }
body.dark-mode .alert-clinical { background: #4a2a23; border-color: #c4513f; }
body.dark-mode .alert-clinical h4 { color: #f0a896; }
body.dark-mode #mm-svg .root-circle { fill: #14110e; }
body.dark-mode #mm-svg .node-bg { fill: #2a2521; stroke: #3d3530; }
body.dark-mode #mm-svg .node-title { fill: #e9e2d3; }
body.dark-mode #mm-svg .node-sub { fill: #b2a98f; }
body.dark-mode #mm-svg .node-chip { fill: #34302a; }
body.dark-mode #mm-svg .node-chip-t { fill: #b2a98f; }
body.dark-mode #mm-svg .node-sub-chip .sub-chip-bg { fill: #2a2521; }
body.dark-mode #mm-svg .node-sub-chip .sub-chip-t { fill: #e9e2d3; }
body.dark-mode #mm-svg .node-sat .sat-bg { fill: #2a2521; stroke: #3d3530; }
body.dark-mode #mm-svg .node-sat .sat-title { fill: #e9e2d3; }
body.dark-mode #mm-svg .node-sat .sat-sub { fill: #b2a98f; }
body.dark-mode .nerve-fig .nerve-svg rect { fill: #34302a; }
body.dark-mode .schema-fig .polyols-svg rect { fill: #34302a; }
body.dark-mode .schema-fig .foot-svg path { fill: #34302a; }
body.dark-mode .cmp-table .cell-danger { background: #5a2a22; color: #f0a896; }
body.dark-mode .cmp-table .cell-pillar { background: #25434c; color: #a3c5cf; }
body.dark-mode .cmp-table .cell-ok     { background: #38492a; color: #c4d59f; }
body.dark-mode .entite-card .card-piege { background: #3a2f25; }
body.dark-mode .entite-card .cat-block { background: #34302a; }
body.dark-mode .diab-section .cat-block { background: #34302a; }
