/* ==========================================================================
   Item 315 · Leucémies aiguës — styles spécifiques
   1ʳᵉ item Hématologie maligne (oncohématologie)
   15 onglets · mindmap 7 branches · decision-tree 6 terminaux ·
   5 cards-urgences · 3 cards-profils · 6 alertes
   ========================================================================== */

: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:   var(--alert-red);
  --warn:     #8a5a12;
  --ok:       #4e6a2f;
  --info:     var(--accent-blue);

  --fam-hemato:    var(--spe-hemato);     /* prune */
  --fam-mir:       var(--spe-mir);
  --fam-pediatrie: var(--spe-pediatrie);  /* turquoise éteint */
  --fam-onco:      var(--spe-onco);       /* rose vif */
  --fam-urg:       var(--alert-red);
  --fam-info:      var(--accent-blue);
  --fam-warn:      var(--warn);
  --fam-ok:        var(--ok);
}

.content { max-width: 1400px; }

@keyframes pc-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.content-panel.active { animation: pc-fadeIn .35s ease-out; }

.mono   { font-family: var(--font-mono); }
.danger { color: var(--danger); }
.warn   { color: var(--warn); }
.ok     { color: var(--ok); }

/* Sec-title + rang-tag */
.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 */
.fam-hemato    { --fam: var(--fam-hemato);    --fam-bg: #e8d5e0; }
.fam-mir       { --fam: var(--fam-mir);       --fam-bg: var(--bg-2); }
.fam-pediatrie { --fam: var(--fam-pediatrie); --fam-bg: #d4e5e3; }
.fam-onco      { --fam: var(--fam-onco);      --fam-bg: #f0d4e0; }
.fam-urg       { --fam: var(--fam-urg);       --fam-bg: #fbeee3; }
.fam-info      { --fam: var(--fam-info);      --fam-bg: #d5e3e7; }
.fam-warn      { --fam: var(--fam-warn);      --fam-bg: #f3e9cc; }
.fam-ok        { --fam: var(--fam-ok);        --fam-bg: #dde2c8; }

/* Lane / step / flow-row */
.lane {
  background: var(--fam-bg, var(--bg-2));
  border: 1px solid color-mix(in oklab, var(--fam, var(--ink)) 30%, var(--rule));
  border-radius: 3px; padding: 16px 18px; margin: 14px 0;
}
.lane .lane-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lane .lane-h .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fam, var(--ink)); }
.lane .lane-h h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; margin: 0; letter-spacing: -.005em; }
.lane .lane-h .kind { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.lane > p { font-size: 13px; color: var(--ink-2); }
.lane > ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.lane > ul li { margin: 5px 0; }
.lane > ul li b { color: var(--ink); font-weight: 600; }

.flow-row     { display: grid; gap: 14px; }
.flow-row.r-2 { grid-template-columns: repeat(2, 1fr); }
.flow-row.r-3 { grid-template-columns: repeat(3, 1fr); }

.step { background: #fff; border: 1px solid var(--rule); border-radius: 3px; padding: 14px 16px; position: relative; }
.step .sn { position: absolute; top: -10px; left: 14px; background: var(--paper); padding: 0 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.step h5 { font-family: var(--font-serif); font-weight: 500; font-size: 16px; margin: 2px 0 6px; }
.step p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.step ul { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.step ul li { margin: 4px 0; }
.step ul li b { color: var(--ink); font-weight: 600; }

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

/* Tables */
table.matrix { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); }
table.matrix th, table.matrix td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 12.5px; }
table.matrix 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); }
table.matrix tbody th { font-family: var(--font-serif); font-weight: 500; font-size: 14.5px; color: var(--ink); border-right: 1px solid var(--rule); }
table.matrix tbody tr:last-child th, table.matrix tbody tr:last-child td { border-bottom: none; }
table.matrix tbody tr:hover td { background: #fff; }
table.matrix.compact th, table.matrix.compact td { padding: 8px 10px; font-size: 11.5px; }
table.matrix.compact tbody th { font-size: 12.5px; }
table.matrix ul { margin: 0; padding-left: 18px; line-height: 1.7; }
table.matrix ul li { margin: 4px 0; }

/* Hbox */
.hbox {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
  padding: 12px 16px;
  display: grid; grid-template-columns: 64px 1fr; gap: 4px 16px; align-items: baseline;
}
.hbox > .n {
  grid-column: 1; grid-row: 1 / -1; align-self: start; padding-top: 2px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); font-weight: 500;
  word-break: break-word; line-height: 1.3;
}
.hbox > h5 {
  grid-column: 2;
  font-family: var(--font-serif); font-weight: 500; font-size: 15px; margin: 0 0 4px;
}
.hbox > p, .hbox > ul {
  grid-column: 2; margin: 0;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}
.hbox > ul { padding-left: 18px; }
.hbox > ul li { margin: 6px 0; }
.hbox > ul li b { color: var(--ink); font-weight: 600; }
.hbox > p b { color: var(--ink); }

/* Vignette */
.vignette {
  background: var(--paper); border: 1px solid var(--rule);
  border-left: 4px solid var(--fam-hemato);
  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(--fam-hemato); 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-size: 12.5px; font-style: italic; color: var(--ink-2); }

/* Definitions */
.def-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.def-card {
  background: var(--paper); border: 1px solid var(--rule);
  border-top: 3px solid var(--fam-hemato); border-radius: 4px;
  padding: 16px 18px;
}
.def-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; letter-spacing: -.01em; margin: 0 0 4px; color: var(--fam-hemato); }
.def-card .def-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 8px; }
.def-card p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.def-card p b { color: var(--ink); font-weight: 600; }

/* Keypoints */
#keypoints ol {
  list-style: decimal-leading-zero;
  padding: 18px 20px 18px 56px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
}
#keypoints ol li { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin: 8px 0; padding-left: 4px; }
#keypoints ol li::marker { font-family: var(--font-mono); font-size: 11px; color: var(--fam-hemato); font-weight: 600; }
#keypoints ol li b { color: var(--ink); font-weight: 600; }

/* Alertes */
.alert-clinical {
  background: #f3dccf; border: 1px solid var(--danger);
  border-radius: 4px; padding: 16px 20px;
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  margin: 18px 0;
}
.alert-clinical .alert-icon { font-family: var(--font-serif); font-size: 32px; line-height: 1; color: var(--danger); font-style: italic; font-weight: 500; }
.alert-clinical h4 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; letter-spacing: -.005em; color: var(--danger); margin: 0 0 8px; }
.alert-clinical p { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 4px 0 0; }
.alert-clinical ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.alert-clinical ul li { margin: 4px 0; }
.alert-clinical ul li b { color: var(--ink); font-weight: 600; }

