:root {
  /* Charte du portail pédagogique (HighEdSuite) : fond lavande pointillé, cartes blanches,
     Plus Jakarta Sans, étiquettes en JetBrains Mono. Promesse relève de l'étape Évaluer (indigo). */
  --paper: #f4f3fb;
  --sheet: #ffffff;
  --ink: #1e1b39;
  --ink-2: #3a3660;
  --ink-3: #6c6890;
  --rule: #dcd8f0;
  --rule-2: #e9e7f7;
  --promis: #4f46e5;
  --evalue: #b45309;
  --valide: #0f766e;
  --ecart: #e11d6f;
  --focus: #4f46e5;
  --indigo: #4f46e5;
  --indigo-fonce: #4338ca;
  --indigo-clair: #eeecfe;
  --mauve: #8b5cf6;
  --serif: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-s: 8px;
  --r-m: 16px;
  --ombre: 0 1px 2px rgba(30, 27, 57, .04), 0 8px 24px rgba(79, 70, 229, .06);
  --ombre-forte: 0 2px 6px rgba(30, 27, 57, .06), 0 18px 40px rgba(79, 70, 229, .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); font-variant-numeric: tabular-nums; }
a { color: var(--promis); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; max-width: 72ch; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Barre supérieure */
.top { display: flex; align-items: center; gap: 2rem; padding: .9rem clamp(1rem, 4vw, 3rem); background: var(--ink); color: #e9edf3; }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: .6rem; }
.brand small { font-family: var(--sans); font-weight: 400; font-size: .8rem; color: #a9b4c4; }
.top nav { display: flex; gap: 1.2rem; flex: 1; }
.top nav a { color: #c8d1de; text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.top nav a[aria-current="page"] { color: #fff; border-color: #8fa8d8; }
.top .who { font-size: .85rem; color: #a9b4c4; display: flex; gap: .8rem; align-items: center; }
.top .who button { background: none; border: 1px solid #45546d; color: #dfe5ee; border-radius: var(--r-s); padding: .25rem .6rem; cursor: pointer; font: inherit; }

main { padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 4vw, 3rem) 4rem; max-width: 1320px; margin: 0 auto; }

/* Ouverture */
.lede { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 2.5rem; align-items: end; padding-bottom: 1.8rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.6rem; }
.lede h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); max-width: 22ch; }
.lede p { color: var(--ink-2); margin-top: .8rem; }
@media (max-width: 860px) { .lede { grid-template-columns: 1fr; } }

/* Légende des trois mesures */
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .p i { background: var(--promis); }
.legend .e i { background: var(--evalue); }
.legend .v i { background: var(--valide); }
.legend .g i { background: var(--ecart); border-radius: 1px; height: 3px; width: 14px; }

/* La règle : l'élément signature. Trois repères sur une échelle 0 à 1, et l'écart en rouge */
.ruler { position: relative; height: 34px; min-width: 160px; }
.ruler .track { position: absolute; left: 0; right: 0; top: 16px; height: 2px; background: var(--rule-2); }
.ruler .ticks { position: absolute; left: 0; right: 0; top: 12px; height: 10px; background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 10%); }
.ruler .gap { position: absolute; top: 15px; height: 4px; background: var(--ecart); opacity: .85; }
.ruler .mark { position: absolute; top: 9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--sheet); box-shadow: 0 0 0 1px rgba(24, 36, 58, .25); }
.ruler .mark.p { background: var(--promis); top: 3px; }
.ruler .mark.e { background: var(--evalue); top: 9px; }
.ruler .mark.v { background: var(--valide); top: 15px; }
.ruler.big { height: 64px; }
.ruler.big .track { top: 30px; height: 3px; }
.ruler.big .ticks { top: 24px; height: 14px; }
.ruler.big .gap { top: 29px; height: 6px; }
.ruler.big .mark { width: 22px; height: 22px; margin-left: -11px; }
.ruler.big .mark.p { top: 0; }
.ruler.big .mark.e { top: 20px; }
.ruler.big .mark.v { top: 40px; }
.ruler .scale { position: absolute; left: 0; right: 0; bottom: -2px; display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-3); }
.ruler.empty .track { background: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 8px); }

