/* ==========================================================================
   Maison — Design system
   Groupe Colonna · v1.0
   --------------------------------------------------------------------------
   Aucun chargement externe : pile de polices système, icônes en sprite local
   (icons.svg). Thème sombre par défaut ; `data-theme="light"` et
   `data-theme="night"` sur <html> (ou sur n'importe quel conteneur).
   Documentation complète et HTML d'exemple : docs/DESIGN.md
   Vitrine : public/design-preview.html
   --------------------------------------------------------------------------
   Sommaire
     1. Tokens (communs)          9. Curseurs (horizontal, vertical)
     2. Thème sombre (défaut)    10. Puces, badges, points d'état
     3. Thème clair              11. Bannières
     4. Mode nuit, profils       12. Cartes métier (scénario, météo, caméra,
     5. Base / reset                 pièce, liste, appareil)
     6. App shell (rail, barre   13. Feuille modale, toast
        du bas, en-tête)         14. Squelettes, état vide
     7. Cartes & tuiles          15. Formulaires, connexion
     8. Boutons, segmented,      16. Écran de veille
        interrupteur             17. Home cinéma (volume, télécommande)
                                 18. Électroménager (four, café, lave-vaisselle)
                                 19. Jarvis (orbe, bulle, conversation)
                                 20. Utilitaires, mouvement réduit
   ========================================================================== */

/* ==========================================================================
   1. TOKENS COMMUNS
   ========================================================================== */
:root {
  /* --- Typographie : pile système, aucune police téléchargée --- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Segoe UI", Roboto, Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Segoe UI", Roboto, Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  /* Échelle fluide : valeur mini à 390 px de large → maxi à 1280 px.
     Respecte les minimums de docs/ERGONOMIE.md §3.0 (13 px téléphone, 14 px 10").
     Les profils [data-profile="room"] et [data-tv="1"] relèvent l'échelle (plus bas). */
  --fs-xs: clamp(13px, 12.562px + 0.1124vw, 14px);   /* minimum absolu : légendes, badges */
  --fs-sm: clamp(14px, 13.562px + 0.1124vw, 15px);   /* texte secondaire */
  --fs-base: clamp(15px, 14.562px + 0.1124vw, 16px); /* valeur d'état (« 58 % », « Fermé ») */
  --fs-md: clamp(16px, 15.124px + 0.2247vw, 18px);   /* corps, nom de tuile */
  --fs-lg: clamp(18px, 16.685px + 0.3371vw, 21px);   /* titre de carte */
  --fs-xl: clamp(22px, 19.371px + 0.6742vw, 28px);   /* titre de vue */
  --fs-2xl: clamp(28px, 23.618px + 1.1236vw, 38px);  /* grand titre (pièce, connexion) */
  --fs-3xl: clamp(36px, 28.989px + 1.7978vw, 52px);  /* valeur héro (température) */
  --fs-display: clamp(34px, 20.854px + 3.3708vw, 64px); /* heure d'accueil : 34 → 64 */
  --fs-giant: clamp(120px, 30vmin, 240px);            /* horloge de veille */
  --fs-toast: clamp(17px, 15.685px + 0.3371vw, 20px);

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-thin: 250;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-body: 1.45;
  --tracking-tight: -0.022em;
  --tracking-caps: 0.08em;

  /* --- Espacements : grille 4/8 pt --- */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --gutter: clamp(16px, 8.989px + 1.7978vw, 32px);   /* marge de page */
  --gap: clamp(10px, 7.371px + 0.6742vw, 16px);      /* gouttière de grille */

  /* --- Rayons --- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;      /* tuiles, cartes */
  --r-xl: 28px;      /* feuilles, grandes cartes */
  --r-pill: 999px;

  /* --- Cibles tactiles --- */
  --hit: 48px;       /* minimum absolu */
  --hit-lg: 56px;    /* tablette murale (lisible / utilisable à 2 m) */

  /* --- Dimensions du shell --- */
  --rail-w: 96px;
  --tabbar-h: 64px;
  --content-max: 1440px;

  /* --- Mouvement --- */
  --dur-instant: 90ms;
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 360ms;
  --dur-xslow: 600ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --press-scale: .97;

  /* --- Z-index --- */
  --z-rail: 20;
  --z-tabbar: 30;
  --z-sheet: 60;
  --z-jarvis: 65;
  --z-toast: 70;
  --z-screensaver: 90;

  /* --- Palette brute (référence, ne pas utiliser directement dans l'UI) --- */
  --amber-400: #FFB547;
  --blue-400: #5AB0FF;
  --red-400: #FF5D55;
  --green-400: #34D399;
  --violet-400: #A78BFA;
  --orange-400: #FF8A3D;
  --teal-400: #5BB8DC;   /* bleu-sarcelle de la marque (logo) */
  --teal-600: #2E7FA0;

  /* Dégradés de scénarios (famille SCN_COLORS de l'ancienne interface, assombrie pour
     un texte blanc ≥ 4,5:1 sur la moitié basse grâce au voile .scene::after) */
  --scn-morning: #E8743A, #A8380F;
  --scn-leave: #5B6B82, #2B3646;
  --scn-home: #16946A, #0D6446;
  --scn-evening: #9B55E6, #5E22C2;
  --scn-movie: #5458E0, #2A2A78;
  --scn-night: #3B4A7A, #151B36;
  --scn-vacation: #138BA3, #0A5A72;
  --scn-custom: #CC8418, #8F5208;
}

/* ==========================================================================
   2. THÈME SOMBRE (défaut)
   ========================================================================== */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Neutres — graphite légèrement froid */
  --bg: #0B0C0E;
  --bg-elev: #111316;          /* rail, barre du bas */
  --surface: #17191D;          /* cartes, tuiles */
  --surface-2: #1F2227;        /* champ, carte imbriquée */
  --surface-3: #2A2E34;        /* survol / pressé */
  --hairline: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .13);
  --fill: rgba(255, 255, 255, .08);      /* bulles d'icône, boutons secondaires */
  --fill-2: rgba(255, 255, 255, .13);
  --scrim: rgba(0, 0, 0, .6);
  --glass: rgba(17, 19, 22, .72);

  --text: #F3F4F6;
  --text-2: #A9AFB8;           /* secondaire — AA sur toutes les surfaces */
  --text-3: #858B94;           /* tertiaire — AA sur --surface */
  --text-on-color: #0B0C0E;    /* texte posé sur une couleur vive */
  --inverse-bg: #F3F4F6;
  --inverse-text: #0B0C0E;
  --inverse-link: #1F6E8E;    /* lien posé sur --inverse-bg (toast) */

  --brand: #5BB8DC;
  --focus: #7CC8E6;

  /* Sémantique : couleur vive (-c), texte sur surface (-fg), fond doux (-bg) */
  --c-lit: #FFB547;     --c-lit-fg: #FFC56E;     --c-lit-bg: rgba(255, 181, 71, .14);
  --c-cover: #5AB0FF;   --c-cover-fg: #7DC0FF;   --c-cover-bg: rgba(90, 176, 255, .14);
  --c-alert: #FF5D55;   --c-alert-fg: #FF7B73;   --c-alert-bg: rgba(255, 93, 85, .15);
  --c-alert-solid: #D92D20; --c-alert-solid-fg: #FFFFFF;   /* bouton destructeur plein (4,8:1) */
  --c-ok: #34D399;      --c-ok-fg: #4ADBA6;      --c-ok-bg: rgba(52, 211, 153, .14);
  --c-device: #A78BFA;  --c-device-fg: #B9A2FC;  --c-device-bg: rgba(167, 139, 250, .15);
  --c-heat: #FF8A3D;    --c-heat-fg: #FF9E5E;    --c-heat-bg: rgba(255, 138, 61, .15);
  --c-info: #5BB8DC;    --c-info-fg: #7CC8E6;    --c-info-bg: rgba(91, 184, 220, .14);
  --c-cinema: #E46BD4;  --c-cinema-fg: #EE8FE0;  --c-cinema-bg: rgba(228, 107, 212, .15);  --c-cinema-2: #6D6AF5;
  --c-jarvis: #3DD9F2;  --c-jarvis-fg: #6FE6F7;  --c-jarvis-bg: rgba(61, 217, 242, .13);   --c-jarvis-2: #3B82F6;

  /* Élévations */
  --elev-0: none;
  --elev-1: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 1px 2px rgba(0, 0, 0, .4);
  --elev-2: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 10px 30px -12px rgba(0, 0, 0, .7);
  --elev-3: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 24px 60px -20px rgba(0, 0, 0, .85);
  --halo-strength: .30;        /* intensité du halo des tuiles allumées */
  --ambient: radial-gradient(1100px 520px at 0% -10%, rgba(91, 184, 220, .07), transparent 70%),
             radial-gradient(900px 500px at 100% -20%, rgba(255, 181, 71, .05), transparent 70%);
}

/* ==========================================================================
   3. THÈME CLAIR
   ========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  --bg: #F2F2F5;
  --bg-elev: #FAFAFB;
  --surface: #FFFFFF;
  --surface-2: #F4F4F7;
  --surface-3: #E8E8ED;
  --hairline: rgba(15, 18, 25, .06);
  --border: rgba(15, 18, 25, .13);
  --fill: rgba(15, 18, 25, .055);
  --fill-2: rgba(15, 18, 25, .09);
  --scrim: rgba(15, 18, 25, .38);
  --glass: rgba(250, 250, 251, .78);

  --text: #111214;
  --text-2: #565C66;
  --text-3: #676D76;
  --text-on-color: #111214;
  --inverse-bg: #111214;
  --inverse-text: #FFFFFF;
  --inverse-link: #7CC8E6;

  --brand: #2E7FA0;
  --focus: #2E7FA0;

  --c-lit: #FFAE33;     --c-lit-fg: #9A5800;     --c-lit-bg: rgba(255, 174, 51, .18);
  --c-cover: #3D9BF5;   --c-cover-fg: #0B63BE;   --c-cover-bg: rgba(61, 155, 245, .13);
  --c-alert: #F04438;   --c-alert-fg: #C8231A;   --c-alert-bg: rgba(240, 68, 56, .11);
  --c-alert-solid: #C8231A; --c-alert-solid-fg: #FFFFFF;
  --c-ok: #22C07E;      --c-ok-fg: #0F7A45;      --c-ok-bg: rgba(34, 192, 126, .13);
  --c-device: #9473F5;  --c-device-fg: #6236CF;  --c-device-bg: rgba(148, 115, 245, .13);
  --c-heat: #FF7A21;    --c-heat-fg: #B04305;    --c-heat-bg: rgba(255, 122, 33, .13);
  --c-info: #3AA4CF;    --c-info-fg: #1F6E8E;    --c-info-bg: rgba(58, 164, 207, .13);
  --c-cinema: #D946C0;  --c-cinema-fg: #A21C8A;  --c-cinema-bg: rgba(217, 70, 192, .11);   --c-cinema-2: #5B5BD6;
  --c-jarvis: #12B5D6;  --c-jarvis-fg: #0A7C93;  --c-jarvis-bg: rgba(18, 181, 214, .12);   --c-jarvis-2: #2F6FEB;

  --elev-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 1px rgba(16, 24, 40, .03);
  --elev-2: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px -10px rgba(16, 24, 40, .14);
  --elev-3: 0 2px 6px rgba(16, 24, 40, .06), 0 28px 64px -18px rgba(16, 24, 40, .28);
  --halo-strength: .26;
  --ambient: radial-gradient(1100px 520px at 0% -10%, rgba(58, 164, 207, .08), transparent 70%),
             radial-gradient(900px 500px at 100% -20%, rgba(255, 174, 51, .08), transparent 70%);
}

/* ==========================================================================
   4. MODE NUIT — chambres : noir pur, rouges/ambres faibles, aucun bleu
   ========================================================================== */
[data-theme="night"] {
  color-scheme: dark;

  --bg: #000000;
  --bg-elev: #040202;
  --surface: #0B0605;
  --surface-2: #120A08;
  --surface-3: #1A0F0C;
  --hairline: rgba(200, 100, 70, .09);
  --border: rgba(200, 100, 70, .18);
  --fill: rgba(200, 100, 70, .09);
  --fill-2: rgba(200, 100, 70, .14);
  --scrim: rgba(0, 0, 0, .75);
  --glass: rgba(4, 2, 2, .85);

  --text: #C96D52;          /* 5,6:1 sur --surface */
  --text-2: #B7674E;        /* 4,7:1 */
  --text-3: #B7674E;
  --text-on-color: #000000;
  --inverse-bg: #3A1A12;
  --inverse-text: #E08A6C;
  --inverse-link: #F0A080;

  --brand: #C96D52;
  --focus: #D9805F;

  --c-lit: #B5742F;     --c-lit-fg: #C9853A;     --c-lit-bg: rgba(201, 133, 58, .12);
  --c-cover: #A8704F;   --c-cover-fg: #B97C59;   --c-cover-bg: rgba(168, 112, 79, .12);
  --c-alert: #C2473A;   --c-alert-fg: #E0604B;   --c-alert-bg: rgba(217, 80, 60, .14);
  --c-alert-solid: #3A140E; --c-alert-solid-fg: #E0604B;
  --c-ok: #A3864A;      --c-ok-fg: #B2934F;      --c-ok-bg: rgba(163, 134, 74, .12);
  --c-device: #A8665A;  --c-device-fg: #B87266;  --c-device-bg: rgba(168, 102, 90, .12);
  --c-heat: #B05A33;    --c-heat-fg: #D2714A;    --c-heat-bg: rgba(200, 101, 58, .13);
  --c-info: #B2634B;    --c-info-fg: #C96D52;    --c-info-bg: rgba(178, 99, 75, .12);
  --c-cinema: #A0605E;  --c-cinema-fg: #B5706A;  --c-cinema-bg: rgba(160, 96, 94, .12);   --c-cinema-2: #6E3A30;
  --c-jarvis: #B0703F;  --c-jarvis-fg: #C27E4A;  --c-jarvis-bg: rgba(176, 112, 63, .12);   --c-jarvis-2: #6E3A20;

  --elev-1: none;
  --elev-2: none;
  --elev-3: 0 0 0 1px rgba(200, 100, 70, .14);
  --halo-strength: .10;
  --ambient: none;
}
/* En mode nuit, toute couleur arbitraire (lampe Hue, dégradé de scénario,
   image de caméra) est ramenée vers l'ambre et assombrie. */
