/* ==========================================================================
   Jarvis : verre laiteux façon iOS / visionOS.
   Une seule famille (Inter, tailles optiques), un matériau gris dépoli posé
   sur un fond lent dont la couleur suit la maison. L'état actif = un aplat,
   jamais une lueur. Rien ne change de taille quand on allume ou éteint.
   ========================================================================== */

@property --lx { syntax: "<percentage>"; inherits: true; initial-value: 85%; }
@property --ly { syntax: "<percentage>"; inherits: true; initial-value: 12%; }

:root {
  --bg: #100c0b;
  --bg-2: #0d0a0a;
  --text: rgba(255, 246, 240, .95);
  --text-2: rgba(245, 236, 230, .62);
  --text-3: rgba(245, 236, 230, .36);
  --sep: rgba(255, 255, 255, .10);

  --glass-card: rgba(255, 236, 222, .10);
  --glass-ctrl: rgba(255, 240, 230, .13);
  --glass-sheet: rgba(46, 34, 34, .72);

  --light: #ffd27a;      /* lampe allumée */
  --light-ink: #3a2a08;
  --heat: #ff9f5a;
  --cool: #7fc1ff;
  --on-neutral: rgba(255, 255, 255, .92);
  --on-ink: #1c1c1e;
  --danger: #ff6961;

  --r-card: 28px;
  --r-ctrl: 14px;
  --margin: 20px;
  --gap: 12px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* intensité des formes du fond (0 → 1), pilotée par app.js */
  --amb-warm: 0;
  --amb-heat: 0;
  --amb-cool: 0;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
/* body transparent : sinon son fond se peint par-dessus le décor animé (z-index négatif). */
html, body { margin: 0; color: var(--text); }
body { background: transparent; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "tnum", "calt";
  font-size: 17px; line-height: 22px; letter-spacing: -0.011em;
  min-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overscroll-behavior-y: contain; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }
:focus-visible { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 2px; }
.muted { color: var(--text-2); }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- fond animé (lent, transform seulement) --------------------------------- */
.ambient { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.shape { position: absolute; border-radius: 50%; will-change: transform; transition: opacity 2s ease; }
/* « Warm Sunset » : bordeaux très sombre, quatre grandes taches très floues (orange, rose,
   ambre, framboise) qui dérivent lentement. C'est le fond qui porte la couleur, pas le verre. */
.shape { filter: blur(110px); }
.shape.amber { width: 420px; height: 420px; left: -230px; top: -200px; background: #f97316; opacity: .26; animation: float-a 52s ease-in-out infinite alternate; }
.shape.rose { width: 380px; height: 380px; right: -250px; top: 42vh; background: #ec4899; opacity: .16; animation: float-b 64s ease-in-out infinite alternate; }
.shape.plum { width: 360px; height: 360px; left: -220px; bottom: -200px; background: #f59e0b; opacity: .15; animation: float-c 58s ease-in-out infinite alternate; }
.shape.gold { width: 260px; height: 260px; right: -150px; top: -140px; background: #be185d; opacity: .14; animation: float-d 71s ease-in-out infinite alternate; }
/* Discrètes, selon la maison : un peu plus chaud quand c'est allumé, orange ou bleu selon la clim. */
.shape.warm { width: 420px; height: 420px; left: 10vw; top: 40vh; background: #fb923c; opacity: calc(var(--amb-warm) * .22); animation: float-b 61s ease-in-out infinite alternate-reverse; }
.shape.heat { width: 380px; height: 380px; right: -100px; bottom: -80px; background: #ea580c; opacity: calc(var(--amb-heat) * .25); animation: float-c 67s ease-in-out infinite alternate; }
.shape.cool { width: 380px; height: 380px; right: -100px; bottom: -80px; background: #3b82f6; opacity: calc(var(--amb-cool) * .25); animation: float-a 73s ease-in-out infinite alternate-reverse; }
@keyframes float-a { to { transform: translate3d(90px, 70px, 0) scale(1.08); } }
@keyframes float-b { to { transform: translate3d(-90px, 60px, 0) scale(.94); } }
@keyframes float-c { to { transform: translate3d(80px, -80px, 0) scale(1.06); } }
@keyframes float-d { to { transform: translate3d(-100px, 90px, 0) scale(1.1); } }

/* Particules : de fines poussières dorées qui flottent dans la lumière. */
.mote { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%;
  background: rgba(255, 214, 170, .8); opacity: 0;
  animation: mote var(--d) linear var(--delay) infinite; will-change: transform, opacity; }
@keyframes mote {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  15% { opacity: var(--o); }
  85% { opacity: var(--o); }
  100% { transform: translate3d(var(--dx), -18vh, 0); opacity: 0; }
}
.paused .mote { animation-play-state: paused; }
.paused .shape, .paused:root { animation-play-state: paused; }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* --- Verre (sobre, façon Apple) ------------------------------------------------
   Remplissage blanc neutre très léger : le fond donne la couleur. Un seul fin reflet
   en haut, un halo très doux dans un coin (qui suit un peu l'inclinaison), une ombre
   portée large. Pas de liseré brillant, pas de déformation. */
.glass, .room-card, .tile, .card, .toast, .banner {
  position: relative;
  background: radial-gradient(at var(--lx) var(--ly), rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, 0) 55%), rgba(255, 255, 255, .09);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .38), inset 0 -1px 0 rgba(0, 0, 0, .10), 0 14px 44px rgba(0, 0, 0, .32);
}
/* Avec la lentille (Chrome) : le reflet de bord vient du filtre, on allège le liseré CSS.
   Un bouton allumé est opaque : inutile de calculer la réfraction derrière. */
.lens [data-lens] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 14px 44px rgba(0, 0, 0, .30); }
.lens .round[data-lens], .lens .step[data-lens] { box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .45); }
.lens .round.on[data-lens] { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* La lumière : position du halo (gyroscope, sinon dérive lente). */
.auto-light { animation: light-drift 24s ease-in-out infinite alternate; }
@keyframes light-drift {
  0% { --lx: 70%; --ly: 8%; }
  100% { --lx: 92%; --ly: 22%; }
}

/* Appui : on s'enfonce vite, on revient avec un ressort. */
.room-card, .tile, .round, .step, .key, .app-chip, .pill, .seg button, .tv-keys button, .btn-done, .btn-primary {
  transition: transform 320ms var(--spring), background-color 250ms var(--ease), color 250ms var(--ease), opacity 250ms var(--ease);
}
.room-card:active, .tile:active { transform: scale(.98); transition-duration: 90ms; }
.round:active, .step:active, .key:active { transform: scale(.92); transition-duration: 90ms; }
.quick-btn:active, .app-chip:active, .pill:active, .tv-keys button:active, .btn-done:active, .btn-primary:active { transform: scale(.96); transition-duration: 90ms; }

/* --- connexion ------------------------------------------------------------------ */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--margin); }
.login-card { width: min(380px, 100%); text-align: center; padding: 32px 20px 20px; border-radius: var(--r-card); }
.login h1 { font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.022em; margin: 16px 0 4px; }
.login form { display: grid; gap: 12px; margin-top: 24px; }
.login input, .tv-input input { background: rgba(0, 0, 0, .22); border: 0; box-shadow: inset 0 0 0 1px var(--sep); border-radius: var(--r-ctrl); padding: 14px 16px; font-size: 17px; outline: none; }
.login input:focus, .tv-input input:focus { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.btn-primary { background: var(--on-neutral); color: var(--on-ink); font-weight: 600; border-radius: var(--r-ctrl); padding: 14px; }
.error { color: var(--danger); min-height: 22px; font-size: 15px; }
.brand-mark { width: 60px; height: 60px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #fff4dc 0 22%, var(--light) 23% 40%, transparent 41%); }

/* --- cadre ------------------------------------------------------------------------- */
#app { max-width: 600px; margin: 0 auto; padding: 0 var(--margin) 32px; }
#view.enter { animation: enter 350ms var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } }
#view.enter-back { animation: enter-back 350ms var(--ease); }
@keyframes enter-back { from { opacity: 0; transform: translateX(-24px); } }
.banner { color: #ffd1cc; border-radius: var(--r-ctrl); padding: 12px 16px; font-size: 15px; line-height: 20px; margin-top: 12px; }
.section { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.018em; margin: 32px 0 12px; }

/* --- boutons ronds ----------------------------------------------------------------- */
.round { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
  background: rgba(255, 255, 255, .09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .14); }
.round svg { width: 21px; height: 21px; }
.round.on { background: var(--on, var(--on-neutral)); color: var(--on-ink-c, var(--on-ink)); }
.round.light.on { --on: var(--light); --on-ink-c: var(--light-ink); }
.round.clim-btn { color: var(--clim, var(--text)); }
.round.clim-btn.m-heat { --clim: var(--heat); } .round.clim-btn.m-cool { --clim: var(--cool); }
.round.clim-btn.on { --on: var(--clim, var(--on-neutral)); --on-ink-c: #2a1606; }
.round.clim-btn.m-cool.on { --on-ink-c: #06213a; }
.round:disabled { opacity: .35; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); flex: none; }
.icon-btn svg { width: 22px; height: 22px; }

/* --- accueil ------------------------------------------------------------------------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; height: 96px; padding-bottom: 4px; }
.eyebrow { margin: 0; color: var(--text-2); font-size: 15px; line-height: 20px; text-transform: capitalize; }
.hero h1, .large-title h1 { margin: 2px 0 0; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.022em; }
.outside { text-align: right; }
.outside strong { display: block; font-size: 28px; line-height: 32px; font-weight: 500; letter-spacing: -0.02em; }
.outside span { font-size: 13px; line-height: 18px; color: var(--text-2); }

.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 12px calc(-1 * var(--margin)) 0; padding: 0 var(--margin); height: 44px; }
.quick::-webkit-scrollbar { display: none; }
.quick-btn { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; font-size: 15px; font-weight: 500; }
.quick-btn svg { width: 18px; height: 18px; }
.quick-btn:disabled { opacity: .35; }

/* Barre d'accueil : date, dehors, tout éteindre, sur une ligne. */
.home-bar { display: flex; align-items: center; gap: 10px; height: 64px; padding-top: 8px; margin-bottom: 8px; }
.home-date { flex: 1; min-width: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.018em; text-transform: capitalize; }
.home-out { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 20px; font-size: 17px; font-weight: 600;
  background: var(--glass-ctrl); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25); }
.home-out svg { width: 16px; height: 16px; color: #ffcf7a; }
.home-bar .round { width: 44px; height: 44px; }
.rooms + .card { margin-top: var(--gap); }

.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.room-card { height: 128px; display: flex; flex-direction: column; padding: 16px; border-radius: var(--r-card); cursor: pointer; }
.room-name { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.012em; }
.room-status { font-size: 15px; line-height: 20px; color: var(--text-2); letter-spacing: -0.006em; margin-top: 2px; }
.room-actions { display: flex; gap: 8px; margin-top: auto; }

/* --- barre de navigation (pièce, groupe, TV) ---------------------------------------- */
.navbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 52px 1fr 52px; align-items: center;
  height: 56px; margin: 0 calc(-1 * var(--margin)); padding: 0 calc(var(--margin) - 8px); }
.navbar::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 250ms var(--ease);
  background: rgba(22, 24, 30, .6); -webkit-backdrop-filter: blur(28px) saturate(140%); backdrop-filter: blur(28px) saturate(140%);
  box-shadow: inset 0 -1px 0 var(--sep); }
.nav-title { text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -0.012em; opacity: 0; transform: translateY(6px); transition: opacity 250ms var(--ease), transform 250ms var(--ease); }
.scrolled .navbar::before { opacity: 1; }
.scrolled .nav-title { opacity: 1; transform: none; }
.nav-right { display: flex; justify-content: flex-end; }
.navbar .round { width: 40px; height: 40px; }
.navbar .round svg { width: 19px; height: 19px; }
.large-title { height: 72px; padding-top: 4px; }
.large-title span { display: block; color: var(--text-2); font-size: 15px; line-height: 20px; margin-top: 2px; }

.sensors { display: flex; gap: 16px; color: var(--text-2); font-size: 13px; line-height: 18px; height: 18px; margin: 0 0 16px; overflow: hidden; }
.sensors span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sensors svg { width: 14px; height: 14px; }

/* --- tuiles (lumières, groupes) -------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.tile { height: 120px; border-radius: var(--r-card); overflow: hidden; touch-action: pan-y; }
.tile .fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .14); transform-origin: left center; transform: scaleX(0);
  transition: transform 250ms var(--ease); pointer-events: none; }
.tile.dragging .fill { transition: none; }
.tile-main { position: relative; z-index: 1; width: 100%; height: 100%; padding: 14px 16px; text-align: left; display: flex; flex-direction: column; }
.tile .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-ctrl); color: var(--text-2); transition: background-color 250ms var(--ease), color 250ms var(--ease); }
.tile .ico svg { width: 20px; height: 20px; }
.tile .name { margin-top: auto; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.012em; }
.tile .state { font-size: 15px; line-height: 20px; color: var(--text-2); letter-spacing: -0.006em; }
.tile.on .ico { background: var(--bulb, var(--light)); color: var(--light-ink); }
.tile.off-line { opacity: .4; }
.tile-more { position: absolute; z-index: 2; right: 6px; top: 8px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-3); border-radius: 50%; }
.tile-more svg { width: 18px; height: 18px; }

/* --- cartes ------------------------------------------------------------------------------ */
.card { border-radius: var(--r-card); padding: 16px; margin-bottom: var(--gap); }
.card.tappable { cursor: pointer; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 48px; }
.card-head > div:first-child { min-width: 0; }
.card-title { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.012em; }
.card-sub { font-size: 15px; line-height: 20px; color: var(--text-2); letter-spacing: -0.006em; }
.card-actions { display: flex; align-items: center; gap: 8px; }

/* Clim : hauteur constante allumée ou éteinte */
.clim { --mode: var(--on-neutral); }
.clim.m-heat { --mode: var(--heat); } .clim.m-cool { --mode: var(--cool); }
.clim .round.on { --on: var(--mode); --on-ink-c: #1c1c1e; }
.temp-row { display: flex; align-items: center; justify-content: space-between; height: 96px; margin: 4px 0 12px; }
.temp { display: flex; align-items: flex-start; font-size: 72px; line-height: 72px; font-weight: 300; letter-spacing: -0.04em; overflow: hidden; height: 72px; }
.temp .deg { font-size: 36px; line-height: 44px; color: var(--text-2); margin-left: 2px; letter-spacing: 0; }
.temp-val { display: inline-block; }
.temp-val.roll { animation: roll 200ms var(--ease); }
@keyframes roll { from { transform: translateY(var(--roll-from, 40%)); opacity: 0; } }
.clim.is-off .temp { color: var(--text-3); }
.step { width: 56px; height: 56px; border-radius: 50%; font-size: 28px; font-weight: 300; display: grid; place-items: center; background: var(--glass-ctrl); }

/* Contrôle segmenté : une seule pastille qui glisse */
.seg { position: relative; display: flex; background: rgba(0, 0, 0, .22); border-radius: var(--r-ctrl); padding: 3px; height: 44px; }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 11px; background: rgba(255, 255, 255, .20); box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform 350ms var(--spring), width 350ms var(--spring), opacity 200ms; opacity: 0; }
.seg-pill.ready { opacity: 1; }
.seg button { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; border-radius: 11px; font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.seg button.sel { color: var(--text); }

/* --- TV, ambilight -------------------------------------------------------------------------- */
.app-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px; height: 40px; }
.app-row::-webkit-scrollbar { display: none; }
.app-chip { flex: none; height: 40px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 500; white-space: nowrap; background: var(--glass-ctrl); }
.app-chip.sel { background: var(--on-neutral); color: var(--on-ink); }
.amb .seg { margin-top: 12px; }
.range-row { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 15px; height: 44px; }
.range-row svg { width: 18px; height: 18px; flex: none; }
.range-val { flex: none; width: 48px; text-align: right; }
.range-row.disabled { opacity: .35; pointer-events: none; }

.now-playing { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; height: 60px; }
.now-playing .label { font-size: 13px; line-height: 18px; color: var(--text-2); }
.now-playing .app { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; }
.remote { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 20px 12px; }
.dpad { position: relative; width: 192px; height: 192px; border-radius: 50%; grid-column: 2; background: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.dpad .key { position: absolute; width: 64px; height: 64px; display: grid; place-items: center; color: var(--text-2); border-radius: 50%; }
.dpad .key svg { width: 24px; height: 24px; }
.dpad .up { top: 0; left: 64px; } .dpad .down { bottom: 0; left: 64px; }
.dpad .left { left: 0; top: 64px; } .dpad .right { right: 0; top: 64px; }
.dpad .ok { left: 54px; top: 54px; width: 84px; height: 84px; background: var(--glass-ctrl); color: var(--text); font-size: 15px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.remote-side { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.remote-side.left { grid-column: 1; } .remote-side.right { grid-column: 3; }
.vol { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 28px; background: rgba(0, 0, 0, .22); }
.vol span { font-size: 11px; line-height: 14px; color: var(--text-3); font-weight: 600; }
.vol .round { font-size: 22px; font-weight: 400; }
.tv-input { display: flex; gap: 8px; margin-top: 12px; }
.tv-input input { flex: 1; min-width: 0; }
.tv-keys { display: flex; gap: 8px; margin-top: 8px; }
.tv-keys button { flex: 1; height: 44px; border-radius: var(--r-ctrl); background: var(--glass-ctrl); font-size: 15px; font-weight: 500; display: grid; place-items: center; }
.tv-keys svg { width: 20px; height: 20px; }

/* --- curseurs ---------------------------------------------------------------------------- */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; margin-top: -10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }

/* --- feuille du bas ---------------------------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 20; animation: fade 300ms var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 600px; margin: 0 auto;
  background: var(--glass-sheet); -webkit-backdrop-filter: blur(40px) saturate(150%); backdrop-filter: blur(40px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  border-radius: 34px 34px 0 0; padding: 8px var(--margin) calc(20px + env(safe-area-inset-bottom));
  animation: up 420ms cubic-bezier(.32, .72, 0, 1); touch-action: pan-y; }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); margin: 0 auto 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 52px; }
.sheet h3 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.018em; }
.sheet .sub { color: var(--text-2); font-size: 15px; line-height: 20px; }
.sheet .label { font-size: 13px; line-height: 18px; color: var(--text-2); margin: 20px 0 6px; display: flex; justify-content: space-between; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 44px; padding: 0 16px; border-radius: 22px; font-size: 15px; font-weight: 500; background: var(--glass-ctrl); color: var(--text-2); }
.pill.on { background: var(--on-neutral); color: var(--on-ink); }
.btn-done { width: 100%; margin-top: 24px; height: 50px; border-radius: var(--r-ctrl); background: var(--glass-ctrl); font-weight: 600; }

/* --- divers ------------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  padding: 12px 20px; border-radius: 24px; font-size: 15px; max-width: calc(100% - 40px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: fade 250ms var(--ease); }
.foot { text-align: center; padding-top: 32px; }
.link { color: var(--text-3); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .room-card, .tile, .card, .quick-btn, .toast, .banner { background: rgba(40, 42, 50, .92); }
}
@media (prefers-reduced-motion: reduce) { *, .shape { animation: none !important; transition: none !important; } }
