/* ============ style-matrices.css — 30 pages bibliothèque & Voies ============ */

.nsi-fiche{
  --a:#f28c28;
  --e:#d51a8a;
  --m:#22bfd1;
  --ink:#18222d;
  --muted:#68737e;
  --line:#dce1e7;
  --paper:#fffefa;
  --soft:#f6f8fa;
}
.nsi-fiche *{box-sizing:border-box}
.nsi-fiche{
  margin:0;background:#edf1f5;color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  line-height:1.45
}
.nsi-fiche .page{
  max-width:1120px;margin:28px auto;background:var(--paper);
  box-shadow:0 16px 42px rgba(26,35,48,.13);
  border-radius:18px;overflow:hidden
}
.nsi-fiche .topline{height:9px;background:linear-gradient(90deg,var(--a) 0 33.33%,var(--e) 33.33% 66.66%,var(--m) 66.66%)}
.nsi-fiche header{padding:34px 42px 24px;border-bottom:1px solid var(--line)}
.nsi-fiche .eyebrow{font-size:.78rem;text-transform:uppercase;letter-spacing:.16em;font-weight:850;color:var(--muted)}
.nsi-fiche h1{margin:6px 0 2px;font-size:clamp(2.2rem,5vw,4rem);letter-spacing:-.04em}
.nsi-fiche .badge{display:inline-block;background:#17202a;color:#fff;border-radius:999px;padding:4px 14px;font-size:.48em;vertical-align:middle}
.nsi-fiche .cross{font-size:1.25rem;font-weight:850}
.nsi-fiche .a{color:var(--a)} .nsi-fiche .e{color:var(--e)} .nsi-fiche .m{color:var(--m)}
.nsi-fiche section{padding:28px 42px;border-bottom:1px solid var(--line)}
.nsi-fiche h2{margin:0 0 16px;font-size:1.35rem}
.nsi-fiche h3{margin:0 0 8px}
.nsi-fiche p{margin:.35rem 0}

.nsi-fiche .meta{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;margin-bottom:18px
}
.nsi-fiche .meta-card{
  border:1px solid var(--line);border-radius:13px;
  padding:13px 15px;background:#fff
}
.nsi-fiche .meta-card small{
  display:block;text-transform:uppercase;letter-spacing:.08em;
  font-weight:800;color:var(--muted);margin-bottom:4px
}

.nsi-fiche .logic-row{
  display:grid;grid-template-columns:.78fr 1.22fr;
  gap:18px;align-items:stretch
}
.nsi-fiche .card{
  border:1px solid var(--line);border-radius:16px;
  padding:18px;background:#fff
}
.nsi-fiche .card-title{
  display:flex;align-items:center;gap:9px;
  margin-bottom:12px;font-size:1rem;font-weight:850
}
.nsi-fiche .icon{
  width:28px;height:28px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:#f0f3f6;font-size:.92rem
}

.nsi-fiche .arche-wrap{display:flex;gap:18px;align-items:center;justify-content:center;flex-wrap:wrap}
.nsi-fiche .arche-simple{
  display:grid;
  grid-template-columns:repeat(3,44px);
  grid-template-rows:repeat(3,44px);
  gap:4px
}
.nsi-fiche .arche-simple div{
  display:flex;align-items:center;justify-content:center;
  border-radius:7px;font-weight:800
}
.nsi-fiche .cell{background:#fff;border:1px solid #e2e6eb;color:#c6cdd4}
.nsi-fiche .cell.active-a{border:2px solid var(--a);background:rgba(242,140,40,.09);color:#a04e00;font-size:1.1rem}
.nsi-fiche .cell.active-e{border:2px solid var(--e);background:rgba(213,26,138,.08);color:#98105e;font-size:1.1rem}
.nsi-fiche .arche-legend{display:grid;gap:8px;font-size:.82rem;color:#4e5965}
.nsi-fiche .arche-legend b{font-weight:900;margin-right:2px}
.nsi-fiche .lg{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:7px;vertical-align:-1px}
.nsi-fiche .lg-a{background:var(--a)} .nsi-fiche .lg-e{background:var(--e)} .nsi-fiche .lg-m{background:var(--m)}

.nsi-fiche .read-rule{display:grid;gap:12px}
.nsi-fiche .rule{border-left:4px solid var(--line);padding-left:13px}
.nsi-fiche .rule.a-rule{border-color:var(--a)}
.nsi-fiche .rule.e-rule{border-color:var(--e)}
.nsi-fiche .rule strong{display:block;margin-bottom:3px}

.nsi-fiche .finality{
  margin-top:18px;border:1px solid var(--line);
  border-radius:16px;padding:18px;background:#fff
}

.nsi-fiche .matrix-wrap{overflow-x:auto}
.nsi-fiche table.matrix{
  width:100%;border-collapse:separate;border-spacing:0;
  border:1px solid var(--line);border-radius:15px;
  overflow:hidden;background:#fff
}
.nsi-fiche .matrix th,.nsi-fiche .matrix td{
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:15px 14px;vertical-align:top;text-align:left
}
.nsi-fiche .matrix th:last-child,.nsi-fiche .matrix td:last-child{border-right:0}
.nsi-fiche .matrix tr:last-child th,.nsi-fiche .matrix tr:last-child td{border-bottom:0}
.nsi-fiche .matrix thead th{
  text-align:center;background:rgba(213,26,138,.08);color:#8d145d
}
.nsi-fiche .matrix tbody th{
  background:rgba(242,140,40,.09);color:#9b4d06;min-width:130px;
  text-align:center;vertical-align:middle
}
.nsi-fiche .th-ico{
  display:block;width:34px;height:34px;margin:2px auto 7px;
  stroke:currentColor;fill:none;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round;opacity:.9
}
.nsi-fiche .th-label{display:block;letter-spacing:.02em}
.nsi-fiche .keyword{display:block;font-weight:900;font-size:1.02rem;margin-bottom:5px}
.nsi-fiche .definition{display:block;font-size:.82rem;line-height:1.35;color:#5e6974;font-weight:500}

.nsi-fiche .paths{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.nsi-fiche .path{
  border:1px solid var(--line);border-radius:14px;
  padding:18px;background:#fff
}
.nsi-fiche .path.primary{
  border:2px solid var(--a);
  background:linear-gradient(180deg,rgba(242,140,40,.08),#fff)
}
.nsi-fiche .path-code{font-weight:900;font-size:1.18rem;margin-bottom:5px}
.nsi-fiche .path-name{font-weight:850}
.nsi-fiche .path p{font-size:.91rem;color:#4f5a65}
.nsi-fiche .note{
  margin-top:10px;padding:10px 12px;border-radius:10px;
  background:#f5f7f9;font-size:.84rem;color:#4e5965
}
.nsi-fiche .note strong{color:#202a34}

.nsi-fiche .am-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:14px
}
.nsi-fiche .am-card{
  border:1px solid var(--line);border-radius:14px;
  padding:16px;background:#fff
}
.nsi-fiche .am-card strong{display:block;margin-bottom:4px}
.nsi-fiche .am-code{font-weight:900;color:var(--m);font-size:1.1rem}

.nsi-fiche .readings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.nsi-fiche .reading{
  border:1px solid var(--line);border-radius:15px;
  padding:19px;background:#fff
}
.nsi-fiche .reading h3{
  font-size:1rem;display:flex;align-items:center;gap:8px
}
.nsi-fiche .reading p{color:#48545f}

.nsi-fiche footer{
  padding:18px 42px 25px;color:var(--muted);
  font-size:.82rem;display:flex;justify-content:space-between
}
@media(max-width:800px){
  .nsi-fiche .logic-row,.nsi-fiche .readings{grid-template-columns:1fr}
  .nsi-fiche .meta,.nsi-fiche .paths,.nsi-fiche .am-grid{grid-template-columns:1fr}
  .nsi-fiche header,.nsi-fiche section,.nsi-fiche footer{padding-left:22px;padding-right:22px}
}

.nsi-fiche .tag-label{display:block;margin-top:13px;font-size:.68rem;text-transform:uppercase;letter-spacing:.11em;font-weight:800;color:var(--muted)}
.nsi-fiche .tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.nsi-fiche .tag{font-size:.75rem;font-weight:600;padding:4px 11px;border-radius:999px;background:var(--soft);border:1px solid var(--line);color:#98a2ac}
.nsi-fiche .tag b{color:#98a2ac;font-weight:700}
.nsi-fiche .tag .cible{font-weight:850;font-style:normal}
.nsi-fiche .reading.psy .cible{color:#d51a8a}
.nsi-fiche .reading.rh .cible{color:#7b2fbe}
.nsi-fiche .reading.philo .cible{color:#0aa3b8}
.nsi-fiche .reading.spi .cible{color:#e07b1a}
.nsi-fiche .reading.psy h3 .icon{background:rgba(213,26,138,.10);color:#d51a8a}
.nsi-fiche .reading.rh h3 .icon{background:rgba(123,47,190,.10);color:#7b2fbe}
.nsi-fiche .reading.philo h3 .icon{background:rgba(10,163,184,.10);color:#0aa3b8}
.nsi-fiche .reading.spi h3 .icon{background:rgba(224,123,26,.12);color:#e07b1a}
.nsi-fiche .tag.gold{background:rgba(34,191,209,.08);border-color:rgba(34,191,209,.35);color:#08798a;font-weight:800}
.nsi-fiche .verif{margin-top:9px;font-size:.86rem;color:#48545f}
.nsi-fiche .verif strong{color:#202a34}
.nsi-fiche .courants{display:grid;gap:8px;margin-top:16px}
.nsi-fiche .courants-intro{margin:14px 0 0;font-size:.8rem;font-weight:800;text-transform:uppercase;
  letter-spacing:.09em;color:var(--muted)}
.nsi-fiche .courant{display:flex;align-items:center;gap:11px;padding:9px 13px;border-radius:11px;
  font-size:.84rem;color:#48545f;border:1px solid var(--line);background:#fff}
.nsi-fiche .courant .fl{font-size:1.15rem;font-weight:900;line-height:1}
.nsi-fiche .courant.desc .fl{color:var(--m)} .nsi-fiche .courant.asc .fl{color:var(--a)}
.nsi-fiche .courant b{color:#202a34}
.nsi-fiche .courant .seq{margin-left:auto;font-weight:850;white-space:nowrap;font-size:.8rem}
.nsi-fiche .courant.desc .seq{color:#08798a} .nsi-fiche .courant.asc .seq{color:#a04e00}
@media(max-width:800px){.nsi-fiche .courant{flex-wrap:wrap}.nsi-fiche .courant .seq{margin-left:31px}}
.nsi-fiche table.am-mini{width:100%;border-collapse:separate;border-spacing:0;margin-top:12px;
  border:1px solid var(--line);border-radius:10px;overflow:hidden;table-layout:fixed}
.nsi-fiche .am-mini th,.nsi-fiche .am-mini td{border-right:1px solid var(--line);border-bottom:1px solid var(--line);
  padding:6px 4px;text-align:center;font-size:.68rem;line-height:1.2;overflow-wrap:break-word}
.nsi-fiche .am-mini th:last-child,.nsi-fiche .am-mini td:last-child{border-right:0}
.nsi-fiche .am-mini tr:last-child th,.nsi-fiche .am-mini tr:last-child td{border-bottom:0}
.nsi-fiche .am-mini thead th{background:rgba(34,191,209,.10);color:#08798a;font-weight:850}
.nsi-fiche .am-mini tbody th{background:rgba(242,140,40,.09);color:#9b4d06;font-weight:850;width:23%}
.nsi-fiche .am-mini td{font-weight:750;color:#08798a;background:#fff}
.nsi-fiche .am-mini thead th:first-child{background:#f6f8fa}
.nsi-fiche .am-note{margin-top:14px;padding:12px 14px;border-radius:12px;background:#f5f7f9;font-size:.86rem;color:#4e5965;border-left:4px solid var(--m)}
.nsi-fiche .am-note strong{color:#202a34}

@media print{
  .nsi-fiche{background:#fff}.nsi-fiche .page{margin:0;box-shadow:none;border-radius:0}
}

/* --- famille EM --- */
/* Adaptations famille EM */
.nsi-fiche.fam-em .cell.active-m{border:2px solid var(--m);background:rgba(34,191,209,.10);color:#08798a;font-size:1.1rem}
.nsi-fiche.fam-em .rule.m-rule{border-color:var(--m)}
.nsi-fiche.fam-em .matrix thead th{background:rgba(34,191,209,.10);color:#08798a}
.nsi-fiche.fam-em .matrix tbody th{background:rgba(213,26,138,.08);color:#98105e}

/* --- famille AM --- */
/* Adaptations famille AM */
.nsi-fiche.fam-am .cell.active-m{border:2px solid var(--m);background:rgba(34,191,209,.10);color:#08798a;font-size:1.1rem}
.nsi-fiche.fam-am .rule.m-rule{border-color:var(--m)}
.nsi-fiche.fam-am .matrix thead th{background:rgba(34,191,209,.10);color:#08798a}

/* --- pages Voies --- */

.nsi-voie{--a:#f28c28;--e:#d51a8a;--m:#22bfd1;--ink:#18222d;--muted:#68737e;--line:#dce1e7;--paper:#fffefa}
.nsi-voie *{box-sizing:border-box}
.nsi-voie{margin:0;background:#edf1f5;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;line-height:1.5}
.nsi-voie .page{max-width:1120px;margin:28px auto;background:var(--paper);box-shadow:0 16px 42px rgba(26,35,48,.13);border-radius:18px;overflow:hidden}
.nsi-voie .topline{height:9px;background:linear-gradient(90deg,var(--a) 0 33.33%,var(--e) 33.33% 66.66%,var(--m) 66.66%)}
.nsi-voie header{padding:34px 42px 26px;border-bottom:1px solid var(--line)}
.nsi-voie .eyebrow{font-size:.78rem;text-transform:uppercase;letter-spacing:.16em;font-weight:850;color:var(--muted)}
.nsi-voie h1{margin:6px 0 6px;font-size:clamp(2rem,4.6vw,3.4rem);letter-spacing:-.03em}
.nsi-voie .sub{font-size:1.05rem;color:#4e5965;max-width:74ch}
.nsi-voie .pivot{display:inline-block;margin-top:12px;padding:6px 16px;border-radius:999px;background:rgba(213,26,138,.08);color:#98105e;font-weight:850;font-size:.9rem}
.nsi-voie section{padding:28px 42px;border-bottom:1px solid var(--line)}
.nsi-voie h2{margin:0 0 14px;font-size:1.3rem}
.nsi-voie p{margin:.4rem 0}
.nsi-voie .cadre{border:1px solid var(--line);border-radius:14px;background:#fff;padding:16px 18px;font-size:.92rem;color:#4e5965}
.nsi-voie .cadre b.a{color:#a04e00}.nsi-voie .cadre b.e{color:#98105e}.nsi-voie .cadre b.m{color:#08798a}
.nsi-voie .cadre a{color:#98105e;font-weight:700}
.nsi-voie .groupe{margin-top:22px}
.nsi-voie .groupe-titre{display:flex;align-items:center;gap:10px;font-weight:850;margin-bottom:12px}
.nsi-voie .pastille{width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:900;background:rgba(242,140,40,.13);color:#a04e00}
.nsi-voie .groupe-titre small{font-weight:600;color:var(--muted)}
.nsi-voie .chemins{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.nsi-voie .chemin{border:1px solid var(--line);border-radius:14px;padding:17px;background:#fff;display:flex;flex-direction:column}
.nsi-voie .chemin.primary{border:2px solid var(--e);background:linear-gradient(180deg,rgba(213,26,138,.05),#fff)}
.nsi-voie .ch-code{font-weight:900;font-size:1.15rem}
.nsi-voie .ch-nom{font-weight:850;color:#98105e;margin:2px 0 6px}
.nsi-voie .chemin p{font-size:.88rem;color:#4f5a65;flex:1}
.nsi-voie .ch-structure{margin-top:10px;padding:9px 11px;border-radius:9px;background:#f5f7f9;font-size:.78rem;color:#4e5965}
.nsi-voie .ch-structure b{color:#202a34}
.nsi-voie .ch-fiches{margin-top:10px;font-size:.8rem;font-weight:700}
.nsi-voie .ch-fiches a{color:#08798a;text-decoration:none;border:1px solid rgba(34,191,209,.4);border-radius:999px;padding:2px 10px;margin-right:5px}
.nsi-voie .note-methode{margin-top:8px;border-left:4px solid var(--m);padding:12px 15px;background:#f5f7f9;border-radius:0 10px 10px 0;font-size:.92rem;color:#4e5965}
.nsi-voie .note-methode a{color:#08798a;font-weight:700}
.nsi-voie footer{padding:18px 42px 25px;color:var(--muted);font-size:.82rem;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
.nsi-voie footer a{color:#98105e;font-weight:700;text-decoration:none}
@media(max-width:860px){.nsi-voie .chemins{grid-template-columns:1fr}.nsi-voie header,.nsi-voie section,.nsi-voie footer{padding-left:22px;padding-right:22px}}

/* --- index bibliothèque --- */

.nsi-fiche .lib-familles{display:grid;gap:22px}
.nsi-fiche .lib-fam{border:1px solid var(--line);border-radius:16px;background:#fff;overflow:hidden}
.nsi-fiche .lib-fam-titre{padding:13px 18px;font-weight:850;border-bottom:1px solid var(--line)}
.nsi-fiche .lib-fam.f-ae .lib-fam-titre{background:rgba(242,140,40,.08);color:#a04e00}
.nsi-fiche .lib-fam.f-em .lib-fam-titre{background:rgba(213,26,138,.07);color:#98105e}
.nsi-fiche .lib-fam.f-am .lib-fam-titre{background:rgba(34,191,209,.09);color:#08798a}
.nsi-fiche .lib-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:16px 18px}
.nsi-fiche .lib-item{display:flex;align-items:baseline;gap:9px;border:1px solid var(--line);border-radius:10px;
  padding:9px 12px;text-decoration:none;color:var(--ink);background:#fff}
.nsi-fiche .lib-item:hover{border-color:#b9c2cc}
.nsi-fiche .lib-item b{font-size:1.02rem}
.nsi-fiche .lib-item span{font-size:.86rem;color:#4e5965}
@media(max-width:820px){.nsi-fiche .lib-grid{grid-template-columns:1fr}}