[data-theme="night"] .tile { --tile-color: var(--c-lit) !important; }
[data-theme="night"] .scene { background: var(--surface) !important; color: var(--text); box-shadow: inset 0 0 0 1px var(--hairline) !important; }
[data-theme="night"] .scene__icon { background: var(--fill) !important; color: var(--c-lit) !important; }
[data-theme="night"] .scene__name { text-shadow: none; }
[data-theme="night"] .scene__watermark, [data-theme="night"] .scene::after { display: none; }
[data-theme="night"] img,
[data-theme="night"] video { filter: brightness(.45) sepia(.6) saturate(.8) hue-rotate(-12deg); }
[data-theme="night"] .rail__logo, [data-theme="night"] .topbar__logo, [data-theme="night"] .login__logo { background: var(--surface-3); box-shadow: none; }
[data-theme="night"] .avatar { background: var(--fill-2) !important; color: var(--text) !important; }
[data-theme="night"] .hslider__value { text-shadow: 0 0 2px #000, 0 0 10px #000; }
[data-theme="night"] .topbar__logo img, [data-theme="night"] .login__logo img,
[data-theme="night"] .rail__logo img { filter: brightness(.5) sepia(1) saturate(2) hue-rotate(-30deg); }

/* ==========================================================================
   4 bis. PROFILS D'ÉCRAN — <html data-profile="mobile|room|home" data-tv="1">
   Relève l'échelle typographique et les cibles selon docs/ERGONOMIE.md §3.0.
   Sans attribut, l'échelle fluide (390 → 1280) s'applique seule.
   ========================================================================== */
[data-profile="mobile"] {
  --fs-display: 34px;
}
[data-profile="home"] {               /* 10" cuisine / salon — lecture à 2 m */
  --fs-xs: 14px; --fs-sm: 15px; --fs-base: 16px; --fs-md: 18px; --fs-lg: 21px;
  --fs-xl: 28px; --fs-display: 64px;
  --hit: 56px;
}
[data-profile="room"] {               /* 7" chambres — mode pièce */
  --fs-xs: 15px; --fs-sm: 16px; --fs-base: 18px; --fs-md: 20px; --fs-lg: 22px;
  --fs-xl: 26px; --fs-2xl: 30px; --fs-display: clamp(44px, 12vh, 96px);
  --hit: 56px; --hit-lg: 64px;        /* 64 dp pour toute commande de la vue pièce */
  --gap: 16px;
}
[data-tv="1"] {                       /* recopie AirPlay 16:9 — minimum 18 px */
  --fs-xs: 18px; --fs-sm: 20px; --fs-base: 22px; --fs-md: 24px; --fs-lg: 26px;
  --fs-xl: 36px; --fs-2xl: 40px; --fs-3xl: 56px; --fs-display: 120px;
  --gutter: 64px;                     /* marge de sécurité TV ≈ 5 % */
}
[data-tv="1"] .shell { grid-template-columns: minmax(0, 1fr); }
[data-tv="1"] .shell > .rail, [data-tv="1"] .tabbar { display: none; }
[data-tv="1"] .shell__main { padding: var(--gutter); max-width: none; border-left: 8px solid var(--brand); }

/* ==========================================================================
   5. BASE / RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* l'attribut hidden gagne toujours sur les display des composants */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "cv11";
  transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
}
/* Mode kiosque/tablette : pas de sélection ni de menu contextuel de lien */
.ds-kiosk, .ds-kiosk body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.ds-kiosk input, .ds-kiosk textarea { -webkit-user-select: text; user-select: text; }

h1, h2, h3, h4, p { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--brand); text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

/* Icône du sprite : <svg class="icon"><use href="icons.svg#i-bulb"/></svg> */
.icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.icon--sm { width: 18px; height: 18px; }
.icon--md { width: 28px; height: 28px; }
.icon--lg { width: 36px; height: 36px; stroke-width: 1.6; }
.icon--xl { width: 48px; height: 48px; stroke-width: 1.5; }
.icon--bold { stroke-width: 2.2; }

/* Typographie utilitaire */
.t-display { font-family: var(--font-display); font-size: var(--fs-display); font-weight: var(--fw-thin); letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.t-hero    { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.t-title   { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.t-headline{ font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -0.015em; line-height: var(--lh-snug); }
.t-subhead { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: var(--lh-snug); }
.t-body    { font-size: var(--fs-md); }
.t-callout { font-size: var(--fs-sm); }
.t-caption { font-size: var(--fs-xs); color: var(--text-2); }
.t-overline{ font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-2); }
.t-muted   { color: var(--text-2); }
.t-num     { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   6. APP SHELL
   --------------------------------------------------------------------------
   <div class="shell"> <nav class="rail">…</nav> <main class="shell__main">…</main>
                       <nav class="tabbar">…</nav> </div>
   Paysage ≥ 600 px : rail latéral ; téléphone et tablette en portrait (< 900 px) : barre du bas (tabbar).
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: calc(var(--rail-w) + env(safe-area-inset-left)) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ambient), var(--bg);
  background-attachment: fixed;
}
.shell__main {
  min-width: 0;
  padding: calc(var(--sp-6) + env(safe-area-inset-top)) calc(var(--gutter) + env(safe-area-inset-right)) var(--sp-12) var(--gutter);
  max-width: var(--content-max);
  width: 100%;
}
.shell--fixed { height: 100vh; height: 100dvh; overflow: hidden; }
.shell--fixed .shell__main { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* --- Rail latéral --- */
.rail {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  z-index: var(--z-rail);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
  padding: calc(var(--sp-5) + env(safe-area-inset-top)) 0 calc(var(--sp-5) + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  background: var(--bg-elev);
  border-right: 1px solid var(--hairline);
}
.rail__logo {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: var(--sp-5);
  display: grid; place-items: center; padding: 8px;
  background: #fff; box-shadow: var(--elev-1);
}
.rail__logo img { width: 100%; height: 100%; object-fit: contain; }
.rail__item {
  position: relative;
  width: 76px; min-height: 64px; padding: var(--sp-2) 0;
  border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-2);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .01em;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.rail__item .icon { width: 26px; height: 26px; }
.rail__item:active { transform: scale(.94); }
.rail__item.is-active, .rail__item[aria-current="page"] { color: var(--text); background: var(--fill); }
.rail__item.is-active::before, .rail__item[aria-current="page"]::before {
  content: ""; position: absolute; left: -10px; top: 50%; width: 4px; height: 24px; margin-top: -12px;
  border-radius: 0 4px 4px 0; background: var(--brand);
}
.rail__spacer { flex: 1; }
.rail__status { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--sp-2); }

/* --- Barre du bas (téléphone) --- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
  padding: 6px calc(var(--sp-2) + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(var(--sp-2) + env(safe-area-inset-left));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline);
}
.tabbar__item {
  flex: 1; min-width: 0; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: var(--r-sm);
  color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium);
  transition: color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tabbar__item .icon { width: 25px; height: 25px; }
.tabbar__item:active { transform: scale(.92); }
.tabbar__item.is-active, .tabbar__item[aria-current="page"] { color: var(--brand); }

/* Navigation responsive (docs/ERGONOMIE.md §2.4)
   - téléphone portrait (< 600) et 7"/10" portrait (< 900 en portrait) : barre du bas
   - paysage ≥ 600 : rail ; téléphone paysage (hauteur < 500) : rail compact sans libellés */
@media (max-width: 599.98px), (max-width: 899.98px) and (orientation: portrait) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell > .rail { display: none; }
  .tabbar { display: flex; }
  .shell__main { padding-bottom: calc(var(--tabbar-h) + var(--sp-8) + env(safe-area-inset-bottom)); padding-left: calc(var(--gutter) + env(safe-area-inset-left)); }
  .topbar__logo { display: block; }
}
@media (min-width: 600px) and (max-width: 899.98px) and (orientation: portrait) {
  :root { --tabbar-h: 72px; }
  .tabbar__item { min-height: 60px; font-size: var(--fs-sm); }
  .tabbar__item .icon { width: 28px; height: 28px; }
}
@media (max-height: 499.98px) and (orientation: landscape) {
  :root { --rail-w: 72px; }
  .rail__item { width: 56px; min-height: 52px; font-size: 0; gap: 0; }
  .rail__item .icon { width: 28px; height: 28px; }
  .rail__logo { width: 40px; height: 40px; margin-bottom: var(--sp-2); }
  .rail__status span { display: none; }
}
/* Tablette 7" paysage (1024×600) : rail 88, rythme vertical resserré */
@media (min-width: 900px) and (max-height: 680px) and (min-height: 500px) {
  :root { --rail-w: 88px; }
  .rail { gap: 2px; padding-top: calc(var(--sp-3) + env(safe-area-inset-top)); padding-bottom: var(--sp-3); }
  .rail__logo { width: 44px; height: 44px; margin-bottom: var(--sp-3); }
  .rail__item { min-height: 60px; width: 76px; }
  .shell__main { padding-top: calc(var(--sp-4) + env(safe-area-inset-top)); }
}

/* Avatar utilisateur (initiale, couleur par utilisateur) */
.avatar {
  width: var(--hit); height: var(--hit); border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--avatar-color, var(--c-device)); color: var(--text-on-color);
  font-size: var(--fs-md); font-weight: var(--fw-bold); text-transform: uppercase;
}
.avatar--device { background: var(--fill); color: var(--text-2); }
/* Indicateur de connexion du rail (bouton 48 dp, pastille + libellé) */
.rail__status { min-height: var(--hit); width: 76px; justify-content: center; flex-direction: column; border-radius: var(--r-md); }
.rail__status:active { background: var(--fill); }

/* Barre de titre des vues secondaires (56 dp) : retour · titre · heure */
.titlebar { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; margin-bottom: var(--sp-4); }
.titlebar__back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--hit); padding: 0 var(--sp-3) 0 var(--sp-1); margin-left: calc(-1 * var(--sp-2)); border-radius: var(--r-pill); color: var(--brand); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.titlebar__back:active { background: var(--fill); }
.titlebar__title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titlebar__time { font-size: var(--fs-lg); color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); }

/* --- En-tête de page --- */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4) var(--sp-6);
  flex-wrap: wrap; margin-bottom: var(--sp-6);
}
.topbar__lead { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; flex: 1 1 auto; }
.topbar__lead > div { min-width: 0; }
.topbar__logo { display: none; width: 40px; height: 40px; padding: 6px; border-radius: 12px; background: #fff; flex: none; }
.topbar__logo img { width: 100%; height: 100%; object-fit: contain; }
.topbar__eyebrow { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.topbar__eyebrow b { color: var(--text); font-weight: var(--fw-semibold); }
.topbar__title { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.topbar__clock { font-family: var(--font-display); font-size: var(--fs-display); font-weight: var(--fw-thin); letter-spacing: -0.04em; line-height: .95; font-variant-numeric: tabular-nums; }
.topbar__summary { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.topbar__actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
@media (max-width: 599.98px) {
  .topbar { align-items: center; flex-wrap: nowrap; margin-bottom: var(--sp-5); }
  .topbar__logo { display: block; }
  .topbar__eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar__actions .chip:not(.chip--keep) { display: none; }
}

/* --- Titre de section --- */
.section { margin-top: var(--sp-8); }
.section:first-child { margin-top: 0; }
.section__head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.section__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.012em; }
.section__meta { font-size: var(--fs-sm); color: var(--text-2); }
.section__action { margin-left: auto; }

/* --- Grilles --- */
.grid { display: grid; gap: var(--gap); }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.grid--scenes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 599.98px) {
  .grid--tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  /* scénarios : défilement horizontal aimanté sur téléphone */
  .grid--scenes { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) var(--sp-2); scrollbar-width: none; }
  .grid--scenes::-webkit-scrollbar { display: none; }
  .grid--scenes > * { flex: 0 0 132px; scroll-snap-align: start; }
}

/* ==========================================================================
   7. CARTES & TUILES
   ========================================================================== */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--elev-1), inset 0 0 0 1px var(--hairline);
  min-width: 0;
}
.card--flat { box-shadow: inset 0 0 0 1px var(--hairline); }
.card--raised { box-shadow: var(--elev-2), inset 0 0 0 1px var(--hairline); }
.card--inset { background: var(--surface-2); box-shadow: none; }
.card--tight { padding: var(--sp-4); }
.card--tinted { background: linear-gradient(160deg, var(--card-tint, var(--c-info-bg)), transparent 65%), var(--surface); }
.card__head { display: flex; align-items: center; gap: var(--sp-3); }
.card__icon {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--fill); color: var(--text-2);
}
.card__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: var(--lh-snug); }
.card__sub { font-size: var(--fs-sm); color: var(--text-2); }
.card__titles { flex: 1; min-width: 0; }
.card__titles > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__body { margin-top: var(--sp-4); }
.card__foot { margin-top: var(--sp-4); display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.card__divider { height: 1px; background: var(--hairline); margin: var(--sp-4) calc(-1 * var(--sp-5)); }

/* --- Tuile d'appareil ----------------------------------------------------
   <button class="tile tile--light is-on" style="--tile-color:#ffb547">
     <span class="tile__icon"><svg class="icon"><use href="icons.svg#i-bulb"/></svg></span>
     <span class="tile__text"><span class="tile__name">Salon</span>
       <span class="tile__state">Allumé · 80 %</span></span>
   </button>
   États : (rien)=éteint · .is-on · .is-busy · .is-error · .is-unavailable
   -------------------------------------------------------------------------- */
.tile {
  --tile-color: var(--c-lit);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-3);
  min-height: 124px; min-width: 0; width: 100%;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--elev-1), inset 0 0 0 1px var(--hairline);
  text-align: left; color: var(--text);
  transition: background-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.tile::before { /* halo coloré */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(130% 110% at 0% 0%, var(--tile-color) 0%, transparent 62%);
  opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
}
.tile::after { /* liseré coloré */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px var(--tile-color); opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
}
button.tile:active, .tile.is-pressable:active { transform: scale(var(--press-scale)); }
.tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.tile__icon {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--fill); color: var(--text-2);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.tile__icon .icon { width: 26px; height: 26px; }
.tile__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile__name { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-snug); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__state { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile__aside { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.tile__action { /* bouton secondaire dans la tuile (ex. ouvrir le détail) */
  width: 40px; height: 40px; margin: -4px -4px 0 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
}
.tile__progress { height: 4px; border-radius: var(--r-pill); background: var(--fill-2); overflow: hidden; }
.tile__progress > i { display: block; height: 100%; width: var(--p, 0%); background: var(--tile-color); border-radius: inherit; transition: width var(--dur-slow) var(--ease-out); }
.tile--wide { grid-column: span 2; }
.tile--wide.tile { flex-direction: row; align-items: center; min-height: 88px; }
.tile--compact { min-height: 76px; flex-direction: row; align-items: center; padding: var(--sp-3) var(--sp-4); }
.tile--compact .tile__icon { width: 44px; height: 44px; }

/* Couleur par type d'équipement (surchargée par style="--tile-color:…" pour une lampe Hue) */
.tile--light    { --tile-color: var(--c-lit); }
.tile--cover    { --tile-color: var(--c-cover); }
.tile--security { --tile-color: var(--c-alert); }
.tile--device   { --tile-color: var(--c-device); }
.tile--heat     { --tile-color: var(--c-heat); }
.tile--ok       { --tile-color: var(--c-ok); }

/* Allumé / ouvert / actif */
.tile.is-on { background: var(--surface); box-shadow: var(--elev-2), 0 18px 40px -24px var(--tile-color); }
.tile.is-on::before { opacity: var(--halo-strength); }
.tile.is-on::after { opacity: .38; }
.tile.is-on .tile__icon { background: var(--tile-color); color: var(--text-on-color); box-shadow: 0 0 0 4px var(--fill), 0 6px 18px -6px var(--tile-color); }
.tile.is-on .tile__state { color: var(--text); }
/* En cours (mouvement de volet, cycle, démarrage) */
/* .is-busy se combine avec l'état visé (optimiste) : .is-on.is-busy = « allumage… » */
.tile__icon { position: relative; }
.tile.is-busy .tile__icon::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--tile-color); border-right-color: transparent; border-bottom-color: transparent;
  animation: ds-spin .9s linear infinite;
}
.tile.is-busy .tile__state { color: var(--text); }
.tile.is-busy .tile__progress > i:only-child:not([style]) { width: 40%; animation: ds-indeterminate 1.4s var(--ease-in-out) infinite; }
/* Erreur */
.tile.is-error { box-shadow: var(--elev-1), inset 0 0 0 1.5px var(--c-alert); }
.tile.is-error .tile__icon { background: var(--c-alert-bg); color: var(--c-alert-fg); }
.tile.is-error .tile__state { color: var(--c-alert-fg); font-weight: var(--fw-medium); }
/* Indisponible (hors ligne) */
.tile.is-unavailable { opacity: .5; pointer-events: none; box-shadow: inset 0 0 0 1px var(--hairline); background: transparent; }
.tile.is-unavailable .tile__icon { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
/* Échec de commande : secousse 200 ms (ajouter puis retirer .is-shake) */
.tile.is-shake, .is-shake { animation: ds-shake .2s linear 2; }
/* Pastille d'état (forme, pas seulement couleur) : vide = éteint, pleine = allumé */
.tile__pip { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--text-3); margin: 6px 4px 0 0; }
.tile.is-on .tile__pip { background: var(--tile-color); box-shadow: 0 0 0 3px var(--surface), 0 0 10px var(--tile-color); }
/* Zone de bascule séparée (tuile pièce : icône = bascule, reste = ouvrir) */
.tile__toggle { margin: -6px; padding: 6px; border-radius: 50%; }
/* Mode lecture seule (serveur injoignable) : tout le conteneur */
.is-readonly .tile, .is-readonly .btn, .is-readonly .icon-btn, .is-readonly .switch, .is-readonly .scene, .is-readonly .range, .is-readonly .vslider, .is-readonly .hslider { opacity: .5; pointer-events: none; }