/* Schémas */
.schema-wrap {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  padding: 16px 18px; margin: 12px 0;
}
.schema-wrap svg { width: 100%; height: auto; display: block; }
.schema-legend { font-size: 12px; color: var(--ink-3); line-height: 1.5; font-style: italic; margin: 8px 0 0; max-width: 1100px; }
.schema-legend b { color: var(--ink); font-weight: 600; }

/* Profil cards */
#urg-grid, #profils-host {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; margin-top: 14px;
}
.profil-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  border-top: 4px solid var(--fam, var(--ink));
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
}
.profil-head {
  background: var(--fam-bg, var(--bg-2));
  padding: 14px 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--fam, var(--ink)) 30%, var(--rule));
}
.profil-head h4 { font-family: var(--font-serif); font-weight: 500; font-size: 17px; letter-spacing: -.005em; margin: 0 0 4px; color: var(--fam, var(--ink)); }
.profil-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.profil-section { padding: 10px 16px; border-bottom: 1px dashed var(--rule); }
.profil-section:last-child { border-bottom: none; }
.profil-section h6 { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--fam, var(--ink-3)); margin: 0 0 4px; font-weight: 500; }
.profil-section ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.profil-section ul li { margin: 3px 0; }
.profil-section ul li b { color: var(--ink); font-weight: 600; }
.profil-section p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.profil-section.profil-pieges {
  background: #fbf5e9;
  border-top: 1px solid color-mix(in oklab, var(--warn) 30%, var(--rule));
}
.profil-section.profil-pieges h6 { color: var(--warn); }

