/* Home control */
.hc {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  padding: 20px 28px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.hc-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.hc-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.hc-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex: none; }
.sum { min-height: 120px; padding: 14px 16px; border-radius: var(--r); background: var(--card); display: flex; flex-direction: column; text-align: left; }
.sum:active { transform: scale(.97); }
.sum b { font-size: 48px; line-height: .95; margin-top: 4px; }
.sum small { font-size: var(--fs-min); color: var(--ink-2); margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum--warm { background: var(--warm); }
.sum--warm .label { color: rgba(0, 0, 0, .55); }
.sum--warn { background: var(--amber); }
.sum--warn .label { color: rgba(0, 0, 0, .55); }

.hc-scenes { display: flex; gap: 10px; flex: none; }
.scene {
  flex: 1; min-height: var(--tap); border-radius: 16px; border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 17px; font-weight: 800; font-stretch: 75%; letter-spacing: .06em; text-transform: uppercase;
}
.scene:active { transform: scale(.95); }
.scene.is-on { background: var(--ink); color: var(--paper); }

.hc-rooms { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 90px; }
.room { margin-bottom: 18px; }
.room-h { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.room-h h3 { font-size: 32px; line-height: 1.1; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.tiles--sheet { grid-template-columns: repeat(4, 1fr); max-height: 470px; overflow-y: auto; }
.tile {
  position: relative; overflow: hidden;
  min-height: 124px; padding: 14px 16px; border-radius: 18px;
  background: var(--card);
  display: flex; flex-direction: column; justify-content: space-between;
  touch-action: pan-y; cursor: pointer;
}
.tile:active { transform: scale(.97); }
.tile-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--lvl); background: var(--warm); }
.tile.is-drag { transform: scale(1.02); box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.tile-icon, .tile-name, .tile-state { position: relative; z-index: 1; }
.tile-icon { color: var(--mute); }
.tile.is-on .tile-icon { color: var(--ink); }
.tile-name { font-size: 18px; font-weight: 700; line-height: 1.1; margin-top: 8px; }
.tile-state { font-size: 17px; color: var(--mute); }
.tile-state.num { font-size: 28px; line-height: 1; color: var(--ink-2); }
.tile:not(.is-on) .tile-state.num { color: var(--mute); }
.tile-state small { display: block; font-size: 13px; font-weight: 700; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; }
.tile--lock .tile-name { margin-top: 4px; }
.tile--light.is-on { background: #FFF1D0; }
.tile--blind .tile-fill { background: #BFD6F2; }
.tile--blind.is-on { background: #E4EEFA; }
.tile--lock .tile-state, .tile--garage .tile-state { font-weight: 800; color: var(--ink); font-size: 19px; }
.tile.is-warn { background: var(--amber); }
.tile.is-warn .tile-icon { color: var(--ink); }
.tile.is-moving { background: repeating-linear-gradient(-45deg, var(--amber) 0 14px, #FFB347 14px 28px); background-size: 40px 40px; }
.hold-ring { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: var(--ink); stroke-width: 4; stroke-dasharray: 107; stroke-dashoffset: 107; stroke-linecap: round; }
.tile.is-holding { background: var(--paper-2); }
.tile.is-holding .hold-ring circle { stroke-dashoffset: 0; }
.pend { position: absolute; right: 14px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); z-index: 2; }

/* climate */
.hc-climate { background: var(--ink); color: #fff; border-radius: var(--r); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.th-main { display: flex; align-items: center; justify-content: space-between; }
.th-btn { width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.th-btn:active { transform: scale(.9); background: rgba(255, 255, 255, .25); }
.th-set { text-align: center; }
.th-set .num { font-size: 116px; line-height: .8; letter-spacing: -.03em; display: block; }
.th-set small { font-size: var(--fs-min); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .65; }
.th-now { display: flex; align-items: center; justify-content: space-between; font-size: 16px; color: rgba(255, 255, 255, .75); }
.th-now b { font-size: 22px; color: #fff; }
.th-verb { padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: rgba(255, 255, 255, .15); color: #fff; }
.th-verb--heating { background: #FF6A1A; }
.th-verb--cooling { background: #2D8CFF; }
.hc-climate .seg { display: flex; }
.hc-climate .seg button { flex: 1; padding: 0; text-align: center; }

/* cameras + media */
.cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.cam { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 11; background: #333; color: #fff; }
.cam img { width: 100%; height: 100%; object-fit: cover; }
.cam::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0) 55%); }
.cam-name { position: absolute; left: 10px; bottom: 8px; z-index: 1; font-size: var(--fs-min); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cam-age { position: absolute; right: 8px; top: 8px; z-index: 1; font-size: 13px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums; }
.hc-media { display: flex; align-items: center; gap: 14px; padding: 12px; margin-top: auto; }
.np-art { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--paper-2); }
.np-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.np-text b { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text > span:last-child { font-size: 16px; color: var(--mute); }
.np-btn { width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; }

/* garage slide-to-confirm */
.slide-confirm { position: relative; height: 88px; border-radius: 999px; background: var(--paper-2); overflow: hidden; touch-action: none; }
.sc-label { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; font-stretch: 80%; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding-left: 60px; }
.sc-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 88px; border-radius: 999px; background: var(--amber); }
.sc-knob { position: absolute; left: 6px; top: 6px; width: 76px; height: 76px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }

/* camera sheet */
.sheet--cam { width: 1000px; background: #000; }
.sheet--cam .sheet-x { background: rgba(255, 255, 255, .2); color: #fff; }
.cam-big { position: relative; }
.cam-big img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.cam-big .tk-live { left: 20px; top: 20px; }
.cam-big-bar .label { position: absolute; left: 24px; bottom: 20px; }
.is-pulse { box-shadow: 0 0 0 6px var(--warm); }