/* ==========================================================================
   8. BOUTONS · SEGMENTED · INTERRUPTEUR
   ========================================================================== */
.btn {
  --btn-bg: var(--fill); --btn-fg: var(--text);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--hit); padding: 0 var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -0.005em; line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out), opacity var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.btn .icon { width: 22px; height: 22px; }
.btn:active { transform: scale(var(--press-scale)); }
.btn:disabled, .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn--primary   { --btn-bg: var(--inverse-bg); --btn-fg: var(--inverse-text); box-shadow: var(--elev-1); }
.btn--secondary { --btn-bg: var(--fill); --btn-fg: var(--text); }
.btn--outline   { --btn-bg: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.btn--ghost     { --btn-bg: transparent; --btn-fg: var(--text-2); }
.btn--ghost:hover { --btn-fg: var(--text); }
.btn--danger    { --btn-bg: var(--c-alert-bg); --btn-fg: var(--c-alert-fg); }
.btn--danger-solid { --btn-bg: var(--c-alert-solid); --btn-fg: var(--c-alert-solid-fg); }
.btn--accent    { --btn-bg: var(--btn-color, var(--c-lit)); --btn-fg: var(--text-on-color); }
.btn--lg { min-height: var(--hit-lg); padding: 0 var(--sp-6); font-size: var(--fs-lg); }
.btn--sm { min-height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-sm); } /* usage dense (≥ 40 px), jamais seul sur tablette */
.btn--block { display: flex; width: 100%; }
.btn--square { border-radius: var(--r-md); }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--btn-fg); border-right-color: transparent;
  animation: ds-spin .7s linear infinite;
}
.btn-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 0; }

/* Bouton-icône rond */
.icon-btn {
  --btn-bg: var(--fill); --btn-fg: var(--text);
  width: var(--hit); height: var(--hit); flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--btn-bg); color: var(--btn-fg);
  transition: background-color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out), color var(--dur) var(--ease-out);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .4; pointer-events: none; }
.icon-btn--lg { width: 64px; height: 64px; }
.icon-btn--lg .icon { width: 28px; height: 28px; }
.icon-btn--xl { width: 80px; height: 80px; }
.icon-btn--xl .icon { width: 34px; height: 34px; }
.icon-btn--primary { --btn-bg: var(--inverse-bg); --btn-fg: var(--inverse-text); }
.icon-btn--ghost { --btn-bg: transparent; --btn-fg: var(--text-2); }
.icon-btn--glass { --btn-bg: rgba(0, 0, 0, .45); --btn-fg: #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.icon-btn--danger { --btn-bg: var(--c-alert-bg); --btn-fg: var(--c-alert-fg); }
.icon-btn.is-on { --btn-bg: var(--btn-color, var(--c-lit)); --btn-fg: var(--text-on-color); }

/* Segmented control
   <div class="seg" role="radiogroup"><button class="seg__item" aria-checked="true" role="radio">Jour</button>…</div> */
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: var(--r-pill);
  background: var(--fill);
  max-width: 100%;
}
.seg__item {
  flex: 1 1 0; min-height: 42px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2);
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.seg__item .icon { width: 20px; height: 20px; }
.seg__item.is-active, .seg__item[aria-checked="true"], .seg__item[aria-pressed="true"] {
  background: var(--seg-active, #3B4048); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
[data-theme="night"] .seg__item[aria-checked="true"], [data-theme="night"] .seg__item.is-active, [data-theme="night"] .seg__item[aria-pressed="true"] { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
[data-theme="light"] .seg__item.is-active, [data-theme="light"] .seg__item[aria-checked="true"], [data-theme="light"] .seg__item[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .12), 0 0 0 .5px rgba(16, 24, 40, .06); }
.seg--block { display: flex; width: 100%; }
.seg--lg .seg__item { min-height: 50px; font-size: var(--fs-md); }

/* Interrupteur
   <button class="switch" role="switch" aria-checked="true" aria-label="Salon"></button> */
.switch {
  --switch-color: var(--c-ok);
  position: relative; flex: none;
  width: 60px; height: 36px; border-radius: var(--r-pill);
  background: var(--fill-2);
  transition: background-color var(--dur) var(--ease-out);
}
.switch::before { content: ""; position: absolute; inset: -6px -2px; } /* cible ≥ 48 px */
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform var(--dur) var(--ease-spring);
}
.switch.is-on, .switch[aria-checked="true"] { background: var(--switch-color); }
.switch.is-on::after, .switch[aria-checked="true"]::after { transform: translateX(24px); }
.switch:disabled { opacity: .4; }
.switch--lit { --switch-color: var(--c-lit); }
.switch--cover { --switch-color: var(--c-cover); }
.switch--alert { --switch-color: var(--c-alert); }
.switch--lg { width: 72px; height: 44px; }
.switch--lg::after { width: 38px; height: 38px; }
.switch--lg.is-on::after, .switch--lg[aria-checked="true"]::after { transform: translateX(28px); }
[data-theme="night"] .switch::after { background: var(--text-2); box-shadow: none; }

/* ==========================================================================
   9. CURSEURS D'INTENSITÉ (style Hue / Apple)
   --------------------------------------------------------------------------
   Horizontal : <input type="range" class="range" style="--v:60%"> (le JS met
   à jour --v à chaque `input`). Vertical : .vslider (div role="slider"),
   le JS calcule la valeur au pointeur et met à jour --v.
   ========================================================================== */
.range {
  --range-color: var(--c-lit);
  --v: 50%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 56px; margin: 0;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--range-color) 0 var(--v), var(--fill-2) var(--v) 100%);
  overflow: hidden; cursor: pointer;
  touch-action: pan-y;
}
.range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 6px; height: 28px; margin-top: 14px; border-radius: 3px;
  background: rgba(255, 255, 255, .95); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), -8px 0 0 -2px transparent;
  transform: translateX(-12px);
}
.range::-moz-range-track { height: 100%; background: transparent; }
.range::-moz-range-thumb { width: 6px; height: 28px; border: 0; border-radius: 3px; background: rgba(255, 255, 255, .95); transform: translateX(-12px); }
.range:disabled { opacity: .45; }
.range--sm { height: 44px; border-radius: var(--r-sm); }
.range--sm::-webkit-slider-thumb { height: 22px; margin-top: 11px; }
.range--cover { --range-color: var(--c-cover); }
.range--heat { --range-color: var(--c-heat); }
.range--off { --range-color: var(--surface-3); }
/* Variante avec libellé et icône posés sur la piste */
.range-field { position: relative; }
.range-field__label {
  position: absolute; left: var(--sp-4); right: var(--sp-4); top: 0; bottom: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.range-field__label .icon { width: 22px; height: 22px; }
.range-field__label > :first-child { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-on-color); mix-blend-mode: normal; }

/* Grand curseur vertical façon Apple Maison / Hue */
.vslider {
  --slider-color: var(--c-lit);
  --v: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  width: 112px; height: 300px; flex: none;
  border-radius: 34px;
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  cursor: grab; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.vslider:active { cursor: grabbing; }
.vslider__fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--v);
  background: var(--slider-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: height var(--dur-fast) linear;
}
.vslider__fill::before { /* poignée discrète */
  content: ""; position: absolute; top: 12px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
  border-radius: 3px; background: rgba(0, 0, 0, .18);
}
.vslider__icon { position: absolute; left: 0; right: 0; bottom: var(--sp-5); display: grid; place-items: center; color: var(--text-2); z-index: 1; transition: color var(--dur) var(--ease-out); }
.vslider__icon .icon { width: 32px; height: 32px; }
.vslider__value { position: absolute; left: 0; right: 0; top: var(--sp-5); text-align: center; z-index: 1; font-size: var(--fs-lg); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--text); }
.vslider.is-high .vslider__value, .vslider:not(.is-off) .vslider__icon { color: var(--text-on-color); }
.vslider.is-off .vslider__fill { height: 0; }
.vslider--cover { --slider-color: var(--c-cover); }
.vslider--heat { --slider-color: var(--c-heat); }
.vslider--sm { width: 88px; height: 220px; border-radius: 28px; }
.vslider-group { display: flex; gap: var(--sp-6); align-items: flex-end; justify-content: center; }
.vslider-group__item { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.vslider-group__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
@media (max-height: 680px) and (min-width: 900px) { .vslider { height: 240px; width: 100px; } }

/* Grand curseur horizontal (mode pièce 7" : 560×120, valeur au centre)
   <div class="hslider" role="slider" aria-valuenow="60" style="--v:60%">
     <div class="hslider__fill"></div><span class="hslider__icon">…</span>
     <span class="hslider__value">60 %</span></div>
   Glisser = relatif à la position de départ, un tap ne saute pas (ERGONOMIE §5.1). */
.hslider {
  --slider-color: var(--c-lit);
  --v: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; height: 96px;
  border-radius: 24px;
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  touch-action: pan-y; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.hslider__fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--v); background: var(--slider-color); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .35); transition: width var(--dur-fast) linear; }
.hslider__icon { position: absolute; left: var(--sp-6); top: 50%; transform: translateY(-50%); z-index: 1; color: var(--text-on-color); }
.hslider__icon .icon { width: 32px; height: 32px; }
.hslider__value { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--text); text-shadow: 0 0 12px var(--surface); pointer-events: none; }
.hslider.is-off .hslider__fill { width: 0; }
.hslider.is-off .hslider__icon { color: var(--text-2); }
.hslider.is-dragging .hslider__fill { transition: none; }
.hslider--lg { height: 120px; }
.hslider--cover { --slider-color: var(--c-cover); }
.hslider--heat { --slider-color: var(--c-heat); }

