/* Atelia · console · écran « Journal des processus » (screens/journal-robot.js).
   Palette inchangée : var(--…) uniquement, composants existants (.card, .segment, .st, .note, .empty, .btn).
   Largeur ordinateur seulement (Saleh, 03/10) : aucune mise en page pour téléphone.
   07/10 (Saleh : « illisible ») : page refaite, résumé d'abord : phrase d'état, « À faire maintenant », « À regarder », « À savoir », les
   robots en ce moment, les données des restaurants (tableau, grille repliée), les processus (une ligne chacun, étapes
   dépliées sur demande) et l'activité en direct (colonnes régulières). Aucun texte coupé au milieu d'un mot. */

.jr .card-h { flex-wrap: wrap; }
.jr .card-h .card-sub { min-width: 0; }
.jr .card-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Témoin « Actualisé il y a N s » : un point qui bat tant que la lecture est à jour. */
.jr-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.jr-live.ko { color: var(--rouge); }
.jr-pt { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--na); }
.jr-live.ok .jr-pt { background: var(--vert); animation: jr-pouls 2s ease-out infinite; }
.jr-live.ko .jr-pt { background: var(--rouge); }
@keyframes jr-pouls {
  0% { box-shadow: 0 0 0 0 rgba(24, 125, 79, .45); }
  100% { box-shadow: 0 0 0 7px rgba(24, 125, 79, 0); }
}
@keyframes jr-pouls-bleu {
  0% { box-shadow: 0 0 0 0 rgba(36, 86, 196, .4); }
  100% { box-shadow: 0 0 0 7px rgba(36, 86, 196, 0); }
}

/* Couleur du point d'état (pastilles des moteurs et panneau) : en cours (bleu, bat), au repos (gris), répond ou en
   marche (vert), en pause, perdue ou en échec (rouge), sans nouvelles ou à vérifier (orange), pas encore construit
   (cercle vide). */
.cours > .jr-pt { background: var(--blue); animation: jr-pouls-bleu 2s ease-out infinite; }
.ok > .jr-pt { background: var(--vert); }
.pause > .jr-pt { background: var(--rouge); }
.silence > .jr-pt { background: var(--orange); }
.absente > .jr-pt { background: transparent; border: 1.5px dashed var(--na); box-sizing: border-box; }
.partie > .jr-pt { background: var(--orange); }
.interdite > .jr-pt { background: transparent; border: 1.5px solid var(--rouge); box-sizing: border-box; }

/* Un processus en étapes : une carte, une rangée de tuiles reliées par des flèches. Six colonnes pour tous les
   processus : l'étape N de chacun tombe sous l'étape N des autres. Les tuiles d'une rangée gardent la même hauteur
   (le <li> étire son bouton). Quand la carte devient trop étroite pour six tuiles lisibles, la rangée passe à trois
   colonnes (requête de conteneur) ; la flèche d'une tuile qui commence une ligne disparaît (rien ne déborde). */
