@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* Police de la marque (Triangle Agency) auto-hébergée : TITRES = Articulat CF Bold.
   NB : le fichier « AvantGarde Normal » fourni par Alexis est CORROMPU pour les accents (les glyphes
   é/è/ê/à contiennent des tracés cyrilliques) -> inutilisable pour du français, retiré. À réintégrer
   quand Alexis fournira une Avant Garde saine (idéalement + une Articulat CF « Regular » pour le corps).
   En attendant : titres en Articulat CF (accents parfaits), corps en Poppins. */
@font-face { font-family: 'Articulat CF'; src: url('/fonts/articulatcf-bold.woff2?v=1') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; }

/* ======================================================================
   PROTOCOLE Δ — thème sombre « friture » (calqué sur protocoledelta.com)
   ====================================================================== */
:root {
    --bleu:      #c9cfdc;   /* gris clair neutre pour le CHROME (aucun bleu dans l'interface générale) */
    --anomalie:  #6f8fd0;   /* BLEU = couleur de la catégorie Anomalie (noms, cartes, barres de pouvoirs) */
    --bleu-vif:  #e6e9f0;   /* ex-bleu vif -> blanc cassé (liens) */
    --trait-fort: #4a5061;  /* liserés neutres (cartes, filtres) */
    --rouge:     #ff3131;   /* accent de marque (protocoledelta.com) */
    --rouge-vif: #ff5252;
    --or:        #d1a24a;   /* catégorie réalité — or adouci (ochre) */
    --vert:      #48c46a;   /* succès */
    --noir:      #08090c;   /* bandeaux / barres */
    --fond:      #0b0c10;   /* fond de page */
    --papier:    #0b0c10;   /* alias fond (rétrocompat) */
    --carte:     #15171f;   /* cartes / panneaux (~#0F1015 du site) */
    --surface2:  #1e212b;   /* survols / zones secondaires */
    --encre:     #eef0f5;   /* texte principal (blanc cassé) */
    --texte:     #eef0f5;
    --gris:      #9aa1b2;   /* texte discret (clair, AA sur fond sombre) */
    --trait:     #2b2f3b;   /* bordures sur fond sombre */
    /* CORPS de texte = Poppins (Avant Garde d'Alexis corrompue pour les accents ; à revoir avec lui). */
    --sans: 'Poppins', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    /* TITRES = Articulat CF Bold (vraie police de marque, accents parfaits) ; repli Poppins. */
    --titres: 'Articulat CF', 'Poppins', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'Consolas', 'SF Mono', 'Roboto Mono', monospace;
}

html, body {
    font-family: var(--sans);
    color: var(--encre);
    background: var(--papier);
    margin: 0;
}

/* ---------- Accessibilité : focus clavier & cibles tactiles ---------- */
/* Pas de contour disgracieux sur focus programmatique/souris (ex. le <h1> ciblé
   par FocusOnNavigate après chaque navigation) ; on garde un anneau net au clavier. */
:focus:not(:focus-visible) { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex="0"]:focus-visible, summary:focus-visible {
    outline: 2px solid var(--bleu-vif); outline-offset: 2px; border-radius: 2px;
}
/* Cibles de focus programmatique (ex. le <h1> ciblé par FocusOnNavigate, tabindex=-1) :
   pas d'anneau — ce n'est pas un focus clavier. */