/* Illustration de volet (64×80) : --closed = 0 % (ouvert) → 100 % (fermé) */
.shutter-vis {
  --closed: 0%;
  position: relative; overflow: hidden; flex: none;
  width: 64px; height: 80px; border-radius: 10px;
  background: linear-gradient(180deg, #8EC5F0, #CFE6F7 70%, #E8D9B8);
  box-shadow: inset 0 0 0 3px var(--surface-3);
}
.shutter-vis::before { /* lames */
  content: ""; position: absolute; left: 3px; right: 3px; top: 3px;
  height: var(--closed);
  max-height: calc(100% - 6px);
  background: repeating-linear-gradient(180deg, #7E8792 0 6px, #636B75 6px 8px);
  border-radius: 2px 2px 0 0;
  transition: height var(--dur-xslow) var(--ease-in-out);
}
.shutter-vis::after { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 3px; margin-left: -1.5px; background: var(--surface-3); }
.shutter-vis--lg { width: 80px; height: 100px; }
.shutter-vis.is-moving::before { transition-duration: 20s; }
[data-theme="night"] .shutter-vis { background: #160C09; }
[data-theme="night"] .shutter-vis::before { background: repeating-linear-gradient(180deg, #3A1E16 0 6px, #24120D 6px 8px); }

/* Glisser pour confirmer (portail, garage, vacances) : 280×64, le JS règle --x (0–1) */
.slide-confirm {
  --x: 0; --slide-color: var(--c-alert);
  position: relative; overflow: hidden;
  width: min(100%, 340px); height: 64px; border-radius: var(--r-pill);
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  touch-action: none; -webkit-user-select: none; user-select: none;
  container-type: inline-size;
}
.slide-confirm__track { position: absolute; left: 0; top: 0; bottom: 0; width: calc(56px + 8px + (100% - 64px) * var(--x)); border-radius: inherit; background: var(--slide-color); opacity: .25; }
.slide-confirm__label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 56px; font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-2); opacity: calc(1 - var(--x) * 1.6); }
.slide-confirm__knob {
  position: absolute; top: 4px; left: 4px; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--slide-color); color: #fff; box-shadow: var(--elev-2);
  transform: translateX(calc(var(--track-w, 276px) * var(--x)));
  transform: translateX(calc((100cqw - 64px) * var(--x)));
  cursor: grab;
}
.slide-confirm__knob .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.slide-confirm.is-done .slide-confirm__label { opacity: 1; color: var(--text); }
.slide-confirm--ok { --slide-color: var(--c-ok); }
.slide-confirm--cover { --slide-color: var(--c-cover); }

/* Pagination (rotation caméras) : point 10 dp, cible 48 dp */
.pager { display: inline-flex; align-items: center; }
.pager__dot { width: var(--hit); height: var(--hit); display: grid; place-items: center; }
.pager__dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fill-2); box-shadow: inset 0 0 0 1.5px var(--text-3); transition: background-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.pager__dot.is-active::before, .pager__dot[aria-current="true"]::before { background: var(--text); box-shadow: none; transform: scale(1.15); }

/* Nuancier de couleurs (lampes Hue) */
.swatches { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.swatch {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: var(--swatch, #fff);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.swatch:active { transform: scale(.9); }
.swatch.is-selected, .swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }

/* Pas à pas (consigne de température, puissance) */
.stepper { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 4px; border-radius: var(--r-pill); background: var(--fill); }
.stepper__btn { width: var(--hit); height: var(--hit); border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); box-shadow: var(--elev-1); }
.stepper__btn:active { transform: scale(.92); }
.stepper__btn:disabled { opacity: .35; }
.stepper__value { min-width: 72px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-align: center; font-size: var(--fs-lg); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* Barre de progression simple */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--fill-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--progress-color, var(--c-ok)); transition: width var(--dur-slow) var(--ease-out); }

/* ==========================================================================
   10. PUCES · BADGES · POINTS D'ÉTAT
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 40px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--fill); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.chip b { color: var(--text); font-weight: var(--fw-semibold); }
.chip .icon { width: 18px; height: 18px; }
button.chip { min-height: var(--hit); }
button.chip:active { transform: scale(.96); }
.chip.is-selected, .chip[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-text); }
.chip.is-selected b, .chip[aria-pressed="true"] b { color: inherit; }
.chip--lg { min-height: 64px !important; padding: 0 var(--sp-5); font-size: var(--fs-md); border-radius: var(--r-md); }
.chip--lg .icon { width: 24px; height: 24px; }
.chip--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.chip--lit    { background: var(--c-lit-bg); color: var(--c-lit-fg); }
.chip--cover  { background: var(--c-cover-bg); color: var(--c-cover-fg); }
.chip--alert  { background: var(--c-alert-bg); color: var(--c-alert-fg); }
.chip--ok     { background: var(--c-ok-bg); color: var(--c-ok-fg); }
.chip--device { background: var(--c-device-bg); color: var(--c-device-fg); }
.chip--heat   { background: var(--c-heat-bg); color: var(--c-heat-fg); }
.chip--info   { background: var(--c-info-bg); color: var(--c-info-fg); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--fill); color: var(--text-2);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .02em;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.badge--lit    { background: var(--c-lit-bg); color: var(--c-lit-fg); }
.badge--cover  { background: var(--c-cover-bg); color: var(--c-cover-fg); }
.badge--alert  { background: var(--c-alert-bg); color: var(--c-alert-fg); }
.badge--ok     { background: var(--c-ok-bg); color: var(--c-ok-fg); }
.badge--device { background: var(--c-device-bg); color: var(--c-device-fg); }
.badge--heat   { background: var(--c-heat-bg); color: var(--c-heat-fg); }
.badge--info   { background: var(--c-info-bg); color: var(--c-info-fg); }
.badge--solid  { background: var(--c-alert-solid); color: var(--c-alert-solid-fg); }
.badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ds-blink 1.6s ease-in-out infinite; }
.badge--count { min-width: 24px; height: 24px; padding: 0 7px; justify-content: center; background: var(--c-alert-solid); color: var(--c-alert-solid-fg); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot--ok { background: var(--c-ok); box-shadow: 0 0 0 4px var(--c-ok-bg); }
.dot--alert { background: var(--c-alert); box-shadow: 0 0 0 4px var(--c-alert-bg); }
.dot--warn { background: var(--c-lit); box-shadow: 0 0 0 4px var(--c-lit-bg); }
.dot--pulse { animation: ds-blink 1.6s ease-in-out infinite; }

/* ==========================================================================
   11. BANNIÈRES
   <div class="banner banner--alert" role="alert">
     <span class="banner__icon">…</span>
     <div class="banner__text"><b class="banner__title">…</b><span class="banner__desc">…</span></div>
     <button class="btn btn--sm">Annuler</button></div>
   ========================================================================== */
.banner {
  --banner-c: var(--c-info); --banner-fg: var(--c-info-fg); --banner-bg: var(--c-info-bg);
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  min-height: 72px;
  border-radius: var(--r-lg);
  background: var(--banner-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--banner-c) 22%, transparent);
}
.banner__icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--banner-c); color: var(--text-on-color); }
.banner__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.banner__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text); }
.banner__desc { font-size: var(--fs-sm); color: var(--text-2); }
.banner__actions { display: flex; gap: var(--sp-2); flex: none; }
.banner .btn { --btn-bg: var(--surface); }
[data-theme="light"] .banner .btn { box-shadow: var(--elev-1); }
.banner--info    { --banner-c: var(--c-info); --banner-fg: var(--c-info-fg); --banner-bg: var(--c-info-bg); }
.banner--alert   { --banner-c: var(--c-alert); --banner-fg: var(--c-alert-fg); --banner-bg: var(--c-alert-bg); }
.banner--warn    { --banner-c: var(--c-lit); --banner-fg: var(--c-lit-fg); --banner-bg: var(--c-lit-bg); }
.banner--ok      { --banner-c: var(--c-ok); --banner-fg: var(--c-ok-fg); --banner-bg: var(--c-ok-bg); }
.banner--vacation{ --banner-c: var(--c-cover); --banner-fg: var(--c-cover-fg); --banner-bg: var(--c-cover-bg); }
/* Compte à rebours (« Je pars » dans 20 s) : --p = progression restante (0–100 %) */
.banner--countdown { --banner-c: var(--c-lit); --banner-fg: var(--c-lit-fg); --banner-bg: var(--c-lit-bg); }
.banner__count {
  position: relative; width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 300; font-variant-numeric: tabular-nums; color: var(--text);
  border-radius: 50%;
  background: conic-gradient(var(--banner-c) var(--p, 100%), var(--fill-2) 0);
}
.banner__count::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); z-index: 0; }
.banner__count > span { position: relative; z-index: 1; }
.banner__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 100%); background: var(--banner-c); transition: width 1s linear; }
@media (max-width: 559.98px) {
  .banner { flex-wrap: wrap; }
  .banner__actions { width: 100%; }
  .banner__actions .btn { flex: 1; }
}

/* Bandeau de connexion perdue : neutre, persistant, en haut */
.banner--offline { --banner-c: var(--text-3); --banner-fg: var(--text-2); --banner-bg: var(--fill); }
.banner--offline .banner__icon { color: var(--bg); }

/* --- Compte à rebours plein écran (scénario différé, ERGONOMIE §5.5) ---
   <div class="countdown is-active" role="alertdialog" style="--p:85%">
     <div class="countdown__title"><svg class="icon">…</svg>Je pars</div>
     <div class="countdown__ring"><span class="countdown__num">17</span></div>
     <p class="countdown__desc">Lumières éteintes · volets fermés</p>
     <button class="countdown__cancel">Annuler</button>
     <button class="countdown__now">Exécuter maintenant</button></div>
   Tout l'écran = Annuler (géré en JS), sauf « Exécuter maintenant ». */
.countdown {
  position: fixed; inset: 0; z-index: calc(var(--z-screensaver) + 5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-6);
  padding: calc(var(--sp-6) + env(safe-area-inset-top)) var(--gutter) calc(var(--sp-6) + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .92); color: #F3F4F6; text-align: center;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
}
.countdown.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.countdown__title { display: inline-flex; align-items: center; gap: var(--sp-3); font-size: clamp(22px, 3.5vmin, 30px); font-weight: var(--fw-semibold); }
.countdown__title .icon { width: 1.3em; height: 1.3em; color: var(--c-lit); }
.countdown__ring {
  position: relative; width: min(240px, 40vmin); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--countdown-color, #FFB547) var(--p, 100%), rgba(255, 255, 255, .1) 0);
}
.countdown__ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #070708; }
.countdown__num { position: relative; font-family: var(--font-display); font-size: min(120px, 20vmin); font-weight: 200; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown__desc { max-width: 520px; font-size: clamp(16px, 2.6vmin, 20px); color: #A9AFB8; }
.countdown__cancel { width: min(320px, 100%); min-height: 80px; border-radius: var(--r-pill); background: #F3F4F6; color: #0B0C0E; font-size: clamp(20px, 3vmin, 24px); font-weight: var(--fw-bold); letter-spacing: .02em; }
.countdown__cancel:active { transform: scale(var(--press-scale)); }
.countdown__now { min-height: var(--hit); padding: 0 var(--sp-4); color: #A9AFB8; font-size: var(--fs-md); text-decoration: underline; text-underline-offset: 4px; }
[data-theme="night"] .countdown { color: var(--text); }
[data-theme="night"] .countdown__cancel { background: var(--inverse-bg); color: var(--inverse-text); }
[data-theme="night"] .countdown__ring { --countdown-color: var(--c-lit); }

/* ==========================================================================
   12. CARTES MÉTIER
   ========================================================================== */
/* --- Scénario : dégradé de --c1 à --c2 ---
   <button class="scene scene--morning"><span class="scene__icon">…</span>
     <span class="scene__name">Bonjour</span></button>          */
.scene {
  --c1: #CC8418; --c2: #8F5208;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-4);
  min-height: 124px; padding: var(--sp-4);
  border-radius: var(--r-lg);
  color: #fff; text-align: left;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 14px 30px -18px var(--c2);
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur) var(--ease-out);
}
.scene::after { /* voile bas : garantit le contraste du nom (AA) */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, .24), transparent 65%);
}
.scene:active { transform: scale(var(--press-scale)); }
.scene__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); color: #fff; }
.scene__icon .icon { width: 24px; height: 24px; }
.scene__name { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: var(--lh-snug); text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.scene__watermark { position: absolute; right: -16px; bottom: -18px; width: 96px; height: 96px; opacity: .14; z-index: -1; stroke-width: 1.3; }
.scene__delay { position: absolute; top: var(--sp-3); right: var(--sp-3); height: 24px; padding: 0 8px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, .22); font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.scene__delay .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.scene.is-running { filter: saturate(1.15) brightness(1.08); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 14px 30px -14px var(--c2); }
.scene.is-running .scene__icon { animation: ds-pulse 1.6s var(--ease-in-out) infinite; }
.scene--morning  { --c1: #E8743A; --c2: #A8380F; }
.scene--leave    { --c1: #5B6B82; --c2: #2B3646; }
.scene--home     { --c1: #16946A; --c2: #0D6446; }
.scene--evening  { --c1: #9B55E6; --c2: #5E22C2; }
.scene--movie    { --c1: #5458E0; --c2: #2A2A78; }
.scene--night    { --c1: #3B4A7A; --c2: #151B36; }
.scene--vacation { --c1: #138BA3; --c2: #0A5A72; }
.scene--custom   { --c1: #CC8418; --c2: #8F5208; }

/* --- Météo ---
   .weather > .weather__now (.weather__icon .weather__temp .weather__desc) + .weather__hours > .weather__hour */
.weather {
  display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: var(--sp-5);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--c-info-bg), transparent 55%), var(--surface);
  box-shadow: var(--elev-1), inset 0 0 0 1px var(--hairline);
  min-width: 0;
}
.weather__now { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--sp-1) var(--sp-4); }
.weather__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--wx-bg, var(--c-lit-bg)); color: var(--wx-fg, var(--c-lit-fg)); grid-row: span 2; }
.weather__icon .icon { width: 36px; height: 36px; stroke-width: 1.6; }
.weather__temp { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.weather__desc { font-size: var(--fs-sm); color: var(--text-2); }
.weather__meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-3); }
.weather__metric { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--fill); display: flex; flex-direction: column; }
.weather__metric span { font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: var(--tracking-caps); font-weight: var(--fw-semibold); }
.weather__metric b { font-size: var(--fs-md); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.weather__hours { display: flex; gap: var(--sp-1); overflow-x: auto; scrollbar-width: none; align-self: center; min-width: 0; }
.weather__hours::-webkit-scrollbar { display: none; }
.weather__hour { flex: 1 0 60px; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-1); border-radius: var(--r-md); font-variant-numeric: tabular-nums; }
.weather__hour.is-now { background: var(--fill); }
.weather__hour time { font-size: var(--fs-xs); color: var(--text-2); font-weight: var(--fw-medium); }
.weather__hour .icon { width: 26px; height: 26px; color: var(--text-2); }
.weather__hour b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.weather__hour small { font-size: var(--fs-xs); color: var(--c-cover-fg); font-weight: var(--fw-semibold); min-height: 1.2em; }
@media (max-width: 899.98px) { .weather { grid-template-columns: minmax(0, 1fr); } }

/* --- Caméra --- */
.cam {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  background: #050607;
  box-shadow: var(--elev-2);
}
.cam > img, .cam > video { width: 100%; height: 100%; object-fit: cover; }
.cam::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 28%, transparent 70%, rgba(0, 0, 0, .5)); }
.cam__top, .cam__bottom { position: absolute; left: var(--sp-3); right: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); z-index: 1; color: #fff; }
.cam__top { top: var(--sp-3); }
.cam__bottom { bottom: var(--sp-3); justify-content: space-between; }
.cam__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.cam__live { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.cam__live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #FF4D45; animation: ds-blink 1.6s ease-in-out infinite; }
.cam__time { font-size: var(--fs-xs); color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; margin-left: auto; }
.cam__offline { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: var(--sp-2); color: #9AA0A8; font-size: var(--fs-sm); background: repeating-linear-gradient(135deg, #0b0c0e 0 14px, #0e1012 14px 28px); z-index: 2; }
.cam.is-offline .cam__offline { display: grid; }

/* --- Pièce (mode pièce / tablette de chambre) ---
   .room-hero : grand en-tête de pièce + commandes principales */
.room-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-6);
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background: radial-gradient(120% 120% at 0% 0%, var(--c-lit-bg), transparent 60%), var(--surface);
  box-shadow: var(--elev-2), inset 0 0 0 1px var(--hairline);
}
.room-hero__name { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.room-hero__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.room-hero__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-6); }
.room-hero__controls { display: flex; gap: var(--sp-5); align-items: flex-end; }
@media (max-width: 599.98px) {
  .room-hero { grid-template-columns: minmax(0, 1fr); padding: var(--sp-5); }
  .room-hero__controls { justify-content: center; }
}

