/* Le bureau des agents : habillage aux couleurs de DataSuits (charte du 22/10/2026).
   Marine pour les titres et les boutons, bleu accent pour les points et les traits,
   lavande sur le seul bouton « Envoyer », police Onest, aucun texte sous 14,5 px. */
@font-face { font-family: Onest; src: url('/static/polices/Onest.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
:root {
  --marine: #14375B; --profond: #0D2440; --accent: #3898EC; --texte: #475467;
  --bordure: rgba(20,55,91,.14); --clair: #EAF3FC; --tres-clair: #F7FAFD;
  --lavande: #C4B5FD; --lavande-survol: #D2C6FE; --erreur: #8E2020; --erreur-fond: #FDF1F1;
  --ombre: 0 10px 34px rgba(20,55,91,.16); --ombre-forte: 0 18px 48px rgba(20,55,91,.28); --ombre-douce: 0 2px 10px rgba(20,55,91,.08);
  --courbe: cubic-bezier(.32,.72,0,1); --panneau: 440px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Onest, system-ui, sans-serif; font-size: 16px; line-height: 1.55; color: var(--texte);
  background: linear-gradient(to bottom, #E8F3FF 0%, #FFFFFF 100%); overflow: hidden; -webkit-font-smoothing: antialiased; }
h2, h3 { color: var(--marine); font-weight: 800; margin: 0; line-height: 1.2; }
h2 { font-size: 25px; } h3 { font-size: 21px; }
p { margin: 0; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }

#monde { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#monde:active { cursor: grabbing; }
#etiquettes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.etiquette { position: absolute; left: 0; top: 0; pointer-events: auto; border: 1px solid var(--bordure); background: #fff; color: var(--marine);
  font-size: 14.5px; font-weight: 700; line-height: 1; padding: 6px 12px; border-radius: 999px; box-shadow: var(--ombre-douce); white-space: nowrap;
  transition: background .15s var(--courbe), color .15s var(--courbe); will-change: transform; }
.etiquette.survol { background: var(--clair); }
.etiquette.choisie { background: var(--marine); color: #fff; border-color: var(--marine); }
.bulle { position: absolute; left: 0; top: 0; background: #fff; border: 1px solid var(--bordure); border-radius: 999px; padding: 8px 12px;
  display: flex; gap: 5px; box-shadow: var(--ombre-douce); will-change: transform; }
.bulle i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pouls 1.1s infinite both; }
.bulle i:nth-child(2) { animation-delay: .18s; } .bulle i:nth-child(3) { animation-delay: .36s; }
@keyframes pouls { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

/* Barre du haut */
.haut { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.groupe { display: flex; gap: 10px; flex-wrap: wrap; pointer-events: auto; }
.groupe.droite { justify-content: flex-end; }
.jeton { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 999px; background: #fff; border: 1px solid var(--bordure);
  box-shadow: var(--ombre-douce); color: var(--marine); font-weight: 700; font-size: 15.5px; white-space: nowrap; transition: background .15s var(--courbe); }
button.jeton:hover { background: var(--tres-clair); }
.marque img { height: 26px; width: auto; display: block; }
.marque span { padding-left: 12px; border-left: 1px solid var(--bordure); font-weight: 800; }
.point { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(56,152,236,.45); animation: onde 2.2s infinite; }
@keyframes onde { 70% { box-shadow: 0 0 0 9px rgba(56,152,236,0); } 100% { box-shadow: 0 0 0 0 rgba(56,152,236,0); } }
.bouton { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid rgba(20,55,91,.16);
  background: #fff; color: var(--marine); font-weight: 700; font-size: 15.5px; white-space: nowrap; box-shadow: var(--ombre-douce);
  transition: background .15s var(--courbe), box-shadow .15s var(--courbe); }
.bouton:hover { background: var(--tres-clair); }
.bouton.principal { background: var(--marine); color: #fff; border-color: var(--marine); }
.bouton.principal:hover { background: var(--profond); }
.bouton.cle { background: var(--lavande); border-color: var(--lavande); color: var(--marine); }
.bouton.cle:hover { background: var(--lavande-survol); }
.bouton.petit { height: 38px; padding: 0 16px; font-size: 14.5px; box-shadow: none; }
.bouton:disabled { opacity: .55; cursor: default; }

/* Volets sous les jetons */
.volet { position: fixed; top: 74px; left: 16px; width: min(360px, calc(100vw - 32px)); background: #fff; border-radius: 24px; padding: 22px;
  box-shadow: var(--ombre); border: 1px solid rgba(20,55,91,.10); animation: paraitre .2s var(--courbe); z-index: 5; }
.volet h3 { margin-bottom: 12px; }
.volet ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.volet li { display: flex; align-items: baseline; gap: 10px; }
.volet li b { color: var(--marine); font-weight: 800; font-size: 21px; min-width: 30px; }
.jauge { height: 8px; border-radius: 999px; background: var(--clair); overflow: hidden; margin: 10px 0 6px; }
.jauge i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 1.1s var(--courbe); }
.note { font-size: 14.5px; color: var(--texte); }
@keyframes paraitre { from { opacity: 0; } to { opacity: 1; } }

/* Fiche de l'agent, en bas à gauche */
.fiche { position: fixed; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 32px)); background: #fff; border-radius: 24px;
  padding: 22px; box-shadow: var(--ombre); border: 1px solid rgba(20,55,91,.10); animation: paraitre .2s var(--courbe); }
.surtitre { font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--marine); }
.fiche h3 { margin: 4px 0 10px; }
.etat { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--clair); color: var(--marine);
  font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }
.etat::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.etat.attente { background: var(--tres-clair); border: 1px solid var(--bordure); } .etat.attente::before { background: transparent; border: 2px solid var(--marine); }
.etat.alerte { background: var(--erreur-fond); color: var(--erreur); } .etat.alerte::before { background: var(--erreur); }
.fiche p { font-size: 15.5px; }
.fiche .quand { margin-top: 8px; color: var(--marine); font-weight: 500; }
.fiche .bouton { width: 100%; margin-top: 16px; }

/* Panneau de droite */
#panneau { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--panneau), 100vw); background: #fff; box-shadow: var(--ombre-forte);
  display: flex; flex-direction: column; animation: paraitre .2s var(--courbe); z-index: 6; }
.tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: max(20px, env(safe-area-inset-top)) 20px 14px; }
.tete h2 { margin-top: 2px; }
.actions { display: flex; align-items: center; gap: 8px; }
.fermer { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--bordure); background: #fff; color: var(--marine); font-size: 24px; line-height: 1; }
.fermer:hover { background: var(--tres-clair); }
.resume { padding: 0 20px 12px; }
.resume .etat { margin-bottom: 6px; }
.resume .quand { font-size: 15.5px; color: var(--marine); font-weight: 500; }
.onglets { display: flex; gap: 6px; padding: 0 20px; border-bottom: 1px solid var(--bordure); }
.onglets button { border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: 15.5px; color: var(--texte); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets button[aria-selected="true"] { color: var(--marine); border-bottom-color: var(--accent); }
.corps { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.vide { margin: auto; text-align: center; max-width: 300px; }
.message { max-width: 92%; padding: 12px 16px; border-radius: 20px; font-size: 15.5px; overflow-wrap: anywhere; animation: paraitre .2s var(--courbe); }
.message.vous { align-self: flex-end; background: var(--marine); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.message.agent { align-self: flex-start; background: var(--tres-clair); border: 1px solid rgba(20,55,91,.10); border-bottom-left-radius: 6px; }
.message.agent strong, .message.agent h4 { color: var(--marine); }
.message h4 { margin: 10px 0 4px; font-size: 16.5px; font-weight: 800; }
.message p + p, .message ul, .message ol, .message pre { margin-top: 8px; }
.message ul, .message ol { padding-left: 20px; margin-bottom: 0; }
.message li + li { margin-top: 4px; }
.message a { color: var(--marine); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.message code { background: var(--clair); border-radius: 6px; padding: 1px 6px; font-size: 14.5px; }
.message pre { background: var(--clair); border-radius: 12px; padding: 10px 12px; overflow-x: auto; font-size: 14.5px; white-space: pre-wrap; }
.message.erreur { align-self: stretch; max-width: 100%; background: var(--erreur-fond); color: var(--erreur); border: 0; }
.geste { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--marine); font-weight: 500; }
.geste::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pouls 1.1s infinite both; }
.cout { align-self: flex-start; font-size: 14.5px; margin-top: -8px; }
.orateur { font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--marine); margin-bottom: -8px; }
.saisie { display: flex; gap: 10px; align-items: flex-end; padding: 12px 20px; border-top: 1px solid var(--bordure); }
.saisie textarea, #salle textarea { flex: 1; resize: none; border: 1px solid rgba(20,55,91,.22); border-radius: 18px; padding: 11px 14px; font-size: 16px; line-height: 1.45;
  color: var(--marine); background: #fff; max-height: 160px; width: 100%; }
.saisie textarea::placeholder, #salle textarea::placeholder { color: #7C8AA0; }
.pied { display: flex; gap: 18px; flex-wrap: wrap; padding: 0 20px max(14px, env(safe-area-inset-bottom)); font-size: 14.5px; }
.pied a, .volet a, .lien { color: var(--marine); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--accent); }
.bloc { border: 1px solid rgba(20,55,91,.10); border-radius: 20px; padding: 16px; background: var(--tres-clair); }
.bloc h3 { font-size: 17.5px; margin-bottom: 8px; }
.bloc dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15.5px; }
.bloc dt { color: var(--texte); } .bloc dd { margin: 0; color: var(--marine); font-weight: 500; }
.bloc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15.5px; }
.bloc li span { display: block; font-size: 14.5px; }
.bloc li b { color: var(--marine); font-weight: 700; }

