@layer app {
  body { background: #0b0c0f; }

  /* ================================================================ tokens */
  .domus {
    --wall: #121317;
    --bg: #14161c;
    --c1: #1a1d24;
    --c2: #22262f;
    --c3: #2c313c;
    --line: rgba(236, 240, 255, 0.07);
    --line-2: rgba(236, 240, 255, 0.13);
    --ink: #eef0f4;
    --ink-2: #b9bfcb;
    --mute: #8a91a0;
    --amber: #ffb547;
    --amber-2: #ffd08a;
    --amber-ink: #2a1700;
    --amber-soft: rgba(255, 181, 71, 0.14);
    --blue: #7da2ff;
    --mint: #4fe0a9;
    --sun: #ffc65c;
    --red: #ff6b55;
    --fr: "Readex Pro", ui-sans-serif, system-ui, sans-serif;
    --fm: "Azeret Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --gap: 14px;
    font: 300 14px/1.4 var(--fr);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
  }
  :where(.domus) *, :where(.domus) *::before, :where(.domus) *::after { box-sizing: border-box; }
  .domus [hidden] { display: none !important; }
  :where(.domus) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; -webkit-user-select: none; user-select: none; }
  :where(.domus) :where(button:disabled) { cursor: default; }
  :where(.domus) :where(h2, h3, p, dl, dd, ol, ul) { margin: 0; }
  :where(.domus) :where(ol, ul) { padding: 0; list-style: none; }
  :where(.domus) .i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  .domus .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .domus :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

  /* ================================================================ wall + tablet */
  .dwall {
    min-height: calc(100svh - var(--fs-bar-h));
    padding: 18px;
    display: grid;
    background:
      radial-gradient(70% 55% at 50% -8%, rgba(255, 196, 120, 0.13), rgba(255, 196, 120, 0) 70%),
      radial-gradient(60% 40% at 85% 110%, rgba(90, 120, 220, 0.08), rgba(90, 120, 220, 0) 70%),
      linear-gradient(180deg, #17171a, #0d0e11);
  }
  .dpanel {
    position: relative; overflow: hidden;
    height: calc(100svh - var(--fs-bar-h) - 36px); min-height: 760px;
    border-radius: 30px;
    background:
      radial-gradient(90% 60% at 0% 0%, rgba(255, 181, 71, 0.05), rgba(255, 181, 71, 0) 60%),
      var(--bg);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.05),
      0 0 0 9px #050608,
      0 0 0 10px rgba(255, 255, 255, 0.07),
      0 50px 90px -40px rgba(0, 0, 0, 0.9),
      0 20px 40px -20px rgba(0, 0, 0, 0.6);
  }
  .dpanel::before { /* camera dot on the bezel */
    content: ""; position: absolute; left: 50%; top: -6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #1d2230; box-shadow: 0 0 0 1px #0a0b0e;
  }
  .dgrid {
    height: 100%;
    display: grid; gap: var(--gap);
    padding: 16px 18px 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "hl   sc   sc  hr"
      "room clim en  dev"
      "room clim en  log";
  }

  /* ================================================================ header */
  .dh { display: flex; align-items: center; min-width: 0; }
  .dh--l { grid-area: hl; gap: 12px; }
  .dh__logo { width: 40px; height: 40px; flex: none; display: block; }
  .dh__txt { min-width: 0; }
  .dh__home { display: flex; align-items: center; gap: 6px; font: 400 11.5px/1.2 var(--fm); color: var(--mute); white-space: nowrap; }
  .wordmark { font: 600 13px/1 var(--fr); letter-spacing: -0.02em; color: var(--amber); }
  .dh__sep { opacity: 0.5; }
  .dh__hi { margin-top: 3px; font: 300 21px/1.15 var(--fr); letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .people { margin-left: auto; padding-left: 12px; display: flex; flex: none; }
  .person { width: 30px; height: 30px; margin-left: -7px; display: grid; place-items: center; border-radius: 50%; font: 500 10.5px/1 var(--fr); letter-spacing: 0.02em; background: oklch(0.34 0.04 var(--h)); color: oklch(0.88 0.07 var(--h)); border: 2px solid var(--bg); opacity: 0.55; }
  .person.is-home { opacity: 1; box-shadow: 0 0 0 1.5px rgba(255, 181, 71, 0.75); }
  .dh--r { grid-area: hr; justify-content: flex-end; gap: 20px; }
  .wx { display: flex; align-items: center; gap: 10px; }
  .wx__ico { color: var(--amber-2); display: grid; }
  .wx__ico .i { width: 30px; height: 30px; stroke-width: 1.5; }
  .wx__t { font: 300 24px/1 var(--fr); letter-spacing: -0.03em; }
  .wx__d { margin-top: 3px; font: 400 10.5px/1.2 var(--fm); color: var(--mute); white-space: nowrap; }
  .clock { text-align: right; }
  .clock__t { font: 200 42px/0.95 var(--fr); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
  .clock__d { margin-top: 4px; font: 400 10.5px/1.2 var(--fm); color: var(--mute); white-space: nowrap; }

  .scenes { grid-area: sc; display: flex; align-items: center; justify-content: center; min-width: 0; }
  .scenes__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .scenes__row { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--c1); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .scenes__row::-webkit-scrollbar { display: none; }
  .scene {
    position: relative; overflow: hidden; flex: none;
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
    font: 400 13.5px/1 var(--fr); color: var(--ink-2); white-space: nowrap;
    transition: background 0.3s, color 0.3s, transform 0.3s var(--spring);
  }
  .scene .i { width: 18px; height: 18px; }
  .scene:hover { background: var(--c2); color: var(--ink); }
  .scene:active { transform: scale(0.95); }
  .scene[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); box-shadow: 0 8px 22px -10px rgba(255, 181, 71, 0.8); }
  .scene.is-running::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%); transform: translateX(-100%); animation: sweep 1.1s var(--ease); }
  @keyframes sweep { to { transform: translateX(100%); } }

  /* ================================================================ cards */
  .card {
    position: relative; min-width: 0; min-height: 0;
    display: flex; flex-direction: column;
    padding: 16px; border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008) 40%), var(--c1);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -30px rgba(0, 0, 0, 0.9);
  }
  .card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; margin-bottom: 12px; flex: none; }
  .card__head h2 { font: 400 15px/1.2 var(--fr); letter-spacing: -0.01em; }
  .card__meta { display: inline-flex; align-items: center; gap: 6px; font: 400 11px/1 var(--fm); color: var(--mute); white-space: nowrap; }
  .card__meta .i { width: 14px; height: 14px; }

  .switch { position: relative; width: 40px; height: 24px; flex: none; border-radius: 12px; background: rgba(236, 240, 255, 0.13); transition: background 0.3s; }
  .switch i { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 9px; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35); transition: transform 0.4s var(--spring), width 0.2s var(--ease); }
  .switch[aria-checked="true"] { background: var(--amber); }
  .switch[aria-checked="true"] i { transform: translateX(16px); }
  .switch:active i { width: 22px; }
  .switch[aria-checked="true"]:active i { transform: translateX(12px); }
  .switch:focus-visible { border-radius: 12px; }
  .pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--c2); border: 1px solid var(--line); font: 400 12.5px/1 var(--fr); color: var(--ink-2); white-space: nowrap; transition: background 0.2s, color 0.2s, transform 0.25s var(--spring), opacity 0.2s; }
  .pill .i { width: 15px; height: 15px; }
  .pill:hover:not(:disabled) { background: var(--c3); color: var(--ink); }
  .pill:active:not(:disabled) { transform: scale(0.94); }
  .pill:disabled { opacity: 0.4; }
  .pill--amber { background: var(--amber); color: var(--amber-ink); border-color: transparent; }
  .pill--amber:hover:not(:disabled) { background: var(--amber-2); color: var(--amber-ink); }

  /* ================================================================ rooms & lights */
  .card--room { grid-area: room; }
  .rtabs { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
  .rtab { position: relative; min-width: 0; height: 34px; padding: 0 3px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font: 400 12px/1 var(--fr); letter-spacing: -0.01em; color: var(--mute); transition: background 0.3s, color 0.3s; }
  .rtab span { overflow: hidden; text-overflow: clip; white-space: nowrap; }
  .rtab:hover { color: var(--ink-2); }
  .rtab.is-active { background: var(--c3); color: var(--ink); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.6); }
  .rtab__dot { position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; flex: none; border-radius: 50%; background: rgba(236, 240, 255, 0.16); transition: background 0.4s, box-shadow 0.4s; }
  .rtab__dot.is-on { background: var(--amber); box-shadow: 0 0 8px rgba(255, 181, 71, 0.8); }
  .rpanel { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 12px; }
  .rhero { position: relative; flex: 1 1 auto; min-height: 190px; overflow: hidden; border-radius: 16px; background: #090b10; isolation: isolate; }
  .rph {
    position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s var(--ease);
    background: radial-gradient(80% 90% at 30% 20%, hsl(var(--hue) 45% 22%), hsl(var(--hue) 30% 9%) 70%);
  }
  .rph.is-active { opacity: 1; }
  .rph__art { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(255, 214, 160, 0.34); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
  .rph__img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: brightness(calc(0.28 + var(--lvl) * 0.82)) saturate(calc(0.55 + var(--lvl) * 0.5));
    transition: filter 0.8s var(--ease), opacity 0.6s var(--ease);
  }
  .rph__img.is-pending { opacity: 0; }
  @media (hover: hover) and (pointer: fine) {
    .rph__img { transform: scale(1.001); transition: filter 0.8s var(--ease), opacity 0.6s var(--ease), transform 1.6s var(--ease); }
    .rhero:hover .rph.is-active .rph__img { transform: scale(1.035); }
  }
  .rph__night { position: absolute; inset: 0; background: linear-gradient(180deg, #0b1a45, #04070f); mix-blend-mode: multiply; opacity: calc((1 - var(--lvl)) * 0.7); transition: opacity 0.8s var(--ease); pointer-events: none; }
  .rph__tint { position: absolute; inset: 0; background: rgb(var(--tint)); mix-blend-mode: soft-light; opacity: calc(var(--lvl) * 0.75); transition: opacity 0.8s var(--ease), background-color 0.6s; pointer-events: none; }
  .rhero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 55%; z-index: 1; pointer-events: none; background: linear-gradient(rgba(8, 9, 12, 0), rgba(8, 9, 12, 0.82)); }
  .rhero__info { position: absolute; left: 14px; bottom: 12px; z-index: 2; min-width: 0; }
  .rhero__name { font: 400 21px/1.1 var(--fr); letter-spacing: -0.025em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
  .rhero__meta { display: flex; gap: 12px; margin-top: 6px; font: 400 11.5px/1 var(--fm); color: rgba(238, 240, 244, 0.85); }
  .rhero__meta span { display: inline-flex; align-items: center; gap: 4px; }
  .rhero__meta .i { width: 14px; height: 14px; }
  .rhero__meta b { font-weight: 500; }
  .rhero__all {
    position: absolute; right: 12px; bottom: 12px; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
    background: rgba(12, 13, 17, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--ink);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font: 400 12px/1 var(--fr); transition: background 0.3s, color 0.3s, transform 0.3s var(--spring);
  }
  .rhero__all .i { width: 16px; height: 16px; }
  .rhero__all:active { transform: scale(0.94); }
  .rhero__all[aria-pressed="true"] { background: rgba(255, 181, 71, 0.92); border-color: transparent; color: var(--amber-ink); }

  .lights { flex: none; display: grid; align-content: start; gap: 2px; margin: 10px -6px 0; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }
  .lights.is-swap .light { animation: rise 0.45s var(--ease) both; }
  .lights.is-swap .light:nth-child(2) { animation-delay: 0.04s; }
  .lights.is-swap .light:nth-child(3) { animation-delay: 0.08s; }
  .lights.is-swap .light:nth-child(4) { animation-delay: 0.12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
  .light { display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px 40px; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 14px; }
  .light + .light { border-top: 1px solid var(--line); border-radius: 0; }
  .light__ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: rgba(236, 240, 255, 0.05); color: var(--mute); transition: background 0.5s, color 0.5s, box-shadow 0.5s; }
  .light__ico .i { width: 18px; height: 18px; }
  .light.is-on .light__ico { color: var(--amber); background: rgba(255, 181, 71, calc(0.08 + var(--b) * 0.18)); box-shadow: 0 0 calc(4px + var(--b) * 20px) rgba(255, 181, 71, calc(var(--b) * 0.5)); }
  .light__main { min-width: 0; }
  .light__name { display: block; margin-bottom: 3px; overflow: hidden; font: 400 13px/1.25 var(--fr); white-space: nowrap; text-overflow: ellipsis; }
  .light__val { font: 400 11px/1 var(--fm); color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
  .light.is-on .light__val { color: var(--ink-2); }
  .dim { display: block; width: 100%; height: 18px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
  .dim::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--amber) var(--p, 50%), rgba(236, 240, 255, 0.1) var(--p, 50%)); }
  .dim::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transition: transform 0.2s var(--spring); }
  .dim:active::-webkit-slider-thumb { transform: scale(1.25); }
  .dim::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(236, 240, 255, 0.1); }
  .dim::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--amber); }
  .dim::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
  .light:not(.is-on) .dim { opacity: 0.4; }
  .dim:focus-visible { outline-offset: 3px; border-radius: 6px; }
  .ct { flex: none; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
  .ct__head { display: flex; align-items: baseline; justify-content: space-between; font: 400 13px/1 var(--fr); }
  .ct__val { font: 400 11.5px/1 var(--fm); color: var(--ink-2); }
  .ctr { display: block; width: 100%; height: 26px; margin: 6px 0 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
  .ctr::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #ff9b44, #ffc98a 30%, #fff1df 55%, #dfeaff 78%, #a9c6ff); }
  .ctr::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; background: var(--thumb, #fff1df); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
  .ctr::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #ff9b44, #ffc98a 30%, #fff1df 55%, #dfeaff 78%, #a9c6ff); }
  .ctr::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--thumb, #fff1df); border: 3px solid #fff; }
  .ct__scale { display: flex; justify-content: space-between; margin-top: 2px; font: 400 10.5px/1 var(--fm); color: var(--mute); }

  /* ================================================================ climate */
  .card--climate { grid-area: clim; }
  .eco { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; font: 400 11px/1 var(--fm); color: var(--mute); background: rgba(236, 240, 255, 0.05); transition: background 0.4s, color 0.4s; }
  .eco .i { width: 14px; height: 14px; }
  .eco.is-on { background: rgba(79, 224, 169, 0.13); color: var(--mint); }
  .dial { position: relative; width: clamp(220px, calc(100svh - 560px), 360px); max-width: 100%; aspect-ratio: 1; margin: -4px auto 0; flex: none; }
  .dial__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .dial__halo { fill: none; stroke: var(--tc); stroke-width: 40; opacity: 0; filter: blur(18px); transition: opacity 0.8s, stroke 0.4s; }
  .dial.is-heating .dial__halo, .dial.is-cooling .dial__halo { opacity: 0.22; animation: breathe 3.6s ease-in-out infinite; }
  @keyframes breathe { 50% { opacity: 0.1; } }
  .dial__face { stroke: rgba(236, 240, 255, 0.06); stroke-width: 1; }
  .dial__tick { stroke: rgba(236, 240, 255, 0.13); stroke-width: 1.2; stroke-linecap: round; transition: stroke 0.25s; }
  .dial__tick.is-major { stroke: rgba(236, 240, 255, 0.3); stroke-width: 1.6; }
  .dial__tick.is-act { stroke: rgba(255, 208, 138, 0.55); }
  .dial[data-mode="cool"] .dial__tick.is-act { stroke: rgba(125, 162, 255, 0.6); }
  .dial__lab { font: 400 10px var(--fm); fill: var(--mute); text-anchor: middle; }
  .dial__track { fill: none; stroke: rgba(236, 240, 255, 0.07); stroke-width: 15; stroke-linecap: round; }
  .dial__seg { fill: none; stroke-width: 15; opacity: 0; transition: opacity 0.2s; }
  .dial__seg.is-on { opacity: 1; }
  .dial__cap { transition: opacity 0.2s; }
  .dial__cur { fill: #fff; stroke: #0d0f14; stroke-width: 2.5; }
  .dial__knob { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55)); }
  .dial__knobring { fill: #f6f7fa; }
  .dial__knobdot { transition: fill 0.25s; }
  .dial.is-drag .dial__knobring { fill: #fff; }
  .dial.is-off .dial__knobring { fill: #8a91a0; }
  .dial__hit { position: absolute; inset: 0; border-radius: 50%; cursor: grab; touch-action: none; z-index: 1; }
  .dial.is-drag .dial__hit { cursor: grabbing; }
  .dial__hit:focus-visible { outline-offset: -6px; }
  .dial__center { position: absolute; inset: 24%; z-index: 0; display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; pointer-events: none; }
  .dial__state { display: inline-flex; align-items: center; gap: 5px; font: 400 10.5px/1 var(--fm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--tc); transition: color 0.4s; }
  .dial__state .i { width: 14px; height: 14px; }
  .dial.is-idle .dial__state { color: var(--mint); }
  .dial.is-off .dial__state { color: var(--mute); }
  .dial__temp { margin-top: 4px; font: 200 62px/0.95 var(--fr); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
  .dial__deg { margin-left: 2px; font-size: 0.42em; vertical-align: 0.95em; color: var(--ink-2); }
  .dial.is-off .dial__temp { color: var(--mute); }
  .dial.is-tick .dial__temp { animation: tickpop 0.25s var(--ease); }
  @keyframes tickpop { 40% { transform: scale(1.04); } }
  .dial__now { margin-top: 6px; font: 400 11px/1 var(--fm); color: var(--mute); }
  .dial__now b { color: var(--ink-2); font-weight: 500; }
  .dial__btn { position: absolute; bottom: 2%; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--c2); border: 1px solid var(--line-2); color: var(--ink); transition: background 0.2s, transform 0.25s var(--spring); }
  .dial__btn:hover { background: var(--c3); }
  .dial__btn:active { transform: scale(0.88); }
  .dial__btn .i { width: 18px; height: 18px; }
  .dial__btn--minus { left: 25%; }
  .dial__btn--plus { right: 25%; }
  .modes { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin-top: 12px; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
  .mode { height: 36px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font: 400 12.5px/1 var(--fr); color: var(--mute); transition: background 0.3s, color 0.3s; }
  .mode .i { width: 16px; height: 16px; }
  .mode:hover { color: var(--ink-2); }
  .mode.is-on { background: var(--c3); color: var(--ink); }
  .mode[data-mode="heat"].is-on .i, .mode[data-mode="auto"].is-on .i { color: var(--amber); }
  .mode[data-mode="cool"].is-on .i { color: var(--blue); }
  .mode[data-mode="off"].is-on .i { color: var(--red); }
  .cstats { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
  .cstats div { min-width: 0; padding: 9px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
  .cstats dt { display: flex; align-items: center; gap: 4px; min-width: 0; font: 400 10px/1.1 var(--fm); color: var(--mute); white-space: nowrap; }
  .cstats dt span { overflow: hidden; text-overflow: ellipsis; }
  .cstats dt .i { display: none; }
  .cstats dd { margin-top: 5px; font: 400 13px/1.2 var(--fr); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sched { flex: none; margin-top: 10px; padding: 10px 10px 8px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
  .sched__head { display: flex; justify-content: space-between; font: 400 10.5px/1 var(--fm); color: var(--mute); }
  .sched__bar { position: relative; height: 22px; margin-top: 8px; border-radius: 6px; background: rgba(236, 240, 255, 0.04); }
  .sched__seg { position: absolute; top: 0; bottom: 0; left: var(--l); width: var(--w); display: grid; place-items: center; overflow: hidden; border-left: 1px solid var(--c1); background: color-mix(in srgb, var(--c) 30%, transparent); }
  .sched__seg:first-child { border-left: 0; border-radius: 6px 0 0 6px; }
  .sched__seg:nth-last-child(2) { border-radius: 0 6px 6px 0; }
  .sched__seg.is-eco { background: color-mix(in srgb, var(--c) 16%, transparent); }
  .sched__seg em { font: 400 9.5px/1 var(--fm); font-style: normal; color: var(--ink-2); }
  .sched__now { position: absolute; top: -3px; bottom: -3px; left: var(--l); width: 2px; margin-left: -1px; border-radius: 1px; background: #fff; box-shadow: 0 0 0 2px var(--bg); }
  .sched__axis { display: flex; justify-content: space-between; margin-top: 5px; font: 400 9.5px/1 var(--fm); color: var(--mute); }
  .rtemps { flex: 1; min-height: 0; overflow: hidden; display: grid; align-content: end; gap: 2px; margin-top: 8px; }
  .rtemp { display: grid; grid-template-columns: 82px minmax(0, 1fr) 46px; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; border-radius: 10px; transition: background 0.2s; }
  .rtemp:hover { background: rgba(236, 240, 255, 0.03); }
  .rtemp__n { font: 400 12.5px/1 var(--fr); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rtemp__bar { height: 4px; border-radius: 2px; background: rgba(236, 240, 255, 0.07); overflow: hidden; }
  .rtemp__bar i { display: block; width: var(--t); height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(125, 162, 255, 0.5), var(--c)); transition: width 1s var(--ease), background 1s; }
  .rtemp__v { font: 400 11.5px/1 var(--fm); text-align: right; font-variant-numeric: tabular-nums; }

  /* ================================================================ energy */
  .card--energy { grid-area: en; }
  .livechip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(79, 224, 169, 0.1); font: 400 11px/1 var(--fm); color: var(--mint); cursor: default; transition: background 0.3s, color 0.3s; }
  .livechip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
  @keyframes blink { 50% { opacity: 0.25; } }
  .livechip.is-pinned { cursor: pointer; background: var(--amber-soft); color: var(--amber); }
  .livechip.is-pinned i { animation: none; }
  .livechip.is-pinned:hover { background: rgba(255, 181, 71, 0.22); }
  .flow { position: relative; flex: none; width: 100%; max-width: 380px; aspect-ratio: 320 / 270; margin: -6px auto 0; }
  .flow__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .fpath { fill: none; stroke: rgba(236, 240, 255, 0.08); stroke-width: 2; stroke-linecap: round; transition: stroke 0.5s; }
  .fpath.is-on { stroke: var(--fc); stroke-opacity: 0.32; }
  .flow__svg.is-static .fpath.is-on { stroke-opacity: 0.8; stroke-dasharray: 2 5; }
  .fdot { fill: var(--fc); }
  .fdot__halo { fill: var(--fc); opacity: 0.22; }
  .enode { --nc: #eef0f4; }
  .enode--solar { --nc: var(--sun); }
  .enode--grid { --nc: var(--blue); }
  .enode--battery { --nc: var(--mint); }
  .enode__glow { fill: var(--nc); opacity: 0; transition: opacity 0.6s; }
  .enode.is-active .enode__glow { opacity: 0.1; }
  .enode__bg { fill: #161920; }
  .enode__ring { fill: none; stroke: var(--nc); stroke-opacity: 0.22; stroke-width: 1.5; transition: stroke-opacity 0.5s; }
  .enode.is-active .enode__ring { stroke-opacity: 0.6; }
  .enode__soc { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.8s var(--ease); }
  .enode__ico { color: var(--nc); stroke-width: 1.6; opacity: 0.55; transition: opacity 0.5s; }
  .enode.is-active .enode__ico { opacity: 1; }
  .enode__val { font: 500 12px var(--fm); fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
  .fcap { position: absolute; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; font: 400 10.5px/1.2 var(--fm); color: var(--mute); white-space: nowrap; text-align: center; }
  .fcap b { font: 400 12px/1.1 var(--fr); color: var(--ink-2); }
  .fcap--solar { left: 21.875%; top: 0; }
  .fcap--grid { left: 78.125%; top: 0; }
  .fcap--battery { left: 21.875%; bottom: 0; }
  .fcap--home { left: 78.125%; bottom: 0; }
  .batt { flex: none; display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
  .batt__cells { position: relative; flex: none; display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 104px; height: 22px; padding: 3px; border-radius: 6px; border: 1.5px solid rgba(236, 240, 255, 0.25); }
  .batt__cells::after { content: ""; position: absolute; right: -5px; top: 6px; width: 3px; height: 7px; border-radius: 0 2px 2px 0; background: rgba(236, 240, 255, 0.3); }
  .batt__cells i { border-radius: 2px; background: rgba(236, 240, 255, 0.06); transition: background 0.4s; }
  .batt__cells i.is-on { background: var(--mint); box-shadow: 0 0 6px rgba(79, 224, 169, 0.35); }
  .batt__cells i.is-edge { animation: blink 1.2s ease-in-out infinite; }
  .batt__txt { min-width: 0; font: 400 11.5px/1.3 var(--fm); color: var(--mute); }
  .batt__txt b { font: 400 17px/1 var(--fr); color: var(--ink); letter-spacing: -0.02em; }
  .batt__sub { display: block; margin-top: 2px; }
  .chart { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; margin-top: 12px; }
  .chart__legend { display: flex; align-items: center; gap: 12px; font: 400 10.5px/1 var(--fm); color: var(--mute); }
  .lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .lg::before { content: ""; width: 12px; height: 3px; border-radius: 2px; background: var(--amber); }
  .lg--load::before { background: var(--ink); }
  .chart__hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; font: 400 10.5px/1.2 var(--fm); color: var(--mute); text-align: center; }
  .chart__hint .i { width: 13px; height: 13px; flex: none; }
  .chart__plot { position: relative; flex: 1 1 auto; min-height: 84px; margin-top: 10px; cursor: crosshair; touch-action: pan-y; border-radius: 8px; }
  .chart__plot:focus-visible { outline-offset: 4px; }
  .chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .chart__grid { stroke: rgba(236, 240, 255, 0.06); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
  .chart__prod { fill: none; stroke: var(--amber); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
  .chart__load { fill: none; stroke: var(--ink); stroke-opacity: 0.75; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
  .chart__future { fill: var(--c1); opacity: 0.6; }
  .chart__now { stroke: var(--amber); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
  .chart__cursor { position: absolute; left: var(--x); top: 0; bottom: 0; width: 0; pointer-events: none; }
  .chart__cursor > i { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: rgba(236, 240, 255, 0.4); }
  .chart__cursor.is-pinned > i { background: var(--amber); width: 2px; margin-left: -0.5px; }
  .chart__cursor > span { position: absolute; top: -2px; left: 0; transform: translateX(calc(-50% + var(--shift, 0) * 1%)); display: flex; gap: 8px; padding: 6px 9px; border-radius: 9px; white-space: nowrap; background: #eef0f4; color: #14161c; font: 400 11px/1 var(--fm); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7); }
  .chart__cursor .tip-prod { color: #a8620a; }
  .chart__axis { display: flex; justify-content: space-between; margin-top: 5px; font: 400 10px/1 var(--fm); color: var(--mute); }
  .etot { flex: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-top: 12px; }
  .etot div { min-width: 0; display: grid; gap: 5px; padding: 9px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
  .etot dt { font: 400 10px/1.1 var(--fm); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .etot dd { font: 400 13.5px/1 var(--fr); letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }

  /* ================================================================ devices */
  .card--devices { grid-area: dev; }
  .devs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dev { min-width: 0; display: flex; flex-direction: column; gap: 9px; padding: 11px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
  .dev--vac { grid-column: 1 / -1; }
  .dev__name { display: flex; align-items: center; gap: 6px; min-width: 0; font: 400 12px/1.2 var(--fr); color: var(--ink-2); }
  .dev__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dev__name .i { width: 15px; height: 15px; color: var(--mute); }
  .dev__batt { margin-left: auto; font: 400 10.5px/1 var(--fm); color: var(--mute); }
  .dev__state { display: grid; gap: 2px; min-width: 0; font: 400 10.5px/1.25 var(--fm); color: var(--mute); }
  .dev__state b { font: 400 13px/1.2 var(--fr); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dev__state span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dev__btns { display: flex; gap: 6px; margin-top: auto; }
  .dev__btns .pill { flex: 1; padding: 0 8px; }
  .dev__row { display: flex; align-items: center; gap: 10px; }
  .dev__ibtns { display: flex; gap: 4px; flex: none; }
  .ibtn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--c2); border: 1px solid var(--line); color: var(--ink-2); transition: background 0.2s, color 0.2s, transform 0.25s var(--spring); }
  .ibtn:hover { background: var(--c3); color: var(--ink); }
  .ibtn:active { transform: scale(0.9); }
  .ibtn .i { width: 15px; height: 15px; }
  .dev__row .dev__state { flex: 1; }
  .shutter { position: relative; height: 78px; overflow: hidden; border-radius: 10px; border: 1px solid var(--line-2); cursor: ns-resize; touch-action: none; }
  .shutter:focus-visible { outline-offset: 2px; }
  .shutter__view {
    position: absolute; inset: 0;
    background:
      radial-gradient(2px 2px at 22% 26%, rgba(255, 255, 255, 0.8), transparent 60%),
      radial-gradient(1.5px 1.5px at 64% 18%, rgba(255, 255, 255, 0.7), transparent 60%),
      radial-gradient(1.5px 1.5px at 82% 40%, rgba(255, 255, 255, 0.6), transparent 60%),
      linear-gradient(180deg, #0f2463 0%, #23489f 55%, #e58f4f 100%);
  }
  .shutter__view::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: linear-gradient(180deg, transparent, rgba(5, 8, 16, 0.9)), repeating-linear-gradient(90deg, rgba(5, 8, 16, 0.9) 0 9px, transparent 9px 14px); clip-path: polygon(0 60%, 12% 20%, 20% 55%, 34% 10%, 46% 50%, 58% 25%, 70% 60%, 84% 15%, 100% 45%, 100% 100%, 0 100%); }
  .shutter::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; z-index: 1; width: 2px; margin-left: -1px; background: rgba(10, 12, 18, 0.7); }
  .shutter__blind {
    position: absolute; left: 0; right: 0; top: 0; z-index: 2; height: calc((1 - var(--o)) * 100%);
    background: repeating-linear-gradient(180deg, #d8d2c6 0 6px, #aaa396 6px 7px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  }
  .shutter__grip { position: absolute; left: 50%; z-index: 3; top: calc((1 - var(--o)) * 100% - 5px); width: 26px; height: 4px; margin-left: -13px; border-radius: 2px; background: #6d675d; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
  .shutter:hover .shutter__grip, .shutter.is-drag .shutter__grip { background: var(--amber); }
  .dev--blinds .dev__row { margin-top: auto; justify-content: space-between; }
  .dev__pct { font: 400 11px/1 var(--fm); color: var(--mute); font-variant-numeric: tabular-nums; }
  .dev--lock .lockbtn { position: relative; width: 78px; height: 78px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.35); color: var(--amber); transition: background 0.4s, border-color 0.4s, color 0.4s, transform 0.3s var(--spring); }
  .lockbtn:active { transform: scale(0.93); }
  .dev--lock.is-locked .lockbtn { background: rgba(79, 224, 169, 0.1); border-color: rgba(79, 224, 169, 0.4); color: var(--mint); }
  .lockbtn__ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; }
  .lockbtn__ring circle { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; opacity: 0; }
  .dev--lock.is-busy .lockbtn__ring circle { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s linear; }
  .lockbtn__ico { position: absolute; display: grid; transition: opacity 0.3s, transform 0.45s var(--spring); }
  .lockbtn__ico .i { width: 30px; height: 30px; stroke-width: 1.6; }
  .lockbtn__ico--shut { opacity: 0; transform: scale(0.6); }
  .dev--lock.is-locked .lockbtn__ico--shut { opacity: 1; transform: none; }
  .dev--lock.is-locked .lockbtn__ico--open { opacity: 0; transform: scale(0.6); }
  .dev--lock.is-done .lockbtn { animation: lockpop 0.5s var(--spring); }
  @keyframes lockpop { 40% { transform: scale(1.08); } }
  .dev--lock .dev__state { text-align: center; justify-items: center; }
  .dev--lock .dev__state span { white-space: normal; }
  .vmap { display: block; width: 100%; height: auto; }
  .vmap__room { fill: rgba(236, 240, 255, 0.03); stroke: rgba(236, 240, 255, 0.1); stroke-width: 1; transition: fill 0.5s, stroke 0.5s; }
  .vmap__room.is-cleaning { fill: rgba(255, 181, 71, 0.08); stroke: rgba(255, 181, 71, 0.55); }
  .vmap__room.is-done { fill: rgba(79, 224, 169, 0.06); stroke: rgba(79, 224, 169, 0.3); }
  .vmap__lab { font: 400 7.5px var(--fm); fill: var(--mute); }
  .vmap__trail { fill: none; stroke: rgba(255, 181, 71, 0.5); stroke-width: 1.2; stroke-dasharray: 1.5 2; }
  .vmap__dock { fill: rgba(236, 240, 255, 0.25); }
  .vmap__bot { fill: var(--amber); stroke: #fff; stroke-width: 1.5; }
  .dev--vac[data-state="cleaning"] .vmap__bot { animation: botpulse 1.2s ease-in-out infinite; }
  @keyframes botpulse { 50% { stroke-width: 3.5; stroke: rgba(255, 255, 255, 0.5); } }
  .vprog { flex: 0 0 30%; height: 4px; border-radius: 2px; background: rgba(236, 240, 255, 0.08); overflow: hidden; }
  .vprog i { display: block; width: var(--p, 0%); height: 100%; border-radius: inherit; background: var(--amber); transition: width 0.3s linear; }

  /* ================================================================ activity log */
  .card--log { grid-area: log; }
  .log { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; margin: -4px -6px 0; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }
  .log__item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 2px; }
  .log__item + .log__item { border-top: 1px solid var(--line); }
  .log__item.is-fresh { animation: logIn 0.7s var(--ease); }
  @keyframes logIn { from { opacity: 0; transform: translateY(-6px); background: rgba(255, 181, 71, 0.1); } }
  .log__ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--c2); color: var(--ink-2); }
  .log__item.is-fresh .log__ico { color: var(--amber); }
  .log__ico .i { width: 15px; height: 15px; }
  .log__txt { font: 300 12.5px/1.35 var(--fr); color: var(--ink-2); }
  .log__time { font: 400 10.5px/1 var(--fm); color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }

  /* ================================================================ toast + mobile tabs */
  .dtoast {
    position: absolute; left: 0; right: 0; bottom: 24px; z-index: 50; margin-inline: auto; width: max-content;
    display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 9px 18px 9px 9px; border-radius: 999px;
    background: rgba(32, 35, 44, 0.94); border: 1px solid var(--line-2); box-shadow: 0 24px 44px -14px rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    font: 400 13.5px/1.3 var(--fr); color: var(--ink);
    opacity: 0; transform: translateY(24px) scale(0.96); pointer-events: none;
    transition: opacity 0.3s, transform 0.5s var(--spring);
  }
  .dtoast.is-on { opacity: 1; transform: none; }
  .dtoast__ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--amber-ink); }
  .dtoast__ico .i { width: 16px; height: 16px; stroke-width: 2; }
  .mtabs { display: none; }

  /* ================================================================ responsive */
  @media (max-width: 1400px) {
    .dgrid { gap: 12px; padding: 14px 14px 16px; }
    .people { display: none; }
    .rtab { font-size: 11.5px; letter-spacing: -0.02em; }
    .cstats div { padding: 8px; }
    .cstats dt { font-size: 9.5px; }
    .light { grid-template-columns: 34px minmax(0, 1fr) 36px 40px; gap: 8px; }
    .scene { padding: 0 13px 0 10px; font-size: 13px; }
    .wx__d { display: none; }
    .chart__hint { display: none; }
  }
  @media (min-width: 1280px) and (max-height: 860px) {
    .rtemps, .chart__hint { display: none; }
    .flow { max-width: 300px; }
    .sched { margin-top: 8px; padding: 8px 10px 6px; }
  }
  @media (max-width: 1279px) {
    .people { display: flex; }
    .rtab { font-size: 12px; letter-spacing: -0.01em; }
    .dpanel { height: auto; min-height: 0; }
    .dial { width: min(100%, 330px); }
    .dgrid {
      height: auto;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: none;
      grid-template-areas: "hl hr" "sc sc" "room clim" "en dev" "en log";
    }
    .card--room { min-height: 640px; }
    .card--log { min-height: 260px; }
    .wx__d { display: block; }
    .chart__hint { display: inline; }
  }
  @media (max-width: 760px) {
    .dwall { padding: 0; min-height: 0; background: var(--bg); }
    .dpanel { height: calc(100svh - var(--fs-bar-h)); min-height: 540px; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
    .dpanel::before { display: none; }
    .dgrid {
      flex: 1; min-height: 0; height: auto; overflow-y: auto; overscroll-behavior-y: auto;
      display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: none; grid-template-rows: none; grid-auto-rows: max-content; align-content: start;
      gap: 12px; padding: 14px 14px calc(84px + env(safe-area-inset-bottom));
    }
    .dh--l { grid-column: 1; grid-row: 1; }
    .dh--r { grid-column: 2; grid-row: 1; gap: 12px; }
    .scenes, .card { grid-area: auto; grid-column: 1 / -1; }
    .card { min-height: auto; }
    .rtemps, .chart, .rhero { flex: none; }
    .rhero { aspect-ratio: 16 / 10.5; min-height: 0; }
    .chart__plot { flex: none; height: 110px; }
    .people, .dh__home .dh__sep, .wx__d, .clock__d { display: none; }
    .dh__logo { width: 34px; height: 34px; }
    .dh__hi { font-size: 18px; }
    .wx__ico .i { width: 24px; height: 24px; }
    .wx__t { font-size: 18px; }
    .clock__t { font-size: 30px; }
    .scenes { justify-content: flex-start; margin: 0 -14px; }
    .scenes__row { padding: 0 14px; border: 0; background: none; box-shadow: none; gap: 6px; }
    .scene { background: var(--c1); border: 1px solid var(--line); height: 42px; }
    .domus[data-tab] [data-panel], .domus[data-tab] .scenes { display: none; }
    .domus[data-tab="home"] [data-panel="home"], .domus[data-tab="home"] .scenes,
    .domus[data-tab="climate"] [data-panel="climate"], .domus[data-tab="energy"] [data-panel="energy"],
    .domus[data-tab="devices"] [data-panel="devices"] { display: flex; }
    .card.is-enter { animation: rise 0.45s var(--ease) both; }
    .card--room { min-height: 0; }
    .lights { overflow: visible; flex: none; }
    .card--log { min-height: 0; }
    .log { overflow: visible; }
    .dial { width: min(100%, 300px); }
    .rtemps { align-content: start; }
    .mtabs {
      display: grid; grid-template-columns: repeat(4, 1fr); position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
      padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
      background: rgba(20, 22, 28, 0.9); border-top: 1px solid var(--line);
      -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
    }
    .mtab { display: grid; justify-items: center; gap: 4px; padding: 8px 0 6px; border-radius: 14px; font: 400 11px/1 var(--fr); color: var(--mute); transition: color 0.25s, background 0.25s; }
    .mtab .i { width: 22px; height: 22px; transition: transform 0.35s var(--spring); }
    .mtab.is-on { color: var(--amber); background: var(--amber-soft); }
    .mtab.is-on .i { transform: translateY(-1px); }
    .dtoast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  }
  @media (max-width: 380px) {
    .dgrid { padding-left: 10px; padding-right: 10px; }
    .scenes { margin: 0 -10px; }
    .scenes__row { padding: 0 10px; }
    .card { padding: 13px; }
    .etot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wx { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .domus *, .domus *::before, .domus *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  }
}