/* --- Liste (journal, réglages, utilisateurs) --- */
.list { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--elev-1), inset 0 0 0 1px var(--hairline); overflow: hidden; }
.list__row { display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: var(--sp-3) var(--sp-4); position: relative; text-align: left; width: 100%; }
.list__row + .list__row::before { content: ""; position: absolute; top: 0; right: 0; left: calc(var(--sp-4) + 40px + var(--sp-3)); height: 1px; background: var(--hairline); }
button.list__row:active, a.list__row:active { background: var(--fill); }
.list__icon { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--fill); color: var(--text-2); }
.list__icon .icon { width: 22px; height: 22px; }
.list__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list__title { font-size: var(--fs-md); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__trail { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; flex: none; }
.list__icon--lit { background: var(--c-lit-bg); color: var(--c-lit-fg); }
.list__icon--cover { background: var(--c-cover-bg); color: var(--c-cover-fg); }
.list__icon--alert { background: var(--c-alert-bg); color: var(--c-alert-fg); }
.list__icon--ok { background: var(--c-ok-bg); color: var(--c-ok-fg); }
.list__icon--device { background: var(--c-device-bg); color: var(--c-device-fg); }
.list__icon--heat { background: var(--c-heat-bg); color: var(--c-heat-fg); }
.list__icon--info { background: var(--c-info-bg); color: var(--c-info-fg); }

/* --- Statistique / valeur (température poêle, batterie robot…) --- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: .5em; color: var(--text-2); margin-left: 2px; font-weight: var(--fw-regular); letter-spacing: 0; }
.stat__label { font-size: var(--fs-xs); color: var(--text-2); }

/* ==========================================================================
   13. FEUILLE MODALE · TOAST
   --------------------------------------------------------------------------
   <div class="sheet-backdrop is-open"></div>
   <section class="sheet is-open" role="dialog" aria-modal="true">
     <div class="sheet__grabber"></div><header class="sheet__head">…</header>
     <div class="sheet__body">…</div><footer class="sheet__foot">…</footer></section>
   Téléphone, portrait < 900 px ou hauteur < 500 px : feuille du bas. Tablette : dialogue centré.
   ========================================================================== */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  background: var(--scrim);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: calc(var(--z-sheet) + 1);
  left: 50%; top: 50%;
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--elev-3), inset 0 0 0 1px var(--hairline);
  opacity: 0; pointer-events: none; visibility: hidden;
  transform: translate(-50%, -48%) scale(.96);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-spring), visibility 0s linear var(--dur-slow);
}
.sheet.is-open { opacity: 1; pointer-events: auto; visibility: visible; transform: translate(-50%, -50%) scale(1); transition-delay: 0s; }
.sheet--wide { width: min(820px, calc(100vw - 2 * var(--gutter))); }
.sheet__grabber { display: none; width: 40px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: var(--sp-2) auto 0; flex: none; }
.sheet__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-3) var(--sp-6); flex: none; }
.sheet__title { flex: 1; min-width: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.015em; line-height: var(--lh-snug); }
.sheet__subtitle { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-regular); letter-spacing: 0; }
.sheet__body { padding: var(--sp-2) var(--sp-6) var(--sp-6); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet__foot { display: flex; gap: var(--sp-2); padding: var(--sp-4) var(--sp-6) calc(var(--sp-5) + env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); flex: none; }
.sheet__foot .btn { flex: 1; }
@media (max-width: 599.98px), (max-width: 899.98px) and (orientation: portrait), (max-height: 499.98px) {
  .sheet, .sheet--wide {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top));
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(104%);
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
    transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
  }
  .sheet.is-open { transform: translateY(0); }
  .sheet__grabber { display: block; }
  .sheet__head { padding: var(--sp-3) var(--sp-4) var(--sp-2) var(--sp-5); }
  .sheet__body { padding: var(--sp-2) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom)); }
  .sheet__foot { padding: var(--sp-3) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
  .sheet__body:has(+ .sheet__foot) { padding-bottom: var(--sp-4); }
}

/* Toast : <div class="toast-region"><div class="toast toast--ok is-visible">…</div></div>
   Tablette : en haut au centre (lisible à distance, hors de la main).
   Téléphone / portrait : en bas, au-dessus de la barre du bas. Un seul à la fois. */
.toast-region {
  position: fixed; z-index: var(--z-toast);
  left: 0; right: 0; top: calc(var(--sp-5) + env(safe-area-inset-top));
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  pointer-events: none; padding: 0 var(--gutter);
}
.toast {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  max-width: min(640px, 100%); min-height: 60px; padding: var(--sp-2) var(--sp-5) var(--sp-2) var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--inverse-bg); color: var(--inverse-text);
  box-shadow: var(--elev-3);
  font-size: var(--fs-toast); font-weight: var(--fw-semibold); letter-spacing: -0.01em;
  pointer-events: auto;
  opacity: 0; transform: translateY(-16px) scale(.96);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-spring);
}
.toast.is-visible { opacity: 1; transform: none; }
@media (max-width: 599.98px), (max-width: 899.98px) and (orientation: portrait) {
  .toast-region { top: auto; bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom)); }
  .toast { transform: translateY(16px) scale(.96); }
  .toast.is-visible { transform: none; }
}
.toast__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(127, 127, 127, .2); }
.toast__icon .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.toast--ok .toast__icon { background: var(--c-ok); color: #06140D; }
.toast--alert .toast__icon { background: var(--c-alert); color: #fff; }
.toast--info .toast__icon { background: var(--c-info); color: #04131A; }
.toast__action { margin-left: var(--sp-2); margin-right: calc(-1 * var(--sp-3)); font-weight: var(--fw-bold); color: var(--inverse-link); min-height: var(--hit); padding: 0 var(--sp-3); border-radius: var(--r-pill); }
[data-theme="night"] .toast { box-shadow: 0 0 0 1px var(--border); }

/* ==========================================================================
   14. SQUELETTES · ÉTAT VIDE
   ========================================================================== */
.skel {
  display: block; border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 40%, var(--fill) 80%) 0 0 / 300% 100%;
  animation: ds-shimmer 1.6s linear infinite;
  color: transparent !important;
}
.skel--text { height: .9em; margin: .25em 0; width: var(--w, 100%); }
.skel--title { height: 1.3em; width: var(--w, 60%); border-radius: var(--r-xs); }
.skel--circle { border-radius: 50%; width: var(--s, 48px); height: var(--s, 48px); }
.skel--tile { height: 124px; border-radius: var(--r-lg); }
.skel--card { height: 180px; border-radius: var(--r-lg); }
.skel--cam { aspect-ratio: 16 / 9; border-radius: var(--r-lg); }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-10) var(--sp-6); text-align: center;
  border-radius: var(--r-lg); border: 1.5px dashed var(--border);
  color: var(--text-2); font-size: var(--fs-sm);
}
.empty .icon { width: 40px; height: 40px; color: var(--text-3); margin-bottom: var(--sp-1); stroke-width: 1.5; }
.empty__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text); }

/* ==========================================================================
   15. FORMULAIRES · CONNEXION
   ========================================================================== */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.form-row > .field { flex: 1 1 180px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
.field__hint { font-size: var(--fs-xs); color: var(--text-2); }
.field__error { font-size: var(--fs-xs); color: var(--c-alert-fg); font-weight: var(--fw-medium); display: none; align-items: center; gap: 6px; }
.field__error .icon { width: 16px; height: 16px; }
.field.is-invalid .field__error { display: flex; }
.field.is-invalid .input { box-shadow: inset 0 0 0 1.5px var(--c-alert); }
.input {
  width: 100%; min-height: 52px; padding: 0 var(--sp-4);
  border: 0; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
  font: inherit; font-size: 17px; /* ≥ 16 px : pas de zoom auto sur iOS */
  transition: box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--focus); background: var(--surface); }
.input:disabled { opacity: .5; }
textarea.input { padding: var(--sp-3) var(--sp-4); min-height: 112px; resize: vertical; line-height: var(--lh-body); }
select.input {
  padding-right: var(--sp-10);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.input-group { position: relative; }
.input-group > .icon { position: absolute; left: var(--sp-4); top: 50%; margin-top: -11px; width: 22px; height: 22px; color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-left: calc(var(--sp-4) + 22px + var(--sp-3)); }
.input-group > .input-group__btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.check { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--hit); font-size: var(--fs-md); cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--brand); flex: none; }

/* Écran de connexion
   <div class="login"><div class="login__card">
     <div class="login__brand"><div class="login__logo"><img src="logo-mark.png" alt=""></div>
       <h1 class="login__title">Maison</h1><p class="login__sub">Groupe Colonna</p></div>
     <form class="form">…</form></div></div> */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: calc(var(--sp-6) + env(safe-area-inset-top)) calc(var(--gutter) + env(safe-area-inset-right)) calc(var(--sp-6) + env(safe-area-inset-bottom)) calc(var(--gutter) + env(safe-area-inset-left));
  background:
    radial-gradient(800px 500px at 15% 0%, var(--c-info-bg), transparent 70%),
    radial-gradient(700px 500px at 100% 100%, var(--c-lit-bg), transparent 70%),
    var(--bg);
}
.login__card {
  width: min(420px, 100%);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--elev-3), inset 0 0 0 1px var(--hairline);
}
.login__brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: var(--sp-6); }
.login__logo { width: 72px; height: 72px; border-radius: 22px; padding: 12px; background: #fff; box-shadow: var(--elev-2); margin-bottom: var(--sp-4); }
.login__logo img { width: 100%; height: 100%; object-fit: contain; }
.login__title { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.login__sub { font-size: var(--fs-sm); color: var(--text-2); margin-top: var(--sp-1); }
.login__foot { margin-top: var(--sp-5); text-align: center; font-size: var(--fs-xs); color: var(--text-3); display: flex; align-items: center; justify-content: center; gap: 6px; }
.login__foot .icon { width: 16px; height: 16px; }
@media (max-width: 479.98px) {
  .login { align-items: start; padding-top: calc(var(--sp-12) + env(safe-area-inset-top)); background: var(--bg); }
  .login__card { background: transparent; box-shadow: none; padding: 0; }
}
/* Onglets (Se connecter / Appairer) : .seg.seg--block.login__tabs */
.login__tabs { margin-bottom: var(--sp-5); }
/* Message de formulaire (erreur par défaut, .is-ok = succès / information) ; vide = masqué */
.login__msg {
  display: block;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--c-alert-bg); color: var(--c-alert-fg);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: var(--lh-snug, 1.35);
}
.login__msg.is-ok, .login__msg.ok { background: var(--c-ok-bg); color: var(--c-ok-fg); }
.login__msg.is-info { background: var(--fill); color: var(--text-2); }
.login__msg:empty { display: none; }
.login__hint { font-size: var(--fs-xs); color: var(--text-2); line-height: var(--lh-body); text-align: center; }
.login__hint:empty { display: none; }
.login__notice { text-align: center; color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-body); }
.login__notice b { color: var(--text); }

/* Code à 6 chiffres (appairage)
   <div class="pin"><span class="pin__box is-current">4</span>…</div> */
.pin { display: flex; justify-content: center; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-5); }
.pin__box, .pin > span {
  flex: 0 1 48px; height: 60px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
  font-family: var(--font-display); font-size: 28px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--text);
  transition: box-shadow var(--dur) var(--ease-out);
}
.pin__box.is-current, .pin > span.cur { box-shadow: inset 0 0 0 2px var(--focus), 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }

/* Pavé numérique
   <div class="keypad"><button class="keypad__key">1</button>…<button class="keypad__key keypad__key--alt">Effacer</button>
   <button class="keypad__key keypad__key--go">Valider</button></div> */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.keypad__key, .keypad > button {
  min-height: 64px; border-radius: var(--r-lg);
  background: var(--fill); color: var(--text);
  font-family: var(--font-display); font-size: 26px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  touch-action: manipulation; cursor: pointer;
  transition: background-color var(--dur-fast, 120ms) var(--ease-out), transform var(--dur-fast, 120ms) var(--ease-out);
}
.keypad__key:active, .keypad > button:active { background: var(--fill-2); transform: scale(var(--press-scale)); }
.keypad .keypad__key--alt { font-family: inherit; font-size: var(--fs-sm); color: var(--text-2); }
.keypad .keypad__key--go { background: var(--inverse-bg); color: var(--inverse-text); font-family: inherit; font-size: var(--fs-md); font-weight: var(--fw-bold); }
.keypad .keypad__key--go:active { background: var(--inverse-bg); filter: brightness(.92); }

