:root{--fond:#F3F7FA;--surface:#FFFFFF;--surface2:#E8EFF5;--texte:#0B121D;--doux:#53657A;--accent:#0E9FBF;
--accent-texte:#FFFFFF;--bord:#D5E0EA;--ok:#14965A;--ko:#C9343F;--attente:#B7791F;--ombre:0 1px 2px rgba(11,18,29,.06),0 8px 24px rgba(11,18,29,.06);
--rayon:18px;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color-scheme:light}
@media (prefers-color-scheme:dark){:root{--fond:#0B121D;--surface:#121D2C;--surface2:#18273A;--texte:#E8F1F8;
--doux:#8EA3B8;--accent:#22C7E8;--accent-texte:#06222B;--bord:#22344B;--ok:#3DDC97;--ko:#FF6B75;--attente:#F5B94A;
--ombre:0 1px 2px rgba(0,0,0,.3),0 8px 28px rgba(0,0,0,.35);color-scheme:dark}}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--fond);color:var(--texte);display:flex;flex-direction:column;min-height:100dvh;
-webkit-tap-highlight-color:transparent;font-size:16px;line-height:1.45}
body::before{content:"";position:fixed;inset:-30vh -20vw auto auto;width:70vw;height:70vh;pointer-events:none;
background:radial-gradient(closest-side,color-mix(in srgb,var(--accent) 18%,transparent),transparent);z-index:0}
[hidden]{display:none!important}
.tete{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:12px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;
background:color-mix(in srgb,var(--fond) 82%,transparent);backdrop-filter:blur(14px);border-bottom:1px solid var(--bord)}
.orbe{border-radius:50%;filter:drop-shadow(0 0 10px color-mix(in srgb,var(--accent) 45%,transparent))}
.orbe.grande{animation:respire 4s ease-in-out infinite}
@keyframes respire{50%{transform:scale(1.05);filter:drop-shadow(0 0 22px color-mix(in srgb,var(--accent) 60%,transparent))}}
@media (prefers-reduced-motion:reduce){.orbe.grande{animation:none}}
.titre{flex:1;min-width:0}.titre h1{margin:0;font-size:1.15rem;letter-spacing:.02em}
.titre p{margin:0;font-size:.75rem;color:var(--doux);letter-spacing:.08em;text-transform:uppercase}
.pastilles{display:flex;gap:6px}
.pastille{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:99px;background:var(--surface2);
font-size:.75rem;color:var(--doux);font-weight:600}
.pastille i{width:8px;height:8px;border-radius:50%;background:var(--doux)}
.pastille.ok i{background:var(--ok);box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 25%,transparent)}
.pastille.ko i{background:var(--ko)}
main{flex:1;position:relative;z-index:1;width:100%;max-width:760px;margin:0 auto;display:flex;flex-direction:column}
.vue{flex:1;display:flex;flex-direction:column;padding:16px;padding-bottom:calc(88px + env(safe-area-inset-bottom))}
#v-discuter{padding-bottom:0}
h2{font-size:1.35rem;margin:.2em 0 .7em;text-wrap:balance}
.carte-centre{align-items:center;justify-content:center;text-align:center;gap:6px}
.carte-centre p{max-width:34ch;color:var(--doux)}
.note{color:var(--doux);font-size:.88rem}
#accueil-erreur{color:var(--ko);min-height:1.4em}
.fil{list-style:none;margin:0;padding:8px 0 16px;flex:1;display:flex;flex-direction:column;gap:10px}
.bulle{max-width:86%;padding:10px 14px;border-radius:var(--rayon);white-space:pre-wrap;overflow-wrap:anywhere;
animation:entre .22s ease-out}
@keyframes entre{from{opacity:0;transform:translateY(6px)}}
.bulle.moi{align-self:flex-end;background:var(--accent);color:var(--accent-texte);border-bottom-right-radius:6px}
.bulle.nala{align-self:flex-start;background:var(--surface);box-shadow:var(--ombre);border-bottom-left-radius:6px}
.bulle.systeme{align-self:center;background:transparent;color:var(--doux);font-size:.85rem;text-align:center}
.bulle .actions{margin-top:8px;padding:8px 10px;border-radius:10px;background:color-mix(in srgb,var(--attente) 14%,transparent);
font-size:.85rem}
.bulle.attente{display:flex;gap:5px;padding:14px 16px}
.bulle.attente span{width:7px;height:7px;border-radius:50%;background:var(--doux);animation:point 1.2s infinite}
.bulle.attente span:nth-child(2){animation-delay:.15s}.bulle.attente span:nth-child(3){animation-delay:.3s}
@keyframes point{40%{transform:translateY(-4px);background:var(--accent)}}
.saisie{position:sticky;bottom:calc(64px + env(safe-area-inset-bottom));display:flex;gap:8px;align-items:flex-end;padding:10px 0 12px;
background:linear-gradient(transparent,var(--fond) 30%)}
textarea{flex:1;resize:none;max-height:9em;padding:12px 14px;border-radius:22px;border:1px solid var(--bord);
background:var(--surface);color:var(--texte);font:inherit;box-shadow:var(--ombre)}
textarea:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#envoyer{flex:none;width:48px;height:48px;border-radius:50%;border:0;background:var(--accent);color:var(--accent-texte);
display:grid;place-items:center;cursor:pointer;transition:transform .15s}
#envoyer:active{transform:scale(.92)}#envoyer:disabled{opacity:.5}
#envoyer svg{width:22px;height:22px;fill:currentColor}
.liste{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.liste li{display:flex;gap:14px;align-items:baseline;padding:14px 16px;background:var(--surface);border-radius:14px;box-shadow:var(--ombre)}
.liste time{font-variant-numeric:tabular-nums;font-weight:700;color:var(--accent);white-space:nowrap}
.vide{color:var(--doux);text-align:center;padding:32px 0}
.grille{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.machine{padding:16px;background:var(--surface);border-radius:16px;box-shadow:var(--ombre)}
.machine h3{margin:0 0 10px;font-size:1rem;display:flex;align-items:center;gap:8px}
.machine h3 i{width:10px;height:10px;border-radius:50%;background:var(--doux)}
.machine.ok h3 i{background:var(--ok)}.machine.ko h3 i{background:var(--ko)}
.jauge{margin:8px 0}.jauge div{display:flex;justify-content:space-between;font-size:.85rem;color:var(--doux)}
.jauge b{color:var(--texte);font-variant-numeric:tabular-nums}
.jauge>span{display:block;height:6px;border-radius:99px;background:var(--surface2);margin-top:4px;overflow:hidden}
.jauge>span::after{content:"";display:block;height:100%;width:var(--v);background:var(--accent);border-radius:inherit}
.jauge.haut>span::after{background:var(--ko)}
#alertes .alerte{margin-top:12px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--ko) 14%,transparent)}
.pied-etat{margin-top:auto;padding-top:24px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.discret{border:1px solid var(--bord);background:transparent;color:var(--ko);padding:10px 14px;border-radius:12px;font:inherit;cursor:pointer}
.onglets{position:fixed;z-index:3;left:0;right:0;bottom:0;display:flex;justify-content:center;gap:4px;
padding:6px 12px calc(6px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--surface) 88%,transparent);
backdrop-filter:blur(14px);border-top:1px solid var(--bord)}
.onglets button{flex:1;max-width:160px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px;border:0;
background:transparent;color:var(--doux);font:600 .72rem/1.2 inherit;border-radius:12px;cursor:pointer}
.onglets svg{width:24px;height:24px;fill:currentColor}
.onglets button[aria-current=page]{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,transparent)}
.bulle .lien{display:block;margin:8px 0 2px;padding:10px 14px;border-radius:12px;background:var(--accent);color:var(--accent-texte);text-align:center;text-decoration:none;font-weight:600}
.tete-sondes{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.tete-sondes h2{margin:0}
.periodes{display:inline-flex;padding:3px;border-radius:99px;background:var(--surface2)}
.periodes button{border:0;background:transparent;color:var(--doux);font:600 .82rem/1 inherit;padding:8px 14px;border-radius:99px;cursor:pointer;min-height:36px}
.periodes button[aria-pressed=true]{background:var(--surface);color:var(--texte);box-shadow:var(--ombre)}
#sondes-resume{margin:6px 0 14px;min-height:1.3em}
#sondes-resume.ko{color:var(--ko);font-weight:600}
.sondes{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}
.sonde{-webkit-user-select:none;user-select:none;padding:14px 16px 12px;background:var(--surface);border-radius:16px;box-shadow:var(--ombre);min-width:0}
.sonde.ko{box-shadow:var(--ombre),inset 0 0 0 2px var(--ko)}
.sonde h3{margin:0;font-size:1rem;display:flex;align-items:center;gap:8px}
.sonde h3 i{flex:none;width:10px;height:10px;border-radius:50%;background:var(--doux)}
.sonde.ok h3 i{background:var(--ok);box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 22%,transparent)}
.sonde.ko h3 i{background:var(--ko)}.sonde.attente h3 i{background:var(--attente)}
.sonde h3 span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sonde h3 em{font-style:normal;font-size:.78rem;font-weight:600;color:var(--doux)}
.sonde.ko h3 em{color:var(--ko)}
.chiffres{display:flex;gap:18px;margin:10px 0 8px}
.chiffres div{display:flex;flex-direction:column;min-width:0}
.chiffres b{font-size:1.25rem;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.chiffres small{color:var(--doux);font-size:.72rem}
.courbe{display:block;width:100%;height:84px;touch-action:pan-y;cursor:crosshair}
.courbe .aire{fill:color-mix(in srgb,var(--accent) 16%,transparent)}
.courbe .trait{fill:none;stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
.courbe .repere{stroke:var(--bord);stroke-width:1;vector-effect:non-scaling-stroke;stroke-dasharray:3 4}
.courbe .curseur{stroke:var(--texte);stroke-width:1;vector-effect:non-scaling-stroke;opacity:.55}
.courbe .b-ok{fill:var(--ok)}.courbe .b-ko{fill:var(--ko)}.courbe .b-mi{fill:var(--attente)}.courbe .b-vide{fill:var(--surface2)}
.axe{display:flex;justify-content:space-between;gap:8px;font-size:.72rem;color:var(--doux);font-variant-numeric:tabular-nums;margin-top:4px}
.axe .lecture{color:var(--texte);font-weight:600;text-align:center;flex:1}
