:root {
  --fond: #f4f5f7;
  --carte: #ffffff;
  --texte: #1d2024;
  --pale: #6b7280;
  --bord: #dde1e6;
  --rouge: #c8102e;
  --vert: #1f9d55;
  --bleu: #1e6fd9;
  --gris: #9aa0a6;
  --violet: #a500ff;
  --accent: #c8102e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15171a;
    --carte: #1f2226;
    --texte: #e8eaed;
    --pale: #9aa0a6;
    --bord: #33373d;
    --rouge: #ff5a6e;
    --vert: #3ecf7e;
    --bleu: #5aa2ff;
    --gris: #6b7078;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, select, input, textarea { font: inherit; color: inherit; }
header#entete { position: sticky; top: 0; z-index: 5; background: var(--carte); border-bottom: 1px solid var(--bord); padding: 8px 16px; }
.ligne { display: flex; align-items: center; gap: 8px; }
.ligne.petite { font-size: 13px; color: var(--pale); justify-content: space-between; margin-top: 4px; }
.logo { width: 36px; height: 36px; border-radius: 6px; background: #fff; }
#choix_installation { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond); }
.icone { width: 40px; height: 40px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond); font-size: 20px; cursor: pointer; }
.attente { width: 18px; height: 18px; border: 3px solid var(--bord); border-top-color: var(--accent); border-radius: 50%; animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.alarme { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--rouge); color: #fff; font-weight: 600; }
.etat { margin-top: 4px; font-size: 14px; }
#message_bis { color: var(--pale); }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 80px; }
h2 { font-size: 18px; margin: 16px 0 8px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.carte.cliquable { cursor: pointer; }
.carte.inactive { opacity: 0.5; cursor: default; }
.carte .titre { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.mesure { font-size: 32px; font-weight: 700; }
.consignes { display: flex; gap: 14px; margin-top: 4px; font-size: 18px; }
.c-normal.actif { color: var(--rouge); font-weight: 700; }
.c-reduit.actif { color: var(--vert); font-weight: 700; }
.c-horsgel.actif { color: var(--bleu); font-weight: 700; }
.consignes span { color: var(--gris); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.marche { color: var(--vert); font-weight: 600; animation: clignote 1s steps(2, start) infinite; }
.arret { color: var(--gris); }
@keyframes clignote { to { visibility: hidden; } }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--fond); border: 1px solid var(--bord); }
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.bouton { padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); cursor: pointer; text-align: center; }
a.bouton { text-decoration: none; color: inherit; display: inline-block; }
.bouton.principal { background: var(--accent); color: #fff; border-color: var(--accent); }
.bouton:disabled { opacity: 0.45; cursor: default; }
.barre { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.reglage { margin: 12px 0; }
.reglage label { display: flex; justify-content: space-between; font-weight: 600; }
.reglage input[type=range] { width: 100%; }
.modes { display: flex; gap: 6px; flex-wrap: wrap; }
.modes label { padding: 8px 12px; border: 1px solid var(--bord); border-radius: 20px; cursor: pointer; }
.modes label { position: relative; }
.modes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.modes label:focus-within { outline: 2px solid var(--accent); }
.modes input:checked + span { font-weight: 700; color: var(--accent); }
.interrupteurs label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--bord); padding: 6px 4px; text-align: left; vertical-align: top; }
th { color: var(--pale); font-weight: 600; position: sticky; top: 0; background: var(--carte); }
td.editable { cursor: pointer; text-decoration: underline dotted; }
.defile { overflow-x: auto; max-height: 70vh; }
.formulaire label { display: block; margin: 8px 0 2px; font-size: 14px; color: var(--pale); }
.formulaire input, .formulaire select, .formulaire textarea { width: 100%; padding: 8px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 600px; margin: 0 auto; padding: 12px 14px; border-radius: 10px; background: #222; color: #fff; z-index: 20; }
.panneau { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.panneau .carte { width: 100%; max-width: 420px; }
.langue { padding: 2px 4px; border: 1px solid var(--bord); border-radius: 6px; background: var(--fond); font-size: 13px; }
.suivi { margin-top: 6px; padding: 6px 10px; border-radius: 8px; font-size: 14px; background: var(--fond); border: 1px solid var(--bord); }
.suivi.attente { border-color: #e08a00; color: #b06d00; }
.suivi.ok { border-color: var(--vert); color: var(--vert); }
.actions { white-space: nowrap; text-align: right; }
.actions button { border: 1px solid var(--bord); border-radius: 8px; background: var(--fond); padding: 4px 8px; cursor: pointer; margin-left: 4px; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: var(--fond); }
.etat-alarme { color: var(--rouge); font-weight: 600; }
.etat-silence { color: #b06d00; font-weight: 600; }
.etat-ok { color: var(--vert); }
.compteurs { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; margin: 6px 0; }
.courbe svg { width: 100%; height: auto; display: block; }
.courbe .axe { stroke: var(--bord); stroke-width: 1; }
.courbe text { fill: var(--pale); font-size: 11px; }
.legende { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; margin-top: 6px; }
.legende span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 4px; }
.pale { color: var(--pale); font-size: 14px; }
/* schema anime du circuit frigo */
:root { --fr-chaud: #d64545; --fr-froid: #2f80d1; --fr-tiede: #e0883a; --fr-tech: #3aa66b; }
.schema-frigo { padding: 6px; overflow-x: auto; }
.schema-frigo svg { width: 100%; min-width: 600px; height: auto; display: block; }     /* textes lisibles : defilement horizontal sur telephone */
.schema-frigo .tuyau { fill: none; stroke-width: 10; stroke-linecap: round; stroke-opacity: .35; }
.schema-frigo .tuyau.fin { stroke-width: 6; stroke-opacity: .6; }
.schema-frigo .flux { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 14; opacity: 0; }
.schema-frigo .flux.actif { opacity: 1; animation: flux 1s linear infinite; }
.schema-frigo .flux.actif.inverse { animation-direction: reverse; }
@keyframes flux { to { stroke-dashoffset: -16; } }
.schema-frigo .organe { fill: var(--carte); stroke: var(--pale); stroke-width: 3; }
.schema-frigo .ballon-actif { stroke: var(--accent); stroke-width: 4; animation: clignote-ballon 1.6s ease-in-out infinite; }
@keyframes clignote-ballon { 50% { stroke-opacity: .3; } }
.schema-frigo .moteur { fill: var(--pale); }
.schema-frigo .dent { fill: var(--pale); }
.schema-frigo .axe-moteur { fill: var(--carte); }
.schema-frigo .pale-helice { fill: var(--fr-froid); fill-opacity: .7; }
.schema-frigo .tourne { animation: tourne 1.2s linear infinite; transform-box: fill-box; transform-origin: center; }
.schema-frigo text { fill: var(--texte); font-size: 15px; }
.schema-frigo .titre-organe { font-weight: 700; font-size: 15px; }
.schema-frigo .titre-organe.petit { font-size: 13px; }
.schema-frigo .valeur { font-weight: 700; font-size: 16px; }
.schema-frigo .valeur.grand { font-size: 22px; }
.schema-frigo .pale-svg { fill: var(--pale); font-size: 14px; }
.schema-frigo .etat-marche { fill: var(--vert); font-weight: 700; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .schema-frigo .flux.actif, .schema-frigo .tourne, .schema-frigo .ballon-actif { animation: none; } }
.rouge { color: var(--rouge); }
.bleu { color: var(--bleu); }
