/* =====================================================================
   Analyse de risques — thème « bouclier » (19/11/2026), d'après la maquette
   https://claude.ai/artifact/WuZbgump4BKm633toXH6jM : bleu nuit EDF,
   turquoise (fait, pas concerné), orange (concerné, à faire), jaune sécurité
   (série, réflexe, badges). Space Grotesk pour les titres, Inter pour le texte.
   ===================================================================== */
:root {
  color-scheme: light;
  --nuit: #0B1440; --nuit-2: #15216B; --nuit-3: #1B2A6B; --nuit-4: #24358A; --nuit-ligne: #2A3878; --nuit-bord: #3A4A9A;
  --nuit-txt: #A9B4E8; --nuit-sub: #D5DCF5;
  --turq: #2DD4BF; --turq-soft: #E0F7F4; --turq-fg: #0b5a54; --turq-fort: #0d9488;
  --orange: #FF8A3D; --orange-soft: #FFF4EC; --orange-fg: #C2410C;
  --jaune: #FFC93C; --jaune-soft: #FFF7E0; --jaune-fg: #7A5300; --jaune-ligne: #E6D29A;
  --rouge: #E5484D; --rouge-soft: #FDECEC; --rouge-fg: #B4231F;
  --fond: #F4F6FB; --g200: #E6EAF2; --g300: #DFE4EE; --g400: #C9D1E3; --g500: #9AA3B8; --g600: #5F6A80; --g700: #4F5A72; --g800: #2F3850;
  --pos: #13804a; --pos-soft: #E3F6EA;
  --r1: 10px; --r2: 14px; --r3: 20px; --r4: 28px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --titre: "Space Grotesk", Inter, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--nuit); font-family: var(--font); -webkit-font-smoothing: antialiased;
       min-height: 100vh; font-size: 16px; line-height: 1.4; }
body.nuit { background: var(--nuit); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--turq-fort); }
h1, h2, h3 { font-family: var(--titre); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }

/* ---------------------------------------------------------------- En-têtes */
.hd { background: var(--nuit); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 20px 22px; }
.hd.rond { border-radius: 0 0 var(--r4) var(--r4); }
.hd-in { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; position: relative; }
.hd-ligne.coin { position: absolute; top: 0; right: 0; min-height: 38px; }
.hd-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.hd-retour { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--nuit-txt); text-decoration: none; font-size: 15px; }
.hd-retour:hover { color: #fff; }
.hd h1 { margin: 0; font-size: 28px; line-height: 1.12; }
.hd-sub { color: var(--nuit-sub); font-size: 14.5px; }
.bonjour { font-size: 14.5px; color: var(--nuit-txt); }
.serie { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,201,60,.16); color: var(--jaune);
         padding: 8px 13px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.serie svg { width: 18px; height: 18px; }
.etapes { display: flex; gap: 4px; }
.etapes button { flex: 1; height: 7px; border: 0; padding: 0; border-radius: 99px; background: var(--nuit-ligne); cursor: pointer; }
.etapes button.faite { background: var(--turq); }
.etapes button.ici { background: #fff; }
.etape-n { font-size: 13px; color: var(--nuit-txt); }

.wrap { max-width: 720px; margin: 0 auto; padding: 18px 20px calc(130px + env(safe-area-inset-bottom)); }
.wrap.court { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* ----------------------------------------------------------------- Blocs */
.card { background: #fff; border-radius: var(--r3); padding: 18px; border: 1px solid var(--g300); }
.card + .card { margin-top: 12px; }
h2 { font-size: 19px; margin: 0 0 6px; line-height: 1.25; }
h3 { font-size: 16px; margin: 0; }
.lead { color: var(--g700); font-size: 15px; margin: 0 0 14px; }
body.nuit .lead { color: var(--nuit-sub); }
.hint { color: var(--g600); font-size: 13.5px; }
.sec-h { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g700);
         margin: 24px 2px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
body.nuit .sec-h { color: var(--nuit-txt); }
.sec-h:first-child { margin-top: 4px; }
.compteur { font-size: 13px; color: var(--g700); font-weight: 700; }
body.nuit .compteur { color: #fff; }

label.lbl { display: block; font-size: 14px; font-weight: 700; color: var(--nuit); margin: 18px 0 7px; }
label.lbl:first-child { margin-top: 0; }
.in, textarea.in { width: 100%; min-height: 52px; border: 2px solid var(--g300); border-radius: var(--r2);
      padding: 12px 14px; font-size: 16.5px; background: var(--fond); }
textarea.in { min-height: 84px; resize: vertical; line-height: 1.4; }
.in:focus { outline: none; border-color: var(--turq-fort); background: #fff; box-shadow: 0 0 0 4px var(--turq-soft); }
.in.ko { border-color: var(--orange); background: var(--orange-soft); }
.in.ok { border-color: var(--turq); background: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
       padding: 0 20px; border: 0; border-radius: var(--r2); font-size: 16.5px; font-weight: 700;
       color: #fff; background: var(--nuit); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
       transition: transform .08s ease; }
.btn:active { transform: scale(.98); }

.btn.block { display: flex; width: 100%; min-height: 60px; font-size: 17.5px; border-radius: 18px; }
.btn.turq { background: var(--turq); color: var(--nuit); }
.btn.orange { background: var(--orange); color: var(--nuit); }
.btn.ghost { background: #fff; border: 2px solid var(--g400); color: var(--nuit); }
body.nuit .btn.ghost { background: transparent; border-color: var(--nuit-bord); color: #fff; }
.btn:disabled, .btn.turq:disabled, .btn.orange:disabled { background: var(--g400); color: var(--g700); cursor: default; transform: none; }
body.nuit .btn:disabled { background: var(--nuit-3); color: var(--nuit-txt); }
.btn.small { min-height: 42px; padding: 0 14px; font-size: 14.5px; }
.btn.rouge { background: var(--rouge); }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 0 12px 0 22px;
       border: 0; border-radius: 18px; background: var(--turq); color: var(--nuit); font-weight: 700; font-size: 18px; cursor: pointer; width: 100%; }
.cta .plus { width: 44px; height: 44px; border-radius: 50%; background: var(--nuit); color: var(--turq); display: grid; place-items: center; font-size: 24px; }

.note { border-radius: var(--r2); padding: 13px 15px; font-size: 14.5px; line-height: 1.45; margin-top: 12px; }
.note b { display: block; margin-bottom: 2px; }
.note.pos { background: var(--turq-soft); color: var(--turq-fg); }
.note.warn { background: var(--orange-soft); color: var(--orange-fg); }
.note.neg { background: var(--rouge-soft); color: var(--rouge-fg); }
.note.jaune { background: var(--jaune-soft); color: var(--jaune-fg); }

.chip { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
        background: var(--g200); color: var(--g800); white-space: nowrap; }
.chip.brouillon { background: var(--orange-soft); color: var(--orange-fg); }
.chip.prete { background: var(--turq-soft); color: var(--turq-fg); }
.chip.briefee { background: #E7EDFF; color: #2A3FA8; }
.chip.close { background: var(--g200); color: var(--g700); }
.chip.stop { background: var(--rouge); color: #fff; }

/* ------------------------------------------------------------ Accueil */
.reflexe { background: var(--jaune-soft); border: 2px solid var(--jaune); border-radius: var(--r3); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.reflexe .k { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--jaune-fg); }
.reflexe .q { font-family: var(--titre); font-size: 18px; font-weight: 700; line-height: 1.25; }
.reflexe .choix { display: grid; gap: 8px; }
.reflexe button { min-height: 50px; border-radius: var(--r2); border: 2px solid var(--jaune-ligne); background: #fff; font-weight: 600; font-size: 14.5px;
                  color: var(--nuit); cursor: pointer; text-align: left; padding: 8px 14px; }
.reflexe button.bon { border-color: var(--turq-fort); background: var(--turq-soft); color: var(--turq-fg); }
.reflexe button.faux { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-fg); }
.reflexe button:disabled { cursor: default; }
.reflexe .verdict { font-size: 14px; font-weight: 600; color: var(--jaune-fg); }
.liste { display: grid; gap: 10px; }
.liste > * { min-width: 0; }
a.item, .item { display: flex; gap: 14px; align-items: center; padding: 14px; background: #fff; border-radius: 18px;
         text-decoration: none; color: var(--nuit); min-height: 72px; border: 1px solid var(--g300); }
a.item:hover { border-color: var(--g500); }
.item .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .t b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t span { font-size: 13px; color: var(--g700); }
.item .t .crit { color: var(--orange-fg); font-weight: 600; }
.item .fl { font-size: 22px; color: var(--g500); }
.anneau { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.anneau span { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.pastille { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--turq-soft); color: var(--turq-fg); }
.pastille svg { width: 26px; height: 26px; }
.pastille.stop { background: var(--rouge-soft); color: var(--rouge-fg); }
.pastille.close { background: var(--g200); color: var(--g700); }
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tuiles > div { background: #fff; border-radius: 16px; padding: 12px 8px; text-align: center; border: 1px solid var(--g300); }
.tuiles b { display: block; font-family: var(--titre); font-size: 24px; }
.tuiles span { font-size: 12px; color: var(--g700); }
.vide { color: var(--g600); font-size: 14.5px; padding: 16px; text-align: center; background: #fff; border: 2px dashed var(--g300); border-radius: 18px; }
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px 6px; border-radius: 16px;
         background: #fff; border: 1px solid var(--g300); font-size: 12px; color: var(--g600); }
.badge .med { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--g200); color: var(--g500); }
.badge .med svg { width: 24px; height: 24px; }
.badge.on { border-color: var(--jaune); color: var(--nuit); font-weight: 600; }
.badge.on .med { background: var(--jaune-soft); color: var(--jaune-fg); }

/* ------------------------------------------------------------ Barre du bas */
.barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.96);
         border-top: 1px solid var(--g300); padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
body.nuit .barre { background: rgba(11,20,64,.94); border-top-color: var(--nuit-ligne); }
.barre-in { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.barre .btn { flex: 1; min-height: 58px; border-radius: 18px; }
.barre .btn.ghost { flex: 0 0 58px; padding: 0; font-size: 22px; }
.barre-etat { font-size: 13px; color: var(--g600); text-align: center; max-width: 720px; margin: 0 auto 7px; font-weight: 600; }
.barre-etat.ko { color: var(--orange-fg); }
body.nuit .barre-etat { color: var(--nuit-txt); }
body.nuit .barre-etat.ko { color: var(--orange); }
.enreg { font-size: 11px; color: var(--g500); }

/* Choix à boutons */
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { flex: 1 1 0; min-height: 54px; min-width: 96px; padding: 8px 12px; border: 2px solid var(--g300); background: #fff;
       border-radius: var(--r2); font-weight: 700; font-size: 15.5px; cursor: pointer; color: var(--nuit); }
.opt[aria-pressed="true"] { background: var(--turq); border-color: var(--turq); color: var(--nuit); }
.opt.danger[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.opt.so[aria-pressed="true"] { background: var(--g700); border-color: var(--g700); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chipb { min-height: 46px; padding: 8px 15px; border: 2px solid var(--g300); background: #fff; border-radius: 999px;
         font-weight: 600; font-size: 14.5px; cursor: pointer; color: var(--nuit); text-align: left; }
.chipb[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--nuit); }
.chipb.aucun[aria-pressed="true"] { background: var(--turq); border-color: var(--turq); }
.chipb .x { margin-left: 6px; opacity: .7; }
.gens { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.gens .chipb { background: var(--turq-soft); border-color: var(--turq-soft); color: var(--turq-fg); }
.ajout { display: flex; gap: 8px; }
.ajout .in { flex: 1; }

/* Règles vitales : une carte à la fois */
.points { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.points button { height: 8px; border: 0; padding: 0; border-radius: 99px; background: var(--nuit-ligne); cursor: pointer; }
.points button.oui { background: var(--orange); }
.points button.non { background: var(--turq); }
.points button.ici { background: #fff; }
.pile { position: relative; margin-top: 18px; padding-top: 14px; }
.pile::before, .pile::after { content: ""; position: absolute; border-radius: var(--r4); }
.pile::before { left: 18px; right: 18px; top: 0; bottom: 12px; background: var(--nuit-3); }
.pile::after { left: 9px; right: 9px; top: 7px; bottom: 6px; background: var(--nuit-4); }
.carte { position: relative; z-index: 1; background: #fff; color: var(--nuit); border-radius: var(--r4); padding: 22px;
         display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 40px rgba(0,0,0,.35); animation: entre .22s ease-out; }
@keyframes entre { from { transform: translateY(14px) scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .carte, .bouclier-plein { animation: none !important; } }
.carte .haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.carte .num { background: var(--turq-soft); color: var(--turq-fg); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.carte .picto { width: 128px; height: 128px; border-radius: 32px; background: var(--fond); display: grid; place-items: center; align-self: center; }
.carte .picto img { width: 100px; height: 100px; object-fit: contain; }
.carte h2 { font-size: 26px; text-align: center; margin: 0; }
.carte .txt { margin: 0; text-align: center; font-size: 15px; line-height: 1.45; color: var(--g800); }
.carte .aide { background: var(--fond); border-radius: var(--r2); padding: 12px; font-size: 13.5px; color: var(--g700); }
.carte .q { font-weight: 700; font-size: 15px; text-align: center; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.duo button { min-height: 66px; border-radius: var(--r3); font-weight: 700; font-size: 17px; cursor: pointer; }
.duo .b-non { border: 2px solid var(--nuit-bord); background: transparent; color: #fff; }
.duo .b-oui { border: 0; background: var(--orange); color: var(--nuit); }
.duo .b-non[aria-pressed="true"] { background: var(--turq); border-color: var(--turq); color: var(--nuit); }
.carte .duo .b-non { border-color: var(--g400); color: var(--nuit); }
.carte .duo .b-oui[aria-pressed="true"] { background: var(--turq); }
.carte .duo .b-stop[aria-pressed="true"] { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.stop { background: var(--rouge); color: #fff; border-radius: var(--r2); padding: 14px; font-size: 14.5px; }
.stop b { display: block; font-family: var(--titre); font-size: 20px; letter-spacing: .04em; margin-bottom: 4px; }
.recap-rv { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.recap-rv button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: var(--r2);
                   border: 2px solid var(--nuit-ligne); background: var(--nuit-2); color: var(--nuit-txt); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.recap-rv img { width: 40px; height: 40px; background: #fff; border-radius: 10px; padding: 3px; opacity: .5; }
.recap-rv button.oui { border-color: var(--orange); color: #fff; }
.recap-rv button.oui img { opacity: 1; }
.recap-rv button.stop-rv { border-color: var(--rouge); background: var(--rouge); color: #fff; }
.fin-rv { background: #fff; color: var(--nuit); border-radius: var(--r4); padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.rond-ok { width: 84px; height: 84px; border-radius: 50%; background: var(--turq); display: grid; place-items: center; }
.rond-ok svg { width: 46px; height: 46px; }

/* Parades : le bouclier */
.ent-risque { display: flex; gap: 16px; align-items: center; }
.ent-risque .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.ent-risque .k.autre { color: var(--turq); }
.ent-risque h1 { font-size: 24px; }
.bouclier { flex: none; }
.bouclier-plein { animation: pulse .6s ease-out; }
@keyframes pulse { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.defense { color: var(--nuit); background: #fff; border-radius: var(--r3); padding: 16px; display: flex; flex-direction: column; gap: 8px; border: 2px dashed var(--g400); }
.defense + .defense { margin-top: 12px; }
.defense.fait { border: 2px solid var(--turq); }
.defense.encours { border: 2px solid var(--orange); }
.defense .tete { display: flex; align-items: center; gap: 10px; }
.defense .n { width: 32px; height: 32px; border-radius: 50%; background: var(--g200); color: var(--g700); display: grid; place-items: center; font-weight: 700; flex: none; }
.defense.fait .n { background: var(--turq); color: var(--nuit); }
.defense.encours .n { background: var(--orange); color: var(--nuit); }
.defense label { font-weight: 700; font-size: 15px; }
.defense .ok { margin-left: auto; color: var(--turq-fort); font-weight: 700; font-size: 18px; }
.defense textarea { color: var(--nuit); border: 0; background: var(--fond); border-radius: 12px; padding: 11px 13px; font-size: 16px; line-height: 1.4; min-height: 70px; resize: vertical; width: 100%; }
.defense textarea:focus { outline: 2px solid var(--turq-fort); background: #fff; }
.defense.encours textarea { background: var(--orange-soft); }
.detecteur { display: flex; gap: 10px; align-items: flex-start; background: var(--nuit); color: #fff; border-radius: var(--r2); padding: 12px; font-size: 14px; line-height: 1.4; }
.detecteur svg { width: 22px; height: 22px; flex: none; color: var(--jaune); }
.detecteur b { color: var(--jaune); }
.idees { display: flex; flex-wrap: wrap; gap: 6px; }
.idees button { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--g400); background: #fff; font-size: 13px; font-weight: 600; color: var(--g800); cursor: pointer; }
.idees button:hover { border-color: var(--turq-fort); color: var(--turq-fg); }
.relu { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 13px; border-radius: var(--r2);
        background: var(--orange-soft); color: var(--orange-fg); font-weight: 600; font-size: 14.5px; cursor: pointer; }
.relu.ok { background: var(--turq-soft); color: var(--turq-fg); }
.relu input { width: 24px; height: 24px; flex: none; accent-color: var(--turq-fort); }
.rex { margin: 0; padding-left: 18px; font-size: 14px; }
.rex li + li { margin-top: 6px; }
.rex small { opacity: .8; }
.onglets-r { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.onglets-r::-webkit-scrollbar { display: none; }
.onglets-r button { flex: none; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--nuit-bord); background: transparent;
                    color: var(--nuit-txt); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.onglets-r button.fait { color: var(--turq); border-color: var(--turq); }
.onglets-r button.ici { background: #fff; color: var(--nuit); border-color: #fff; }

/* Contexte */
.ctx .q { font-weight: 700; font-size: 15.5px; margin-bottom: 10px; }
.case { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 14.5px; color: var(--g800); cursor: pointer; }
.case input { width: 22px; height: 22px; flex: none; accent-color: var(--turq-fort); }

/* Synthèse */
.radio-r { display: flex; gap: 12px; align-items: center; padding: 13px; border: 2px solid var(--g300); border-radius: var(--r2);
           cursor: pointer; font-weight: 600; font-size: 15px; background: #fff; }
.radio-r + .radio-r { margin-top: 8px; }
.radio-r input { width: 22px; height: 22px; accent-color: var(--orange-fg); flex: none; }
.radio-r.on { border-color: var(--orange); background: var(--orange-soft); }
.reste { margin: 8px 0 0; padding: 0; list-style: none; }
.reste li { padding: 9px 0; border-top: 1px solid rgba(180,35,31,.2); font-size: 14px; }
.reste li:first-child { border-top: 0; }
.reste a { font-weight: 700; color: inherit; }

/* Fiche */
.fiche dl { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 14.5px; }
.fiche dt { color: var(--g600); }
.fiche dd { margin: 0; font-weight: 600; }
.critique { background: var(--nuit); color: #fff; border-radius: var(--r3); padding: 18px; border: 2px solid var(--orange); }
.critique .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.critique .v { font-family: var(--titre); font-size: 21px; font-weight: 700; margin: 4px 0 12px; line-height: 1.2; }
.critique .p { background: rgba(255,255,255,.1); border-radius: var(--r2); padding: 11px 13px; font-size: 15.5px; }
.r-bloc { padding: 12px 0; border-top: 1px solid var(--g200); }
.r-bloc:first-of-type { border-top: 0; padding-top: 4px; }
.r-bloc h3 { font-size: 15.5px; margin-bottom: 6px; }
.r-bloc p { margin: 5px 0 0; font-size: 14.5px; }
.r-bloc p b { color: var(--g600); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; display: block; }
.rv-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rv-mini div { border: 2px solid var(--g300); border-radius: var(--r1); padding: 6px 4px; text-align: center; font-size: 11px; color: var(--g500); font-weight: 700; }
.rv-mini div.oui { border-color: var(--orange); color: var(--orange-fg); background: var(--orange-soft); }
.rv-mini img { width: 34px; height: 34px; display: block; margin: 0 auto 2px; filter: grayscale(1); opacity: .4; }
.rv-mini div.oui img { filter: none; opacity: 1; }
.sig { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sig > div { border: 1px solid var(--g300); border-radius: var(--r2); padding: 11px 12px; font-size: 14px; }
.sig .k { font-size: 11.5px; color: var(--g600); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.sig .v { font-weight: 700; margin-top: 2px; }
.sig .vide-s { color: var(--g500); font-weight: 400; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.histo { font-size: 13px; color: var(--g600); margin: 8px 0 0; padding-left: 18px; }

/* Briefing */
.flash { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.flash button { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 18px; font-weight: 600; font-size: 16px;
                cursor: pointer; background: var(--nuit-2); color: #fff; border: 2px solid var(--nuit-ligne); text-align: left; }
.flash .lettre { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; background: rgba(255,255,255,.12); }
.flash .verdict { margin-left: auto; font-size: 13px; font-weight: 700; }
.flash button.bon { background: var(--orange); color: var(--nuit); border-color: var(--orange); }
.flash button.bon .lettre { background: var(--nuit); color: var(--orange); }
.flash button.choisi { border-color: var(--nuit-txt); background: var(--nuit-3); }
.revele { background: #fff; color: var(--nuit); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.revele .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-fg); }
.revele .v { font-family: var(--titre); font-size: 19px; font-weight: 700; line-height: 1.25; }
.revele .m { font-size: 14px; color: var(--g700); }
.carte-blanche { background: #fff; color: var(--nuit); border-radius: var(--r3); padding: 16px; margin-top: 12px; }
.carte-blanche summary { cursor: pointer; font-weight: 700; min-height: 30px; }
.questions { margin: 6px 0 0; padding-left: 20px; font-size: 15.5px; }
.questions li + li { margin-top: 6px; }
.avatars { display: flex; gap: 12px; flex-wrap: wrap; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--nuit-txt); cursor: pointer; font-size: 13px; width: 72px; padding: 0; }
.avatar .rond { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 19px;
                border: 3px dashed var(--nuit-bord); color: var(--nuit-txt); transition: transform .1s; }
.avatar[aria-pressed="true"] { color: #fff; }
.avatar[aria-pressed="true"] .rond { background: var(--turq); color: var(--nuit); border: 3px solid #fff; transform: scale(1.04); }
.avatar .nom { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.nuit .ajout .in { background: var(--nuit-2); border-color: var(--nuit-ligne); color: #fff; }

/* Bravo */
.bravo-hd { position: relative; text-align: center; align-items: center; padding-top: 18px; }
.confetti { position: absolute; border-radius: 3px; }
.bravo-hd h1 { font-size: 30px; }

dialog { border: 0; border-radius: var(--r3); padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
         box-shadow: 0 20px 50px rgba(11,20,64,.35); color: var(--nuit); }
dialog::backdrop { background: rgba(11, 20, 64, .55); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 18px 4px; }
.dlg-h h2 { margin: 0; }
.dlg-b { padding: 6px 18px 18px; }
.xbtn { width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; border-radius: var(--r2); font-size: 22px; color: var(--g700); }

#toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
         background: var(--nuit); color: #fff; padding: 12px 16px; border-radius: var(--r2); font-size: 14.5px; font-weight: 600;
         max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#toast.on { opacity: 1; }
#toast.err { background: var(--orange-fg); }

.imp-seul { display: none; }
@media (min-width: 700px) { .hd h1 { font-size: 32px; } }
@media (max-width: 520px) { .fiche dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .fiche dd { margin-bottom: 8px; } }

/* Impression (A4) */
@media print {
  @page { size: A4; margin: 12mm; }
  body, body.nuit { background: #fff; color: #000; font-size: 11pt; }
  .hd { background: #fff !important; color: #000; border-bottom: 3px solid #000; padding: 0 0 6px; border-radius: 0; }
  .hd-sub, .bonjour { color: #333 !important; }
  .hd-retour, .barre, .actions, .actions-2, .no-imp, #toast, .rtb, .rtb-ligne, .serie { display: none !important; }
  .imp-seul { display: block; }
  .wrap { padding: 8px 0 0; max-width: none; }
  .card { border: 1px solid #999; border-radius: 6px; padding: 10px 12px; break-inside: avoid; }
  .critique { background: #fff !important; color: #000; border: 2px solid #000; }
  .critique .k { color: #000; }
  .critique .p { background: #f2f2f2; }
  a { color: #000; text-decoration: none; }
}

/* =====================================================================
   Parcours express (19/11/2026) : 6 questions éclair, check de départ,
   briefing = signatures, suivi de validation, chrono d'envoi.
   ===================================================================== */
body.nuit .in { color: var(--nuit); background: #fff; }
body.nuit .ajout .in { background: var(--nuit-2); border-color: var(--nuit-ligne); color: #fff; }
.sec-h.orange { color: var(--orange); }
.chip.a_valider { background: var(--orange-soft); color: var(--orange-fg); }
.chip.validee { background: var(--turq-soft); color: var(--turq-fg); }
.pastille.attente { background: var(--orange-soft); color: var(--orange-fg); }
.chipb.petit { min-height: 40px; padding: 6px 12px; font-size: 13.5px; }

/* Autres risques : 6 questions éclair */
.eclairs { display: flex; flex-direction: column; gap: 8px; }
.eclair { border-radius: 18px; padding: 10px 10px 10px 12px; background: var(--nuit-3); border: 2px solid var(--nuit-bord); color: #fff; }
.eclair.oui { background: #fff; color: var(--nuit); border-color: #fff; }
.eclair.non { background: var(--nuit-2); color: var(--nuit-txt); border-color: var(--nuit-2); }
.eclair-l { display: flex; align-items: center; gap: 10px; }
.eclair .num { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--nuit-4); color: #fff; }
.eclair.oui .num { background: var(--orange); color: var(--nuit); }
.eclair.non .num { background: var(--turq); color: var(--nuit); }
.eclair .t { flex: 1; font-weight: 600; font-size: 15px; line-height: 1.25; }
.eclair .b-n, .eclair .b-o { min-width: 58px; min-height: 44px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer;
                             background: transparent; color: inherit; border: 2px solid var(--nuit-bord); }
.eclair.oui .b-n { border-color: var(--g400); }
.eclair .b-n[aria-pressed="true"] { background: var(--turq); border-color: var(--turq); color: var(--nuit); }
.eclair .b-o[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--nuit); }
.eclair-d { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-left: 40px; }
.eclair-d .chipb[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); }

/* Check de départ */
.voyants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.voyant { min-height: 112px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 18px;
          text-align: left; cursor: pointer; background: var(--nuit-3); color: #fff; border: 2px solid var(--nuit-bord); transition: transform .08s; }
.voyant:active { transform: scale(.97); }
.voyant b { font-size: 15px; line-height: 1.2; }
.voyant .s { font-size: 12.5px; line-height: 1.3; opacity: .85; }
.voyant .rond { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: var(--nuit-4); color: #fff; }
.voyant.ok { background: var(--turq); color: var(--nuit); border-color: var(--turq); }
.voyant.ko { background: var(--orange); color: var(--nuit); border-color: var(--orange); }
.voyant.ok .rond, .voyant.ko .rond { background: var(--nuit); color: #fff; }
.sac { background: #fff; color: var(--nuit); border-radius: 20px; padding: 14px; margin-top: 14px; }
.sac-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.sac-h span { font-size: 12px; color: var(--g700); }
.sac summary { cursor: pointer; min-height: 32px; }
.sac textarea.in { margin-top: 10px; }
.chipb.pris { background: var(--turq-soft); border-color: var(--turq); color: var(--turq-fg); }

/* Briefing */
.crit-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.crit-b { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 14px; cursor: pointer; text-align: left;
          font-weight: 600; font-size: 14px; background: var(--nuit-3); color: #fff; border: 2px solid var(--nuit-bord); }
.crit-b svg { flex: none; }
.crit-b.on { background: #fff; color: var(--nuit); border-color: var(--orange); }
.phrase { background: #fff; color: var(--nuit); border-radius: 18px; padding: 12px; border: 2px solid var(--orange); }
.phrase textarea.in { border: 0; background: var(--orange-soft); font-family: var(--titre); font-weight: 700; font-size: 17px; min-height: 70px; }
.phrase .hint { margin-top: 6px; }
.avatar .role { font-size: 11px; color: var(--nuit-txt); }
.avatar[aria-pressed="true"] .role { color: var(--jaune); }

/* Suivi d'une ADR envoyée */
.suivi-adr { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--g300); border-radius: var(--r3); padding: 16px; margin-top: 12px; }
.card .suivi-adr { border: 0; padding: 0; margin: 0; }
.pas { display: flex; gap: 12px; align-items: center; opacity: .55; }
.pas.fait, .pas.encours { opacity: 1; }
.pas .p { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px dashed var(--g400); display: grid; place-items: center; font-weight: 700; }
.pas.fait .p { background: var(--turq); border: 0; color: var(--nuit); }
.pas.encours .p { border: 2px solid var(--orange); background: var(--orange-soft); }
.pas.encours .p::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.pas div { display: flex; flex-direction: column; gap: 2px; }
.pas b { font-size: 15px; }
.pas span { font-size: 13px; color: var(--g700); }

/* Chrono d'envoi */
.chrono-k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--turq); }
.chrono { font-family: var(--titre); font-size: 60px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.clin { margin: 6px 0 0; font-family: var(--titre); font-size: 20px; font-weight: 700; line-height: 1.25; }

/* ── Parades : pré-mortem, parades classées S·T·O·P, plan « Si… alors… » (refonte 23/11/2026) ── */
.pm { background: var(--nuit-2); border: 1px solid var(--nuit-ligne); border-radius: var(--r3); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pm + .pm { margin-top: 14px; }
.pm.attente { opacity: .38; pointer-events: none; }
.pm-k { display: flex; align-items: center; gap: 8px; color: var(--jaune); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pm-k svg { width: 18px; height: 18px; flex: none; }
.pm-q { margin: 0; font-family: var(--titre); font-size: 22px; line-height: 1.15; color: #fff; }
.pm-s { margin: 0; font-size: 14px; color: var(--nuit-sub); }
.pm-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--nuit-txt); }
.pm-lbl { font-size: 14px; font-weight: 700; color: #fff; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-lbl span { font-weight: 500; color: var(--nuit-txt); }
.pm textarea, .plan-stop textarea { width: 100%; min-height: 56px; border-radius: 12px; border: 2px solid var(--nuit-bord); background: var(--nuit); color: #fff;
  padding: 10px 12px; font: 16px/1.4 var(--font); resize: vertical; }
.pm textarea:focus, .plan-stop textarea:focus { outline: none; border-color: var(--turq); }
.scens { display: flex; flex-direction: column; gap: 8px; }
.scen { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--nuit-ligne);
  background: var(--nuit); color: #fff; font: 600 15px/1.3 var(--font); text-align: left; cursor: pointer; }
.scen .l { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); font-weight: 700; font-size: 14px; }
.scen[aria-pressed="true"] { background: #fff; color: var(--nuit); border-color: #fff; }
.scen[aria-pressed="true"] .l { background: var(--orange); color: var(--nuit); }
.scen.autre { justify-content: center; border-style: dashed; border-color: var(--nuit-bord); color: var(--nuit-sub); font-size: 14px; }
.scen.autre[aria-pressed="true"] { background: transparent; color: var(--turq); border: 2px solid var(--turq); }
.stop-opts { display: flex; flex-direction: column; gap: 8px; }
.stop-opt { min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 16px; border: 2px solid transparent;
  background: #fff; color: var(--nuit); text-align: left; cursor: pointer; font-family: var(--font); }
.stop-opt .lettre { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--fond); font: 700 16px var(--titre); }
.stop-opt .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.stop-opt .txt small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--g700); }
.stop-opt .barres { flex: none; display: flex; align-items: flex-end; gap: 2px; }
.stop-opt .barres i { display: block; width: 5px; border-radius: 2px; }
.stop-opt[aria-pressed="true"] { border-color: var(--turq); box-shadow: 0 0 0 2px var(--turq); }
.stop-opt[aria-pressed="true"] .lettre { background: var(--nuit); color: #fff; }
.pm-retour { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r2); padding: 10px 12px; font-size: 13.5px; line-height: 1.4; }
.pm-retour svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pm-retour.faible { background: var(--jaune-soft); color: #5c3f00; }
.pm-retour.fort { background: var(--turq-soft); color: var(--turq-fg); }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan-c { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; border: 0; background: #fff; color: var(--nuit);
  text-align: left; cursor: pointer; font-family: var(--font); }
.plan-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-n { font-size: 12px; font-weight: 700; color: var(--orange-fg); }
.plan-niv { display: flex; gap: 4px; }
.plan-niv i { font: normal 700 12px var(--titre); padding: 2px 7px; border-radius: 6px; }
.plan-p { font-size: 14.5px; line-height: 1.45; }
.plan-sec { margin-top: 14px; }
.plan-sec .idees button { background: transparent; color: var(--nuit-sub); border-color: var(--nuit-bord); }
.plan-stop { margin-top: 14px; background: #0f1a52; border: 2px solid #A12117; border-radius: var(--r3); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.plan-stop .carre { width: 22px; height: 22px; border-radius: 6px; background: #c62a20; display: inline-block; position: relative; }
.plan-stop .carre::after { content: ""; position: absolute; inset: 6px; background: #fff; border-radius: 2px; }
body.nuit .pm .detecteur, body.nuit .plan-stop .detecteur { background: var(--nuit-3); }
@media print { .pm, .plan-stop { display: none; } }