.dist { font-family: var(--serif); font-weight: 600; color: var(--ecart); }
.dist.ok { color: var(--valide); }
.dist.none { color: var(--ink-3); font-weight: 400; font-family: var(--sans); }

/* Filtres */
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2); padding: .25rem .7rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-s); padding: .45rem .6rem; }
textarea { width: 100%; min-height: 9rem; font-size: .85rem; line-height: 1.45; }
label.field { display: grid; gap: .25rem; font-size: .85rem; color: var(--ink-2); }

/* Tableau des certifications */
.ledger { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); }
.ledger th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--ink-2); padding: .6rem .8rem; border-bottom: 1px solid var(--rule); background: #f8f9fb; position: sticky; top: 0; }
.ledger th button { all: unset; cursor: pointer; }
.ledger td { padding: .65rem .8rem; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.ledger tr.row { cursor: pointer; }
.ledger tr.row:hover td { background: #f7f9fc; }
.ledger .title { font-weight: 500; }
.ledger .num { color: var(--ink-3); font-size: .8rem; }
.ledger .col-ruler { width: 30%; min-width: 180px; }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: var(--r-s); background: #e8edf5; color: var(--ink-2); margin: 0 .25rem .2rem 0; }
.tag.warn { background: #f6ead3; color: #7a5717; }
.tag.bad { background: #f3dcd8; color: #7c2b20; }
.tag.good { background: #d8ece6; color: #1f5a4c; }
.table-wrap { overflow-x: auto; }

/* Boutons */
.btn { font: inherit; font-size: .9rem; border-radius: var(--r-s); padding: .45rem .9rem; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; }
.btn.secondary { background: var(--sheet); color: var(--ink); border-color: var(--rule); }
.btn.danger { background: var(--sheet); color: var(--ecart); border-color: #dcb3ab; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Fiche certification */
.cert-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--rule); }
.cert-head .crumbs { font-size: .85rem; margin-bottom: .6rem; }
.cert-head h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.cert-head .meta { color: var(--ink-2); font-size: .9rem; margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.gauge { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1rem 1.2rem; }
.gauge .figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .6rem; }
.gauge .figs div { font-size: .78rem; color: var(--ink-3); }
.gauge .figs b { display: block; font: 600 1.25rem/1.2 var(--serif); color: var(--ink); }
.gauge .figs .p b { color: var(--promis); }
.gauge .figs .e b { color: var(--evalue); }
.gauge .figs .v b { color: var(--valide); }
.gauge .figs .d b { color: var(--ecart); }
@media (max-width: 900px) { .cert-head { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--rule); margin: 1.4rem 0 1.2rem; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: .6rem 0; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); font-weight: 600; }
.tabs button:focus-visible { outline: 2px solid var(--focus); }

.bloc { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m); margin-bottom: 1.2rem; }
.bloc > header { display: grid; grid-template-columns: minmax(0, 1fr) 220px 70px; gap: 1rem; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--rule-2); }
.bloc > header .code { color: var(--ink-3); font-size: .8rem; }
.bloc .modal-line { padding: .5rem 1.1rem; font-size: .82rem; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); background: #fafbfc; }
.comp { display: grid; grid-template-columns: minmax(0, 1fr) 220px 70px; gap: 1rem; align-items: center; padding: .7rem 1.1rem; border-bottom: 1px solid var(--rule-2); }
.comp:last-child { border-bottom: 0; }
.comp .txt { font-size: .92rem; }
.comp details { grid-column: 1 / -1; font-size: .85rem; color: var(--ink-2); }
.comp details summary { cursor: pointer; color: var(--ink-3); font-size: .8rem; }
.comp details dl { display: grid; grid-template-columns: 9rem 1fr; gap: .3rem .8rem; margin: .5rem 0 0; }
.comp details dt { color: var(--ink-3); }
.comp details dd { margin: 0; }
@media (max-width: 720px) { .bloc > header, .comp { grid-template-columns: 1fr; } }

.status-non_enseignee { color: var(--ecart); }
.status-non_evaluee { color: #8a5a10; }
.status-non_certifiante { color: #6b5a1a; }
.status-alignee { color: var(--valide); }

.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
.panel h3 { margin-bottom: .6rem; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.note { border-left: 3px solid var(--evalue); background: #fbf6ec; padding: .6rem .9rem; font-size: .88rem; margin-bottom: 1rem; }
.note.err { border-color: var(--ecart); background: #fbefed; }

.syl-list { list-style: none; padding: 0; margin: 0; }
.syl-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--rule-2); align-items: center; }
.syl-list li:last-child { border-bottom: 0; }

dialog { border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1.4rem; max-width: min(640px, 94vw); width: 100%; color: var(--ink); }
dialog::backdrop { background: rgba(24, 36, 58, .45); }
dialog h2 { margin-bottom: .8rem; }
dialog form { display: grid; gap: .9rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .3rem .8rem; font-size: .88rem; }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r-s); font-size: .9rem; z-index: 50; max-width: 90vw; }
.job { font-size: .85rem; color: var(--ink-2); display: flex; gap: .6rem; align-items: center; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--rule); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 2.4rem 1.4rem; text-align: left; background: var(--sheet); border: 1px dashed var(--rule); border-radius: var(--r-m); }
.empty h3 { margin-bottom: .4rem; }

.login { max-width: 400px; margin: 10vh auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 2rem; }
.login h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.login form { display: grid; gap: .9rem; margin-top: 1.2rem; }

.syl-view h2 { margin: 1.4rem 0 .6rem; }
.syl-view table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.syl-view th, .syl-view td { text-align: left; border-bottom: 1px solid var(--rule-2); padding: .45rem .5rem; vertical-align: top; }
.syl-view th { color: var(--ink-2); font-weight: 600; font-size: .8rem; }

.prose { max-width: 74ch; }
.prose h2 { margin: 1.8rem 0 .6rem; }
.prose code { background: #e8edf5; padding: .05rem .3rem; border-radius: 2px; font-size: .88em; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.ruler .mark, .ruler .gap { transition: left .5s ease, width .5s ease; }

/* ---------- Indicateurs IA et RSE ---------- */
.tag.muted { color: var(--ink-3); }
.ledger.compact td, .ledger.compact th { padding: .4rem .6rem; font-size: .85rem; }
.ind-fam { margin-top: 1.2rem; }
.ind-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.ind-index { text-align: right; }
.ind-index b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1; }
.ind-index span { font-size: .78rem; color: var(--ink-3); }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.ind-card { border: 1px solid var(--rule-2); border-radius: var(--r-m); padding: .7rem .8rem; display: grid; gap: .15rem; background: var(--paper); }
.ind-card b { font-family: var(--serif); font-size: 1.45rem; }
.ind-card span { font-weight: 600; font-size: .86rem; }
.ind-card small { color: var(--ink-3); font-size: .75rem; line-height: 1.35; }
.ind-items { display: grid; gap: .2rem; margin-top: 1rem; }
.ind-item { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: .4rem 1.2rem; padding: .7rem 0; border-top: 1px solid var(--rule-2); align-items: center; }
.ind-item details { grid-column: 1 / -1; }
.ind-item summary { cursor: pointer; font-size: .85rem; color: var(--promis); }
.funnel { display: grid; gap: 3px; }
.funnel .fb { display: block; height: 7px; background: var(--rule-2); border-radius: 2px; overflow: hidden; }
.funnel .fb i { display: block; height: 100%; }
.funnel .p i { background: var(--ink-3); }
.funnel .t i { background: var(--promis); }
.funnel .e i { background: var(--evalue); }
.funnel .v i { background: var(--valide); }
.chain { margin: .5rem 0 .3rem; padding-left: 1.2rem; font-size: .86rem; display: grid; gap: .25rem; }
.chain li::marker { color: var(--ink-3); }
.ind-item hr { border: 0; border-top: 1px dashed var(--rule-2); margin: .6rem 0; }
/* ---------- Bibliographie ---------- */
.refs { padding-left: 1.3rem; display: grid; gap: .7rem; margin: .6rem 0 0; }
.ref a:first-child { font-weight: 600; }
.ref .tag { text-decoration: none; margin-right: .2rem; }
#form-res input { width: 100%; max-width: 9rem; font: inherit; padding: .25rem .4rem; border: 1px solid var(--rule); border-radius: var(--r-s); }
@media (max-width: 720px) { .ind-item { grid-template-columns: 1fr; } }


/* ═══ Charte HighEdSuite : surcharges ═══════════════════════════════════════ */
body { background-color: var(--paper); background-image: radial-gradient(circle, #dedaf2 1px, transparent 1px); background-size: 22px 22px; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; }
.dist, .gauge .figs b { font-weight: 800; }
:focus-visible { outline: 3px solid rgba(79, 70, 229, .35); border-radius: 8px; }

/* Barre supérieure : carte blanche flottante, comme celle du portail */
.top { position: sticky; top: 0; z-index: 20; margin: 14px 18px 0; padding: .7rem 1rem .7rem .8rem; border-radius: 18px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); color: var(--ink); border: 1px solid var(--rule-2); box-shadow: var(--ombre); }
.brand { color: var(--ink); font-weight: 800; letter-spacing: -.01em; align-items: center; }
.brand::before { content: 'PR'; width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--indigo), var(--mauve)); color: #fff; font: 600 12px var(--mono); box-shadow: 0 6px 14px rgba(79, 70, 229, .28); }
.brand small { color: var(--ink-3); }
.top nav a { color: var(--ink-2); font-weight: 600; padding: .4rem .7rem; border-radius: 10px; border: 0; }
.top nav a:hover { background: var(--indigo-clair); color: var(--indigo); }
.top nav a[aria-current="page"] { background: var(--indigo-clair); color: var(--indigo); box-shadow: inset 0 -3px 0 var(--indigo); }
.top .who { color: var(--ink-3); }
.top .who button { border-color: var(--rule-2); color: var(--ink); background: #fff; border-radius: 10px; padding: .35rem .7rem; }

/* Cartes et panneaux */
.panel, .bloc, .gauge, .ledger, .empty { border-color: var(--rule-2); border-radius: 18px; box-shadow: var(--ombre); }
.note { border-radius: 12px; background: #fffbeb; }
.ledger { border-collapse: separate; border-spacing: 0; overflow: hidden; }
.ledger th { background: #fbfaff; font: 600 10px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ledger tr.row:hover td { background: #faf9ff; }
.bloc .modal-line { background: #fbfaff; }

/* Étiquettes et boutons */
.tag { border-radius: 7px; background: var(--indigo-clair); color: var(--indigo-fonce); }
.tag.warn { background: #fef3c7; color: #b45309; }
.tag.bad { background: #fdeef4; color: #be185d; }
.tag.good { background: #ccfbf1; color: #0f766e; }
.chip { border-color: var(--rule-2); }
.chip[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); }
.btn { background: var(--indigo); border-color: var(--indigo); border-radius: 11px; font-weight: 600; padding: .55rem 1rem; }
.btn:hover { background: var(--indigo-fonce); border-color: var(--indigo-fonce); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--rule-2); }
.btn.secondary:hover { border-color: var(--rule); box-shadow: var(--ombre); background: #fff; }
.btn.danger { background: #fff; color: var(--ecart); border-color: #f6c6d9; }
input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea { border-color: var(--rule); border-radius: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); outline: none; box-shadow: 0 0 0 3px var(--indigo-clair); }
.tabs button[aria-selected="true"] { color: var(--indigo); border-color: var(--indigo); }
label.field, .small.muted { letter-spacing: 0; }

/* Indicateurs */
.ind-card { border-radius: 14px; border-color: var(--rule-2); }
.ind-card span, .ind-head .small { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* Affiché au centre du portail : la barre du portail suffit */
html.dans-portail .top { margin-top: 8px; }

/* Consentement de recherche */
.kicker { font: 600 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--indigo); }
dialog.consent { border-radius: 20px; border-color: var(--rule-2); box-shadow: var(--ombre-forte); max-width: min(680px, 94vw); }
dialog.consent h2 { margin: .4rem 0 .8rem; }
details.notice { margin-top: .6rem; }
details.notice summary { cursor: pointer; color: var(--indigo); font-weight: 600; }
details.notice h3 { font-size: .95rem; margin: 1rem 0 .3rem; }
details.notice p { font-size: .9rem; color: var(--ink-2); }