[tabindex="-1"]:focus { outline: none; }
/* Cibles tactiles d'au moins 44px sur écrans tactiles (WCAG) */
@media (pointer: coarse) {
    .role-btn, .nav-link, .nav-logout, .auth-btn, .rep-save-btn, button[type="submit"] {
        min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    }
}
/* Tableaux (roster, événements, rapports) : défilement horizontal plutôt que débordement */
@media (max-width: 700px) {
    .gm-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ---------- Coquille / navigation ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
    display: flex; align-items: center; gap: 1.5rem;
    background: var(--noir); color: #fff;
    padding: .7rem 1.5rem; border-bottom: 4px solid var(--rouge);
}
.brand-mini { font-weight: 900; letter-spacing: .05em; color: #fff; text-decoration: none; font-size: 1.15rem; display: inline-flex; align-items: center; gap: .55rem; }
.brand-logo { height: 1.7rem; width: auto; display: block; }
.brand-mini .delta, .brand .delta, .card-title .delta { color: var(--rouge); }
.app-nav { display: flex; gap: .25rem; }
.app-auth { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
/* Bascule de menu mobile (hamburger) : cachée en desktop, activée sous 700px. */
.nav-toggle { display: none; }
.nav-burger { display: none; }
.app-user { color: #fff; font-family: var(--mono); font-size: .8rem; opacity: .9; }
.app-logout-form { display: inline; margin: 0; }
.nav-logout { background: none; border: 1px solid rgba(255,49,49,.55); color: #fff; cursor: pointer;
    font: inherit; font-weight: 600; font-size: .9rem; padding: .3rem .8rem; border-radius: 3px; line-height: 1.2; transition: background .12s, border-color .12s; }
.nav-logout:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.auth-card { max-width: 430px; margin: 2.5rem auto; background: var(--carte); border: 1px solid var(--trait); box-shadow: 3px 3px 0 rgba(22,32,63,.08); padding: 1.8rem 2.2rem 2.2rem; }
.auth-title { font-weight: 900; font-size: 1.6rem; color: var(--bleu); margin: .1rem 0 1.2rem; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; }
.auth-label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.auth-hint { font-weight: 400; color: var(--gris); font-size: .8rem; }
.auth-input { padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: 4px; font: inherit; }
.auth-input:focus { outline: 2px solid var(--bleu-vif); border-color: var(--bleu-vif); }
.auth-btn { margin-top: .4rem; background: var(--bleu); color: #fff; border: none; padding: .7rem 1.2rem; font-weight: 700; border-radius: 4px; cursor: pointer; font-size: 1rem; }
.auth-btn:hover { filter: brightness(1.08); }
.auth-err { background: #fdf5f5; border-left: 4px solid var(--rouge); color: #b3261e; padding: .55rem .8rem; font-size: .88rem; }
.auth-alt { margin-top: 1.1rem; font-size: .88rem; color: var(--gris); }
.nav-role { border-bottom: 2px solid var(--or); }
.gm-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .92rem; }
.gm-table th, .gm-table td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--trait); }
.gm-table th { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gris); }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .7rem; margin: 1.2rem 0; }
.agent-cell { border: 1px solid var(--trait); border-left: 4px solid var(--bleu); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.agent-cell .lbl { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; color: var(--gris); }
.agent-cell .val { font-weight: 700; }
.agent-note { color: var(--gris); font-size: .9rem; font-style: italic; }
.q-titre { font-weight: 900; font-size: 1.4rem; color: var(--bleu); margin: .3rem 0 1.2rem; line-height: 1.3; }
.q-progress { height: 6px; background: var(--surface2); border-radius: 4px; overflow: hidden; margin: .2rem 0 .35rem; }
.q-progress-bar { height: 100%; background: var(--rouge); border-radius: 4px; transition: width .35s ease; }
.q-progress-label { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; color: var(--gris); text-transform: uppercase; margin: 0 0 1rem; }
.rapport-filtre { display: flex; align-items: flex-end; gap: .8rem; flex-wrap: wrap; margin: .4rem 0 1.4rem;
    padding: .8rem 1rem; border: 1px solid var(--trait); border-left: 4px solid var(--bleu); background: var(--carte); }
.rapport-filtre label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; }
.rapport-filtre .auth-input { padding: .4rem .55rem; }
.rapport-periode { font-family: var(--mono); font-size: .78rem; color: var(--gris); }
.q-options { display: flex; flex-direction: column; gap: .5rem; }
.q-option { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--trait); padding: .6rem .8rem; cursor: pointer; }
.q-option:hover { background: #f4f8ff; }
.q-option input { accent-color: var(--bleu); }
.rel-block { border: 1px solid var(--trait); border-left: 4px solid var(--bleu); padding: .9rem 1rem; margin: 0; }
.rel-q { font-weight: 800; color: var(--bleu); padding: 0 .3rem; }
.rel-inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; margin-right: 1rem; }
.rel-inline input { accent-color: var(--bleu); }
.rel-consent { margin-top: .5rem; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.comptes-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.role-form { display: inline; margin: 0; }
.role-btn { font-family: var(--mono); font-size: .78rem; padding: .25rem .5rem; border: 1px solid var(--trait); background: #f4f8ff; cursor: pointer; border-radius: 3px; }
.role-btn.on { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.role-btn:hover { filter: brightness(.97); }
.prog-axes { display: flex; flex-direction: column; gap: .6rem; margin: .4rem 0 1rem; }
.prog-axe { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; border: 1px solid var(--trait); border-left: 4px solid var(--bleu); padding: .7rem .9rem; margin: 0; }
.prog-axe > span:first-of-type { flex: 1 1 180px; }
.prog-prompt { border: 1px solid var(--trait); border-left: 4px solid var(--bleu); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .45rem; }
.prog-deblocages { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.prog-deblocages li { border-left: 3px solid var(--trait); padding: .2rem 0 .2rem .6rem; font-size: .95rem; }
.prog-deblocages .lbl { font-family: var(--mono); font-size: .72rem; color: var(--gris); margin-right: .4rem; }
.badge-alerte { display: inline-block; margin-left: .5rem; font-family: var(--mono); font-size: .72rem; font-weight: 700; color: #fff; background: var(--rouge); padding: .12rem .5rem; border-radius: 3px; vertical-align: middle; }
.prog-err { color: var(--rouge); font-weight: 600; border-left: 4px solid var(--rouge); padding: .4rem .7rem; background: #fdeff0; }
.prog-realite { display: flex; flex-direction: column; gap: .4rem; margin: 0; }
.prog-rel { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.prog-rel input { max-width: 80px; }
.ev-form { display: flex; flex-direction: column; gap: .5rem; max-width: 460px; }
.ev-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; font-weight: 600; }
.ev-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.ev-part { border: 1px solid var(--trait); border-left: 4px solid var(--bleu); padding: .7rem .9rem; margin: 0 0 .7rem; }
.ev-part-head { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; align-items: baseline; }
.ev-part-grid { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .5rem 0 .3rem; }
.ev-part-grid label { font-size: .9rem; }
.ev-check { display: inline-flex; align-items: center; gap: .3rem; }
.ev-num { max-width: 64px; }
.ev-tag { font-family: var(--mono); font-size: .74rem; color: var(--bleu); font-weight: 700; }
.ev-pay { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: .3rem; }
@media print {
    .app-header, .app-footer, #blazor-error-ui, .no-print { display: none !important; }
    .app-main { padding: 0 !important; }
    .app-shell { display: block !important; }
    .fiche-print { max-width: none !important; margin: 0 !important; box-shadow: none !important; border: none !important; }
    .fiche-print .agent-cell, .fiche-print .gm-table, .fiche-print .prog-deblocages li { break-inside: avoid; }
    a[href]::after { content: ""; }
}
.app-nav .nav-link {
    color: #d6d8de; text-decoration: none; font-weight: 600;
    padding: .3rem .8rem; border-radius: 3px; font-size: .95rem;
}
.app-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav .nav-link.active { color: #fff; background: var(--bleu); }
.app-stamp {
    margin-left: auto; font-family: var(--mono); font-size: .7rem; letter-spacing: .15em;
    color: #fff; border: 1px solid rgba(255,255,255,.4); padding: .2rem .5rem; transform: rotate(-2deg);
}
.app-main { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 2rem 2rem 4rem; box-sizing: border-box; }
.app-footer {
    text-align: center; font-size: .75rem; color: var(--gris);
    padding: 1.2rem; border-top: 1px solid var(--trait); font-family: var(--mono); letter-spacing: .08em;
}

/* ---------- Étiquettes / titres ---------- */
.cat-label {
    color: var(--bleu); font-family: var(--mono); font-weight: 700;
    text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; margin: 0 0 .4rem;
}
.cat-label.big { font-size: .95rem; }
.brand { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 900; letter-spacing: .02em; margin: .2rem 0; line-height: 1; color: var(--rouge); }
.section-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; margin: .2rem 0 .5rem; }
.section-intro { color: var(--gris); max-width: 44ch; }
.tagline { color: var(--bleu-vif); font-weight: 800; font-size: 1.2rem; margin: .3rem 0; }
.hero-home { text-align: center; padding: 1.5rem 0 2.5rem; border-bottom: 2px dashed var(--trait); margin-bottom: 2rem; }

/* ---------- Tableau de bord de l'agent (accueil connecté) ---------- */
.dash { background: var(--carte); border: 1px solid var(--trait); border-top: 5px solid var(--bleu); box-shadow: 3px 3px 0 rgba(22,32,63,.07); padding: 1.4rem 1.6rem; margin-bottom: 2rem; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }
.dash-nom { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900; color: var(--bleu); text-transform: uppercase; line-height: 1; margin: .1rem 0; }
.dash-stats { display: flex; gap: .5rem; flex-wrap: wrap; }
.dash-stat { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); border: 1px solid var(--trait); padding: .3rem .55rem; border-radius: 3px; }
.dash-stat b { color: var(--encre); font-size: 1rem; }
.dash-todo { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; flex-direction: column; gap: .35rem; }
.dash-todo li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px dotted var(--trait); }
.dash-todo li.done { color: var(--gris); }
.dash-check { font-family: var(--mono); font-weight: 900; width: 1.2rem; text-align: center; }
.dash-todo li.done .dash-check { color: var(--vert); }
.dash-todo li.todo .dash-check { color: var(--rouge); }
.dash-todo a { color: var(--bleu-vif); text-decoration: none; border-bottom: 1px solid var(--bleu-vif); }
.dash-todo a:hover { background: rgba(47,95,224,.08); }
.dash-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.hero-sub { color: var(--gris); font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; }

/* le NOM prend la couleur de sa CATÉGORIE ; par défaut (chrome / pages joueur) = blanc.
   Les pages de catégorie surchargent : Anomalie -> .cat-bleu, Réalité -> .cat-or, Compétence -> .cat-rouge. */
.anomaly-name { color: var(--texte); font-weight: 900; }
.anomaly-name.huge { font-size: clamp(3rem, 12vw, 7rem); line-height: .95; letter-spacing: -.01em; text-transform: uppercase; margin: .1rem 0; }
.power-name { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900; color: var(--encre); }

/* couleurs par catégorie (le nom/label prend la couleur de sa catégorie) */
.cat-bleu  { color: var(--bleu); }
.cat-or    { color: var(--or); }
.cat-vert  { color: var(--vert); }
.cat-rouge { color: var(--rouge); }
.entity-card-name { font-weight: 800; font-size: 1.2rem; }
.dossier-card.re { border-top-color: var(--or); }
.dossier-card.cp { border-top-color: var(--rouge); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-top .statut { align-self: auto; }
.card-tagline { color: var(--gris); font-style: italic; font-size: .92rem; line-height: 1.35; }

/* ---------- Grille de dossiers (cartes) ---------- */
.dossier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.dossier-card {
    display: flex; flex-direction: column; gap: .35rem;
    background: var(--carte); border: 1px solid var(--trait); border-top: 4px solid var(--bleu);
    padding: 1rem; text-decoration: none; color: var(--encre);
    box-shadow: 2px 2px 0 rgba(22,32,63,.06); transition: transform .12s, box-shadow .12s;
}
.dossier-card:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 rgba(22,32,63,.12); }
.dossier-card.an { border-top-color: var(--bleu); }
.dossier-card.pv { border-top-color: var(--rouge); }
.dossier-card.disabled { opacity: .55; pointer-events: none; border-top-color: var(--gris); }
.card-code { font-family: var(--mono); font-size: .8rem; letter-spacing: .12em; color: var(--gris); }
.card-title { font-weight: 800; font-size: 1.15rem; }

/* ---------- Badges ---------- */
.statut { display: inline-block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
    text-transform: uppercase; padding: .12rem .5rem; border-radius: 2px; align-self: flex-start; }
.statut-approuve  { background: #d8f0dd; color: #1c7c3a; }
.statut-a_reviser { background: #fdeccb; color: #9a6a12; }
.statut-a_traduire{ background: #fde0cb; color: #a1521a; }
.statut-brouillon { background: #e6e6ea; color: #565b6b; }
.qualite-badge { display: inline-block; font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
    letter-spacing: .1em; background: var(--bleu); color: #fff; padding: .12rem .55rem; border-radius: 2px; vertical-align: middle; }

/* ---------- Fiche (doc) ---------- */
.doc { position: relative; }
.doc-stamp {
    position: absolute; top: -.5rem; right: 0; z-index: 2;
    font-family: var(--mono); font-weight: 700; text-transform: uppercase; letter-spacing: .18em;
    font-size: 1.05rem; padding: .45rem 1.1rem; border: 3px solid currentColor; border-radius: 5px;
    background: transparent; opacity: .8; transform: rotate(7deg);
}
@media (max-width: 640px) { .doc-stamp { position: static; display: inline-block; transform: none; margin-bottom: 1rem; } }
.doc-hero { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.anomaly-art { width: 360px; max-width: 46%; height: auto; }
.doc-hero-text { flex: 1; min-width: 260px; }
.doc-body { max-width: 68ch; line-height: 1.6; }
.doc-body h2 { font-weight: 900; margin-top: 1.6rem; }
.doc-body p { margin: .7rem 0; }
.doc-body a { color: var(--bleu-vif); }

/* les « 3 » de succès, toujours en rouge */
.die { color: var(--rouge); font-weight: 900; }

/* wikilinks */
.wikilink { color: var(--bleu-vif); text-decoration: none; border-bottom: 1px solid var(--bleu-vif); }
.wikilink:hover { background: rgba(47,95,224,.08); }
.wikilink.unresolved { color: var(--gris); border-bottom: 1px dashed var(--gris); }

/* ---------- Callouts (icônes SVG calquées du livre : sans boîte, comme le manuel) ---------- */
.callout { margin: .7rem 0; }
.callout-title { font-weight: 700; display: flex; align-items: flex-start; gap: .55rem; }
.callout-title > span { padding-top: .12rem; }
.callout-ico { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; }
/* Icônes officielles Triangle Agency (Third Party Licensed Assets) rendues en MASQUE CSS :
   la forme officielle est colorée par le thème (blanc / or / rouge) — donc jamais de bleu du livre. */
.ta-ico { display: inline-block; background: currentColor;
    -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
    -webkit-mask-mode: alpha; mask-mode: alpha; }
.ta-c-blanc { color: var(--texte); }
.ta-c-or    { color: var(--or); }
.ta-c-rouge { color: var(--rouge); }
.ta-c-gris  { color: var(--gris); }
.callout-body { margin-left: 2.05rem; }
.callout-body > :first-child { margin-top: .1rem; }
.callout-body > :last-child { margin-bottom: 0; }

/* le bloc Q/R (colonne droite) = panneau bleu pâle, comme le livre */
.callout-question { background: #eef3ff; border-radius: 8px; padding: .9rem 1rem; margin: 0 0 1rem; }
.callout-question .callout-title { color: var(--bleu); font-family: var(--mono); letter-spacing: .02em; }
.callout-question .callout-body { margin-left: 0; }
.callout-question ul { list-style: none; padding: 0; margin: 0; }
.callout-question li { margin: .55rem 0; }
.callout-tagline .callout-title { justify-content: center; color: var(--bleu-vif); font-size: 1.3rem; }

/* ---------- Pouvoirs : 2 colonnes (gauche = texte, droite = Q/R) ---------- */
.powers-heading { margin-top: 2.2rem; }
.power-block { border-top: 2px solid var(--trait); padding-top: 1.4rem; margin-top: 1.4rem; }
.power-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 2.5rem; align-items: start; }
.power-main { min-width: 0; }
.power-main .doc-body { max-width: none; }
.power-name-inline { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 900; color: var(--encre); margin: 0 0 .6rem; display: flex; align-items: center; gap: 1rem; }
.power-name-inline .qualite-badge { margin-left: auto; }
.power-aside { position: sticky; top: 1rem; }
@media (max-width: 820px) {
    .power-grid { grid-template-columns: 1fr; gap: 1rem; }
    .power-aside { position: static; }
}

/* ---------- Corps en 2 colonnes (comme le livre) — anomalies, réalités, compétences ---------- */
.doc-columns { max-width: none; column-count: 2; column-gap: 2.8rem; }
.doc-columns > :first-child { margin-top: 0; }
.doc-columns h2 { break-inside: avoid; }
.doc-columns p, .doc-columns li, .doc-columns .callout { break-inside: avoid; }
@media (max-width: 820px) { .doc-columns { column-count: 1; } }

/* ---------- En-têtes de section colorés par catégorie (comme le livre) ---------- */
.doc .doc-columns h2 { font-weight: 900; margin-top: 1.6rem; padding-bottom: .25rem; border-bottom: 3px solid; }
.doc.anomalie   .doc-columns h2 { color: var(--bleu);  border-color: var(--bleu); }
.doc.realite    .doc-columns h2 { color: var(--or);    border-color: var(--or); }
.doc.competence .doc-columns h2 { color: var(--rouge); border-color: var(--rouge); }

/* Grosses ponctuations décoratives (façon livre) */
.doc.realite .callout-question, .doc.competence .callout-question,
.doc.realite .callout-success { position: relative; overflow: hidden; }
.doc.realite .callout-question::after, .doc.competence .callout-question::after,
.doc.realite .callout-success::after {
    position: absolute; right: .5rem; bottom: -2.4rem; font-size: 8rem; font-weight: 900;
    line-height: 1; pointer-events: none; opacity: .12;
}
.doc.realite .callout-question::after    { content: "?"; color: var(--or); }
.doc.competence .callout-question::after { content: "?"; color: var(--rouge); }
.doc.realite .callout-success::after     { content: "!"; color: var(--or); }

/* ---------- Callouts narratifs (manuel) = boîte légère ---------- */
.callout-info, .callout-note, .callout-tip, .callout-example, .callout-abstract,
.callout-warning, .callout-error, .callout-danger, .callout-quote, .callout-bug {
    border: 1px solid var(--trait); border-left: 4px solid var(--bleu);
    background: #fff; padding: .6rem .9rem; border-radius: 4px;
}
.callout-info .callout-body, .callout-note .callout-body, .callout-tip .callout-body,
.callout-example .callout-body, .callout-abstract .callout-body,
.callout-warning .callout-body, .callout-error .callout-body, .callout-danger .callout-body,
.callout-quote .callout-body, .callout-bug .callout-body { margin-left: 0; }
.callout-warning, .callout-error, .callout-danger, .callout-bug { border-left-color: var(--rouge); background: #fdf5f5; }
.callout-quote { border-left-color: var(--gris); font-style: italic; background: #faf8f2; }

/* ---------- Manuel : table des matières ---------- */
.dossier-card.man { border-top-color: var(--encre); }
.manuel-chapitre { margin-top: 2.2rem; border-bottom: 2px solid var(--trait); padding-bottom: .3rem; font-size: 1.4rem; }
.manuel-toc { list-style: none; padding: 0; margin: .6rem 0; }
.manuel-toc li { display: flex; align-items: baseline; gap: .8rem; padding: .28rem 0; border-bottom: 1px dotted var(--trait); }
.manuel-toc a { display: flex; gap: .8rem; align-items: baseline; text-decoration: none; color: var(--encre); flex: 1; }
.manuel-toc a:hover .manuel-titre { color: var(--bleu-vif); }
.manuel-titre { flex: 1; }
.manuel-page { font-family: var(--mono); font-size: .75rem; color: var(--gris); }
.manuel-doc .doc-body { max-width: 74ch; }
.manuel-nav { margin-top: 2rem; }

/* ---------- Animations (gros titres qui apparaissent) ---------- */
@keyframes appear { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.animate-in { animation: appear .55s cubic-bezier(.2,.75,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .animate-in { animation: none; } }

/* ---------- Mobile (lecture optimisée) ---------- */
@media (max-width: 700px) {
    .app-header { flex-wrap: wrap; gap: .4rem .9rem; padding: .55rem .9rem; }
    .app-stamp { display: none; }
    /* Menu repliable : le hamburger apparaît, nav + auth se cachent jusqu'à ouverture. */
    .nav-burger { display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
        width: 2.6rem; height: 2.6rem; font-size: 1.35rem; color: #fff; background: none;
        border: 1px solid rgba(255,255,255,.3); border-radius: 4px; cursor: pointer; }
    .app-nav, .app-auth { display: none; order: 3; width: 100%; flex-basis: 100%; }
    .app-nav { flex-direction: column; gap: .15rem; margin-top: .3rem; }
    .app-nav .nav-link { display: block; width: 100%; box-sizing: border-box; padding: .55rem .7rem; white-space: nowrap; }
    .app-auth { order: 4; margin-left: 0; margin-top: .2rem; padding-top: .5rem;
        border-top: 1px solid var(--trait); justify-content: space-between; flex-wrap: wrap; }
    .nav-toggle:checked ~ .app-nav, .nav-toggle:checked ~ .app-auth { display: flex; }
    .app-main { padding: 1.2rem 1rem 3rem; }

    /* Rapports : les tableaux se replient en cartes empilées (au lieu du défilement horizontal). */
    .rapport-table, .rapport-table tbody, .rapport-table tr, .rapport-table td { display: block; width: 100%; }
    .rapport-table { white-space: normal; overflow: visible; }
    .rapport-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .rapport-table tr { border: 1px solid var(--trait); border-left: 4px solid var(--bleu);
        margin-bottom: .7rem; padding: .4rem .7rem; box-sizing: border-box; }
    .rapport-table td { display: flex; justify-content: space-between; gap: 1rem; text-align: right;
        border: 0; padding: .28rem 0; }
    .rapport-table td::before { content: attr(data-label); font-family: var(--mono); font-size: .7rem;
        text-transform: uppercase; letter-spacing: .04em; color: var(--gris); text-align: left; }
    .app-footer { font-size: .68rem; padding: 1rem .8rem; }

    .dossier-grid { grid-template-columns: 1fr; gap: .8rem; }
    .doc-hero { gap: 1rem; }
    .anomaly-art { width: 200px; max-width: 55%; }
    .doc-body, .power-main .doc-body, .manuel-doc .doc-body { max-width: 100%; }
    .doc-body table { display: block; overflow-x: auto; white-space: nowrap; }
    .doc-stamp { font-size: .85rem; padding: .3rem .7rem; }

    .manuel-toc li { flex-wrap: wrap; }
    .brand { font-size: clamp(2rem, 13vw, 3.2rem); }
    .anomaly-name.huge { font-size: clamp(2.6rem, 16vw, 4.5rem); }
    .callout-question::after { display: none; }   /* pas de grosse ponctuation sur petit écran */
}

/* ---------- Dossier de proposition ---------- */
.prop-doc { background: var(--carte); border: 1px solid var(--trait); max-width: 820px; margin: 0 auto; padding: 2.5rem; box-shadow: 3px 3px 0 rgba(22,32,63,.08); }
.prop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 4px solid var(--rouge); padding-bottom: 1rem; }
.prop-title { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900; margin: .2rem 0; line-height: 1; }
.delta-red { color: var(--rouge); }
.prop-sub { color: var(--gris); margin: 0; }
.prop-stamp { border: 3px solid var(--rouge); color: var(--rouge); font-family: var(--mono); font-weight: 700; font-size: .78rem; text-align: center; padding: .4rem .7rem; transform: rotate(6deg); letter-spacing: .1em; flex: 0 0 auto; }
.prop-meta { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .9rem; }
.prop-meta td { padding: .3rem .6rem; border-bottom: 1px dotted var(--trait); }
.prop-meta td:first-child { font-family: var(--mono); color: var(--gris); width: 12rem; text-transform: uppercase; font-size: .74rem; letter-spacing: .06em; }
.prop-section { margin: 1.8rem 0; }
.prop-h { font-size: 1.4rem; font-weight: 900; color: var(--bleu); border-bottom: 2px solid var(--bleu); padding-bottom: .2rem; }
.prop-badge { font-family: var(--mono); font-size: .62rem; padding: .12rem .45rem; border-radius: 2px; vertical-align: middle; letter-spacing: .08em; }
.prop-badge.ok { background: #d8f0dd; color: #1c7c3a; }
.prop-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .8rem; margin: 1rem 0; }
.prop-stat { text-align: center; border: 1px solid var(--trait); border-top: 4px solid var(--bleu); padding: .7rem; }
.prop-stat .num { display: block; font-size: 2rem; font-weight: 900; color: var(--bleu); }
.prop-stat .lbl { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; color: var(--gris); }
.prop-list { line-height: 1.7; }
.prop-url { font-family: var(--mono); color: var(--bleu); }
.prop-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; }
.prop-phase { border: 1px solid var(--trait); border-left: 5px solid var(--gris); padding: .8rem; }
.prop-phase.done { border-left-color: #1c7c3a; background: #f4fbf6; }
.prop-phase .ph-code { font-family: var(--mono); font-size: .7rem; color: var(--gris); display: block; }
.prop-phase .ph-title { font-weight: 900; font-size: 1.1rem; display: block; }
.prop-phase .ph-status { font-family: var(--mono); font-size: .7rem; color: var(--or); }
.prop-phase.done .ph-status { color: #1c7c3a; }
.prop-phase p { font-size: .87rem; margin: .4rem 0 0; }
a.prop-synth { display: block; text-decoration: none; color: inherit; border: 2px solid var(--bleu); background: #eef3ff; padding: .9rem 1.1rem; margin: 1rem 0; transition: background .12s, box-shadow .12s; }
a.prop-synth:hover { background: #e2ebff; box-shadow: 3px 3px 0 rgba(30,63,176,.15); }
a.prop-synth h3 { margin: 0 0 .3rem; color: var(--bleu); font-size: 1.12rem; font-weight: 900; }
a.prop-synth p { margin: 0; font-size: .9rem; line-height: 1.5; }
.prop-feats { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 1rem 0; }
.prop-feat { border: 1px solid var(--trait); border-left: 5px solid var(--bleu); padding: .7rem .9rem; }
.prop-feat.done { border-left-color: #1c7c3a; background: #f4fbf6; }
.prop-feat h3 { font-size: 1.02rem; font-weight: 800; margin: 0 0 .3rem; color: var(--bleu); }
.prop-feat.done h3 { color: #1c7c3a; }
.prop-feat p { font-size: .86rem; margin: 0; line-height: 1.5; }

/* Blocs de fonctionnalité cliquables -> fiche dédiée */
a.prop-feat { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: background .12s, border-left-width .12s, box-shadow .12s; }
a.prop-feat:hover { background: #f2f7ff; border-left-width: 8px; box-shadow: 2px 2px 0 rgba(22,32,63,.08); }
a.prop-feat.done:hover { background: #edfaf1; }
a.prop-feat h3::after { content: " ›"; color: var(--bleu); font-weight: 900; }
a.prop-feat.done h3::after { color: #1c7c3a; }

/* Fiche de fonctionnalité (page dédiée) */
.fonction-back { display: inline-block; margin-bottom: 1.1rem; color: var(--bleu-vif); text-decoration: none; font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; }
.fonction-back:hover { text-decoration: underline; }
.fonction-doc .prop-title { margin: 0; }
.fonction-body { max-width: none; }
.fonction-body h2 { color: var(--bleu); border-bottom: 1px solid var(--trait); padding-bottom: .18rem; margin-top: 1.9rem; font-size: 1.25rem; }
.fonction-body ul { padding-left: 1.15rem; }
.fonction-body li { margin: .4rem 0; }
.prop-stamp.livre { color: #1c7c3a; border-color: #1c7c3a; }
.fonction-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid var(--trait); font-family: var(--mono); font-size: .8rem; }
.fonction-nav a { color: var(--bleu-vif); text-decoration: none; max-width: 40%; }
.fonction-nav a:hover { text-decoration: underline; }
.fonction-nav-up { text-transform: uppercase; letter-spacing: .05em; color: var(--gris) !important; }
@media (max-width: 640px) { .fonction-nav { flex-direction: column; align-items: stretch; text-align: center; } .fonction-nav a { max-width: none; } }
@media print { a.prop-feat h3::after { content: ""; } }

/* Espace réponses (page cachée par jeton) */
.rep-intro { color: var(--gris); font-size: .92rem; line-height: 1.55; }
.rep-context { font-family: var(--mono); font-size: .8rem; margin: .2rem 0 1rem; }
.rep-saved { background: #eefaf1; border-left: 4px solid #1c7c3a; color: #155e2c; padding: .6rem .9rem; font-weight: 700; margin: 1rem 0; }
.rep-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.2rem; }
.rep-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid var(--trait); border-left: 5px solid var(--bleu); padding: .7rem .9rem; text-decoration: none; color: inherit; transition: background .12s, border-left-width .12s; }
.rep-item:hover { background: #f2f7ff; border-left-width: 8px; }
.rep-item.complete { border-left-color: #1c7c3a; background: #f4fbf6; }
.rep-item-title { font-weight: 700; }
.rep-item-prog { font-family: var(--mono); font-size: .8rem; color: var(--gris); white-space: nowrap; }
.rep-q { margin: 1.2rem 0; }
.rep-q-text { font-weight: 600; margin-bottom: .4rem; line-height: 1.45; }
.rep-q-text strong { color: var(--bleu); }
.rep-a { width: 100%; box-sizing: border-box; font-family: inherit; font-size: .95rem; line-height: 1.5; padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: 4px; resize: vertical; background: #fff; }
.rep-a:focus { outline: 2px solid var(--bleu-vif); outline-offset: 1px; border-color: var(--bleu-vif); }
.rep-save-btn { display: block; margin: 1.4rem 0 0; background: var(--bleu); color: #fff; border: none; padding: .7rem 1.4rem; font-weight: 700; border-radius: 4px; cursor: pointer; font-size: 1rem; }
.rep-save-btn:hover { filter: brightness(1.08); }
/* Section « À préciser » intégrée à la fiche (espace privé) */
.fonction-questions { margin-top: .5rem; }
.fonction-questions > h2 { color: var(--bleu); border-bottom: 1px solid var(--trait); padding-bottom: .18rem; margin-top: 1.9rem; font-size: 1.25rem; }

.prop-price { background: var(--noir); color: #fff; padding: 1.2rem 1.5rem; border-radius: 6px; text-align: center; margin: 1rem 0; }
.prop-price-amount { font-size: clamp(2.4rem, 8vw, 3.6rem); font-weight: 900; color: #fff; display: block; line-height: 1; }
.prop-price-note { font-family: var(--mono); font-size: .8rem; color: #d6d8de; }
.prop-incl { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1rem 0; }
.prop-incl h3 { font-size: 1rem; font-weight: 800; margin-bottom: .3rem; }
.prop-fine { font-size: .87rem; color: var(--gris); }
.prop-pay { text-align: center; margin: .1rem 0 1rem; padding: .55rem .8rem; background: #f4f8ff; border: 1px solid var(--trait); border-left: 4px solid var(--bleu); font-size: .92rem; }
.prop-steps { line-height: 1.8; }
.prop-foot { border-top: 2px solid var(--trait); margin-top: 2rem; padding-top: 1rem; font-size: .88rem; color: var(--gris); }
.prop-sign { margin-top: 2rem; font-family: var(--mono); }
.prop-print { display: block; margin: 1.5rem auto 0; background: var(--rouge); color: #fff; border: none; padding: .7rem 1.4rem; font-weight: 700; border-radius: 4px; cursor: pointer; font-size: 1rem; }
.prop-print:hover { filter: brightness(.92); }
@media (max-width: 640px) { .prop-doc { padding: 1.2rem; } .prop-incl, .prop-feats { grid-template-columns: 1fr; } .prop-meta td:first-child { width: auto; } .prop-head { flex-wrap: wrap; } }

/* ---------- Impression / PDF ---------- */
@media print {
    .app-header, .app-footer, .prop-print, .no-print { display: none !important; }
    .app-main { max-width: none; padding: 0; }
    html, body { background: #fff; }
    .prop-doc { box-shadow: none; border: none; max-width: none; padding: 0; }
    .prop-section, .prop-phase, .prop-stat, .prop-price, .prop-h { break-inside: avoid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Chrome Blazor (conservé) ---------- */
#blazor-error-ui {
    color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Une erreur est survenue." }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #ff9a9a; }

/* ======================================================================
   THÈME SOMBRE — surcharges (fond noir + rouge, comme protocoledelta.com)
   ====================================================================== */
html, body { background: var(--fond); color: var(--texte); }

/* En-tête : autorise le retour à la ligne (beaucoup de liens pour un Coordo)
   au lieu de déborder horizontalement la page. */
.app-header { flex-wrap: wrap; row-gap: .3rem; }
.app-nav { flex-wrap: wrap; }

/* Surfaces claires -> panneaux sombres */
.auth-card, .dash, .dossier-card, .prop-doc, .ev-part, .prog-axe, .prog-prompt,
.rel-block, .rep-item, .prop-feat, .prop-phase, .prop-stat, .q-option, .prop-pay,
.callout-info, .callout-note, .callout-tip, .callout-example, .callout-abstract { background: var(--carte); }
.callout-warning, .callout-error, .callout-danger, .callout-bug { background: #2a1416; border-left-color: var(--rouge); }
.callout-quote { background: var(--surface2); }
.callout-question { background: #141a30; }

/* Champs de formulaire & petits boutons -> sombres */
.auth-input, .rep-a { background: var(--surface2); color: var(--texte); border-color: var(--trait); }
.auth-input::placeholder, .rep-a::placeholder { color: var(--gris); }
/* Autofill Chrome/Edge : garder le fond sombre et le texte clair */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
    -webkit-text-fill-color: var(--texte);
    -webkit-box-shadow: 0 0 0 1000px var(--surface2) inset;
    box-shadow: 0 0 0 1000px var(--surface2) inset;
    caret-color: var(--texte);
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="number"] { color-scheme: dark; }
select.auth-input option { background: var(--carte); color: var(--texte); }
.role-btn { background: var(--surface2); color: var(--texte); border-color: var(--trait); }
.role-btn.on { background: var(--bleu); color: #fff; border-color: var(--bleu); }

/* Survols sombres */
.q-option:hover, .rep-item:hover, a.prop-feat:hover, a.prop-synth:hover,
a.prop-feat.done:hover { background: var(--surface2); }

/* Boutons d'action = rouge de marque */
.auth-btn, .rep-save-btn, .prop-print { background: var(--rouge); color: #fff; }
.auth-btn:hover, .rep-save-btn:hover, .prop-print:hover { filter: brightness(1.1); }

/* États succès / erreur -> teintes sombres */
.rep-saved, .rep-item.complete, .prop-feat.done, .prop-phase.done {
    background: rgba(72,196,106,.14); border-left-color: var(--vert); color: var(--texte); }
.rep-saved { color: #8fe6a8; }
.prog-err { background: rgba(255,49,49,.14); color: #ff9a9a; border-left-color: var(--rouge); }
.auth-err { background: rgba(255,49,49,.14); color: #ff9a9a; }
a.prop-synth { background: #141a30; }

/* Badges de statut (contenu) -> versions sombres */
.statut-approuve  { background: rgba(72,196,106,.20); color: #7de29a; }
.statut-a_reviser { background: rgba(224,169,44,.20); color: #e9c069; }
.statut-a_traduire{ background: rgba(224,120,44,.20); color: #eaa06a; }
.statut-brouillon { background: var(--surface2); color: var(--gris); }
.qualite-badge { background: var(--bleu); color: #08090c; }

/* Cartes : ombres remplacées par un liseré discret sur fond sombre */
.dossier-card, .auth-card, .dash, .prop-doc { box-shadow: none; }
.dossier-card:hover { box-shadow: 0 0 0 1px var(--trait); }

/* Tableaux & liserés */
.gm-table th { color: var(--gris); }
.gm-table td, .gm-table th { border-bottom-color: var(--trait); }
.dossier-card.man { border-top-color: var(--rouge); }
.doc-body a, .wikilink { color: var(--bleu-vif); }

/* Messages « flash » (accueil / rapports) déjà sur var(--bleu) : ok */

/* ---------- Friture : grain animé (auto-hébergé en SVG, sans dépendance) ---------- */
body::after {
    content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 150px 150px; opacity: .05; mix-blend-mode: overlay;
    animation: friture .5s steps(3) infinite;
}
/* Grain renforcé derrière la vitrine (accueil) */
.hero-home { position: relative; overflow: hidden; }
.hero-home::before {
    content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 160px 160px; opacity: .16; animation: friture .5s steps(3) infinite;
}
@keyframes friture {
    0%   { background-position: 0 0; }
    33%  { background-position: -42px 16px; }
    66%  { background-position: 26px -32px; }
    100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) { body::after, .hero-home::before { animation: none; } }
@media print { body::after, .hero-home::before { display: none !important; } }

/* ---------- Harmonisation : bleu réservé aux CATÉGORIES, chrome en blanc/rouge ----------
   (le bleu accent partout clashait avec le rouge de marque, surtout sur l'accueil) */
.tagline { color: var(--texte); }              /* baselines en blanc (au lieu de bleu) */
.hero-home .cat-label { color: var(--gris); }  /* eyebrow d'accueil discret */
.dash-nom { color: var(--texte); }             /* « BIENVENUE » / nom d'agent en blanc */
.auth-title { color: var(--texte); }           /* « Connexion » / « Inscription » en blanc */

/* Aucun lien ne doit tomber en bleu/violet navigateur par défaut : couleur de lien du thème. */
a:not([class]) { color: var(--bleu-vif); text-underline-offset: 2px; }
/* Liens secondaires sous les formulaires et « ← Retour » : neutres, survol rouge. */
.auth-alt a, a.lien-retour { color: var(--texte); text-decoration: underline; text-underline-offset: 2px; }
.auth-alt a:hover, a.lien-retour:hover { color: var(--rouge-vif); }


/* ======================================================================
   SANS BLEU + POLICE DES TITRES (rencontre Alexis 2026-09-07)
   Le bleu représente l'Anomalie dans l'univers de Protocole Delta : il est banni du site
   (réservé à un futur mode « site hacké par une anomalie »). Accents = rouge de marque,
   liens = blanc souligné, catégorie anomalie = blanc.
   ====================================================================== */
h1, h2, h3, .brand, .brand-mini, .anomaly-name, .section-title, .q-titre, .dash-nom, .auth-title,
.prop-title, .card-title, .entity-card-name, .power-name, .power-name-inline, .tiroir-titre, .fiche-h2 {
    font-family: var(--titres);
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex="0"]:focus-visible, summary:focus-visible { outline-color: var(--rouge-vif); }
.auth-input:focus, .rep-a:focus { outline-color: var(--rouge-vif); border-color: var(--rouge-vif); }
.q-option input, .rel-inline input { accent-color: var(--rouge); }

/* Liserés d'accent : rouge de marque ; cartes neutres */
.agent-cell, .rel-block, .prog-axe, .prog-prompt, .ev-part, .rapport-filtre, .rep-item, .prop-feat, .prop-pay { border-left-color: var(--rouge); }
.dash { border-top-color: var(--rouge); }
.dossier-card, .prop-stat { border-top-color: var(--trait-fort); }
.dossier-card.an { border-top-color: var(--anomalie); }  /* catégorie Anomalie = bleu */
.dossier-card.re { border-top-color: var(--or); }
.dossier-card.cp, .dossier-card.man, .dossier-card.pv { border-top-color: var(--rouge); }
.cat-bleu { color: var(--anomalie); }  /* nom d'Anomalie = bleu (couleur de la catégorie) */
.doc.anomalie .doc-columns h2 { color: var(--texte); border-color: var(--trait-fort); }

/* Titres et étiquettes qui étaient en bleu -> blanc */
.q-titre, .auth-title, .dash-nom, .prop-h, .prop-stat .num, .prop-url, .fonction-body h2, .fonction-questions > h2,
.rep-q-text strong, .prop-feat h3, a.prop-synth h3, .rel-q, .ev-tag, .callout-question .callout-title,
.callout-tagline .callout-title { color: var(--texte); }
.cat-label { color: var(--gris); }
.prop-h { border-bottom-color: var(--rouge); }
a.prop-feat h3::after { color: var(--rouge); }
.role-btn.on { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.qualite-badge { background: var(--surface2); color: var(--texte); border: 1px solid var(--trait-fort); }
.app-nav .nav-link.active { background: var(--rouge); color: #fff; }

/* Liens : blanc souligné, survol rouge */
a:not([class]), .doc-body a, .wikilink, .dash-todo a, .fonction-back, .fonction-nav a { color: var(--texte); }
.wikilink { border-bottom-color: var(--texte); }
.wikilink:hover { background: rgba(255,49,49,.12); color: var(--rouge-vif); border-bottom-color: var(--rouge-vif); }
.doc-body a:hover, a:not([class]):hover, .dash-todo a:hover, .fonction-back:hover, .fonction-nav a:hover { color: var(--rouge-vif); }
.dash-todo a { border-bottom-color: var(--texte); }
.dash-todo a:hover { background: rgba(255,49,49,.08); }
.manuel-toc a:hover .manuel-titre { color: var(--rouge-vif); }

/* Fonds qui tiraient sur le bleu -> neutres */
.callout-question, a.prop-synth { background: var(--surface2); }
a.prop-synth { border-color: var(--rouge); }
.q-option:hover { background: var(--surface2); }

/* ---------- Entrevue RH : description longue, tiroirs, options ---------- */
.q-desc { max-width: 68ch; line-height: 1.6; margin: -.4rem 0 1.2rem; }
.q-desc p { margin: .6rem 0; }
.tiroirs { display: flex; flex-direction: column; gap: .5rem; }
.tiroir { border: 1px solid var(--trait); background: var(--carte); }
.tiroir[open] { border-color: var(--rouge); }
.tiroir-titre { cursor: pointer; padding: .8rem 1rem; font-weight: 800; font-size: 1.1rem; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.tiroir-titre::-webkit-details-marker { display: none; }
.tiroir-titre::after { content: "+"; color: var(--gris); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.tiroir[open] > .tiroir-titre::after { content: "\2212"; color: var(--rouge); }
.tiroir-corps { padding: .6rem 1rem .4rem; max-width: none; line-height: 1.55; border-top: 1px solid var(--trait); }
.tiroir-corps p { margin: .55rem 0; }
.tiroir-choix { margin: .3rem 1rem 1rem; width: auto; }
.q-bonus { display: inline-block; margin-left: .5rem; font-family: var(--mono); font-size: .7rem; color: var(--or);
    border: 1px solid var(--or); padding: .05rem .4rem; border-radius: 2px; vertical-align: middle; }
.q-option-texte { display: flex; flex-direction: column; gap: .15rem; }
.q-option-desc { color: var(--gris); font-size: .88rem; }
.q-option-desc p { margin: .2rem 0; }
.rh .rel-block { margin-bottom: .6rem; }

/* ---------- Fiche d'agent : blocs de contenu du choix (pouvoirs, déclencheur, directive…) ---------- */
.fiche-h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; border-bottom: 1px solid var(--trait); padding-bottom: .25rem; font-weight: 900; }
.fiche-h3 { font-size: .95rem; margin: 1rem 0 .4rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
.fiche-tagline { color: var(--gris); font-style: italic; margin: .2rem 0 .8rem; }
.fiche-bloc { border: 1px solid var(--trait); border-left: 4px solid var(--rouge); background: var(--carte); padding: .7rem .9rem; margin: .6rem 0; }
.fiche-bloc h3 { margin: 0 0 .3rem; font-size: .82rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--gris); font-weight: 700; }
.fiche-bloc .doc-body { max-width: none; }
.fiche-bloc .doc-body p { margin: .4rem 0; }
/* Barres de fiche par CATÉGORIE : Réalité (déclencheur/libération/relations) = jaune,
   Compétence (comportements/réquisition) = rouge, Anomalie (pouvoirs) = bleu. */
.fiche-bloc-declencheur,
.fiche-bloc-liberation { border-left-color: var(--or); }        /* Réalité = jaune */
.fiche-bloc-comportements,
.fiche-bloc-requisition { border-left-color: var(--rouge); }     /* Compétence = rouge */
/* Pouvoirs d'anomalie sur la fiche : encadré avec barre gauche BLEUE (couleur Anomalie). */
.fiche .power-block { border: 1px solid var(--trait); border-left: 4px solid var(--anomalie);
    background: var(--carte); padding: .7rem .9rem; margin: .6rem 0; }
.fiche .power-block .power-name-inline { color: var(--anomalie); }
/* Relations (catégorie Réalité) : barre gauche jaune. */
.agent-grid.relations .agent-cell { border-left-color: var(--or); }
.ref-staff { margin-top: 1.6rem; }

/* ---------- Éditeur de l'entrevue (Coordo) ---------- */
.ed-aide { margin: .6rem 0 1rem; font-size: .9rem; color: var(--gris); }
.ed-aide summary { cursor: pointer; color: var(--texte); }
.ed-aide li { margin: .25rem 0; }
.ed-generer { margin: 0 0 1rem; }
.q-ed-cond { margin-left: 1.4rem; border-left-color: var(--or); }
.q-ed-note, .q-ed-desc { color: var(--gris); font-size: .85rem; margin: .3rem 0; }
.q-ed-edit, .q-ed-option { margin-top: .5rem; border: 1px dashed var(--trait); padding: .3rem .6rem; }
.q-ed-edit summary, .q-ed-option summary { cursor: pointer; font-size: .9rem; }
.q-ed-options { margin-top: .5rem; display: flex; flex-direction: column; gap: .3rem; }
.ev-form textarea { font-family: inherit; }
/* Déplacer une question à une position précise (à côté des flèches ▲▼). */
.ev-pos { display: inline-flex; align-items: center; gap: .25rem; }
.ev-pos-num { width: 3.4rem; padding: .25rem .35rem; text-align: center; }
/* Barre d'outils markdown (Gras / Italique) au-dessus des descriptions. */
.md-field { display: flex; flex-direction: column; gap: .25rem; }
.md-toolbar { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.md-btn { min-width: 2rem; padding: .15rem .5rem; line-height: 1.4; }
.md-btn b { font-weight: 900; }
.md-hint { font-family: var(--mono); font-size: .68rem; color: var(--gris); }
/* Bouton d'action destructive (suppressions définitives). */
.role-btn.danger { border-color: var(--rouge); color: var(--rouge-vif); }
.role-btn.danger:hover { background: var(--rouge); color: #fff; border-color: var(--rouge); }

@media print {
    .fiche-bloc, .power-block, .agent-cell { break-inside: avoid; }
    .fiche-bloc { background: #fff; color: #000; border-color: #999; }
    .tiroirs, .dash-actions { display: none !important; }
}

/* Bootstrap (reboot) flotte les <legend> (float:left) : le libellé qui suit se retrouvait écrasé
   à droite (largeur 0) dans les blocs de relations. On neutralise pour nos fieldsets. */
.rel-block > legend { float: none; width: auto; margin: 0 0 .4rem; font-size: 1.05rem; line-height: 1.3; }

/* Bandeau d'erreur Blazor : lien sans bleu Bootstrap */
#blazor-error-ui a { color: #08090c; }

/* ---------- Guide du staff (/guide) ---------- */
.guide { max-width: 860px; }
.guide-sec { scroll-margin-top: 90px; margin-top: 2.2rem; }
.guide-toc { border: 1px solid var(--trait); border-left: 4px solid var(--rouge); background: var(--carte); padding: .9rem 1.2rem; margin: 1.4rem 0 .5rem; }
.guide-toc-titre { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gris); margin: 0 0 .5rem; }
.guide-toc ol { margin: 0; padding-left: 0; list-style: none; columns: 2; column-gap: 2rem; }
.guide-toc li { margin: .18rem 0; }
.guide-toc a { color: var(--texte); text-decoration: none; border-bottom: 1px solid transparent; }
.guide-toc a:hover { color: var(--rouge-vif); border-bottom-color: var(--rouge-vif); }
.guide-steps { line-height: 1.6; }
.guide-steps li, .guide-list li { margin: .35rem 0; }
.guide-list { line-height: 1.6; }
.guide-fig { margin: 1rem 0 1.4rem; }
.guide-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--trait); border-radius: 4px; box-shadow: 0 1px 0 var(--trait); }
.guide-fig figcaption { font-family: var(--mono); font-size: .76rem; color: var(--gris); margin-top: .45rem; line-height: 1.4; }
.guide-table { margin: .6rem 0 1rem; }
.guide-table td { vertical-align: top; }
.guide-role { display: inline-block; font-family: var(--mono); font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: .1rem .45rem; border-radius: 3px; vertical-align: middle; }
.guide-role-coordo { background: rgba(209,162,74,.18); color: var(--or); border: 1px solid var(--or); }
@media (max-width: 640px) { .guide-toc ol { columns: 1; } }
@media print { .guide-toc { break-inside: avoid; } .guide-fig, .guide-sec { break-inside: avoid; } .guide-fig img { border-color: #999; } }