/* Tablette murale en paysage : marque à gauche, formulaire à droite */
@media (min-width: 700px) and (orientation: landscape) and (max-height: 820px) {
  .login__card--split { width: min(860px, 100%); display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-10); align-items: center; padding: var(--sp-8); }
  .login__card--split .login__brand { margin: 0; }
  .login__card--split .login__logo { width: 104px; height: 104px; border-radius: 28px; padding: 16px; }
  .login__card--split .login__foot { grid-column: 1 / -1; margin-top: 0; }
}
@media (max-height: 620px) {
  .login { padding-top: calc(var(--sp-4) + env(safe-area-inset-top)); padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); }
  .login__card--split { padding: var(--sp-6); }
  .login__card .form { gap: var(--sp-3); }
  .login__card .input { min-height: 48px; }
  .keypad__key, .keypad > button { min-height: 54px; }
  .pin__box, .pin > span { height: 52px; }
}

/* ==========================================================================
   16. ÉCRAN DE VEILLE (horloge géante)
   <div class="screensaver is-active"><div class="screensaver__inner">
     <time class="screensaver__clock">22:41</time><div class="screensaver__date">…</div>
     <div class="screensaver__weather">…</div></div><div class="screensaver__brand">…</div></div>
   Un toucher le ferme (géré en JS). Dérive lente anti-marquage.
   ========================================================================== */
.screensaver {
  position: fixed; inset: 0; z-index: var(--z-screensaver);
  display: grid; place-items: center;
  background: #000; color: #E6E8EB;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-xslow) var(--ease-out), visibility 0s linear var(--dur-xslow);
  cursor: none;
}
.screensaver.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.screensaver__inner { display: flex; flex-direction: column; align-items: center; text-align: center; animation: ds-drift 240s ease-in-out infinite alternate;
  transform: translate(var(--shift-x, 0), var(--shift-y, 0)); /* ou décalage aléatoire posé en JS */ }
.screensaver__clock { font-family: var(--font-display); font-size: var(--fs-giant); font-weight: 200; letter-spacing: -0.045em; line-height: .9; font-variant-numeric: tabular-nums; }
.screensaver__date { margin-top: var(--sp-3); font-size: clamp(18px, 3.4vmin, 32px); color: #9097A0; font-weight: var(--fw-medium); }
.screensaver__weather { margin-top: var(--sp-6); display: inline-flex; align-items: center; gap: var(--sp-3); font-size: clamp(18px, 3.4vmin, 30px); color: #C2C7CE; font-variant-numeric: tabular-nums; }
.screensaver__weather .icon { width: 1.4em; height: 1.4em; stroke-width: 1.5; color: #FFC56E; }
.screensaver__weather small { color: #80868F; font-size: .75em; }
.screensaver__brand { position: absolute; bottom: calc(var(--sp-6) + env(safe-area-inset-bottom)); font-size: var(--fs-xs); letter-spacing: .32em; text-transform: uppercase; color: #3F444B; }
.screensaver__alert {
  margin-top: var(--sp-8); display: inline-flex; align-items: center; gap: var(--sp-3);
  min-height: 64px; padding: var(--sp-3) var(--sp-6); border-radius: var(--r-pill);
  background: rgba(255, 181, 71, .14); color: #FFC56E;
  font-size: clamp(18px, 3vmin, 22px); font-weight: var(--fw-semibold);
}
.screensaver__alert .icon { width: 26px; height: 26px; }
.screensaver__alert--alert { background: rgba(255, 93, 85, .16); color: #FF8A83; }
.screensaver__alert--info { background: rgba(91, 184, 220, .14); color: #8FD0EA; }
@media (max-width: 599.98px) { .screensaver__brand { bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); } .screensaver__room { bottom: calc(var(--sp-10, 40px) + env(safe-area-inset-bottom)) !important; right: auto !important; left: 50%; transform: translateX(-50%); } }
.screensaver__room { position: absolute; right: calc(var(--sp-6) + env(safe-area-inset-right)); bottom: calc(var(--sp-6) + env(safe-area-inset-bottom)); font-size: 15px; color: rgba(230, 232, 235, .4); }
/* Veille de nuit (chambres) : chiffres rouge-ambre très faibles */
.screensaver--night, [data-theme="night"] .screensaver { color: #7A3B1E; } /* ≈ 15 % de luminance, ERGONOMIE §4.4 */
.screensaver--night .screensaver__date, [data-theme="night"] .screensaver__date,
.screensaver--night .screensaver__weather, [data-theme="night"] .screensaver__weather { color: #6B3122; }
.screensaver--night .screensaver__weather .icon, [data-theme="night"] .screensaver__weather .icon { color: #7A3A26; }
.screensaver--night .screensaver__brand, [data-theme="night"] .screensaver__brand,
.screensaver--night .screensaver__weather, [data-theme="night"] .screensaver__weather { display: none; }
.screensaver--night .screensaver__inner, [data-theme="night"] .screensaver__inner { animation: none; }
.screensaver--night .screensaver__alert, [data-theme="night"] .screensaver__alert { background: rgba(122, 59, 30, .18); color: #7A3B1E; }
.screensaver--night .screensaver__room, [data-theme="night"] .screensaver__room { color: #3A1C10; }

/* Variantes sémantiques cinéma / Jarvis des composants génériques */
.tile--cinema { --tile-color: var(--c-cinema); }
.tile--jarvis { --tile-color: var(--c-jarvis); }
.chip--cinema { background: var(--c-cinema-bg); color: var(--c-cinema-fg); }
.chip--jarvis { background: var(--c-jarvis-bg); color: var(--c-jarvis-fg); }
.badge--cinema { background: var(--c-cinema-bg); color: var(--c-cinema-fg); }
.badge--jarvis { background: var(--c-jarvis-bg); color: var(--c-jarvis-fg); }
.list__icon--cinema { background: var(--c-cinema-bg); color: var(--c-cinema-fg); }
.list__icon--jarvis { background: var(--c-jarvis-bg); color: var(--c-jarvis-fg); }
.switch--cinema { --switch-color: var(--c-cinema); }
.c-cinema { color: var(--c-cinema-fg); } .c-jarvis { color: var(--c-jarvis-fg); }

/* ==========================================================================
   17. HOME CINÉMA
   --------------------------------------------------------------------------
   <section class="cinema">
     <header class="cinema__head">…</header>
     <div class="cinema__devices"> .cinema__device × 2 (ampli, projecteur) </div>
     <div class="source-grid"> .source × n </div>
     <div class="volume">…</div>
   </section>
   Dégradé magenta → indigo réservé au cinéma (séance, source active, volume).
   ========================================================================== */
.cinema {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: var(--sp-5);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c-cinema-2) 26%, transparent), transparent 55%),
    radial-gradient(90% 110% at 0% 100%, var(--c-cinema-bg), transparent 60%),
    var(--surface);
  box-shadow: var(--elev-2), inset 0 0 0 1px var(--hairline);
  min-width: 0;
}
.cinema__head { display: flex; align-items: center; gap: var(--sp-3); }
.cinema__badge {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--c-cinema), var(--c-cinema-2));
  box-shadow: 0 10px 24px -10px var(--c-cinema);
}
.cinema__badge .icon { width: 26px; height: 26px; }
.cinema__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.012em; }
.cinema__sub { font-size: var(--fs-sm); color: var(--text-2); }
.cinema__devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--sp-3); }
.cinema__device {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 72px; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); background: var(--fill);
}
.cinema__device .card__icon { width: 44px; height: 44px; }
.cinema__device.is-on .card__icon { background: var(--c-cinema-bg); color: var(--c-cinema-fg); }
.cinema__device.is-busy .card__icon { animation: ds-blink 1.2s ease-in-out infinite; }

/* Sources (HDMI, appli TV, Bluetooth…) */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--sp-2); }
.source {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-md); background: var(--fill); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-align: center;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.source .icon { width: 28px; height: 28px; }
.source small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); }
.source:active { transform: scale(.96); }
.source.is-selected, .source[aria-pressed="true"] {
  color: var(--text);
  background: linear-gradient(140deg, color-mix(in srgb, var(--c-cinema) 26%, transparent), color-mix(in srgb, var(--c-cinema-2) 26%, transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c-cinema) 70%, transparent);
}
.source.is-selected .icon, .source[aria-pressed="true"] .icon { color: var(--c-cinema-fg); }
.source.is-selected small, .source[aria-pressed="true"] small { color: var(--text-2); }

/* Volume : piste 56 dp, gradué ; le JS règle --v (0–100 %) et le libellé.
   <div class="volume" style="--v:45%">
     <button class="icon-btn volume__mute" aria-pressed="false">…i-volume…</button>
     <div class="volume__track" role="slider" aria-valuenow="45"><div class="volume__fill"></div>
       <span class="volume__label">Volume</span><span class="volume__value">−28 dB</span></div>
     <button class="icon-btn">−</button><button class="icon-btn">+</button></div> */
.volume { --v: 40%; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.volume__track {
  position: relative; overflow: hidden; isolation: isolate; flex: 1; min-width: 0;
  height: 56px; border-radius: var(--r-pill);
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none;
}
.volume__track::after { /* graduations tous les 10 % */
  content: ""; position: absolute; inset: 18px 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255, 255, 255, .14) calc(10% - 1px) 10%);
}
[data-theme="light"] .volume__track::after { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(15, 18, 25, .1) calc(10% - 1px) 10%); }
.volume__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--v);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c-cinema-2), var(--c-cinema));
  box-shadow: 0 0 22px -4px var(--c-cinema);
  transition: width var(--dur-fast) linear;
}
.volume__fill::after { content: ""; position: absolute; right: 8px; top: 50%; width: 4px; height: 24px; margin-top: -12px; border-radius: 2px; background: rgba(255, 255, 255, .9); }
.volume__label, .volume__value { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; pointer-events: none; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.volume__label { left: var(--sp-5); font-size: var(--fs-sm); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.volume__value { right: var(--sp-5); font-size: var(--fs-md); color: var(--text); }
.volume.is-muted .volume__fill { background: var(--surface-3); box-shadow: none; }
.volume.is-muted .volume__label { color: var(--text-2); text-shadow: none; }
.volume__mute[aria-pressed="true"] { --btn-bg: var(--c-alert-bg); --btn-fg: var(--c-alert-fg); }
@media (max-width: 599.98px) { .volume__step { display: none; } } /* téléphone : piste seule + muet */

/* --- Télécommande tactile ---
   <div class="remote">
     <div class="dpad"><button class="dpad__btn dpad__btn--up" aria-label="Haut">…</button>
       (--right, --down, --left) <button class="dpad__ok">OK</button></div>
     <div class="remote__keys"> .icon-btn.icon-btn--lg × 6 </div></div>
   Variante : .touchpad (glisser = flèches, toucher = OK). */
.remote { display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); }
.dpad {
  --dpad: clamp(208px, 26vmin, 260px);
  position: relative; width: var(--dpad); height: var(--dpad); flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--surface-3), var(--surface-2) 70%);
  box-shadow: var(--elev-2), inset 0 0 0 1px var(--hairline), inset 0 -10px 24px rgba(0, 0, 0, .18);
}
.dpad__btn {
  position: absolute; display: grid; place-items: center;
  width: 33%; height: 33%; border-radius: 50%;
  color: var(--text-2);
  transition: color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.dpad__btn .icon { width: 30px; height: 30px; stroke-width: 2; }
.dpad__btn:active { color: var(--text); background: var(--fill-2); transform: scale(.92); }
.dpad__btn--up    { top: 2%; left: 33.5%; }
.dpad__btn--down  { bottom: 2%; left: 33.5%; }
.dpad__btn--left  { left: 2%; top: 33.5%; }
.dpad__btn--right { right: 2%; top: 33.5%; }
.dpad__ok {
  position: absolute; left: 50%; top: 50%; width: 40%; height: 40%; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: .04em; color: #fff;
  background: linear-gradient(145deg, var(--c-cinema), var(--c-cinema-2));
  box-shadow: 0 10px 26px -8px var(--c-cinema), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur) var(--ease-out);
}
.dpad__ok:active { transform: translate(-50%, -50%) scale(.94); filter: brightness(1.1); }
.remote__keys { display: grid; grid-template-columns: repeat(3, 64px); gap: var(--sp-3) var(--sp-5); justify-content: center; }
.remote__keys .icon-btn { width: 64px; height: 64px; }
.remote__keys .icon-btn .icon { width: 26px; height: 26px; }
.touchpad {
  position: relative; overflow: hidden;
  width: 100%; aspect-ratio: 16 / 9; max-height: 260px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle, var(--fill-2) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    radial-gradient(80% 80% at 50% 0%, var(--c-cinema-bg), transparent 70%),
    var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  display: grid; place-items: center; touch-action: none;
}
.touchpad__hint { font-size: var(--fs-sm); color: var(--text-3); text-align: center; padding: var(--sp-4); }
.touchpad__ripple { position: absolute; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--c-cinema-bg); box-shadow: inset 0 0 0 2px var(--c-cinema); animation: ds-ripple .5s var(--ease-out) forwards; pointer-events: none; }
/* Grille d'applis (lanceur Apple TV / Android TV)
   <div class="app-grid"><button class="app-tile" style="--app-color:#E5484D" aria-label="Ouvrir Films">
     <span class="app-tile__art">F</span><span class="app-tile__name">Films</span></button>…</div>
   --app-color : couleur de l'appli ; .app-tile__art accepte une lettre, une icône ou une <img> 16:9.
   .is-active = appli au premier plan. */
.app-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 88px), 1fr)); width: 100%; }
.app-tile { --app-color: var(--c-cinema); display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; text-align: left; border-radius: var(--r-md); color: var(--text); }
.app-tile__art {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; width: 100%; overflow: hidden;
  border-radius: var(--r-md); color: #fff; font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.02em;
  background: radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, .28), transparent 50%), linear-gradient(150deg, var(--app-color), color-mix(in srgb, var(--app-color) 55%, #000));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px -12px var(--app-color);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out);
}
.app-tile__art .icon { width: 30px; height: 30px; stroke-width: 2; }
.app-tile__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.app-tile__name { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.app-tile:active .app-tile__art { transform: scale(.95); }
.app-tile.is-active .app-tile__art { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c-cinema), 0 10px 24px -10px var(--app-color); }
.app-tile.is-active .app-tile__name { color: var(--text); font-weight: var(--fw-semibold); }
.app-tile--add .app-tile__art { background: var(--fill); color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--border); }
[data-theme="night"] .app-tile__art { background: var(--fill-2); color: var(--text); box-shadow: none; }

