/* PetKit Reprise — interface « suivi du futur » : sombre, vitrée, pictogrammes lumineux.
   Couleurs des graphiques et des états : palette validée (contraste, daltonisme) sur la
   surface #0f1626 ; une couleur d'état n'est jamais seule : toujours pictogramme + texte.
   Pictogrammes : Lucide (ISC) intégrés dans index.html (outils/pictos.py). */
:root {
  color-scheme: dark;
  --page: #050812;
  --surface: #0f1626;
  --verre: rgba(148, 180, 255, 0.045);
  --verre-2: rgba(148, 180, 255, 0.085);
  --bord: rgba(125, 211, 252, 0.14);
  --bord-fort: rgba(125, 211, 252, 0.3);
  --texte: #eaf0fd;
  --texte-2: #9cabc4;
  --discret: #6b7891;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --accent-texte: #03111f;
  --accent-doux: rgba(56, 189, 248, 0.13);
  --lueur: 0 0 0 1px rgba(56, 189, 248, 0.4), 0 0 26px -4px rgba(56, 189, 248, 0.6);
  --serie: #3987e5;
  --grille: #1c2739;
  --axe: #2c3a52;
  --bon: #0ca30c;
  --bon-texte: #4ade80;
  --attention: #fab219;
  --attention-texte: #ffd277;
  --critique: #d03b3b;
  --critique-texte: #ff8a80;
  --critique-fond: rgba(208, 59, 59, 0.15);
  --attention-fond: rgba(250, 178, 25, 0.12);
  --bon-fond: rgba(12, 163, 12, 0.14);
  --t-urine: #3987e5;
  --t-selles: #d95926;
  --t-rien: #199e70;
  --t-approche: #c98500;
  --rayon: 20px;
  --rayon-petit: 12px;
  --police: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0; min-height: 100vh; color: var(--texte);
  font: 15px/1.5 var(--police);
  background:
    radial-gradient(1000px 560px at 6% -12%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(900px 640px at 108% 4%, rgba(167, 139, 250, 0.14), transparent 60%),
    radial-gradient(800px 520px at 50% 118%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--page);
  background-attachment: fixed;
}
body::before { /* grille holographique fixe */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 25%, #000 25%, transparent 78%);
}
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
h1 { font-size: 18px; margin: 0; line-height: 1.1; letter-spacing: 0.01em; }
.degrade { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 {
  font-size: 12px; margin: 0 0 14px; font-weight: 650; color: var(--texte-2);
  text-transform: uppercase; letter-spacing: 0.13em; display: flex; align-items: center; gap: 9px;
}
h2 .ic { color: var(--accent); width: 18px; height: 18px; filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6)); }
p { margin: 6px 0; }
a { color: var(--accent); }
.cache { display: none !important; }
.discret { color: var(--texte-2); font-size: 13px; }
.petit-texte { font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.centre { text-align: center; }
.ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ligne.deux > * { flex: 1 1 140px; }
.entre { justify-content: space-between; }
.sur-titre { margin: 0; font-size: 11px; color: var(--discret); text-transform: uppercase; letter-spacing: 0.14em; }

/* ------------------------------------------------------------------ entête */
.entete {
  position: sticky; top: 0; z-index: 20;
  background: rgba(5, 8, 18, 0.74); backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--bord);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 22px; padding: 12px 26px;
}
.marque { display: flex; gap: 12px; align-items: center; }
.marque .discret { margin: 0; font-size: 12px; letter-spacing: 0.05em; }
.logo {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #e6f8ff;
  background: radial-gradient(circle at 30% 25%, rgba(56, 189, 248, 0.6), rgba(167, 139, 250, 0.35) 60%, rgba(15, 22, 38, 0.95));
  box-shadow: var(--lueur);
}
.logo .ic { width: 22px; height: 22px; }
.entete-droite { display: flex; gap: 10px; align-items: center; justify-self: end; }
.onglets { display: flex; gap: 4px; justify-self: center; padding: 5px; border-radius: 999px; background: var(--verre); border: 1px solid var(--bord); }
.onglets button {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; border-radius: 999px; padding: 8px 15px;
  color: var(--texte-2); font-weight: 550; font-size: 14px; white-space: nowrap;
}
.onglets button .ic { width: 17px; height: 17px; }
.onglets button:hover { color: var(--texte); background: var(--verre-2); }
.onglets button[aria-selected="true"] {
  color: var(--accent-texte); font-weight: 650;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px -8px rgba(56, 189, 248, 0.9);
}
.icone-seule { padding: 8px; border-radius: 50%; display: grid; place-items: center; }