/* Mindmap */
.mmwrap {
  position: relative; width: 100%;
  border: 1px solid var(--rule); border-radius: 4px;
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 100%);
  height: 800px; overflow: hidden;
}
.mmwrap .zctl { position: absolute; top: 14px; right: 14px; z-index: 10; display: flex; gap: 4px; }
.mmwrap .zctl button { width: 32px; height: 32px; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; font-family: var(--font-mono); font-size: 14px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mmwrap .zctl button:hover { background: var(--bg-2); }
.mmwrap .zhint { position: absolute; bottom: 14px; left: 14px; z-index: 5; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); background: var(--paper); padding: 4px 10px; border-radius: 2px; border: 1px solid var(--rule); }
.mmwrap svg.canvas { width: 100%; height: 100%; cursor: grab; }
.mmwrap svg.canvas:active { cursor: grabbing; }
.mmwrap svg.canvas .root-circle { fill: var(--ink); }
.mmwrap svg.canvas .root-text { fill: var(--paper); font-family: var(--font-serif); font-weight: 500; }
.mmwrap svg.canvas .node-card { cursor: pointer; }
.mmwrap svg.canvas .node-card:hover .node-bg { stroke-width: 2; }
.mmwrap svg.canvas .node-bg { fill: #fff; stroke: var(--rule-2); stroke-width: 1; }
.mmwrap svg.canvas .node-accent { fill: var(--fam, var(--ink)); }
.mmwrap svg.canvas .node-title { fill: var(--ink); font-family: var(--font-serif); font-weight: 500; font-size: 15px; }
.mmwrap svg.canvas .node-sub { fill: var(--ink-2); font-size: 11px; }
.mmwrap svg.canvas .node-chip { fill: #fff; stroke: var(--rule); stroke-width: 1; }
.mmwrap svg.canvas .node-chip-t { fill: var(--ink-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.mmwrap svg.canvas path.link { fill: none; stroke: var(--rule-2); stroke-width: 1.2; stroke-dasharray: 3 4; }
.mmwrap svg.canvas path.link.main { stroke-width: 1.4; }
.mmwrap svg.canvas path.link.sat { stroke: var(--rule-2); stroke-width: 1; stroke-dasharray: 1 5; opacity: .55; }
.mmwrap svg.canvas .ring { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.mmwrap svg.canvas .node-sat { cursor: pointer; }
.mmwrap svg.canvas .node-sat:hover .sat-bg { fill: var(--ink); }
.mmwrap svg.canvas .node-sat:hover .sat-title,
.mmwrap svg.canvas .node-sat:hover .sat-sub { fill: var(--paper); }
.mmwrap svg.canvas .sat-bg { fill: var(--bg-2); stroke: var(--ink); stroke-width: 1; }
.mmwrap svg.canvas .sat-title { fill: var(--ink); font-family: var(--font-serif); font-weight: 500; font-size: 12.5px; }
.mmwrap svg.canvas .sat-sub { fill: var(--ink-2); font-size: 9.5px; font-family: var(--font-mono); letter-spacing: .04em; }

/* Responsive */
@media (max-width: 720px) {
  .mmwrap { height: 600px; }
  .flow-row.r-2, .flow-row.r-3 { grid-template-columns: 1fr; }
  .def-grid { grid-template-columns: 1fr; }
  #urg-grid, #profils-host { grid-template-columns: 1fr; }
}

/* MODE NUIT */
body.dark-mode {
  --paper:    #1f1c17;
  --paper-2:  #251f17;
  --rule:     #4a4232;
  --rule-2:   #6b5e45;
  --bg-2:     #2a241c;
  --bg-3:     #322a20;
  --ink-2:    #d7ccb4;
  --ink-3:    #a89c7d;
  --ink-4:    #786a52;
}
body.dark-mode .vignette { background: var(--paper); }
body.dark-mode .vignette p { color: var(--ink-2); }
body.dark-mode .vignette .vg-trap { background: var(--bg-2); color: var(--ink-3); }
body.dark-mode .def-card { background: var(--paper); }
body.dark-mode .def-card p { color: var(--ink-2); }
body.dark-mode #keypoints ol { background: var(--paper); }
body.dark-mode #keypoints ol li { color: var(--ink-2); }
body.dark-mode .step { background: var(--paper-2); }
body.dark-mode .step p, body.dark-mode .step ul { color: var(--ink-2); }
body.dark-mode .hbox { background: var(--paper); }
body.dark-mode .hbox > p, body.dark-mode .hbox > ul { color: var(--ink-2); }
body.dark-mode table.matrix { background: var(--paper); }
body.dark-mode table.matrix tbody tr:hover td { background: var(--bg-2); }
body.dark-mode .alert-clinical { background: #3a1a14; border-color: #c9624c; }
body.dark-mode .alert-clinical h4 { color: #f0a896; }
body.dark-mode .alert-clinical p, body.dark-mode .alert-clinical ul { color: #f0d5c9; }
body.dark-mode .alert-clinical ul li b { color: #fff8e1; }
body.dark-mode .schema-wrap { background: var(--paper); }
body.dark-mode .profil-card { background: var(--paper); }
body.dark-mode .profil-section ul { color: var(--ink-2); }
body.dark-mode .profil-section.profil-pieges { background: #2a2418; }
body.dark-mode .cat-block { background: var(--paper-2); }
body.dark-mode .mmwrap { background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
body.dark-mode .mmwrap .zctl button { background: var(--paper); color: var(--ink-2); border-color: var(--rule); }
body.dark-mode .mmwrap .zhint { background: var(--paper); color: var(--ink-3); border-color: var(--rule); }
body.dark-mode .mmwrap svg.canvas .node-bg { fill: var(--paper); stroke: var(--rule-2); }
body.dark-mode .mmwrap svg.canvas .node-title { fill: var(--ink-2); }
body.dark-mode .mmwrap svg.canvas .node-sub { fill: var(--ink-3); }
body.dark-mode .mmwrap svg.canvas .node-chip { fill: var(--paper-2); stroke: var(--rule); }
body.dark-mode .mmwrap svg.canvas .node-chip-t { fill: var(--ink-3); }
body.dark-mode .mmwrap svg.canvas .sat-bg { fill: var(--bg-2); stroke: var(--ink-2); }
body.dark-mode .mmwrap svg.canvas .sat-title { fill: var(--ink-2); }
body.dark-mode .mmwrap svg.canvas .sat-sub { fill: var(--ink-3); }
body.dark-mode .mmwrap svg.canvas .root-circle { fill: var(--ink-2); }
body.dark-mode .mmwrap svg.canvas .root-text { fill: var(--paper); }

/* Decision-tree racine */
.dt-svg .dt-node.dt-root rect { fill: var(--ink); }
.dt-svg .dt-node.dt-root text { fill: var(--paper-2, #faf6ec); }
body.dark-mode .dt-svg .dt-node.dt-root rect { fill: var(--ink-2) !important; }
body.dark-mode .dt-svg .dt-node.dt-root text { fill: var(--paper) !important; }