/* ==========================================================================
   18. ÉLECTROMÉNAGER (Home Connect)
   --------------------------------------------------------------------------
   .appliance = carte d'appareil (en-tête + corps). Couleur : --app-color
   (four = chauffage, cafetière / lave-vaisselle = appareils).
   ========================================================================== */
.appliance {
  --app-color: var(--c-device); --app-fg: var(--c-device-fg); --app-bg: var(--c-device-bg);
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: var(--sp-5);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--elev-1), inset 0 0 0 1px var(--hairline);
  min-width: 0;
}
.appliance::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(110% 80% at 0% 0%, var(--app-bg), transparent 60%); opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
.appliance.is-on::before, .appliance.is-running::before { opacity: 1; }
.appliance--heat { --app-color: var(--c-heat); --app-fg: var(--c-heat-fg); --app-bg: var(--c-heat-bg); }
.appliance__head { display: flex; align-items: center; gap: var(--sp-3); }
.appliance__icon { width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; background: var(--fill); color: var(--text-2); }
.appliance__icon .icon { width: 28px; height: 28px; }
.appliance.is-on .appliance__icon, .appliance.is-running .appliance__icon { background: var(--app-color); color: var(--text-on-color); box-shadow: 0 8px 22px -10px var(--app-color); }
.appliance__titles { flex: 1; min-width: 0; }
.appliance__name { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appliance__state { font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.appliance.is-running .appliance__state { color: var(--app-fg); font-weight: var(--fw-medium); }
.appliance__body { display: grid; gap: var(--sp-5); grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.appliance__controls { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.appliance__foot { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.appliance__foot .btn { flex: 1 1 140px; }
@media (max-width: 599.98px) { .appliance__body { grid-template-columns: minmax(0, 1fr); justify-items: center; } .appliance__controls { width: 100%; } }

/* Anneau de progression (température du four + temps restant)
   <div class="ring" style="--p:72%; --p2:40%">
     <div class="ring__center"><span class="ring__value">172<small>°C</small></span>
       <span class="ring__label">→ 200 °C</span><span class="ring__sub">18:40 restantes</span></div></div>
   --p  : anneau extérieur (température atteinte / consigne)
   --p2 : anneau intérieur optionnel (.ring--dual : temps écoulé / durée) */
.ring {
  --ring-size: clamp(184px, 22vmin, 232px); --ring-w: 14px;
  --ring-color: var(--c-heat); --ring-color-2: var(--c-lit);
  --p: 0%; --p2: 0%;
  position: relative; width: var(--ring-size); aspect-ratio: 1; flex: none;
  display: grid; place-items: center;
}
.ring::before, .ring::after {
  content: ""; position: absolute; border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-w)), #000 calc(100% - var(--ring-w) + 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-w)), #000 calc(100% - var(--ring-w) + 1px));
}
.ring::before {
  inset: 0;
  background: conic-gradient(from 0deg, var(--ring-color-2), var(--ring-color) var(--p), var(--fill-2) var(--p) 100%);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ring-color) 45%, transparent));
}
.ring--dual::after {
  inset: calc(var(--ring-w) + 8px); --ring-w: 6px;
  background: conic-gradient(var(--text-2) var(--p2), var(--fill) var(--p2) 100%);
}
.ring__center { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.ring__value { font-family: var(--font-display); font-size: clamp(40px, 6vmin, 56px); font-weight: 250; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring__value small { font-size: .4em; font-weight: var(--fw-medium); color: var(--text-2); letter-spacing: 0; margin-left: 2px; vertical-align: .9em; }
.ring__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.ring__sub { margin-top: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-heat-fg); font-variant-numeric: tabular-nums; }
.ring--device { --ring-color: var(--c-device); --ring-color-2: var(--c-cover); }
.ring--device .ring__sub { color: var(--c-device-fg); }
.ring.is-heating::before { animation: ds-glow 2.4s var(--ease-in-out) infinite; }
.ring--sm { --ring-size: 132px; --ring-w: 10px; }
.ring--sm .ring__value { font-size: 32px; }

/* Choix (modes de cuisson, boissons, programmes) : grille de gros boutons
   <div class="choice-grid"><button class="choice is-selected" aria-pressed="true">
     <svg class="icon">…</svg><span class="choice__name">Chaleur tournante</span><small class="choice__meta">3D</small></button></div> */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); gap: var(--sp-2); }
.choice-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-grid--scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.choice-grid--scroll::-webkit-scrollbar { display: none; }
.choice-grid--scroll > .choice { flex: 0 0 112px; scroll-snap-align: start; }
.choice {
  --choice-color: var(--c-heat); --choice-fg: var(--c-heat-fg); --choice-bg: var(--c-heat-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-md); background: var(--fill); color: var(--text-2);
  text-align: center;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.choice .icon { width: 30px; height: 30px; }
.choice__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.2; color: var(--text); }
.choice__meta { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.choice:active { transform: scale(.96); }
.choice.is-selected, .choice[aria-pressed="true"], .choice[aria-checked="true"] { background: var(--choice-bg); color: var(--choice-fg); box-shadow: inset 0 0 0 1.5px var(--choice-color); }
.choice.is-selected .choice__meta, .choice[aria-pressed="true"] .choice__meta { color: var(--choice-fg); }
.choice--device { --choice-color: var(--c-device); --choice-fg: var(--c-device-fg); --choice-bg: var(--c-device-bg); }
.choice:disabled { opacity: .4; }

/* Minuteur / durée : <div class="timer"><svg class="icon">i-timer</svg><span class="timer__value">18:40</span><span class="timer__label">restantes</span></div> */
.timer { display: inline-flex; align-items: baseline; gap: var(--sp-2); font-variant-numeric: tabular-nums; }
.timer .icon { align-self: center; color: var(--text-2); }
.timer__value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.timer__label { font-size: var(--fs-sm); color: var(--text-2); }

/* Cycle (lave-vaisselle) : phases + temps restant
   <ol class="phases"><li class="is-done">Prélavage</li><li class="is-current" style="--p:45%">Lavage</li><li>Rinçage</li><li>Séchage</li></ol> */
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.phases li { display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phases li::before { content: ""; height: 6px; border-radius: var(--r-pill); background: var(--fill-2); }
.phases li.is-done { color: var(--text-2); }
.phases li.is-done::before { background: var(--phase-color, var(--c-device)); opacity: .55; }
.phases li.is-current { color: var(--text); font-weight: var(--fw-semibold); }
.phases li.is-current::before { background: linear-gradient(90deg, var(--phase-color, var(--c-device)) var(--p, 50%), var(--fill-2) var(--p, 50%)); box-shadow: 0 0 12px -2px var(--phase-color, var(--c-device)); }
.cycle { display: flex; flex-direction: column; gap: var(--sp-4); }
.cycle__top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

/* ==========================================================================
   19. JARVIS — ASSISTANT VOCAL
   --------------------------------------------------------------------------
   Orbe flottant (bouton micro) :
   <button class="jarvis-orb" data-state="idle|listening|thinking|speaking" aria-label="Parler à Jarvis">
     <svg class="icon jarvis-orb__icon"><use href="icons.svg#i-mic"/></svg>
     <span class="jarvis-orb__wave" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span>
     <span class="jarvis-orb__dots" aria-hidden="true"><i></i><i></i><i></i></span></button>
   Les classes .is-listening / .is-thinking / .is-speaking sont équivalentes à data-state.
   Bulle de transcription : .jarvis-bubble ; panneau de conversation : .jarvis-panel.
   Style « hologramme » discret : cyan → bleu, verre, fines lignes de balayage.
   ========================================================================== */
.jarvis-orb {
  --orb: 72px;
  position: fixed; z-index: var(--z-jarvis);
  right: calc(var(--gutter) + env(safe-area-inset-right));
  bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  width: var(--orb); height: var(--orb); border-radius: 50%;
  display: grid; place-items: center; isolation: isolate;
  color: #F0FDFF;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), transparent 24%),
    radial-gradient(circle at 50% 60%, var(--c-jarvis) 0%, var(--c-jarvis-2) 62%, #0A1838 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--c-jarvis) 45%, transparent),
    0 0 28px -6px var(--c-jarvis),
    0 14px 32px -12px rgba(0, 0, 0, .65),
    inset 0 -8px 18px rgba(4, 20, 60, .45), inset 0 2px 10px rgba(255, 255, 255, .25);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur-slow) var(--ease-out);
}
.jarvis-orb:active { transform: scale(.92); }
.jarvis-orb::before { /* anneau orbital */
  content: ""; position: absolute; inset: -7px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 18%, var(--c-jarvis) 34%, transparent 48% 66%, var(--c-jarvis-2) 84%, transparent 96%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  opacity: .7; animation: ds-spin 9s linear infinite;
}
.jarvis-orb::after { /* onde d'écoute */
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1;
  box-shadow: 0 0 0 2px var(--c-jarvis); opacity: 0; pointer-events: none;
}
.jarvis-orb__icon { width: 30px; height: 30px; stroke-width: 2; filter: drop-shadow(0 1px 3px rgba(0, 30, 70, .5)); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.jarvis-orb__wave, .jarvis-orb__dots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; opacity: 0; transition: opacity var(--dur) var(--ease-out); pointer-events: none; }
.jarvis-orb__wave i { width: 4px; height: 26px; border-radius: 2px; background: #F0FDFF; transform: scaleY(.3); box-shadow: 0 0 8px rgba(200, 250, 255, .8); }
.jarvis-orb__dots i { width: 7px; height: 7px; border-radius: 50%; background: #F0FDFF; box-shadow: 0 0 8px rgba(200, 250, 255, .9); }
/* Écoute : respiration + ondes concentriques */
.jarvis-orb.is-listening, .jarvis-orb[data-state="listening"] { animation: jv-breathe 1.8s var(--ease-in-out) infinite; box-shadow: 0 0 0 1px var(--c-jarvis), 0 0 44px -2px var(--c-jarvis), 0 14px 32px -12px rgba(0, 0, 0, .65), inset 0 -8px 18px rgba(4, 20, 60, .45), inset 0 2px 10px rgba(255, 255, 255, .25); }
.jarvis-orb.is-listening::after, .jarvis-orb[data-state="listening"]::after { animation: jv-ripple 1.8s var(--ease-out) infinite; }
/* Réflexion : anneau rapide, points qui pulsent */
.jarvis-orb.is-thinking::before, .jarvis-orb[data-state="thinking"]::before { inset: -9px; opacity: 1; animation-duration: 1.1s;
  background: conic-gradient(var(--c-jarvis) 0 22%, transparent 22% 50%, var(--c-jarvis-2) 50% 72%, transparent 72%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); }
.jarvis-orb.is-thinking .jarvis-orb__icon, .jarvis-orb[data-state="thinking"] .jarvis-orb__icon,
.jarvis-orb.is-speaking .jarvis-orb__icon, .jarvis-orb[data-state="speaking"] .jarvis-orb__icon { opacity: 0; transform: scale(.6); }
.jarvis-orb.is-thinking .jarvis-orb__dots, .jarvis-orb[data-state="thinking"] .jarvis-orb__dots { opacity: 1; }
.jarvis-orb__dots i { animation: jv-dot 1.2s var(--ease-in-out) infinite; }
.jarvis-orb__dots i:nth-child(2) { animation-delay: .15s; }
.jarvis-orb__dots i:nth-child(3) { animation-delay: .3s; }
/* Parole : barres d'égaliseur */
.jarvis-orb.is-speaking .jarvis-orb__wave, .jarvis-orb[data-state="speaking"] .jarvis-orb__wave { opacity: 1; }
.jarvis-orb__wave i { animation: jv-bar .9s var(--ease-in-out) infinite; }
.jarvis-orb__wave i:nth-child(2) { animation-delay: -.6s; }
.jarvis-orb__wave i:nth-child(3) { animation-delay: -.3s; }
.jarvis-orb__wave i:nth-child(4) { animation-delay: -.75s; }
.jarvis-orb__wave i:nth-child(5) { animation-delay: -.45s; }
.jarvis-orb.is-speaking, .jarvis-orb[data-state="speaking"] { box-shadow: 0 0 0 1px var(--c-jarvis), 0 0 52px 0 color-mix(in srgb, var(--c-jarvis) 70%, transparent), 0 14px 32px -12px rgba(0, 0, 0, .65), inset 0 -8px 18px rgba(4, 20, 60, .45); }
/* Erreur / micro indisponible */
.jarvis-orb.is-error, .jarvis-orb[data-state="error"] { background: radial-gradient(circle at 50% 60%, var(--c-alert), #5A120E); box-shadow: 0 0 0 1px var(--c-alert), 0 14px 32px -12px rgba(0, 0, 0, .65); }
.jarvis-orb.is-error::before, .jarvis-orb[data-state="error"]::before { display: none; }
.jarvis-orb--inline { position: relative; right: auto; bottom: auto; z-index: auto; }
.jarvis-orb--sm { --orb: 44px; }
.jarvis-orb--sm .jarvis-orb__icon { width: 22px; height: 22px; }
.jarvis-orb--sm .jarvis-orb__wave i { width: 3px; height: 16px; }
.jarvis-orb--sm .jarvis-orb__dots i { width: 5px; height: 5px; }
.jarvis-orb--sm::before { inset: -5px; }
.jarvis-orb--lg { --orb: 112px; }
.jarvis-orb--lg .jarvis-orb__icon { width: 42px; height: 42px; }
.jarvis-orb--lg .jarvis-orb__wave i { width: 6px; height: 40px; gap: 6px; }
@media (max-width: 599.98px), (max-width: 899.98px) and (orientation: portrait) {
  .jarvis-orb:not(.jarvis-orb--inline) { --orb: 60px; bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom)); right: calc(var(--sp-4) + env(safe-area-inset-right)); }
}

/* Bulle de transcription (au-dessus de l'orbe)
   <div class="jarvis-bubble is-visible" role="status" aria-live="polite">
     <div class="jarvis-bubble__label">J'écoute…</div>
     <p class="jarvis-bubble__text">Éteins le salon et <span class="is-partial">ferme les vol</span></p></div> */
.jarvis-bubble {
  position: fixed; z-index: var(--z-jarvis);
  right: calc(var(--gutter) + env(safe-area-inset-right));
  bottom: calc(var(--sp-6) + 72px + var(--sp-4) + env(safe-area-inset-bottom));
  width: max-content; max-width: min(440px, calc(100vw - 2 * var(--gutter)));
  padding: var(--sp-4) var(--sp-5);
  border-radius: 24px 24px 8px 24px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c-jarvis) 12%, transparent), transparent 60%), var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(22px); backdrop-filter: saturate(160%) blur(22px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-jarvis) 35%, transparent), 0 0 30px -12px var(--c-jarvis), var(--elev-3);
  opacity: 0; transform: translateY(10px) scale(.97); transform-origin: 100% 100%; pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-spring);
}
.jarvis-bubble.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.jarvis-bubble::before { /* liseré holographique */
  content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-jarvis), transparent);
}
.jarvis-bubble__label { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-jarvis-fg); margin-bottom: 6px; }
.jarvis-bubble__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-jarvis); box-shadow: 0 0 10px var(--c-jarvis); animation: ds-blink 1.2s ease-in-out infinite; }
.jarvis-bubble__text { font-size: var(--fs-lg); font-weight: var(--fw-medium); line-height: var(--lh-snug); letter-spacing: -0.01em; color: var(--text); }
.jarvis-bubble__text .is-partial { color: var(--text-2); }
.jarvis-bubble__text .is-partial::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--c-jarvis); animation: ds-blink 1s steps(2) infinite; }
.jarvis-bubble--static { position: relative; right: auto; bottom: auto; opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 599.98px), (max-width: 899.98px) and (orientation: portrait) {
  .jarvis-bubble:not(.jarvis-bubble--static) { right: calc(var(--sp-4) + env(safe-area-inset-right)); left: calc(var(--sp-4) + env(safe-area-inset-left)); width: auto; max-width: none; bottom: calc(var(--tabbar-h) + var(--sp-4) + 60px + var(--sp-3) + env(safe-area-inset-bottom)); }
}

