* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #12161c; color: #f4f7fb; font-family: "Segoe UI", "PingFang SC", sans-serif; }
button, input { font: inherit; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.card { width: min(420px, 100%); display: grid; gap: 14px; background: #1c232c; padding: 28px; border-radius: 18px; }
.card h1 { margin: 0; font-size: 1.7rem; }
.card label { display: grid; gap: 6px; color: #c5d0dc; }
.card input { height: 46px; border: 0; border-radius: 10px; padding: 0 12px; background: #0e1318; color: white; }
.card button, #logout { border: 0; border-radius: 10px; background: #2f6fed; color: white; height: 46px; }
.error { min-height: 1.2em; margin: 0; color: #ffb4a8; }
.app { height: 100dvh; }
.stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
}
.status { display: flex; align-items: center; gap: 12px; min-height: 36px; color: #d5deea; }
.status strong { font-size: 1rem; }
#logout { height: 32px; padding: 0 12px; margin-left: auto; background: #2a3340; }
.pads { flex: 1; display: flex; align-items: center; justify-content: center; gap: max(44px, 4vw); min-height: 0; }
.pad {
  border: 0;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  touch-action: manipulation;
  user-select: none;
  display: grid;
  place-items: center;
  padding: 12%;
}
.pad.home { background: #2f6fed; }
.pad.away { background: #e07a2f; }
.pad.cooling { opacity: 0.45; }
.log {
  list-style: none;
  margin: 0;
  height: clamp(3.2rem, 18dvh, 7rem);
  overflow: auto;
  padding: 6px 2px;
  color: #d5deea;
  font-variant-numeric: tabular-nums;
}
.log li { padding: 3px 0; }
@media (orientation: portrait) {
  .pads { flex-direction: column; }
}
