/* Nest thermostat (ideas 1–10). No filter:blur on the tile. */
.nest-thermo{
  --heat:#ff8a3d; --heat2:#ff5f45; --cool:#22d3ee; --cool2:#3b82f6;
  --ease:cubic-bezier(.22,1,.36,1); --spring:cubic-bezier(.34,1.36,.64,1);
  --mc:var(--muted);
  position:relative;padding:22px 24px;display:flex;flex-direction:column;
  overflow:hidden;
  background:linear-gradient(160deg,rgba(22,42,84,.62),rgba(9,19,44,.82));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
  -webkit-tap-highlight-color:transparent;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  user-select:none;
}
.card.nest-thermo{border-radius:28px;}
.nest-thermo[data-mode=heat]{--mc:var(--heat)}
.nest-thermo[data-mode=cool]{--mc:var(--cool)}
.nest-thermo[data-mode=auto]{--mc:#c4b5fd}
.nest-thermo .glow{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .6s var(--ease)}
.nest-thermo .glow.heat{background:radial-gradient(360px 300px at 30% 52%,rgba(255,122,61,.22),transparent 70%)}
.nest-thermo .glow.cool{background:radial-gradient(360px 300px at 30% 52%,rgba(34,211,238,.20),transparent 70%)}
.nest-thermo .glow.auto{background:radial-gradient(260px 260px at 20% 60%,rgba(255,122,61,.15),transparent 70%),radial-gradient(260px 260px at 42% 45%,rgba(34,211,238,.15),transparent 70%)}
.nest-thermo[data-mode=heat] .glow.heat,.nest-thermo[data-mode=cool] .glow.cool,.nest-thermo[data-mode=auto] .glow.auto{opacity:1}
.nest-thermo .t-top{display:flex;align-items:center;gap:10px;position:relative;z-index:1}
.nest-thermo .t-title{font-size:13px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);font-weight:750}
.nest-thermo .t-sub{font-size:12px;color:#5f7193;font-weight:600}
.nest-thermo .spacer{flex:1}
.nest-thermo .hum{display:flex;align-items:center;gap:10px;padding:6px 12px 6px 6px;border-radius:999px;background:rgba(255,255,255,.04);border:1px solid var(--line)}
.nest-thermo .hum svg{width:34px;height:34px;display:block}
.nest-thermo .hum b{font-size:16px;font-variant-numeric:tabular-nums;font-weight:700}
.nest-thermo .hum span{display:block;font-size:11px;color:var(--muted);font-weight:650;letter-spacing:.02em}
.nest-thermo .t-body{display:flex;align-items:center;gap:18px;flex:1;position:relative;min-height:0;z-index:1}
.nest-thermo .dial{position:relative;flex:none;touch-action:none;user-select:none;-webkit-user-select:none}
.nest-thermo .dial svg{display:block;width:100%;height:100%;overflow:visible}
.nest-thermo .track{fill:none;stroke:rgba(255,255,255,.07);stroke-linecap:round}
.nest-thermo .seg{fill:none;stroke-linecap:round;transition:stroke-dasharray .45s var(--ease),stroke-dashoffset .45s var(--ease),opacity .45s}
.nest-thermo .seg.halo{opacity:.22}
.nest-thermo .dragging .seg{transition:opacity .45s}
.nest-thermo .tick{stroke:rgba(255,255,255,.16);stroke-width:2;stroke-linecap:round;transition:stroke .4s}
.nest-thermo .tick.maj{stroke:rgba(255,255,255,.3)}
.nest-thermo .tick.lit-h{stroke:rgba(255,160,110,.85)}
.nest-thermo .tick.lit-c{stroke:rgba(120,230,250,.85)}
.nest-thermo .tick.lit-z{stroke:rgba(255,255,255,.55)}
.nest-thermo .handle{transition:transform .45s var(--ease),opacity .3s}
.nest-thermo .dragging .handle{transition:opacity .3s}
.nest-thermo .handle .hit{fill:transparent}
.nest-thermo .handle .knob{fill:#fff;stroke-width:5;transition:r .2s var(--spring)}
.nest-thermo .handle.h .knob{stroke:var(--heat)}
.nest-thermo .handle.c .knob{stroke:var(--cool)}
.nest-thermo .handle.grab .knob{r:15}
.nest-thermo .cur-mark{transition:transform .6s var(--ease)}
.nest-thermo .cur-mark circle{fill:#fff}
.nest-thermo .cur-mark text{fill:#cfe0ff;font-size:11px;font-weight:700;text-anchor:middle;dominant-baseline:middle;font-variant-numeric:tabular-nums}
.nest-thermo .dial .lim{fill:#5f7193;font-size:11px;font-weight:700;text-anchor:middle}
.nest-thermo .center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;text-align:center}
.nest-thermo .c-label{font-size:12px;letter-spacing:.2em;font-weight:800;text-transform:uppercase;color:var(--mc);transition:color .4s;height:16px}
.nest-thermo .bign{display:flex;align-items:flex-start;justify-content:center;font-weight:200;letter-spacing:-.04em;font-variant-numeric:tabular-nums;line-height:1}
.nest-thermo .deg{font-size:.36em;font-weight:300;margin-top:.12em;opacity:.8;letter-spacing:0}
.nest-thermo .roll{position:relative;display:inline-block;overflow:hidden;height:1em;line-height:1;text-align:center}
.nest-thermo .roll span{display:block}
.nest-thermo .roll span.abs{position:absolute;left:0;right:0;top:0}
.nest-thermo .c-sub{margin-top:8px;font-size:14px;color:var(--muted);font-weight:600;font-variant-numeric:tabular-nums}
.nest-thermo .c-sub b{color:#dbe7ff;font-weight:700}
.nest-thermo .dual{display:none;align-items:center;gap:14px}
.nest-thermo .dual .dv{display:flex;flex-direction:column;align-items:center}
.nest-thermo .dual .dv small{font-size:11px;font-weight:800;letter-spacing:.16em;margin-bottom:4px}
.nest-thermo .dual .dv.h small{color:var(--heat)}.nest-thermo .dual .dv.c small{color:var(--cool)}
.nest-thermo .dual .sep{width:1px;height:46px;background:linear-gradient(transparent,rgba(255,255,255,.3),transparent)}
.nest-thermo[data-mode=auto] .single{display:none}
.nest-thermo[data-mode=auto] .dual{display:flex}
.nest-thermo[data-mode=off] .seg,.nest-thermo[data-mode=off] .handle{opacity:0;pointer-events:none}
.nest-thermo[data-mode=heat] .seg.cool,.nest-thermo[data-mode=heat] .handle.c{opacity:0;pointer-events:none}
.nest-thermo[data-mode=cool] .seg.heat,.nest-thermo[data-mode=cool] .handle.h{opacity:0;pointer-events:none}
.nest-thermo .ctrl{flex:1;display:flex;flex-direction:column;gap:12px;min-width:0}
.nest-thermo .step{min-width:0;display:flex;align-items:center;gap:10px;padding:10px;border-radius:22px;background:rgba(255,255,255,.035);border:1px solid var(--line);transition:opacity .35s,border-color .4s}
.nest-thermo .step .who{flex:1;padding-left:6px}
.nest-thermo .step .who small{display:block;white-space:nowrap;font-size:11px;letter-spacing:.16em;font-weight:800;text-transform:uppercase}
.nest-thermo .step .who b{display:flex;font-size:34px;font-weight:300;font-variant-numeric:tabular-nums;letter-spacing:-.02em;line-height:1.1}
.nest-thermo .step.h small{color:var(--heat)}.nest-thermo .step.c small{color:var(--cool)}
.nest-thermo .step.h{border-color:rgba(255,138,61,.22)}.nest-thermo .step.c{border-color:rgba(34,211,238,.22)}
.nest-thermo .sb{width:64px;height:64px;border-radius:20px;border:1px solid rgba(255,255,255,.12);flex:none;cursor:pointer;
  background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,.03));display:grid;place-items:center;
  transition:transform .18s var(--spring),background-color .2s,box-shadow .2s}
.nest-thermo .sb svg{width:24px;height:24px;stroke:#fff;stroke-width:2.4;stroke-linecap:round;fill:none}
.nest-thermo .sb:active,.nest-thermo .sb.down{transform:scale(.92)}
.nest-thermo .step.h .sb.down{box-shadow:0 0 0 1px rgba(255,138,61,.5),0 0 24px -4px rgba(255,138,61,.6)}
.nest-thermo .step.c .sb.down{box-shadow:0 0 0 1px rgba(34,211,238,.5),0 0 24px -4px rgba(34,211,238,.6)}
.nest-thermo .step.dis{opacity:.35;pointer-events:none}
.nest-thermo .gapnote{font-size:12px;color:var(--muted);font-weight:600;padding:0 6px;display:none}
.nest-thermo[data-mode=auto] .gapnote{display:block}
.nest-thermo[data-mode=heat] .step.c,.nest-thermo[data-mode=cool] .step.h{display:none}
.nest-thermo .offmsg{display:none;font-size:14px;color:var(--muted);line-height:1.45;padding:4px 6px}
.nest-thermo[data-mode=off] .offmsg{display:block}
.nest-thermo .status{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);font-weight:600;min-height:20px;padding:0 6px;transition:opacity .4s}
.nest-thermo .status i{width:8px;height:8px;border-radius:50%;background:#64748b;flex:none}
.nest-thermo .status.pending i{background:#fbbf24;animation:nest-pend 1s ease-in-out infinite}
.nest-thermo .status.ok i{background:#34d399}
@keyframes nest-pend{50%{opacity:.3}}
.nest-thermo .modes{position:relative;display:grid;grid-template-columns:repeat(4,1fr);margin-top:14px;padding:5px;border-radius:20px;background:rgba(0,0,0,.25);border:1px solid var(--line);z-index:1}
.nest-thermo .mpill{position:absolute;top:5px;bottom:5px;left:5px;width:calc((100% - 10px)/4);border-radius:15px;transform:translateX(calc(var(--i,0)*100%));
  transition:transform .38s var(--ease),background .4s,box-shadow .4s;background:rgba(148,163,184,.25)}
.nest-thermo[data-mode=heat] .mpill{background:linear-gradient(135deg,rgba(255,138,61,.45),rgba(255,95,69,.30));box-shadow:0 8px 22px -10px rgba(255,120,60,.8),inset 0 0 0 1px rgba(255,180,140,.5)}
.nest-thermo[data-mode=cool] .mpill{background:linear-gradient(135deg,rgba(34,211,238,.40),rgba(59,130,246,.30));box-shadow:0 8px 22px -10px rgba(34,211,238,.8),inset 0 0 0 1px rgba(150,235,250,.5)}
.nest-thermo[data-mode=auto] .mpill{background:linear-gradient(90deg,rgba(255,138,61,.38),rgba(34,211,238,.38));box-shadow:0 8px 22px -10px rgba(150,160,255,.7),inset 0 0 0 1px rgba(255,255,255,.45)}
.nest-thermo[data-mode=off] .mpill{background:rgba(148,163,184,.22);box-shadow:inset 0 0 0 1px rgba(255,255,255,.25)}
.nest-thermo .mb{position:relative;z-index:1;min-height:54px;border:0;background:none;font-size:15px;font-weight:700;color:var(--muted);cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:7px;transition:color .3s;font-family:inherit}
.nest-thermo .mb svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nest-thermo .mb.on{color:#fff}

/* Room chip */
.chip.nest-chip, button.climate-chip.nest-chip{
  display:flex;align-items:center;gap:10px;min-height:52px;padding:0 18px 0 14px;border-radius:999px;cursor:pointer;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.14);font-size:17px;font-weight:650;font-variant-numeric:tabular-nums;
  transition:transform .18s var(--spring),box-shadow .3s,border-color .3s;color:inherit}
.chip.nest-chip:active{transform:scale(.96)}
.nest-chip .cd{width:10px;height:10px;border-radius:50%;background:#64748b;transition:background .4s,box-shadow .4s;flex:none}
.nest-chip[data-mode=heat]{border-color:rgba(255,138,61,.45)}.nest-chip[data-mode=heat] .cd{background:var(--heat,#ff8a3d);box-shadow:0 0 10px var(--heat,#ff8a3d)}
.nest-chip[data-mode=cool]{border-color:rgba(34,211,238,.45)}.nest-chip[data-mode=cool] .cd{background:var(--cool,#22d3ee);box-shadow:0 0 10px var(--cool,#22d3ee)}
.nest-chip[data-mode=auto]{border-color:rgba(196,181,253,.45)}.nest-chip[data-mode=auto] .cd{background:linear-gradient(90deg,#ff8a3d 50%,#22d3ee 50%)}
.nest-chip .ct{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
.nest-chip .cm{color:var(--muted);font-weight:600}
.nest-chip .cm em{font-style:normal;color:#e8f1ff}


/* Hold-to-unlock safeguard — locked by default so a casual tap can't move the Nest. */
.nest-thermo.locked,
.nest-thermo.unlocking{touch-action:none}
.nest-thermo.locked .t-body,
.nest-thermo.locked .modes,
.nest-thermo.locked .s-body,
.nest-thermo.locked .ctrl{
  opacity:.55;
  filter:saturate(.4);
  transition:opacity .35s var(--ease),filter .35s var(--ease);
}
.nest-thermo:not(.locked) .t-body,
.nest-thermo:not(.locked) .modes,
.nest-thermo:not(.locked) .s-body,
.nest-thermo:not(.locked) .ctrl{
  opacity:1;filter:none;
  transition:opacity .35s var(--ease),filter .35s var(--ease);
}
.nest-thermo.locked .dial,
.nest-thermo.locked .sb,
.nest-thermo.locked .mb,
.nest-thermo.locked .ctrl,
.nest-thermo.locked .modes{
  pointer-events:none;
}
.nest-lock-ico{
  display:none;align-items:center;gap:7px;
  color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.04em;
  flex:none;margin-right:8px;
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;
}
.nest-thermo.locked .nest-lock-ico,
.nest-thermo.unlocking .nest-lock-ico{display:inline-flex}
.nest-lock-ico svg{display:block;flex:none}
.nest-unlock{
  display:none;position:absolute;inset:0;z-index:12;
  align-items:center;justify-content:center;flex-direction:column;gap:10px;
  background:rgba(8,14,24,.42);
  pointer-events:none;
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;
}
.nest-thermo.unlocking .nest-unlock{display:flex}
.nest-unlock-ring{position:relative;width:148px;height:148px}
.nest-unlock-ring svg{width:100%;height:100%;transform:rotate(-90deg);display:block}
.nest-unlock-ring .bg{stroke:rgba(255,255,255,.14)}
.nest-unlock-ring .fg{stroke:#72d9f8;stroke-linecap:round;stroke-dasharray:0 100;transition:none}
.nest-unlock-count{
  position:absolute;inset:0;display:grid;place-items:center;
  font-size:72px;font-weight:200;letter-spacing:-.04em;line-height:1;
  font-variant-numeric:tabular-nums;color:#edf4fa;
}
.nest-unlock-hint{font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#99a8b8}
@keyframes nest-unlock-pulse{
  0%{transform:scale(1)}
  40%{transform:scale(1.025);filter:brightness(1.18)}
  100%{transform:scale(1)}
}
.nest-thermo.unlock-pulse .t-body,
.nest-thermo.unlock-pulse .modes{
  animation:nest-unlock-pulse .48s cubic-bezier(.22,1,.36,1);
}
@media (prefers-reduced-motion:reduce){
  .nest-thermo.unlock-pulse .t-body,
  .nest-thermo.unlock-pulse .modes{animation:none}
}

/* Frosted bottom sheet — blur allowed here, not on the tile */
.climate-overlay{position:fixed;inset:0;z-index:70;pointer-events:none;visibility:hidden}
.climate-overlay .climate-scrim{position:absolute;inset:0;background:rgba(2,6,18,.55);opacity:0;pointer-events:none;transition:opacity .35s cubic-bezier(.22,1,.36,1)}
.climate-overlay .climate-sheet{
  position:absolute;z-index:21;left:50%;bottom:0;width:min(700px,calc(100% - 32px));margin:0;
  padding:10px 26px 26px;border-radius:30px 30px 0 0;
  background:linear-gradient(180deg,rgba(24,44,88,.82),rgba(9,19,44,.92));
  border:1px solid rgba(255,255,255,.12);border-bottom:0;
  box-shadow:0 -30px 80px -20px rgba(0,0,0,.8),inset 0 1px 0 rgba(255,255,255,.16);
  -webkit-backdrop-filter:blur(18px) saturate(1.2);backdrop-filter:blur(18px) saturate(1.2);
  transform:translate3d(-50%,105%,0);transition:transform .5s cubic-bezier(.22,1,.36,1);touch-action:none;
  --heat:#ff8a3d;--cool:#22d3ee;--ease:cubic-bezier(.22,1,.36,1);--mc:var(--muted);
}
@media (min-width:901px){
  .climate-overlay .climate-sheet{left:calc(240px + (100% - 240px)/2)}
}
.climate-overlay.open{pointer-events:auto;visibility:visible}
.climate-overlay.open .climate-scrim{opacity:1;pointer-events:auto}
.climate-overlay.open .climate-sheet{transform:translate3d(-50%,var(--dy,0px),0)}
.climate-sheet.drag{transition:none}
.climate-sheet .grab{width:46px;height:5px;border-radius:3px;background:rgba(255,255,255,.3);margin:4px auto 12px}
.climate-sheet .s-top{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.climate-sheet .s-top h2{margin:0;font-size:20px;font-weight:750;flex:1}
.climate-sheet .x,.climate-close{width:48px;height:48px;border-radius:50%;border:1px solid rgba(148,178,220,.14);background:rgba(255,255,255,.05);display:grid;place-items:center;cursor:pointer;color:inherit}
.climate-sheet .x svg,.climate-close svg{width:18px;height:18px;stroke:#cbd5e1;stroke-width:2.4;stroke-linecap:round}
.climate-sheet .s-body{display:flex;align-items:center;gap:22px}
.climate-sheet[data-mode=auto] .c-label{display:none}
.climate-sheet .glow{border-radius:30px 30px 0 0}
.climate-sheet[data-mode=heat]{--mc:var(--heat)}
.climate-sheet[data-mode=cool]{--mc:var(--cool)}
.climate-sheet[data-mode=auto]{--mc:#c4b5fd}
/* Keep the frosted sheet chrome; only drop a nested card frame feel. */
.climate-overlay .climate-sheet.nest-thermo{overflow:visible}

@media (max-width:900px),(orientation:portrait){
  .climate-overlay .climate-sheet{left:50%;width:min(700px,calc(100% - 16px))}
  .nest-thermo .t-body{flex-direction:column}
  .nest-thermo .dial{width:264px!important;height:264px!important}
}

@media (prefers-reduced-motion:reduce){
  .nest-thermo *,.nest-thermo *::before,.nest-thermo *::after,
  .climate-overlay *,.climate-overlay *::before,.climate-overlay *::after{animation:none!important;transition-duration:.01ms!important}
}

/* Office Sony HDMI buttons */
.sony-inputs{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.sony-inputs .btn{min-height:44px}

body.has-nowbar .climate-overlay .climate-sheet{bottom:76px}
@media (orientation: portrait){
  .climate-overlay .climate-sheet{left:50%;width:min(700px,calc(100% - 16px));padding-bottom:calc(22px + env(safe-area-inset-bottom,0px))}
  body.has-nowbar .climate-overlay .climate-sheet{bottom:calc(76px + env(safe-area-inset-bottom,0px))}
  .card.nest-thermo{overflow:visible}
  .card.nest-thermo .t-body{flex-wrap:wrap;justify-content:center}
}

/* Portrait: keep humidity pill inside the tile (was overflowing the right edge) */
@media (orientation: portrait){
  .nest-thermo .t-top{flex-wrap:wrap;row-gap:8px}
  .nest-thermo .t-top>div:first-child{min-width:0;flex:1 1 auto}
  .nest-thermo .t-top .spacer{display:none}
  .nest-thermo .hum{flex:0 0 auto;margin-left:auto;max-width:100%}
}