main { max-width: 1260px; margin: 0 auto; padding: 22px 26px 50px; }
.vue { display: grid; gap: 18px; animation: apparition 0.3s ease-out; }
@keyframes apparition { from { transform: translateY(6px); } to { transform: none; } }

/* ------------------------------------------------------------------ cartes */
.carte {
  position: relative; min-width: 0; padding: 20px 22px;
  background: linear-gradient(180deg, rgba(148, 180, 255, 0.065), rgba(148, 180, 255, 0.02));
  border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}
.carte::after { /* reflet lumineux sur l'arête haute */
  content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.55), transparent);
}
.carte.etroite { max-width: 500px; margin: 42px auto; }
.grille-accueil { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.grille-stats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--verre); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 11px 13px; font-size: 13px; color: var(--texte-2);
}
.note .ic { color: var(--accent); margin-top: 1px; }

/* écrans d'accès / connexion */
.ecran-accueil { padding-top: 34px; }
.sceau {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px; display: grid; place-items: center; color: #e6f8ff;
  background: radial-gradient(circle at 30% 25%, rgba(56, 189, 248, 0.6), rgba(167, 139, 250, 0.35) 65%, rgba(15, 22, 38, 0.95));
  box-shadow: var(--lueur);
}
.sceau .ic { width: 36px; height: 36px; }
.titre-centre { justify-content: center; font-size: 13px; }

/* ------------------------------------------------------------- bannière */
.heros {
  display: grid; gap: 22px 28px; align-items: center;
  grid-template-columns: minmax(250px, 1fr) minmax(300px, 1.3fr) auto;
  grid-template-areas: "chat litiere actions" "reprise reprise reprise";
}
.heros-chat { grid-area: chat; display: flex; gap: 18px; align-items: center; }
.heros-litiere { grid-area: litiere; display: flex; gap: 18px; align-items: center; }
.heros-actions { grid-area: actions; display: grid; grid-template-columns: repeat(4, auto); gap: 12px; }
.heros-reprise {
  grid-area: reprise; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  padding-top: 16px; border-top: 1px solid var(--bord);
}
.heros-reprise .message, .heros-reprise .encart, .heros-reprise .alerte, .heros-reprise .petit-texte { flex-basis: 100%; margin: 0; }
.heros-nom { margin: 2px 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.heros-presence { margin: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--bon-texte); }
.heros-presence.dedans { color: var(--attention-texte); }

/* radar autour de l'avatar */
.radar { position: relative; width: 112px; height: 112px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0 55%, transparent 56%),
              repeating-radial-gradient(circle, rgba(56, 189, 248, 0.22) 0 1px, transparent 1px 18px);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35), 0 0 30px -8px rgba(56, 189, 248, 0.6); }
.radar-balayage { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(56, 189, 248, 0.45), rgba(56, 189, 248, 0) 70deg, transparent 360deg);
  animation: balayage 4s linear infinite; }
.radar.dedans { box-shadow: inset 0 0 0 1px rgba(250, 178, 25, 0.6), 0 0 36px -6px rgba(250, 178, 25, 0.8); }
.radar.dedans .radar-balayage { background: conic-gradient(from 0deg, rgba(250, 178, 25, 0.55), rgba(250, 178, 25, 0) 70deg, transparent 360deg); animation-duration: 1.6s; }
@keyframes balayage { to { transform: rotate(360deg); } }
.avatar { position: relative; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #0b1222; border: 2px solid rgba(56, 189, 248, 0.6); box-shadow: 0 0 18px rgba(56, 189, 248, 0.5); }
.avatar img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) contrast(1.05); }
.avatar-ic { width: 38px; height: 38px; color: var(--accent); }
.avatar img:not([hidden]) + .avatar-ic { display: none; }