/* Fenêtre de réunion */
dialog { border: 0; padding: 0; border-radius: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--ombre-forte); color: var(--texte); }
dialog::backdrop { background: rgba(13,36,64,.45); }
#salle-form { padding: 28px; display: grid; gap: 12px; }
.chapo { font-size: 15.5px; }
#salle label[for], .etiquette-champ { font-weight: 700; color: var(--marine); font-size: 15.5px; margin-top: 6px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille-choix { position: relative; }
.pastille-choix input { position: absolute; opacity: 0; inset: 0; }
.pastille-choix span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(20,55,91,.22); color: var(--marine);
  font-weight: 700; font-size: 15px; background: #fff; cursor: pointer; transition: background .15s var(--courbe); }
.pastille-choix input:checked + span { background: var(--marine); color: #fff; border-color: var(--marine); }
.pastille-choix input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.boutons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.erreur { color: var(--erreur); background: var(--erreur-fond); border-radius: 14px; padding: 10px 14px; font-size: 15px; }

#aide { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(255,255,255,.92); border: 1px solid var(--bordure);
  border-radius: 999px; padding: 7px 16px; font-size: 14.5px; color: var(--marine); box-shadow: var(--ombre-douce); white-space: nowrap; pointer-events: none; }
#accueil { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: linear-gradient(to bottom, #E8F3FF 0%, #FFFFFF 100%);
  z-index: 20; transition: opacity .45s var(--courbe); color: var(--marine); font-weight: 500; text-align: center; padding: 24px; }
#accueil.parti { opacity: 0; pointer-events: none; }
#accueil .secours { display: grid; gap: 8px; margin-top: 8px; }

body.panneau-ouvert .groupe.droite { margin-right: var(--panneau); }
body.panneau-ouvert #aide { left: calc((100vw - var(--panneau)) / 2); }
@media (max-width: 1180px) { #aide { display: none; } }
@media (max-width: 900px) {
  body.panneau-ouvert .groupe.droite { margin-right: 0; }
  #panneau { top: auto; height: min(78vh, 720px); width: 100vw; border-radius: 24px 24px 0 0; }
  body.panneau-ouvert .fiche { display: none; }
  .jeton, .bouton { height: 44px; padding: 0 16px; }
  .marque span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Page de connexion */
body.porte { overflow: auto; display: grid; place-items: center; padding: 24px 16px; }
.entree { width: min(440px, 100%); background: #fff; border-radius: 24px; padding: 36px 30px; box-shadow: var(--ombre); border: 1px solid rgba(20,55,91,.10);
  display: grid; gap: 16px; justify-items: center; text-align: center; }
.entree h1 { color: var(--marine); font-weight: 800; font-size: 32px; line-height: 1.15; margin: 8px 0 0; }
.entree p { font-size: 16.5px; line-height: 1.65; }
.entree .bouton { width: 100%; text-decoration: none; margin-top: 6px; }
