:root {
  --bleu: #231F20; --bleu-2: #C8412A; --jaune: #F5C400; --brun: #8A5A2B; --or: #E8742A; --or-f: #FDEEE6;
  --fond: #F2F4F7; --carte: #FFFFFF; --texte: #1A1A1A; --doux: #5B6470; --trait: #DCE1E8;
  --vert: #2E7D4F; --orange: #D9822B; --rouge: #C0392B; --gris: #8A939E;
  --vert-f: #E5F3EA; --orange-f: #FCEFE0; --rouge-f: #FBE7E5; --jaune-f: #FFF6D1;
  --rayon: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--fond); color: var(--texte); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; font-family: Georgia, 'Times New Roman', serif; }
h2 { font-size: 1.25rem; color: var(--bleu); }
h3 { font-size: 1.05rem; color: var(--bleu); }
.barre { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 10px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--bleu); color: #fff; border-bottom: 3px solid var(--or); }
.barre-logo { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 8px; padding: 1px; }
.barre-titre { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.barre-titre strong { font-size: 1.05rem; letter-spacing: .06em; font-family: Georgia, 'Times New Roman', serif; }
.barre-titre span { font-size: .82rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-droite { display: flex; align-items: center; gap: 10px; flex: none; }
.pastille { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.14); }
.pastille::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }
.pastille.horsligne::before { background: var(--orange); }
.btn-lien { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; padding: 4px; }
.bandeau { background: var(--jaune-f); color: var(--texte); padding: 10px 16px; font-size: .92rem; border-bottom: 1px solid #EAD98A; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.etroit { max-width: 520px; margin: 0 auto; }
.carte { background: var(--carte); border-radius: var(--rayon); padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.chargement { text-align: center; color: var(--doux); padding: 40px 0; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--trait); border-radius: 10px; background: #fff; color: var(--texte); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--jaune); border-color: var(--bleu); }
textarea { min-height: 80px; resize: vertical; }
.aide { font-size: .84rem; color: var(--doux); margin: 4px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 10px; border: 1px solid var(--bleu); background: var(--bleu); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.secondaire { background: #fff; color: var(--bleu); }
.btn.jaune { background: var(--jaune); border-color: var(--jaune); color: var(--bleu); }
.btn.danger { background: #fff; color: var(--rouge); border-color: var(--rouge); }
.btn.petit { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn.plein { width: 100%; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .grille2 { grid-template-columns: 1fr; } }

/* écran agent */
.service-entete { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.service-site { font-size: 1.2rem; font-weight: 700; color: var(--bleu); }
.service-horaire { color: var(--doux); }
.grand-bouton { width: 100%; min-height: 96px; font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; border-radius: 16px; border: 0; cursor: pointer; margin-top: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.grand-bouton.debut { background: var(--jaune); color: var(--bleu); }
.grand-bouton.fin { background: var(--bleu); color: #fff; }
.grand-bouton:disabled { opacity: .6; }
.gps { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fond); font-size: .92rem; }
.gps .point { width: 12px; height: 12px; border-radius: 50%; background: var(--gris); flex: none; }
.gps.ok .point { background: var(--vert); } .gps.loin .point { background: var(--rouge); } .gps.moyen .point { background: var(--orange); }
.resultat { margin-top: 12px; padding: 12px; border-radius: 10px; font-size: .95rem; }
.resultat.valide { background: var(--vert-f); } .resultat.reserve { background: var(--orange-f); } .resultat.anomalie { background: var(--rouge-f); } .resultat.attente { background: var(--jaune-f); }
.resultat ul { margin: 6px 0 0; padding-left: 18px; }
.urgence { display: flex; gap: 10px; flex-wrap: wrap; }
.urgence a { flex: 1 1 140px; text-align: center; padding: 14px; border-radius: 12px; background: var(--rouge); color: #fff; font-weight: 700; text-decoration: none; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.b-valide, .b-vert, .b-faible { background: var(--vert-f); color: var(--vert); }
.b-reserve, .b-orange, .b-moyenne, .b-moyen { background: var(--orange-f); color: #A55C12; }
.b-anomalie, .b-rouge, .b-haute, .b-eleve { background: var(--rouge-f); color: var(--rouge); }
.b-critique { background: var(--rouge); color: #fff; }
.b-gris, .b-cloturee { background: #ECEFF3; color: var(--doux); }
.b-ouverte, .b-transmise_direction { background: var(--jaune-f); color: #8A3A12; }
.b-attente { background: var(--jaune-f); color: #8A3A12; }

/* listes */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 12px 0; border-bottom: 1px solid var(--trait); }
.liste > li:last-child { border-bottom: 0; }
.liste .ligne1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.petit-texte { font-size: .86rem; color: var(--doux); }
.vide { color: var(--doux); font-style: italic; }

/* encadrement */
.onglets { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.onglets button { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--trait); background: #fff; color: var(--bleu); font-weight: 600; cursor: pointer; }
.onglets button.actif { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.onglets .compteur { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--rouge); color: #fff; font-size: .75rem; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tuile { background: #fff; border-radius: var(--rayon); padding: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.tuile .valeur { font-size: 2rem; font-weight: 800; color: var(--bleu); line-height: 1.1; }
.tuile .libelle { font-size: .86rem; color: var(--doux); }
.tuile.alerte .valeur { color: var(--rouge); }
.tuile.bon .valeur { color: var(--vert); }
#carte { height: 380px; border-radius: var(--rayon); z-index: 1; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--doux); margin-top: 8px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.tableau-boite { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--doux); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 2px solid var(--trait); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--trait); vertical-align: top; }
tr.retard td:first-child { box-shadow: inset 3px 0 0 var(--rouge); }
.deux-colonnes { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 900px) { .deux-colonnes { grid-template-columns: 1fr; } }
details.formulaire > summary { cursor: pointer; font-weight: 700; color: var(--bleu); list-style: none; }
details.formulaire > summary::before { content: "+ "; }
details.formulaire[open] > summary::before { content: "− "; }
.integrite { padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-bottom: 10px; }
.integrite.ok { background: var(--vert-f); color: var(--vert); } .integrite.ko { background: var(--rouge-f); color: var(--rouge); }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1A1A1A; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 2000; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: .95rem; }
.toast.erreur { background: var(--rouge); }

.presence { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.presence .choix { display: flex; gap: 6px; }
.presence .choix button { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--trait); background: #fff; cursor: pointer; font-size: .86rem; font-weight: 600; }
.presence .choix button.on-present { background: var(--vert); color: #fff; border-color: var(--vert); }
.presence .choix button.on-absent { background: var(--rouge); color: #fff; border-color: var(--rouge); }

@media print {
  .barre, .onglets, .bandeau, .no-print { display: none !important; }
  body { background: #fff; }
}
.affiche { text-align: center; padding: 30px; }
.affiche .code { font-size: 4rem; font-weight: 900; letter-spacing: .2em; color: var(--bleu); margin: 16px 0; }
.affiche #qr { display: inline-block; margin: 10px auto; }

/* onglets du bas (téléphone) */
body:has(.nav-bas) main { padding-bottom: 92px; }
.nav-bas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; background: #fff; border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(16,24,40,.06); }
.nav-bas button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 10px; border: 0; background: none; color: var(--doux); font-size: .78rem; font-weight: 600; cursor: pointer; }
.nav-bas button span { font-size: 1.25rem; line-height: 1; }
.nav-bas button.actif { color: var(--bleu); box-shadow: inset 0 3px 0 var(--jaune); }

/* fenêtres par-dessus : caméra, alarme, photo */
.voile { position: fixed; inset: 0; z-index: 3000; background: rgba(35,20,15,.82); display: flex; align-items: center; justify-content: center; padding: 16px; }
.voile-boite { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 420px; text-align: center; }
.voile-boite video { width: 100%; border-radius: 12px; background: #000; max-height: 55vh; object-fit: cover; margin: 8px 0; }
.voile-boite video.miroir { transform: scaleX(-1); }
.voile-boite .rangee { justify-content: center; margin-top: 10px; }
.voile.alarme { background: rgba(192,57,43,.92); }
.alarme-heure { font-size: 3.2rem; font-weight: 900; color: var(--rouge); line-height: 1; margin-bottom: 8px; }

/* plein temps */
.horloge-carte { text-align: center; background: var(--bleu); color: #fff; }
.horloge-carte .petit-texte { color: rgba(255,255,255,.85); }
.horloge { font-size: 3.4rem; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.interrupteur { display: flex; align-items: center; gap: 12px; font-weight: 600; margin: 8px 0; cursor: pointer; }
.interrupteur input { width: 46px; height: 26px; appearance: none; -webkit-appearance: none; background: #CBD3DD; border-radius: 99px; position: relative; flex: none; cursor: pointer; padding: 0; border: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.interrupteur input:checked { background: var(--vert); }
.interrupteur input:checked::after { left: 23px; }
h4 { margin: 16px 0 4px; color: var(--brun); font-size: .95rem; }
.lecteur-etat { padding: 10px 12px; background: var(--fond); border-radius: 10px; margin: 8px 0; font-size: .92rem; }

/* formation */
.jauge { height: 10px; background: #E6EAF0; border-radius: 99px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--vert); }
li.cliquable { cursor: pointer; }
li.cliquable:hover { background: var(--fond); }
.cours h3 { margin-top: 18px; }
.cours ul { padding-left: 20px; }
.cours li { margin: 4px 0; }
.question { border: 1px solid var(--trait); border-radius: 10px; margin: 0 0 12px; padding: 10px 12px; }
.question legend { font-weight: 700; padding: 0 4px; }
.choix-q { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 6px 0; padding: 6px; border-radius: 8px; }
.choix-q input { width: auto; margin-top: 3px; }
.question.faux { border-color: var(--rouge); }
.question.juste { border-color: var(--vert); }
.choix-q.bonne-reponse { background: var(--vert-f); }

/* guide de l'agent */
.guide-entete { display: flex; gap: 14px; align-items: center; }
.guide-entete img { width: 56px; height: 68px; object-fit: contain; }
.guide-entete h2 { margin: 0; }
.guide-sujet { padding: 0; overflow: hidden; }
.guide-sujet summary { display: flex; align-items: center; gap: 12px; padding: 16px; font-weight: 700; color: var(--bleu); cursor: pointer; list-style: none; font-size: 1.02rem; }
.guide-sujet summary::-webkit-details-marker { display: none; }
.guide-sujet summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--brun); }
.guide-sujet[open] summary::after { content: "−"; }
.guide-sujet > :not(summary) { margin-left: 16px; margin-right: 16px; }
.guide-sujet > :last-child { margin-bottom: 16px; }
.guide-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--jaune); color: var(--bleu); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.guide-etapes { padding-left: 22px; }
.guide-etapes li { margin: 0 0 10px; padding-left: 4px; }
.guide-etapes li::marker { font-weight: 800; color: var(--brun); }
.guide-note { background: var(--jaune-f); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }
.nav-bas button { font-size: .72rem; }
.pin-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; font-weight: 800; letter-spacing: .15em; color: var(--bleu); }

/* bandeau d'urgence publié par la direction */
.bandeau-urgence{background:var(--rouge);color:#fff;padding:12px 16px;font-size:.95rem;line-height:1.4;border-bottom:2px solid #8e2318}
.bandeau-urgence strong{display:block;font-size:1.02rem}
.info-dir{border-top:1px solid #e3e7ee;padding:10px 0}
.info-dir:first-of-type{border-top:0}

/* ---------- ASG : niveaux de vue du directeur, cahier de bord, finance */
.niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.niveaux button { padding: 12px 10px; border-radius: 12px; border: 2px solid var(--bleu); background: #fff; color: var(--bleu); font-weight: 800; font-size: 1rem; cursor: pointer; }
.niveaux button.actif { background: var(--bleu); color: #fff; }
.onglets { margin-top: 0; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: #EEF3FA; }
.c { text-align: center; } .d { text-align: right; white-space: nowrap; }
.barre-h { height: 10px; background: #E3ECF7; border-radius: 99px; overflow: hidden; } .barre-h span { display: block; height: 100%; background: var(--bleu-2); border-radius: 99px; }
.histo { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.histo-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.histo-barre { width: 100%; max-width: 46px; background: var(--bleu-2); border-radius: 6px 6px 0 0; min-height: 2px; }
.histo-val { font-size: .68rem; color: var(--doux); margin-bottom: 3px; white-space: nowrap; } .histo-lib { font-size: .78rem; margin-top: 4px; color: var(--doux); }
@media print { .niveaux { display: none !important; } }

/* ---------- Identité BSI : rouge, orange, noir */
.niveaux button.site-web { border-color: var(--or); background: var(--or-f); color: var(--bleu); }
.niveaux button.site-web:hover { background: var(--or); }
.nav-bas button[data-m="site"] { color: #9E2F1C; }
.marque { font-family: Georgia, 'Times New Roman', serif; font-size: 1.5rem; font-weight: 700; letter-spacing: .12em; color: var(--bleu); margin-top: 6px; }
.devise { color: #9E2F1C; font-style: italic; font-family: Georgia, 'Times New Roman', serif; margin: 2px 0 6px; }
.filet-or { width: 70px; height: 3px; background: var(--or); border: 0; border-radius: 3px; margin: 8px auto; }
.contact-asg { text-align: center; font-size: .88rem; color: var(--doux); }
.contact-asg a { color: var(--bleu); font-weight: 700; text-decoration: none; white-space: nowrap; }
.preset-horaires { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.preset-horaires .aide { margin: 0 4px 0 0; }

/* ---------- anti-zoom et confort d'application native */
html, body { touch-action: pan-x pan-y; }
html { overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; overscroll-behavior-y: none; }
.barre, .nav-bas, .btn, button, summary, .niveaux, .onglets { -webkit-user-select: none; user-select: none; }
input, select, textarea { font-size: 16px; }
.leaflet-container { touch-action: none; }
/* alarmes : choix des jours */
.jours { display: flex; gap: 6px; flex-wrap: wrap; }
.jour { margin: 0; font-weight: 600; cursor: pointer; }
.jour input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jour span { display: inline-block; padding: 8px 12px; border: 1px solid var(--trait); border-radius: 99px; background: #fff; min-width: 46px; text-align: center; }
.jour input:checked + span { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.jour input:focus-visible + span { outline: 2px solid var(--jaune); }
.zone-radio { margin: 12px 0 2px; color: #9E2F1C; font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; }
/* outils du téléphone */
.outils-boite { max-width: 480px; max-height: 88vh; overflow-y: auto; text-align: left; }
.outil { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.outil:last-child { border-bottom: 0; }
.outil .interrupteur { margin: 0; }
.pastille.faible { background: var(--rouge); }

[hidden] { display: none !important; }

/* ---------- signature du concepteur (lien vers nibarkamedia.com) */
.signature-nibarka { text-align: center; padding: 6px 0 12px; font-size: .68rem; line-height: 1; }
.signature-nibarka a { color: var(--doux, #8a94a6); text-decoration: none; opacity: .75; letter-spacing: .2px; }
.signature-nibarka a:hover, .signature-nibarka a:focus { opacity: 1; text-decoration: underline; }
body:has(.nav-bas) main { padding-bottom: 8px; }
body:has(.nav-bas) .signature-nibarka { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
@media print { .signature-nibarka { display: none !important; } }

/* ---------- installation de l'application (PWA) et préparation du téléphone */
.feuille-voile { position: fixed; inset: 0; z-index: 3500; background: rgba(35,20,15,0); display: flex; align-items: flex-end; justify-content: center; transition: background .25s; }
.feuille-voile.ouverte { background: rgba(35,20,15,.6); }
.feuille { background: #fff; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.2); transform: translateY(100%); transition: transform .25s ease-out; max-height: 92vh; overflow: auto; }
.feuille-voile.ouverte .feuille { transform: none; }
@media (min-width: 700px) { .feuille-voile { align-items: center; } .feuille { border-radius: 18px; } }
.feuille-poignee { width: 42px; height: 5px; border-radius: 9px; background: var(--trait); margin: 0 auto 12px; }
.feuille-tete { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.feuille-tete img { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 2px 8px rgba(35,31,32,.18); flex: none; }
.feuille-tete h2 { margin: 0 0 2px; font-size: 1.2rem; color: var(--bleu); }
.feuille-atouts { list-style: none; padding: 12px 14px; margin: 0 0 12px; background: var(--or-f); border-radius: 12px; font-size: .92rem; line-height: 1.55; }
.feuille-etapes { margin: 0 0 12px; padding-left: 22px; font-size: .95rem; line-height: 1.5; }
.feuille-etapes li { margin-bottom: 6px; }
.feuille-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.btn-installer { background: var(--jaune); color: var(--bleu); border: 0; border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.btn-installer:hover { filter: brightness(1.05); }
.maj-dispo { position: fixed; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 3200; max-width: 480px; margin: 0 auto; background: var(--bleu); color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: .9rem; }
@media print { .feuille-voile, .btn-installer, .maj-dispo { display: none !important; } }
@media (max-width: 480px) {
  .barre-droite:has(#btn-installer) #batterie { display: none; }
  .btn-installer { padding: 5px 10px; font-size: .74rem; }
  .barre-titre { min-width: 0; }
}

/* ---------- Programme : mise en page « presse » */
.presse { --encre: #231F20; }
.presse-une { border-bottom: 3px double var(--encre); padding-bottom: 12px; margin-bottom: 14px; }
.presse-bandeau { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 3px solid var(--encre); border-bottom: 1px solid var(--encre); padding: 5px 0; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--encre); }
.presse-bandeau span:last-child { font-weight: 400; letter-spacing: .04em; text-transform: none; font-style: italic; }
.presse-titre { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.45rem, 3.4vw, 2.2rem); line-height: 1.15; color: var(--encre); margin: 12px 0 8px; font-weight: 700; }
.presse-chapo { font-family: Georgia, 'Times New Roman', serif; font-size: 1.02rem; line-height: 1.55; color: #3A4256; margin: 0; }
.presse-section { font-family: Georgia, 'Times New Roman', serif; font-size: 1.25rem; color: var(--encre); margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--encre); }
.presse-filtres { margin-top: 4px; }
.presse-jour + .presse-jour { margin-top: 18px; }
.presse-rubrique { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 2px solid var(--or); margin-bottom: 10px; padding-bottom: 4px; }
.presse-rubrique h3 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 1.08rem; color: var(--encre); text-transform: capitalize; }
.presse-rubrique span { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--doux); font-weight: 700; }
.presse-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.presse-grille.une { grid-template-columns: 1fr; }
.article { background: #fff; border: 1px solid var(--trait); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.article-surtitre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); font-weight: 700; }
.article-une { margin-left: auto; color: var(--brun); }
.article-titre { font-family: Georgia, 'Times New Roman', serif; font-size: 1.12rem; line-height: 1.3; margin: 2px 0 0; color: var(--encre); font-weight: 400; }
.article-titre span { font-weight: 700; }
.article-signature { font-size: .8rem; color: var(--doux); font-style: italic; }
.article-chapo { margin: 4px 0 0; font-size: .92rem; line-height: 1.5; color: #333; }
.article-pied { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--trait); }
.article.etat-manque { background: var(--rouge-f); border-color: #EBC3BE; }
.article.etat-en_cours { background: var(--jaune-f); }
.article.a-la-une { border: 2px solid var(--encre); padding: 18px 20px; }
.article.a-la-une .article-titre { font-size: 1.5rem; }
.article.a-la-une .article-chapo { font-family: Georgia, 'Times New Roman', serif; font-size: 1.02rem; }
.jauge { height: 8px; border-radius: 99px; background: #E6EBF2; overflow: hidden; margin: 4px 0 2px; }
.jauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--bleu-2), var(--vert)); border-radius: 99px; }

/* ---------- ASG aide (assistant IA) */
.btn-aide { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 2500; background: var(--bleu); color: #fff; border: 2px solid var(--or); border-radius: 99px; padding: 10px 16px; font-weight: 700; font-size: .9rem; box-shadow: 0 6px 18px rgba(35,31,32,.35); cursor: pointer; }
.btn-aide span { color: var(--or); }
body:has(.nav-bas) .btn-aide { bottom: calc(86px + env(safe-area-inset-bottom)); }
.panneau-aide { position: fixed; right: 16px; bottom: 16px; z-index: 3100; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 32px)); background: #fff; border-radius: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.3); display: none; flex-direction: column; overflow: hidden; }
.panneau-aide.ouvert { display: flex; }
@media (max-width: 520px) { .panneau-aide { right: 0; left: 0; bottom: 0; width: 100%; height: 88vh; border-radius: 18px 18px 0 0; } }
.aide-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bleu); color: #fff; }
.aide-tete strong { color: var(--or); font-size: 1.02rem; } .aide-tete .petit-texte { color: rgba(255,255,255,.75); }
.aide-fil { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--fond); }
.aide-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.5; word-wrap: break-word; }
.aide-msg.ia { background: #fff; border: 1px solid var(--trait); align-self: flex-start; border-bottom-left-radius: 4px; }
.aide-msg.moi { background: var(--bleu); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.aide-note { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--trait); font-size: .76rem; color: var(--doux); }
.aide-idees { display: flex; flex-wrap: wrap; gap: 6px; }
.aide-idee { background: #fff; border: 1px solid var(--or); color: var(--bleu); border-radius: 99px; padding: 6px 11px; font-size: .82rem; cursor: pointer; text-align: left; }
.aide-msg.attente { display: flex; gap: 5px; padding: 14px; }
.aide-msg.attente span { width: 7px; height: 7px; border-radius: 50%; background: var(--doux); animation: aide-pt 1s infinite ease-in-out; }
.aide-msg.attente span:nth-child(2) { animation-delay: .15s; } .aide-msg.attente span:nth-child(3) { animation-delay: .3s; }
@keyframes aide-pt { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.aide-saisie { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--trait); background: #fff; }
.aide-saisie textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; margin: 0; }
.aide-pied { font-size: .7rem; color: var(--doux); text-align: center; padding: 0 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; }
@media print { .btn-aide, .panneau-aide { display: none !important; } }

/* =====================================================================
   DESIGN BSI — Bourgou Services International : rouge, orange, noir
   (même application, nouvelle identité visuelle)
   ===================================================================== */
:root {
  --bleu: #231F20; --bleu-2: #C8412A; --jaune: #F39A1E; --or: #E8742A; --or-f: #FDEEE6; --brun: #9E2F1C;
  --fond: #F6F4F3; --trait: #E7E1DE; --doux: #6B6260; --jaune-f: #FFF3E0;
  --rouge-bsi: #C8412A; --orange-bsi: #E8742A; --rayon: 16px;
}
h1, h2, h3, .marque, .presse-titre, .presse-section, .presse-rubrique h3, .article-titre, .zone-radio, .devise, .barre-titre strong { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h2 { font-weight: 800; letter-spacing: -.01em; }
h3 { font-weight: 700; }
.barre { background: linear-gradient(100deg, #A82F18 0%, var(--rouge-bsi) 45%, var(--orange-bsi) 100%); border-bottom: 0; box-shadow: 0 2px 10px rgba(168,47,24,.35); }
.barre-logo { border-radius: 12px; padding: 2px; }
.barre-titre strong { font-weight: 900; letter-spacing: .12em; }
.pastille { background: rgba(0,0,0,.18); }
.carte, .tuile { border-radius: var(--rayon); border: 1px solid var(--trait); box-shadow: 0 2px 6px rgba(35,31,32,.05); }
.tuile .valeur { color: var(--bleu); }
.btn { border-radius: 999px; background: var(--rouge-bsi); border-color: var(--rouge-bsi); font-weight: 700; }
.btn:hover { filter: brightness(1.06); }
.btn.secondaire { background: #fff; color: var(--bleu); border-color: #D9CFCB; }
.btn.jaune { background: var(--jaune); border-color: var(--jaune); color: #231F20; }
.btn.petit { border-radius: 999px; }
.onglets button { border-radius: 999px; }
.onglets button.actif { background: var(--rouge-bsi); border-color: var(--rouge-bsi); }
.niveaux button { border: 0; border-radius: 14px; background: #fff; color: var(--bleu); box-shadow: 0 2px 8px rgba(35,31,32,.08); font-weight: 800; }
.niveaux button:hover { box-shadow: 0 3px 12px rgba(200,65,42,.18); }
.niveaux button.actif { background: linear-gradient(120deg, var(--rouge-bsi), var(--orange-bsi)); color: #fff; }
.nav-bas button.actif { color: var(--rouge-bsi); box-shadow: inset 0 3px 0 var(--orange-bsi); }
.jour input:checked + span { background: var(--rouge-bsi); border-color: var(--rouge-bsi); }
.marque { font-weight: 900; letter-spacing: .2em; color: var(--bleu); }
.devise { font-style: normal; font-weight: 600; color: var(--rouge-bsi); text-transform: uppercase; font-size: .78rem; letter-spacing: .12em; }
.filet-or { background: linear-gradient(90deg, var(--rouge-bsi), var(--orange-bsi)); width: 90px; }
.contact-asg a { color: var(--rouge-bsi); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(232,116,42,.45); border-color: var(--orange-bsi); }
.feuille-atouts { background: var(--or-f); }
.btn-installer { background: #fff; color: var(--rouge-bsi); }
.btn-aide { background: linear-gradient(120deg, var(--rouge-bsi), var(--orange-bsi)); border-color: #fff; }
.btn-aide span { color: #fff; }
.aide-tete { background: linear-gradient(100deg, #A82F18, var(--rouge-bsi) 55%, var(--orange-bsi)); }
.aide-tete strong { color: #fff; }
.aide-msg.moi { background: var(--bleu); }
.aide-idee { border-color: var(--orange-bsi); color: var(--bleu); }
.presse { --encre: #231F20; }
.presse-rubrique { border-bottom-color: var(--orange-bsi); }
.article { border-radius: 14px; }
.article.a-la-une { border-color: var(--rouge-bsi); }
.jauge span { background: linear-gradient(90deg, var(--rouge-bsi), var(--orange-bsi)); }
.maj-dispo { background: var(--bleu); }