/* anneau d'état de la litière */
.anneau { position: relative; width: 116px; height: 116px; flex: none; display: grid; place-items: center; --c: var(--accent); }
.anneau-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.anneau-fond { fill: none; stroke: rgba(148, 180, 255, 0.1); stroke-width: 8; }
.anneau-arc { fill: none; stroke: var(--c); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px var(--c)); transition: stroke 0.3s; }
.anneau-ic { width: 46px; height: 46px; color: var(--c); filter: drop-shadow(0 0 8px var(--c)); }
.anneau[data-phase="en_cours"], .anneau[data-phase="retour"] { --c: var(--bon-texte); }
.anneau[data-phase="en_cours"] .anneau-arc, .anneau[data-phase="retour"] .anneau-arc {
  stroke-dasharray: 90 237; animation: tourne 1.4s linear infinite; transform-origin: 60px 60px; }
.anneau[data-phase="pause"] { --c: var(--attention); }
.anneau[data-phase="pause_securite"] { --c: #ff5a4f; }
.anneau[data-phase="pause_securite"] .anneau-arc { animation: pulse 1.2s infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
.heros-etat { min-width: 0; }

/* boutons ronds à pictogramme */
.action-ronde {
  display: grid; justify-items: center; gap: 7px; padding: 0; border: none; background: none; color: var(--texte-2);
  font-size: 12px; font-weight: 550; letter-spacing: 0.02em; min-width: 66px;
}
.action-ronde .ic {
  width: 58px; height: 58px; padding: 16px; border-radius: 50%; color: var(--texte);
  background: radial-gradient(circle at 30% 25%, rgba(148, 180, 255, 0.16), rgba(148, 180, 255, 0.04));
  border: 1px solid var(--bord-fort); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}
.action-ronde:hover:not(:disabled) .ic { border-color: var(--accent); color: var(--accent); box-shadow: var(--lueur); }
.action-ronde:active:not(:disabled) .ic { transform: scale(0.96); }
.action-ronde:disabled { opacity: 0.35; }
.action-ronde[aria-pressed="true"] .ic { color: #1b1300; background: radial-gradient(circle at 30% 25%, #ffe29a, #fab219); border-color: transparent;
  box-shadow: 0 0 28px -2px rgba(250, 178, 25, 0.85); }
.action-ronde[aria-pressed="true"] { color: var(--attention-texte); }

/* bouclier de sécurité */
.bouclier {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: var(--attention-fond); border: 1px solid rgba(250, 178, 25, 0.35); color: var(--texte); font-size: 14px;
}
.bouclier input { position: absolute; opacity: 0; pointer-events: none; }
.bouclier .ic { width: 22px; height: 22px; color: var(--attention); }
.bouclier:has(input:checked) { background: var(--bon-fond); border-color: rgba(74, 222, 128, 0.5); box-shadow: 0 0 22px -6px rgba(74, 222, 128, 0.8); }
.bouclier:has(input:checked) .ic { color: var(--bon-texte); }
.bouclier:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- tuiles */
.tuiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tuile {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto;
  column-gap: 14px; padding: 16px 18px; align-items: center;
  background: linear-gradient(155deg, rgba(56, 189, 248, 0.09), rgba(148, 180, 255, 0.02) 55%);
  border: 1px solid var(--bord); border-radius: var(--rayon);
}
.tuile-ic { grid-row: 1 / 4; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 45%, transparent);
  box-shadow: 0 0 22px -8px var(--c, var(--accent)); }
.tuile-ic .ic { width: 24px; height: 24px; }
.t-accent { --c: var(--accent); }
.tuile-lib { font-size: 11px; color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.1em; }
.tuile-val { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.tuile-delta { font-size: 12px; color: var(--discret); min-height: 1em; }

/* ------------------------------------------------------- frise des 24 h */
.frise { position: relative; height: 138px; margin: 8px 8px 0; }
.frise-piste { position: absolute; left: 0; right: 0; top: 58px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0.4)); }
.frise-graduation { position: absolute; top: 118px; transform: translateX(-50%); font-size: 11px; color: var(--discret); font-variant-numeric: tabular-nums; }
.frise-graduation::before { content: ""; position: absolute; left: 50%; top: -58px; width: 1px; height: 50px; background: linear-gradient(transparent, var(--grille)); }
.frise-maintenant { position: absolute; top: 14px; height: 96px; width: 2px; transform: translateX(-1px);
  background: var(--accent); box-shadow: 0 0 12px var(--accent); border-radius: 2px; }
