:root {
  --fond: #0A1013; --carte: #111B20; --bord: #1D2C33; --texte: #E6F1F3; --doux: #8FA6AD;
  --ok: #2DD4BF; --orange: #F59E0B; --rouge: #F87171; --gris: #64748B;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 28px 0 8px; }

/* ---- oeil (dessin de sbyookei-anime.svg) ---- */
.haut { text-align: center; padding-top: 8px; }
.oeil { width: 180px; height: 180px; display: block; margin: 0 auto; }
.oeil .paupiere { transform-box: view-box; transform-origin: 60px 60px; animation: cligner 4.8s ease-in-out infinite; transition: transform .6s ease; }
.oeil .regard { animation: regarder 9.6s ease-in-out infinite; }
.oeil .noeud { transform-box: fill-box; transform-origin: center; animation: pulser 2.4s ease-in-out infinite; }
.oeil .n2 { animation-delay: .8s; } .oeil .n3 { animation-delay: 1.6s; }
.oeil .halo { transform-box: view-box; transform-origin: 60px 60px; animation: respirer 3.2s ease-in-out infinite; }
.oeil .blanc-a, .oeil .blanc-b, .oeil .halo-c { transition: stop-color .6s ease; }
.etat-ok .blanc-a { stop-color: #2DD4BF; } .etat-ok .blanc-b { stop-color: #3B82F6; } .etat-ok .halo-c { stop-color: #2DD4BF; }
.etat-ok .noeud { fill: #2DD4BF; } .etat-ok .trait { stroke: #2DD4BF; }
.etat-orange .blanc-a { stop-color: #FBBF24; } .etat-orange .blanc-b { stop-color: #F97316; } .etat-orange .halo-c { stop-color: #F59E0B; }
.etat-orange .noeud { fill: #FBBF24; } .etat-orange .trait { stroke: #FBBF24; }
.etat-rouge .blanc-a { stop-color: #F87171; } .etat-rouge .blanc-b { stop-color: #DC2626; } .etat-rouge .halo-c { stop-color: #EF4444; }
.etat-rouge .noeud { fill: #F87171; } .etat-rouge .trait { stroke: #F87171; }
.etat-rouge .paupiere { animation: none; transform: scaleY(.06); }   /* panne : oeil ferme */
@keyframes cligner { 0%,88%,100% { transform: scaleY(1); } 91% { transform: scaleY(.06); } 94% { transform: scaleY(1); } }
@keyframes regarder { 0%,18% { transform: translate(0,0); } 24%,40% { transform: translate(-6px,1px); } 46%,62% { transform: translate(6px,-1px); } 68%,100% { transform: translate(0,0); } }
@keyframes pulser { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes respirer { 0%,100% { opacity: .3; transform: scale(1); } 50% { opacity: .55; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .oeil .paupiere, .oeil .regard, .oeil .noeud, .oeil .halo { animation: none; } }

.resume { font-size: 20px; font-weight: 600; margin: 8px 0 2px; }
.maj { color: var(--doux); font-size: 13px; margin: 0; }

/* ---- connexion ---- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 16px; padding: 20px; margin-top: 24px; }
label { display: block; color: var(--doux); font-size: 14px; margin-bottom: 14px; }
input { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 17px; color: var(--texte); background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; }
button { font: inherit; font-size: 16px; color: #0A1013; background: var(--ok); border: 0; border-radius: 10px; padding: 12px 16px; width: 100%; font-weight: 600; }
button.discret { background: transparent; color: var(--doux); border: 1px solid var(--bord); width: auto; font-weight: 400; font-size: 14px; padding: 8px 12px; }
.erreur { color: var(--rouge); min-height: 1.4em; margin: 10px 0 0; }

/* ---- elements ---- */
.groupe { color: var(--doux); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 20px 0 6px; }
.ligne { display: flex; align-items: flex-start; gap: 10px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.pastille { flex: 0 0 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--gris); }
.p-ok { background: var(--ok); } .p-orange { background: var(--orange); } .p-rouge { background: var(--rouge); } .p-pause, .p-inconnu { background: var(--gris); }
.corps { flex: 1; min-width: 0; }
.nom { font-weight: 600; }
.detail { color: var(--doux); font-size: 14px; overflow-wrap: anywhere; }
.heure { color: var(--doux); font-size: 12px; white-space: nowrap; margin-top: 3px; }
.confirmer { color: var(--orange); font-size: 12px; }

/* ---- incidents ---- */
.incidents { list-style: none; padding: 0; margin: 0; }
.incidents li { border-left: 3px solid var(--gris); padding: 6px 10px; margin-bottom: 6px; background: var(--carte); border-radius: 0 10px 10px 0; font-size: 14px; }
.incidents li.i-rouge { border-color: var(--rouge); } .incidents li.i-orange { border-color: var(--orange); }
.incidents .quand { color: var(--doux); font-size: 12px; }
.incidents .vide { color: var(--doux); border: 0; background: none; }
.encours { color: var(--rouge); font-weight: 600; }
.pied { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 28px; }

/* ---- reglages (lot 2) ---- */
.aide { color: var(--doux); font-size: 14px; margin: 0 0 14px; }
.deux { display: flex; gap: 12px; } .deux label { flex: 1; }
label.case { display: flex; align-items: center; gap: 10px; color: var(--texte); font-size: 16px; }
label.case input { width: 22px; height: 22px; margin: 0; }
input[type="time"] { color-scheme: dark; }
button.secondaire { background: transparent; color: var(--ok); border: 1px solid var(--ok); margin-top: 10px; }
button:disabled { opacity: .45; }
.message { min-height: 1.4em; font-size: 14px; margin: 10px 0 0; color: var(--doux); }
.message.ok { color: var(--ok); } .message.ko { color: var(--rouge); }
