/* Appli Maison — éléments communs (navigation, plein écran, fenêtres, messages) */
:root {
  --fond: #fff6ee; --fond2: #ffe9dc; --carte: #ffffff; --texte: #2b2233; --doux: #7d6f86; --ligne: #f1e4dc;
  --ombre: 0 10px 30px rgba(120, 60, 30, .10); --rayon: 24px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--texte);
  font-family: "Nunito", "Segoe UI Rounded", "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1100px 600px at 20% -15%, var(--teinte, var(--fond2)), transparent 65%), var(--fond);
  transition: background .4s;
}
button { font: inherit; border: 0; cursor: pointer; color: inherit; margin: 0; }
.page { max-width: 980px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }

/* Barre de navigation : appareil (Clim / Alarme) à gauche, vue de la clim à sa droite */
.nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: nowrap; }
.seg { flex: none; display: inline-flex; background: var(--carte); border-radius: 999px; padding: 4px; box-shadow: var(--ombre); }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-weight: 800; font-size: 13.5px;
  color: var(--doux); text-decoration: none; white-space: nowrap; }
.seg a .i { font-size: 16px; line-height: 1; }
.seg.appareil a.on { background: #2b2233; color: #fff; }
.seg.vue a.on { background: var(--acc1, #2b2233); color: #fff; }
.enligne { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 13px; color: var(--doux); white-space: nowrap; min-width: 0; }
.point { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #b8aebf; }
.point.ok { background: #1fb57a; box-shadow: 0 0 0 4px rgba(31, 181, 122, .18); }
.point.ko { background: #d4432b; }
.point.vieux { background: #f0a020; }
.plein-btn, .engrenage { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--carte); box-shadow: var(--ombre); color: var(--texte);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 18px; }
.plein-btn svg { width: 18px; height: 18px; }
.retour { display: inline-flex; align-items: center; background: var(--carte); border-radius: 999px; padding: 10px 16px; box-shadow: var(--ombre);
  font-weight: 800; font-size: 14px; color: var(--texte); text-decoration: none; white-space: nowrap; }
/* La barre ne déborde jamais : le nom de la vue active se raccourcit s'il manque de place */
.nav { min-width: 0; }
.seg.vue { flex: 0 1 auto; min-width: 0; }
.seg.vue a.on { min-width: 0; }
.seg a .l { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .page { padding-left: 10px; padding-right: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .nav { gap: 6px; }
  .seg { padding: 3px; }
  .seg a { padding: 7px 9px; font-size: 13px; gap: 5px; }
  .seg a .i { font-size: 15px; }
  .seg a:not(.on) .l { display: none; }
  .enligne > span:last-child { display: none; }
  .plein-btn, .engrenage { width: 34px; height: 34px; border-radius: 11px; }
}

/* Message bref */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 200%); background: var(--texte); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-weight: 800; transition: transform .3s; z-index: 30; max-width: calc(100% - 24px); text-align: center; }
.toast.vu { transform: translate(-50%, 0); }

/* Fenêtre de confirmation */
.voile { position: fixed; inset: 0; background: rgba(30, 20, 35, .45); display: none; align-items: flex-end; justify-content: center; z-index: 20;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
.voile.vu { display: flex; }
@media (min-width: 721px) { .voile { align-items: center; } }
.feuille { width: 100%; max-width: 440px; background: var(--carte); border-radius: 28px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); text-align: center; }
.feuille .gros { font-size: 46px; }
.feuille h3 { margin: 6px 0 8px; font-size: 21px; font-weight: 900; }
.feuille p { margin: 0 0 14px; color: var(--doux); font-weight: 700; line-height: 1.4; }
.feuille .avert { display: none; text-align: left; background: #fff1ee; color: #b4322f; border-radius: 16px; padding: 12px 14px; font-weight: 800; font-size: 14px; margin-bottom: 14px; }
.feuille .avert.vu { display: block; }
.feuille button { display: block; width: 100%; font-weight: 900; font-size: 16px; padding: 15px; border-radius: 18px; }
.feuille .ok { color: #fff; background: linear-gradient(135deg, #ff6b3d, #ffb03b); }
.feuille .ok.froid { background: linear-gradient(135deg, #2f7bff, #33c3ff); }
.feuille .ok.armee { background: linear-gradient(135deg, #e5484d, #ff8a65); }
.feuille .ok.nuit { background: linear-gradient(135deg, #5b5bd6, #9d8cff); }
.feuille .ok.desarmee { background: linear-gradient(135deg, #1fb57a, #6fd6a8); }
.feuille .ok.danger { background: #e5484d; }
.feuille .non { margin-top: 8px; background: var(--fond); color: var(--texte); }

/* Code de l'alarme (appli autonome) */
.feuille .code { display: block; width: 100%; margin: 0 0 12px; padding: 14px; border: 2px solid var(--ligne); border-radius: 16px; font: inherit; font-size: 22px; font-weight: 900; text-align: center; letter-spacing: 6px; background: var(--fond); color: var(--texte); }
.feuille .code::placeholder { font-size: 15px; letter-spacing: 0; font-weight: 700; }
.feuille .code[hidden] { display: none; }