.frise-maintenant::after { content: "maintenant"; position: absolute; top: -14px; right: 4px; font-size: 10px; color: var(--accent); letter-spacing: 0.08em; white-space: nowrap; }
.frise-point[data-ligne="0"] { top: 42px; }
.frise-point[data-ligne="1"] { top: 4px; }
.frise-point[data-ligne="2"] { top: 80px; }
.frise-point { position: absolute; top: 42px; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; color: #fff; border: 2px solid var(--surface);
  background: var(--c); box-shadow: 0 0 16px -2px var(--c); cursor: pointer; transition: transform 0.12s; }
.frise-point .ic { width: 18px; height: 18px; }
.frise-point:hover, .frise-point:focus-visible { transform: scale(1.15); z-index: 2; }
.frise-vide { position: absolute; inset: 0; display: grid; place-items: center; color: var(--texte-2); font-size: 14px; }

/* ----------------------------------------------------------- jauges appareil */
.jauges { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.jauge { display: grid; justify-items: center; gap: 6px; padding: 14px 10px; border-radius: 16px; background: var(--verre); border: 1px solid var(--bord); text-align: center; }
.jauge-anneau { position: relative; width: 78px; height: 78px; display: grid; place-items: center; --c: var(--accent); }
.jauge-anneau svg.cercle { position: absolute; inset: 0; transform: rotate(-90deg); }
.jauge-anneau .fond { fill: none; stroke: rgba(148, 180, 255, 0.1); stroke-width: 7; }
.jauge-anneau .arc { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 5px var(--c)); }
.jauge-anneau .ic { width: 28px; height: 28px; color: var(--c); }
.jauge-val { font-size: 18px; font-weight: 700; }
.jauge-lib { font-size: 11px; color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.1em; }
.jauge-detail { font-size: 12px; color: var(--discret); }
.jauge.bon .jauge-anneau { --c: var(--bon-texte); }
.jauge.attention .jauge-anneau { --c: var(--attention); }
.jauge.critique .jauge-anneau { --c: #ff5a4f; }

/* -------------------------------------------------------------- formulaires */
label { display: grid; gap: 5px; margin: 10px 0; font-size: 12px; color: var(--texte-2); letter-spacing: 0.02em; }
label.case { display: flex; gap: 10px; align-items: flex-start; color: var(--texte); font-size: 14px; letter-spacing: 0; }
label.case input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
input, select {
  font: inherit; color: var(--texte); background: rgba(5, 8, 18, 0.7);
  border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22); }
button {
  font: inherit; cursor: pointer; border-radius: var(--rayon-petit); padding: 10px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--bord-fort); background: var(--verre-2); color: var(--texte);
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
button:hover:not(:disabled) { border-color: var(--accent); background: rgba(56, 189, 248, 0.1); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.38; cursor: not-allowed; }
button.principal {
  color: var(--accent-texte); font-weight: 650; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -10px rgba(56, 189, 248, 0.95);
}
button.principal:hover:not(:disabled) { box-shadow: var(--lueur); background: linear-gradient(135deg, #63cffb, #b9a1fb); }
button.grand { padding: 12px 22px; font-size: 15px; }
button.large { width: 100%; margin-top: 8px; }
button.lien { background: none; border: none; color: var(--accent); padding: 0; font-size: 13px; box-shadow: none; }
button.lien:hover:not(:disabled) { background: none; text-decoration: underline; }
button:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filtres { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.filtres label { margin: 0; }
.segments { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--bord); border-radius: 999px; background: var(--verre); }
.segments button { border: none; border-radius: 999px; background: none; padding: 7px 15px; color: var(--texte-2); }
.segments button[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); font-weight: 650; box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45); }

