:root {
  --ice: #5cb8ff; --ice-deep: #3373f2;
  --bg: #111214; --card: rgba(255,255,255,.07); --text: #f2f3f5; --muted: #9aa0a8;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f3f4f7; --card: rgba(0,0,0,.055); --text: #15171a; --muted: #6b7280; color-scheme: light; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
body { display: flex; justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
main, #lock { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }

#lock { align-items: center; text-align: center; margin-top: 12vh; gap: 10px; }
.lockicon { width: 84px; height: 84px; border-radius: 20px; }
#lock h1 { margin: 6px 0 0; font-size: 22px; }
#lock p { margin: 0; color: var(--muted); }
#pinform { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 260px; margin-top: 10px; }
#pin { font-size: 26px; text-align: center; letter-spacing: .3em; padding: 12px; border-radius: 14px; border: 0;
  background: var(--card); color: var(--text); outline: none; }
#pinform button { padding: 13px; border-radius: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--ice), var(--ice-deep)); }

header { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
h1 { font-size: 22px; font-weight: 650; margin: 0 0 4px; }
h2 { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -6px; }
.status { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8e8e93; }
main:not(.off) .dot { background: #34c759; }
.spin { width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; }
.power { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--muted); transition: .25s; }
main:not(.off) .power { background: linear-gradient(135deg, var(--ice), var(--ice-deep)); color: #fff; box-shadow: 0 0 26px rgba(92,184,255,.55); }
.power:active, .round:active, .chips button:active { transform: scale(.94); }

.temp { position: relative; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center;
  padding: 26px 18px 46px; border-radius: 22px; transition: .25s;
  background: linear-gradient(180deg, rgba(92,184,255,.2), rgba(51,115,242,.07)); }
main.off .temp { background: var(--card); opacity: .55; }
.round { width: 54px; height: 54px; border-radius: 50%; background: var(--card); font-size: 26px; line-height: 1; transition: .1s; }
.value { text-align: center; }
.big { font-size: 84px; font-weight: 200; font-variant-numeric: tabular-nums; line-height: 1; }
.sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ambient { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 14px; }

.chips { display: flex; gap: 8px; }
.chips button { flex: 1; padding: 12px 0; border-radius: 13px; background: var(--card); color: var(--muted);
  font-size: 14px; font-weight: 500; border: 1px solid transparent; transition: .15s; }
.chips button.sel { background: rgba(92,184,255,.2); border-color: rgba(92,184,255,.7); color: var(--ice); }
main.off .chips, main.off .row { opacity: .5; pointer-events: none; }

.row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 44px; height: 26px; border-radius: 13px; background: rgba(127,127,127,.35); position: relative; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--ice-deep); }
.switch input:checked + span::after { left: 21px; }
select { font: inherit; color: var(--text); background: var(--card); border: 0; border-radius: 11px; padding: 9px 12px; }
select.set { color: var(--ice); }
.error { color: #ff6b6b; font-size: 13px; margin: 0; }
footer { text-align: center; margin-top: 8px; }
.link { color: var(--muted); font-size: 13px; }