.jr-chaine + .jr-chaine { margin-top: 16px; }
.jr-etapes-cadre { container-type: inline-size; }
.jr-etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 24px; row-gap: 16px; }
@container (max-width: 840px) {
  .jr-etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .jr-etapes > .jr-etape-li:nth-child(3n + 1) > .jr-fleche { display: none; }
}
.jr-etape-li { position: relative; display: flex; min-width: 0; }
.jr-fleche { position: absolute; left: -23px; top: 50%; width: 22px; height: 10px; margin-top: -5px; display: flex; color: var(--na); }
.jr-fleche svg { display: block; width: 22px; height: 10px; overflow: visible; }
.jr-fleche path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.jr-fleche.pointillee .jr-fleche-trait { stroke-dasharray: 3 4; }
.jr-etape { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; min-height: 170px; box-sizing: border-box; padding: 11px 11px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .12s; }
.jr-etape > * { flex: none; max-width: 100%; }
.jr-etape:hover { border-color: var(--blue-bd); box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.jr-etape:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.jr-etape.ok { border-color: var(--vert-bd); }
.jr-etape.cours { border-color: var(--blue-bd); }
.jr-etape.pause { border-color: var(--rouge-bd); }
.jr-etape.silence, .jr-etape.partie { border-color: var(--orange-bd); }
.jr-etape.absente { border-style: dashed; border-color: color-mix(in srgb, var(--na) 30%, var(--line)); background: var(--surface-2); }
.jr-etape.interdite { border-style: dashed; border-color: var(--rouge-bd); background: var(--surface-2); }
.jr-etape-tete { display: flex; align-items: flex-start; gap: 6px; width: 100%; }
.jr-etape-nom { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 800; line-height: 1.3; color: var(--navy); -webkit-hyphens: manual; hyphens: manual; overflow-wrap: break-word; }
.jr-etape.absente .jr-etape-nom, .jr-etape.interdite .jr-etape-nom { color: var(--ink-2); }
.jr-etape .st { white-space: normal; align-items: flex-start; font-size: 11px; line-height: 1.3; padding: 2px 8px; }
.jr-etape .st::before { flex: none; margin-top: 4px; }
.jr-etape-quoi { font-size: 12px; line-height: 1.45; color: var(--ink-2); overflow-wrap: break-word; }
.jr-etape-ch { display: flex; flex-direction: column; gap: 3px; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); width: 100%; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.jr-etape-ligne { overflow-wrap: break-word; }
.jr-etape-ligne b { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.jr-etape-ligne b.na { font-weight: 600; color: var(--muted); }
.jr-etape-ligne.discret { color: var(--muted); }
.jr-etape-ligne.discret b { color: var(--ink-2); }
.jr-etape-ligne .jr-main { font-weight: 700; color: var(--navy); }
.jr-etape:hover .jr-chevron { opacity: 1; transform: translateX(2px); }
.jr-chaine-pied { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.jr-chaine-l { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.jr-chaine-l .btn { margin-left: 4px; }

/* Comptes des étapes par état : en tête des étapes dépliées d'un processus (les non nuls) et sous le titre « Processus »
   (tous). Une pastille, le nombre en gras, le libellé, espacés (règles d'avant le 07/10, que comptesHtml utilise). */
.jr-comptes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.jr-compte { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.jr-compte b { color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.c-marche > .jr-pt { background: var(--vert); }
.c-difficulte > .jr-pt { background: var(--rouge); }
.c-inconnu > .jr-pt { background: transparent; border: 1.5px solid var(--na); box-sizing: border-box; }
.c-partie > .jr-pt { background: var(--orange); }
.c-absente > .jr-pt { background: transparent; border: 1.5px dashed var(--na); box-sizing: border-box; }
.c-interdite > .jr-pt { background: transparent; border: 1.5px solid var(--rouge); box-sizing: border-box; }
.jr-lecture { margin: -4px 0 14px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.jr-lecture .btn { margin-left: 4px; }

.jr-chevron { flex: none; font-size: 18px; font-weight: 700; line-height: 1; color: var(--blue); opacity: .55; transition: opacity .15s, transform .15s; }
.jr-ligne:hover .jr-chevron { opacity: 1; transform: translateX(2px); }
.jr-etat-titre { font-weight: 700; color: var(--navy); }

/* ---- Filtres : le segment « Tout | Erreurs et alertes », le restaurant et le processus ---- */
.jr .segment button { display: inline-flex; align-items: center; gap: 6px; }
.jr .jr-n { font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 10px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.jr .segment button.on .jr-n { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.jr .jr-filtre { min-width: 0; max-width: 100%; }
.jr .jr-filtre select { font: inherit; font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 220px; }

/* ---- Événements : une ligne par passe ou par événement ; un clic ouvre le panneau ---- */
.jr-liste { list-style: none; margin: 0; padding: 0; }
.jr-liste > li + li { border-top: 1px solid var(--line-2); }
.jr-ligne { display: grid; grid-template-columns: 76px 138px 160px minmax(0, 1fr) 124px 12px; gap: 12px; align-items: center; width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.jr-ligne:hover { background: var(--surface-2); }
.jr-ligne:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.jr-ligne.attention { background: var(--orange-bg); box-shadow: inset 3px 0 0 var(--orange); }
.jr-ligne.erreur { background: var(--rouge-bg); box-shadow: inset 3px 0 0 var(--rouge); }
.jr-ligne > .st { justify-self: start; }
.jr-heure { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.25; color: var(--ink-2); }
.jr-jour { font-size: 11px; color: var(--muted); }
.jr-hms { font-weight: 600; }
.jr-texte { display: flex; flex-direction: column; min-width: 0; }
.jr-principal { line-height: 1.45; overflow-wrap: break-word; }
.jr-resto { font-weight: 700; color: var(--navy); margin-right: 4px; }
.jr-msg { color: var(--ink); }

.jr-bandeau { margin-bottom: 12px; flex-wrap: wrap; }
.jr .empty { padding: 32px 20px; }
.jr-vide-act { margin-top: 12px; }
.jr .jr-aide { margin: 10px 0 0; font-size: 12.5px; }

/* ---- Panneau par-dessus (tiroir de l'app) : processus, passe ou événement ---- */
.jr-tiroir { display: flex; flex-direction: column; gap: 12px; font-size: 13px; color: var(--ink); }
.jr-tiroir > * { margin: 0; }
.jr-t-retour { margin-bottom: -2px; }
.jr-t-phrase { font-size: 13.5px; line-height: 1.5; }
.jr-t-titre { margin: 6px 0 -4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.jr-t-rythme { margin: 0; padding-left: 18px; color: var(--ink-2); line-height: 1.5; }
.jr-t-rythme li + li { margin-top: 4px; }
.jr-t-note, .jr-t-vide { font-size: 12.5px; line-height: 1.45; }
.jr-t-note { color: var(--ink-2); }
.jr-t-maj { font-size: 12px; margin-top: 4px; }
.jr-t-ligne { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); line-height: 1.45; overflow-wrap: break-word; }
.jr-t-ligne > div { min-width: 0; }
.jr-t-ligne .muted { font-size: 12px; margin-top: 2px; }
.jr-t-ligne .btn { flex: none; }
.jr-t-erreur { padding: 10px 12px; border: 1px solid var(--rouge-bd); background: var(--rouge-bg); border-radius: 10px; }
.jr-t-erreur-msg { color: var(--ink); line-height: 1.45; overflow-wrap: break-word; white-space: pre-wrap; }
.jr-t-erreur-msg + .jr-t-erreur-msg { margin-top: 6px; }
.jr-t-erreur-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; }
.jr-t-err { color: var(--rouge); }
.jr-t-texte { white-space: pre-wrap; overflow-wrap: break-word; }
.jr-t-statut { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); }
.jr-t-absent { margin-bottom: 2px; }
.jr-t-json { margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }

/* Rangs « libellé : valeur » du détail. */
.jr-rangs { display: flex; flex-direction: column; gap: 7px; }
.jr-rang { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.45; }
.jr-rang-l { color: var(--muted); }
.jr-rang-v { min-width: 0; overflow-wrap: break-word; }
.jr-rang-v .st { vertical-align: middle; }

/* État du processus dans son panneau. */
.jr-etat { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.jr-etat .jr-pt { margin-top: 6px; }
.jr-etat-txt { min-width: 0; overflow-wrap: break-word; }
.jr-etat.cours { background: var(--blue-soft); border-color: var(--blue-bd); }
.jr-etat.cours .jr-etat-titre { color: var(--blue); }
.jr-etat.pause { background: var(--rouge-bg); border-color: var(--rouge-bd); }
.jr-etat.pause .jr-etat-titre, .jr-etat.pause .jr-etat-txt { color: var(--rouge); }
.jr-etat.silence { background: var(--orange-bg); border-color: var(--orange-bd); }
.jr-etat.silence .jr-etat-titre { color: var(--orange); }
.jr-etat-etape.ok { background: var(--vert-bg); border-color: var(--vert-bd); }
.jr-etat-etape.ok .jr-etat-titre { color: var(--vert); }
.jr-etat.absente { border-style: dashed; border-color: color-mix(in srgb, var(--na) 30%, var(--line)); }
.jr-etat.partie { background: var(--orange-bg); border-color: var(--orange-bd); }
.jr-etat.partie .jr-etat-titre { color: var(--orange); }
.jr-etat.interdite { background: var(--rouge-bg); border-color: var(--rouge-bd); border-style: dashed; }
.jr-etat.interdite .jr-etat-titre { color: var(--rouge); }

/* Panneau d'une étape : passer à l'étape voisine, l'encart « une seule récupération », le tableau par restaurant. */
.jr-t-nav { display: flex; gap: 8px; margin-bottom: -2px; }
.jr-t-nav .jr-t-nav-suiv { margin-left: auto; }
.jr-t-encart { padding: 10px 12px; border: 1px solid var(--blue-bd); background: var(--blue-soft); border-radius: 10px; line-height: 1.5; }
.jr-t-encart p { margin: 0 0 8px; }
.jr-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.jr-tab th, .jr-tab td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; line-height: 1.4; overflow-wrap: break-word; }
.jr-tab thead th { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.jr-tab tbody th { font-weight: 700; color: var(--navy); }
.jr-tab .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jr-tab td.n[colspan] { white-space: normal; }
/* La colonne des restaurants garde la place d'un nom (les mots ne se coupent pas) ; les en-têtes des chiffres passent
   à la ligne plutôt que de l'écraser. */
.jr-tab tbody th { min-width: 118px; overflow-wrap: break-word; }
.jr-tab thead th.n { white-space: normal; overflow-wrap: normal; }

/* Fonctions de la liste validée rattachées à une étape (panneau). */
.jr-fonctions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.jr-fonction { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.jr-fonction-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.jr-fonction-tete b { min-width: 0; color: var(--navy); line-height: 1.35; overflow-wrap: break-word; }
.jr-fonction-tete .st { flex: none; }
.jr-fonction p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: break-word; }
.jr-fonction-liste { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* Chiffres du jour dans le panneau. */
.jr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.jr-stat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); min-width: 0; }
.jr-stat .l { font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.jr-stat .v { margin-top: 4px; font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.jr-stat .v.txt { font-size: 13px; font-weight: 700; line-height: 1.35; overflow-wrap: break-word; }
.jr-stat.ko { border-color: var(--rouge-bd); background: var(--rouge-bg); }
.jr-stat.ko .v { color: var(--rouge); }

/* Lignes du panneau : plus étroites, sans le nom du processus. La pastille et le restaurant sur la première
   ligne, le résumé dessous, en entier (rien n'est coupé). */
.jr-t-liste { border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; }
.jr-ligne.compact { grid-template-columns: 58px minmax(0, 1fr) 10px; gap: 8px; align-items: start; padding: 8px 8px; font-size: 12.5px; }
.jr-ligne.compact .jr-heure { font-size: 12px; padding-top: 3px; }
.jr-ligne.compact .jr-chevron { align-self: center; }
.jr-l1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.jr-l1 .st { flex: none; }
.jr-l1 .jr-resto { margin-right: 0; min-width: 0; overflow-wrap: break-word; }
.jr-ligne.compact .jr-principal { display: block; margin-top: 3px; white-space: normal; overflow: visible; overflow-wrap: break-word; }

/* Frise des étapes d'une passe, la plus ancienne en haut. */
.jr-frise { list-style: none; margin: 0 0 0 6px; padding: 0; border-left: 2px solid var(--line); }
.jr-frise li { position: relative; display: grid; grid-template-columns: 64px 16px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 5px 0 5px 14px; font-size: 12.5px; line-height: 1.4; }
.jr-frise li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); box-sizing: border-box; }
.jr-frise li.finie::before { background: var(--vert); border-color: var(--vert); }
.jr-frise li.point::before { background: var(--blue-soft); border-color: var(--blue-bd); }
.jr-frise li.jalon::before { background: var(--navy); border-color: var(--navy); }
.jr-frise li.att::before { background: var(--orange); border-color: var(--orange); }
.jr-frise li.err::before { background: var(--rouge); border-color: var(--rouge); }
.jr-frise li.point { color: var(--ink-2); }
.jr-frise li.err .jr-frise-l { color: var(--rouge); }
.jr-frise-h { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.jr-frise-e { font-weight: 800; color: var(--navy); }
.jr-frise-l { min-width: 0; overflow-wrap: break-word; }
.jr-frise-a { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .jr-live.ok .jr-pt, .cours > .jr-pt { animation: none; }
  .jr-robot, .jr-etape, .jr-chevron { transition: none; }
  .jr-etape:hover { transform: none; }
}

/* ================================================================ 07/10 : la page lisible */
.jr-bloc { margin: 0 0 22px; }
.jr-h2-l { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; }
.jr-h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--navy); }
.jr-h2-s { font-size: 12.5px; color: var(--muted); }
.jr-lien { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.jr-lien:hover { text-decoration: underline; }
.jr-lien:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* (1) La phrase d'état : vert, orange ou rouge, sobre (fond doux, liseré à gauche). */
.jr-etatpage { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 22px; padding: 16px 20px; border-radius: var(--r-sm); border: 1px solid var(--line);
  border-left-width: 5px; background: var(--surface); box-shadow: var(--shadow); }
.jr-etatpage-pt { flex: none; width: 14px; height: 14px; margin-top: 6px; border-radius: 50%; background: var(--na); }
.jr-etatpage-c { min-width: 0; }
.jr-etatpage-t { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.3px; line-height: 1.25; color: var(--navy); }
.jr-etatpage-s { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); }
.jr-etatpage-f { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.jr-etatpage-f b { color: var(--navy); }
.jr-etatpage.vert { border-color: var(--vert-bd); border-left-color: var(--vert); background: var(--vert-bg); }
.jr-etatpage.vert .jr-etatpage-pt { background: var(--vert); }
.jr-etatpage.vert .jr-etatpage-t { color: var(--vert); }
.jr-etatpage.orange { border-color: var(--orange-bd); border-left-color: var(--orange); background: var(--orange-bg); }
.jr-etatpage.orange .jr-etatpage-pt { background: var(--orange); }
.jr-etatpage.orange .jr-etatpage-t { color: var(--orange); }
.jr-etatpage.rouge { border-color: var(--rouge-bd); border-left-color: var(--rouge); background: var(--rouge-bg); }
.jr-etatpage.rouge .jr-etatpage-pt { background: var(--rouge); box-shadow: 0 0 0 4px var(--rouge-bd); }
.jr-etatpage.rouge .jr-etatpage-t { color: var(--rouge); }
.jr-etatpage.inconnu { border-left-color: var(--na); background: var(--surface-2); }

/* (2) Cartes « À faire maintenant » : deux par rangée ; « À savoir » : une liste neutre. */
/* Une carte prend au plus la largeur de sa colonne : sous 400 px de place, une seule carte, aussi large que l'écran (à 390 px,
   la colonne de 400 px faisait défiler l'écran de côté). */
.jr-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); gap: 14px; }
.jr-carte { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-top-width: 4px; border-radius: var(--r-sm); box-shadow: var(--shadow); }
.jr-carte.rouge { border-top-color: var(--rouge); }
.jr-carte.orange { border-top-color: var(--orange); }
.jr-carte-t { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 800; line-height: 1.3; color: var(--navy); }
.jr-carte-t .jr-pt { width: 10px; height: 10px; }
.jr-carte-sous { margin: -4px 0 0 19px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); overflow-wrap: break-word; }
/* « À regarder » : les mêmes cartes, plus discrètes (rien à faire tout de suite). */
.jr-carte.regarder { box-shadow: none; border-top-width: 3px; }
.jr-carte.regarder.orange { border-top-color: var(--orange-bd); }
.jr-carte.regarder .jr-carte-t { font-size: 14px; }
.jr-carte.rouge .jr-carte-t .jr-pt { background: var(--rouge); }
.jr-carte.orange .jr-carte-t .jr-pt { background: var(--orange); }
.jr-carte-l { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); overflow-wrap: break-word; }
.jr-carte-k { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.jr-carte-pied { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.jr-carte-act, .jr-savoir-act, .jr-detail-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jr-details > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 2px 0; }
.jr-details > summary:hover { color: var(--navy); }
.jr-details-c { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.jr-details-c .jr-t-texte { margin: 0; color: var(--ink); }
.jr-detail-alerte p { margin: 0; }
.jr-detail-t { font-weight: 700; color: var(--navy); }
.jr-detail-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jr-savoir { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.jr-savoir-i { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--na); border-radius: var(--r-sm); }
.jr-savoir-c { min-width: 0; }
.jr-savoir-t { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--navy); }
.jr-savoir-x { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.jr-savoir-i .jr-details { margin-top: 6px; }
.jr-savoir-act { flex: none; }

/* (3) Les robots en ce moment : trois tuiles de même hauteur, toujours côte à côte sur ordinateur ; sous 700 px, une seule colonne
   (à 390 px, une tuile de 112 px laissait le nom d'un compte, insécable, déborder de l'écran). */
.jr-robots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
@media (max-width: 700px) { .jr-robots { grid-template-columns: minmax(0, 1fr); } }
.jr-robot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 14px 16px; box-sizing: border-box; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); font: inherit; color: var(--ink); text-align: left; }
button.jr-robot { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.jr-robot:hover { border-color: var(--blue-bd); box-shadow: var(--shadow-raised); }
button.jr-robot:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.jr-robot-nom { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.jr-robot-sous { margin-top: -4px; font-size: 12px; color: var(--muted); }
.jr-robot-etat { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: var(--navy); }
.jr-robot-etat .jr-pt { width: 10px; height: 10px; }
.jr-robot.cours .jr-robot-etat { color: var(--blue); }
.jr-robot.pause .jr-robot-etat { color: var(--rouge); }
.jr-robot.silence .jr-robot-etat { color: var(--orange); }
.jr-robot.vide .jr-robot-etat { color: var(--muted); }
.jr-robot-txt { font-size: 13px; line-height: 1.5; color: var(--ink); overflow-wrap: break-word; }
.jr-robot-pied { font-size: 12px; line-height: 1.5; color: var(--muted); }
.jr-robot-lien { margin-top: auto; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.jr-robot > .jr-lien { margin-top: auto; }
.jr-compte-b { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; }
.jr-compte-l { display: grid; grid-template-columns: 10px auto minmax(0, 1fr) 12px; gap: 8px; align-items: center; width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.jr-compte-l:hover { border-color: var(--blue-bd); }
.jr-compte-l:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.jr-compte-n { font-weight: 700; color: var(--navy); white-space: nowrap; }
.jr-compte-e { min-width: 0; overflow-wrap: break-word; color: var(--ink-2); }
.jr-compte-l.pause { border-color: var(--rouge-bd); background: var(--rouge-bg); }
.jr-compte-l.pause .jr-compte-e { color: var(--rouge); font-weight: 600; }
.jr-compte-l.silence { border-color: var(--orange-bd); background: var(--orange-bg); }
.jr-compte-l.silence .jr-compte-e { color: var(--orange); }
.jr-compte-l:hover .jr-chevron, button.jr-robot:hover .jr-chevron { opacity: 1; transform: translateX(2px); }

/* (4) Données des restaurants : tableau des problèmes, ligne des données non collectées, grille repliée. */
/* Le tableau défile dans son cadre quand il est plus large que la carte (comme la grille) ; le cadre, positionné, garde
   aussi le titre caché de la colonne « Détails » : sans lui, ce titre échappait au rognage des cartes et faisait défiler
   toute la page de côté (540 px à 390 px). */
.jr-probl-cadre { position: relative; overflow-x: auto; }
.jr-probl th, .jr-probl td { font-size: 13px; vertical-align: middle; overflow-wrap: normal; word-break: normal; }
.jr-probl td:nth-of-type(1) { min-width: 140px; }
.jr-probl tbody th { min-width: 140px; }
.jr-probl-q { white-space: nowrap; }
.jr-probl-q .muted { display: block; font-size: 11.5px; }
.jr-probl-b { width: 1%; text-align: right; white-space: nowrap; }
.jr-st-p { margin-left: 4px; vertical-align: middle; }
.jr-ok-l { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13.5px; color: var(--vert); font-weight: 600; }
.jr-ok-l .jr-pt { background: var(--vert); }
.jr-nc { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.jr-nc-t { margin: 0 0 4px; font-weight: 600; color: var(--navy); }
.jr-nc-l { margin: 0; padding-left: 18px; line-height: 1.55; }
.jr-nc + .jr-nc { margin-top: 10px; }
.jr-grille-d { margin-top: 14px; }
.jr-grille-d > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); padding: 4px 0; }
/* La grille tient dans la carte autant que possible ; s'il y a plus de colonnes que de place, elle défile dans son cadre et
   la colonne des restaurants reste en place. */
.jr-grille-cadre { margin-top: 10px; overflow-x: auto; }
.jr-grille { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
.jr-grille th, .jr-grille td { padding: 5px 3px; border-bottom: 1px solid var(--line-2); text-align: center; vertical-align: middle; }
.jr-grille thead th { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); line-height: 1.25; vertical-align: bottom; }
.jr-grille .jr-g-n { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 700; color: var(--navy); min-width: 110px; max-width: 150px; padding-left: 6px;
  background: var(--surface); box-shadow: 1px 0 0 var(--line-2); }
.jr-grille thead .jr-g-n { color: var(--muted); background: var(--surface-2); }
.jr-g-nom { display: block; margin-bottom: 3px; line-height: 1.3; }
.jr-g-s { display: block; font-weight: 600; text-transform: none; }
.jr-f { display: inline-block; padding: 1px 5px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; }
.jr-f.ok { color: var(--vert); background: var(--vert-bg); border-color: var(--vert-bd); }
.jr-f.vieille { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-bd); }
.jr-f.rouge { color: var(--rouge); background: var(--rouge-bg); border-color: var(--rouge-bd); }
.jr-f.ecartee { color: var(--rouge); background: var(--surface); border-color: var(--rouge); }
.jr-f.nc { color: var(--ink-2); background: var(--chip-2); border-color: var(--line); }
/* Plus de 26 h, mais une donnée qui ne fait pas les chiffres (carte, opérations, clients…) : grise, moins urgent. */
.jr-f.neutre { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.jr-f.vide { color: var(--na); }
.jr-legende { margin: 10px 0 0; font-size: 12px; line-height: 1.9; color: var(--muted); }

/* (5) Processus : une ligne par processus, ses étapes dépliées dessous. */
.jr-procs { padding: 4px 0; }
.jr-proc-tot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); }
.jr-proc + .jr-proc { border-top: 1px solid var(--line-2); }
.jr-proc-l { display: grid; grid-template-columns: 250px minmax(0, 1fr) 84px auto; gap: 16px; align-items: center; padding: 14px 20px; }
.jr-proc-nom { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jr-proc-nom b { font-size: 14px; font-weight: 800; color: var(--navy); }
.jr-proc-nom span { font-size: 12px; line-height: 1.35; color: var(--muted); }
.jr-proc-mode { display: flex; flex-wrap: wrap; gap: 4px; grid-column: 1; grid-row: 2; margin-top: -8px; }
.jr-proc-mode .st { white-space: normal; }
.jr-proc-na { font-size: 12px; }
.jr-proc-etat { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--ink); }
.jr-proc-etat .muted { font-size: 12.5px; }
.jr-proc-n { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.jr-proc-n b { font-size: 22px; font-weight: 800; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.jr-proc-n span { font-size: 11.5px; color: var(--muted); }
.jr-proc-act { grid-column: 4; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.jr-proc.ouvert { background: var(--surface-2); }
.jr-proc-etapes { padding: 0 20px 18px; }
.jr-chaine-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: 0 0 12px; font-size: 12px; }
.jr-proc-etapes .jr-etape { background: var(--surface); }

/* (6) Activité en direct : filtres au-dessus, une ligne régulière par collecte ou par événement. */
.jr-activite .jr-filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.jr-entete { display: grid; grid-template-columns: 76px 138px 160px minmax(0, 1fr) 124px 12px; gap: 12px; padding: 0 10px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.jr-qui { font-size: 12.5px; color: var(--ink-2); overflow-wrap: break-word; }
.jr-ou { min-width: 0; overflow-wrap: break-word; }
.jr-ou .jr-resto { margin-right: 0; }
.jr-quoi { min-width: 0; line-height: 1.45; overflow-wrap: break-word; }
.jr-quoi-s { display: block; font-size: 11.5px; }
.jr-res { justify-self: start; }
.jr-res .st { white-space: nowrap; }
.jr-ligne.erreur .jr-quoi { color: var(--rouge); }
.jr-heure-g { display: flex; flex-direction: column; }
.jr-heure-a { font-size: 11px; color: var(--muted); white-space: nowrap; }
.jr-groupe > .jr-ligne .jr-chevron { font-size: 13px; }
.jr-groupe.ouvert > .jr-ligne { background: var(--surface-2); }
.jr-groupe-l { margin: 2px 0 6px 20px; border-left: 2px solid var(--line); }
.jr-groupe-l > li + li { border-top: 1px solid var(--line-2); }
.jr-t-audit { margin-top: 4px; }
.jr-robot.ok .jr-robot-etat .jr-pt { background: var(--vert); }
.jr-robot.cours .jr-robot-etat .jr-pt { background: var(--blue); animation: jr-pouls-bleu 2s ease-out infinite; }
.jr-robot.pause .jr-robot-etat .jr-pt { background: var(--rouge); }
.jr-robot.silence .jr-robot-etat .jr-pt { background: var(--orange); }
.jr-robot.repos .jr-robot-etat .jr-pt { background: var(--na); }
@media (prefers-reduced-motion: reduce) { .jr-robot.cours .jr-robot-etat .jr-pt { animation: none; } }
.jr-procs + .jr-lecture { margin: 8px 0 0; }