/* Panneau de conversation
   <aside class="jarvis-panel is-open" aria-label="Jarvis">
     <header class="jarvis-panel__head">(.jarvis-orb--inline.jarvis-orb--sm) titre · statut · fermer</header>
     <div class="jarvis-panel__body"> .jv-msg--user / .jv-msg--jarvis (+ .jv-action) </div>
     <div class="jarvis-panel__suggest"> .chip × n </div>
     <form class="jarvis-panel__input"> input · micro </form></aside>
   Tablette : panneau latéral droit (420 dp). Téléphone : feuille plein écran. */
.jarvis-panel {
  position: fixed; z-index: calc(var(--z-jarvis) + 1);
  top: calc(var(--sp-4) + env(safe-area-inset-top)); bottom: calc(var(--sp-4) + env(safe-area-inset-bottom));
  right: calc(var(--sp-4) + env(safe-area-inset-right));
  width: min(420px, calc(100vw - 2 * var(--sp-4)));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-xl);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--c-jarvis) 9%, transparent), transparent 30%),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--c-jarvis) 3.5%, transparent) 0 1px, transparent 1px 4px),
    var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(26px); backdrop-filter: saturate(160%) blur(26px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-jarvis) 26%, transparent), 0 0 60px -30px var(--c-jarvis), var(--elev-3);
  opacity: 0; visibility: hidden; transform: translateX(24px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
}
.jarvis-panel.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.jarvis-panel--static { position: relative; top: auto; right: auto; bottom: auto; width: 100%; height: 600px; opacity: 1; visibility: visible; transform: none; z-index: auto; }
.jarvis-panel__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-3) var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--hairline); flex: none; }
.jarvis-panel__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: .01em; }
.jarvis-panel__status { font-size: var(--fs-xs); color: var(--c-jarvis-fg); font-weight: var(--fw-semibold); letter-spacing: .02em; }
.jarvis-panel__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.jarvis-panel__suggest { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding: 0 var(--sp-5) var(--sp-3); flex: none; }
.jarvis-panel__suggest::-webkit-scrollbar { display: none; }
.jarvis-panel__suggest .chip { flex: none; }
.jarvis-panel__input { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--hairline); flex: none; }
.jarvis-panel__input .input { min-height: var(--hit); border-radius: var(--r-pill); background: var(--fill); box-shadow: none; }
.jarvis-panel__input .input:focus { box-shadow: inset 0 0 0 2px var(--c-jarvis); }
.jarvis-panel__mic { --btn-bg: linear-gradient(140deg, var(--c-jarvis), var(--c-jarvis-2)); background: linear-gradient(140deg, var(--c-jarvis), var(--c-jarvis-2)); color: #F0FDFF; box-shadow: 0 6px 18px -8px var(--c-jarvis); }
@media (max-width: 599.98px), (max-width: 899.98px) and (orientation: portrait) {
  .jarvis-panel:not(.jarvis-panel--static) { left: 0; right: 0; bottom: 0; top: calc(24px + env(safe-area-inset-top)); width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(40px); }
  .jarvis-panel:not(.jarvis-panel--static).is-open { transform: none; }
  .jarvis-panel__input { padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); }
}

/* Messages */
.jv-msg { max-width: 86%; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md); line-height: var(--lh-snug); animation: ds-enter var(--dur-slow) var(--ease-out) both; }
.jv-msg--user { align-self: flex-end; border-radius: 20px 20px 6px 20px; background: var(--fill-2); color: var(--text); }
.jv-msg--jarvis {
  align-self: flex-start; border-radius: 20px 20px 20px 6px; color: var(--text);
  background: linear-gradient(135deg, var(--c-jarvis-bg), transparent 80%), var(--fill);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-jarvis) 24%, transparent);
}
.jv-msg__meta { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.jv-msg--typing { display: inline-flex; gap: 5px; padding: var(--sp-4); }
.jv-msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-jarvis-fg); animation: jv-dot 1.2s var(--ease-in-out) infinite; }
.jv-msg--typing i:nth-child(2) { animation-delay: .15s; }
.jv-msg--typing i:nth-child(3) { animation-delay: .3s; }
/* Action exécutée par Jarvis (résumé + annuler) */
.jv-action { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); }
.jv-action .icon { width: 20px; height: 20px; flex: none; color: var(--c-ok-fg); stroke-width: 2.2; }
.jv-action__text { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.jv-action .btn { min-height: 40px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }

/* Indicateur permanent « micro actif » (toujours visible quand le micro écoute,
   y compris sur l'écran de veille — exigence de confiance / vie privée)
   <div class="jarvis-mic" role="status"><span class="jarvis-mic__dot"></span>Micro actif</div>
   Variante .jarvis-mic--muted : micro coupé volontairement (icône i-mic-off). */
.jarvis-mic {
  position: fixed; z-index: calc(var(--z-screensaver) + 6);
  top: calc(var(--sp-3) + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 32px; padding: 0 var(--sp-3) 0 var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .02em; color: var(--c-jarvis-fg);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-jarvis) 40%, transparent), 0 0 18px -6px var(--c-jarvis);
  pointer-events: none; white-space: nowrap;
}
.jarvis-mic .icon { width: 16px; height: 16px; stroke-width: 2; }
.jarvis-mic__dot { position: relative; width: 10px; height: 10px; margin: 0 2px; border-radius: 50%; background: var(--c-jarvis); box-shadow: 0 0 8px var(--c-jarvis); }
.jarvis-mic__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--c-jarvis); animation: jv-ripple 1.8s var(--ease-out) infinite; }
.jarvis-mic--muted { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.jarvis-mic--muted .jarvis-mic__dot { background: var(--text-3); box-shadow: none; }
.jarvis-mic--muted .jarvis-mic__dot::after { display: none; }
.jarvis-mic--static { position: relative; top: auto; left: auto; transform: none; z-index: auto; }

/* Carte de suggestion d'automatisation
   <article class="jarvis-suggest">
     <div class="jarvis-suggest__icon"><svg class="icon"><use href="icons.svg#i-idea"/></svg></div>
     <div class="jarvis-suggest__body">
       <div class="jarvis-suggest__eyebrow">Suggestion de Jarvis</div>
       <h3 class="jarvis-suggest__title">Voulez-vous que j'automatise… ?</h3>
       <p class="jarvis-suggest__text">Contexte (habitude détectée)</p>
       <div class="jarvis-suggest__actions"> .btn--jarvis Oui, automatiser · .btn--ghost Plus tard </div></div>
     <button class="icon-btn icon-btn--ghost jarvis-suggest__close" aria-label="Ignorer">…</button></article> */
.jarvis-suggest {
  position: relative; display: flex; gap: var(--sp-4); align-items: flex-start;
  padding: var(--sp-5); border-radius: var(--r-xl); overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c-jarvis) 16%, transparent), transparent 55%),
    var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-jarvis) 28%, transparent), var(--elev-1);
}
.jarvis-suggest::before { content: ""; position: absolute; left: var(--sp-5); right: var(--sp-5); top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--c-jarvis), transparent); opacity: .8; }
.jarvis-suggest__icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #F0FDFF;
  background: linear-gradient(140deg, var(--c-jarvis), var(--c-jarvis-2)); box-shadow: 0 8px 22px -10px var(--c-jarvis); }
.jarvis-suggest__icon .icon { width: 28px; height: 28px; stroke-width: 2; }
.jarvis-suggest__body { flex: 1; min-width: 0; }
.jarvis-suggest__eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-jarvis-fg); }
.jarvis-suggest__title { margin-top: 4px; font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.jarvis-suggest__text { margin-top: var(--sp-1); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-body, 1.45); }
.jarvis-suggest__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.jarvis-suggest__close { flex: none; margin: calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) 0 0; }
.btn--jarvis { --btn-bg: linear-gradient(140deg, var(--c-jarvis), var(--c-jarvis-2)); background: linear-gradient(140deg, var(--c-jarvis), var(--c-jarvis-2)); color: #F0FDFF; box-shadow: 0 8px 20px -10px var(--c-jarvis); }
[data-theme="night"] .jarvis-suggest__icon, [data-theme="night"] .btn--jarvis { color: #120805; box-shadow: none; }
[data-theme="night"] .jarvis-mic { box-shadow: inset 0 0 0 1px var(--border); }

/* Mode nuit : Jarvis devient une braise discrète, sans halo */
[data-theme="night"] .jarvis-orb { color: #120805; background: radial-gradient(circle at 50% 60%, var(--c-jarvis), var(--c-jarvis-2) 70%, #1A0A05); box-shadow: 0 0 0 1px var(--border); }
[data-theme="night"] .jarvis-orb::before { opacity: .35; }
[data-theme="night"] .jarvis-orb__wave i, [data-theme="night"] .jarvis-orb__dots i { background: #120805; box-shadow: none; }
[data-theme="night"] .jarvis-panel, [data-theme="night"] .jarvis-bubble { background: var(--glass); box-shadow: inset 0 0 0 1px var(--border); }
[data-theme="night"] .cinema, [data-theme="night"] .appliance::before { background: var(--surface); }
[data-theme="night"] .cinema__badge, [data-theme="night"] .dpad__ok { background: var(--fill-2); color: var(--text); box-shadow: none; }
[data-theme="night"] .volume__fill { background: var(--c-cinema); box-shadow: none; }
[data-theme="night"] .ring::before { filter: none; }

@keyframes jv-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes jv-ripple { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes jv-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes jv-bar { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@keyframes ds-ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes ds-glow { 0%, 100% { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ring-color) 35%, transparent)); } 50% { filter: drop-shadow(0 0 16px color-mix(in srgb, var(--ring-color) 70%, transparent)); } }

/* ==========================================================================
   20. UTILITAIRES · ANIMATIONS · MOUVEMENT RÉDUIT
   ========================================================================== */
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--sp-4)); }
.row { display: flex; align-items: center; gap: var(--row-gap, var(--sp-3)); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hide-phone { }
.only-phone { display: none; }
@media (max-width: 599.98px) { .hide-phone { display: none !important; } .only-phone { display: revert; } }
.c-lit { color: var(--c-lit-fg); } .c-cover { color: var(--c-cover-fg); } .c-alert { color: var(--c-alert-fg); }
.c-ok { color: var(--c-ok-fg); } .c-device { color: var(--c-device-fg); } .c-heat { color: var(--c-heat-fg); } .c-info { color: var(--c-info-fg); }

/* Transition d'apparition d'une vue */
.view-enter { animation: ds-enter var(--dur-slow) var(--ease-out) both; }

@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes ds-blink { 50% { opacity: .3; } }
@keyframes ds-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.9); opacity: .85; } }
@keyframes ds-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes ds-indeterminate { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes ds-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ds-drift { /* anti-marquage : ±12 dp */
  0% { transform: translate(-12px, -8px); }
  33% { transform: translate(10px, 6px); }
  66% { transform: translate(-6px, 12px); }
  100% { transform: translate(12px, -10px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .skel { animation: none; background: var(--fill); }
  .screensaver__inner { animation: none; }
  .jarvis-orb, .jarvis-orb::before, .jarvis-orb::after, .ring::before { animation: none !important; }
  .jarvis-orb__wave i { transform: scaleY(.6); }
}
/* Option applicative équivalente : <html class="ds-reduce-motion"> */
.ds-reduce-motion *, .ds-reduce-motion *::before, .ds-reduce-motion *::after { animation: none !important; transition: none !important; }

/* Hover uniquement sur appareils à pointeur fin (pas d'état collant au toucher) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.08); }
  .btn--secondary:hover, .btn--outline:hover, .btn--ghost:hover { background: var(--fill-2); filter: none; }
  .icon-btn:hover { background: var(--fill-2); }
  .icon-btn--primary:hover, .icon-btn.is-on:hover { filter: brightness(1.08); background: var(--btn-bg); }
  .tile:not(.is-on):not(.is-unavailable):hover { background: var(--surface-2); }
  .rail__item:hover { color: var(--text); }
  button.list__row:hover, a.list__row:hover { background: var(--fill); }
  button.chip:hover:not(.is-selected) { background: var(--fill-2); }
}