/* ------------------------------------------------------------------ états */
.pastille {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--verre-2); color: var(--texte-2); border: 1px solid var(--bord); white-space: nowrap;
}
.pastille::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--discret); }
.pastille.ok { color: var(--bon-texte); border-color: rgba(74, 222, 128, 0.32); }
.pastille.ok::before { background: var(--bon-texte); box-shadow: 0 0 10px var(--bon-texte); }
.pastille.direct { color: #ffb4ae; border-color: rgba(255, 138, 128, 0.45); font-weight: 650; }
.pastille.direct::before { background: #ff5a4f; box-shadow: 0 0 10px #ff5a4f; animation: pulse 1.4s infinite; }
.pastille.chat { color: var(--attention-texte); border-color: rgba(250, 178, 25, 0.45); margin-top: 6px; }
.pastille.chat::before { background: var(--attention); box-shadow: 0 0 10px var(--attention); animation: pulse 1.4s infinite; }
.etat { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 2px 0; }
.etat.en_cours, .etat.retour { color: var(--bon-texte); }
.etat.pause { color: var(--attention-texte); }
.etat.pause_securite { color: var(--critique-texte); }
.alerte { background: var(--critique-fond); color: var(--critique-texte); border-radius: var(--rayon-petit); padding: 10px 12px; border: 1px solid rgba(255, 138, 128, 0.3); }
.encart { background: var(--attention-fond); border: 1px solid rgba(250, 178, 25, 0.3); border-radius: var(--rayon-petit); padding: 11px 13px; font-size: 14px; }
.message { min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }
.message.erreur { color: var(--critique-texte); }
.message.ok { color: var(--bon-texte); }

/* ------------------------------------------------------------------ alertes */
.alertes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alertes li { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; background: var(--verre); border: 1px solid var(--bord); align-items: center; }
.alertes .icone { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.alertes .icone .ic { width: 20px; height: 20px; }
.alertes .urgent { --c: #ff5a4f; border-color: rgba(255, 138, 128, 0.35); }
.alertes .attention { --c: var(--attention); }
.alertes .info { --c: var(--accent); }
.alertes .rien { --c: var(--bon-texte); }
.alertes strong { font-size: 14px; }
.alertes span.txt { font-size: 13px; color: var(--texte-2); }

/* ------------------------------------------------------------------ passages */
.jour h3 { font-size: 12px; margin: 8px 0 10px; color: var(--texte-2); font-weight: 650; text-transform: uppercase; letter-spacing: 0.11em; display: flex; gap: 8px; align-items: center; }
.jour h3 .ic { color: var(--accent); }
.liste-passages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.passage {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px 16px; align-items: center; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(148, 180, 255, 0.055), rgba(148, 180, 255, 0.02));
  border: 1px solid var(--bord); border-radius: 16px; transition: border-color 0.15s, box-shadow 0.15s;
}
.passage:hover { border-color: var(--bord-fort); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08); }
.compacte .passage { background: var(--verre); padding: 9px 12px; grid-template-columns: auto 1fr; border-radius: 14px; }
.badge-type { display: grid; justify-items: center; gap: 4px; min-width: 54px; }
.badge-type .rond { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: var(--c, var(--verre-2)); box-shadow: 0 0 18px -4px var(--c, transparent); border: 1px solid rgba(255, 255, 255, 0.12); }
.badge-type .rond .ic { width: 22px; height: 22px; }
.badge-type .attente { --c: #3a475e; }
.compacte .badge-type .rond { width: 34px; height: 34px; border-radius: 11px; }
.compacte .badge-type .rond .ic { width: 18px; height: 18px; }
.passage .heure { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--texte); font-size: 13px; letter-spacing: 0.02em; }
.passage .mesures { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.passage .mesures span { color: var(--texte-2); display: inline-flex; align-items: center; gap: 6px; }
.passage .mesures .ic { color: var(--accent); width: 16px; height: 16px; }
.passage .mesures b { color: var(--texte); font-weight: 650; font-variant-numeric: tabular-nums; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.puce { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--verre-2); color: var(--texte-2); border: 1px solid var(--bord); }
.puce .ic { width: 14px; height: 14px; }
.puce.alerte-puce { background: var(--critique-fond); color: var(--critique-texte); border-color: rgba(255, 138, 128, 0.32); }
.puce.ia { border-style: dashed; }
.puce.type-puce { color: var(--texte); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
.puce.type-puce .ic { color: var(--c); }
.vignettes { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 400px; }
.vignettes button { padding: 0; border: 1px solid var(--bord); background: none; border-radius: 11px; overflow: hidden; }
.vignettes button:hover { border-color: var(--accent); box-shadow: var(--lueur); }
.vignettes img { width: 56px; height: 56px; object-fit: cover; display: block; }
.vignettes .vignette-chat img { width: 72px; }
.passage video, .video-ligne video { width: 100%; max-width: 440px; border-radius: 14px; background: #000; display: block; margin-top: 6px; border: 1px solid var(--bord); }
.passage .actions-passage { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.vide { color: var(--texte-2); font-size: 14px; padding: 24px 0; text-align: center; }

/* types de passage : même couleur et même pictogramme partout */
.t-urine { --c: var(--t-urine); }
.t-selles { --c: var(--t-selles); }
.t-rien { --c: var(--t-rien); }
.t-approche { --c: var(--t-approche); }

/* ------------------------------------------------------- caméra (habillage HUD) */
.video {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 420px; margin-top: 6px;
  background: radial-gradient(circle at 50% 45%, #0d1a2e, #03060c 70%);
  border-radius: 16px; overflow: hidden; border: 1px solid var(--bord);
  display: flex; align-items: center; justify-content: center;
}
.video::before, .video::after { content: ""; position: absolute; z-index: 2; pointer-events: none; width: 28px; height: 28px; border: 2px solid rgba(56, 189, 248, 0.8); }
.video::before { top: 12px; left: 12px; border-right: none; border-bottom: none; border-top-left-radius: 7px; }
.video::after { bottom: 12px; right: 12px; border-left: none; border-top: none; border-bottom-right-radius: 7px; }
.video p { color: #7e8ba3; font-size: 13px; margin: 0; padding: 0 16px; text-align: center; letter-spacing: 0.05em; }
.video > div { position: absolute; inset: 0; }
.etat-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--texte-2); }
.etat-sources li { display: flex; gap: 10px; align-items: flex-start; }
.etat-sources .ic { color: var(--accent); margin-top: 2px; }
.video-ligne { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--bord); border-radius: 16px; background: var(--verre); }
.video-ligne strong { display: flex; align-items: center; gap: 8px; }
.video-ligne strong .ic { color: var(--accent); }
.liste-videos-jour { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.garder { display: inline-flex; gap: 6px; align-items: center; margin: 0; color: var(--texte); font-size: 14px; }
.garder input { accent-color: var(--accent); }

/* ----------------------------------------------------------------- graphes */
.zone-graphe { width: 100%; min-height: 220px; }
.graphe { display: block; overflow: visible; }
.g-grille { stroke: var(--grille); stroke-width: 1; }
.g-axe { stroke: var(--axe); stroke-width: 1; }
.g-tick { fill: var(--discret); font-size: 11px; font-variant-numeric: tabular-nums; }
.g-valeur { fill: var(--texte-2); font-size: 12px; font-weight: 600; }
.g-ligne { fill: none; stroke: var(--serie); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-point, .g-point-petit { fill: var(--serie); stroke: var(--surface); stroke-width: 2; }
.g-colonne { fill: var(--serie); }
.g-reticule { stroke: var(--axe); stroke-width: 1; }
.g-reference { stroke: var(--texte-2); stroke-width: 1; }
.graphe rect:focus, .graphe rect:focus-visible { outline: none; }
.g-zone:hover, .g-zone:focus { fill: var(--accent); fill-opacity: 0.06; }
.g-seg { fill: var(--c); }
.bulle {
  position: absolute; display: none; pointer-events: none; z-index: 60;
  background: rgba(10, 16, 30, 0.95); border: 1px solid var(--bord-fort); border-radius: 11px;
  padding: 8px 11px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); font-size: 12px; backdrop-filter: blur(8px);
}
.bulle strong { display: block; font-size: 14px; color: var(--texte); }
.bulle span { color: var(--texte-2); }
.bulle .bulle-titre { display: block; margin-bottom: 4px; }
.bulle-ligne { display: grid; grid-template-columns: 12px auto 1fr; gap: 6px; align-items: center; }
.bulle-ligne strong { display: inline; font-size: 13px; text-align: right; min-width: 14px; }
.trait { display: inline-block; width: 12px; height: 2px; border-radius: 1px; background: var(--c); }
.legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--texte-2); margin: 4px 0 2px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende .ic { width: 15px; height: 15px; color: var(--c); }
.cle { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
details { margin-top: 8px; }
details summary { cursor: pointer; font-size: 13px; color: var(--texte-2); }
details summary:hover { color: var(--accent); }
table { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--grille); }
th { color: var(--texte-2); font-weight: 600; font-size: 12px; }

/* ---------------------------------------------------------------- divers */
.aide { margin: 0; padding-left: 18px; color: var(--texte-2); }
.aide li { margin: 7px 0; font-size: 14px; }
.aide strong { color: var(--texte); }
.journal { margin: 0; padding-left: 20px; font-size: 12px; max-height: 200px; overflow: auto; color: var(--texte-2); font-family: ui-monospace, Consolas, monospace; }
pre { background: rgba(3, 6, 12, 0.8); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 10px;
  font-size: 12px; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-all; color: #b9c6dd; }
.visionneuse { position: fixed; inset: 0; background: rgba(2, 4, 9, 0.93); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; padding: 24px; }
.visionneuse figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-height: 100%; }
.visionneuse img { max-width: min(92vw, 1056px); max-height: calc(100vh - 90px); border-radius: 16px; border: 1px solid var(--bord-fort); }
.visionneuse figcaption { color: var(--texte-2); font-size: 13px; letter-spacing: 0.04em; }
.visionneuse .fermer { position: absolute; top: 14px; right: 18px; background: var(--verre-2); border-radius: 50%; padding: 10px; color: #fff; }
.visionneuse .defiler { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 50%; padding: 12px;
  background: var(--verre-2); border: 1px solid var(--bord-fort); color: #fff; }
.visionneuse .defiler .ic, .visionneuse .fermer .ic { width: 24px; height: 24px; }
.visionneuse .defiler:disabled { opacity: 0.2; }
.visionneuse .gauche { left: 14px; }
.visionneuse .droite { right: 14px; }

@media (prefers-reduced-motion: reduce) {
  .vue, .radar-balayage, .anneau-arc, .pastille::before { animation: none !important; }
  * { transition: none !important; }
}

/* ----------------------------------------------------------- écrans moyens */
@media (max-width: 1100px) {
  .heros { grid-template-columns: 1fr 1fr; grid-template-areas: "chat litiere" "actions actions" "reprise reprise"; }
  .heros-actions { justify-content: start; }
}

/* --------------------------------------------------- téléphone : barre du bas */
@media (max-width: 760px) {
  /* pas de flou ici : un backdrop-filter piégerait la barre d'onglets « fixe » dans l'entête */
  .entete { grid-template-columns: 1fr auto; padding: 10px 16px; backdrop-filter: none; background: rgba(5, 8, 18, 0.97); }
  .onglets {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    justify-content: space-around; border-radius: 22px; padding: 6px;
    background: rgba(8, 13, 24, 0.9); backdrop-filter: blur(18px); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.65);
  }
  .onglets button { flex-direction: column; gap: 3px; padding: 7px 6px; font-size: 11px; border-radius: 16px; flex: 1; }
  .onglets button .ic { width: 22px; height: 22px; }
  main { padding: 14px 14px calc(100px + env(safe-area-inset-bottom)); }
  .heros { grid-template-columns: 1fr; grid-template-areas: "chat" "litiere" "actions" "reprise"; }
  .heros-actions { grid-template-columns: repeat(4, 1fr); }
  .action-ronde .ic { width: 54px; height: 54px; padding: 15px; }
  .grille-accueil, .grille-stats { grid-template-columns: 1fr; }
  .passage { grid-template-columns: auto 1fr; }
  .passage .vignettes { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .tuile-val { font-size: 24px; }
  .heros-reprise .principal { flex: 1 1 100%; }
  .bouclier { flex: 1 1 100%; }
}
