:root {
  --w: 1280px;
  --h: 752px;
  --bg: #000;
  --grouped: #1c1c1e;
  --grouped-2: #2c2c2e;
  --fill: rgba(120, 120, 128, 0.24);
  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.58);
  --tertiary: rgba(235, 235, 245, 0.3);
  --tint: #0a84ff;
  --live: #30d158;
  --bad: #ff453a;
  --wait: rgba(235, 235, 245, 0.28);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--text);
  font: 16px/1.25 var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

.stage {
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--w);
  height: var(--h);
  display: grid;
  grid-template-rows: 80px 228px minmax(176px, 1fr) minmax(0, 1.15fr);
  gap: 12px;
  padding: 16px 20px 14px;
  transform-origin: center center;
  transition: grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.doorbell-fs {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.doorbell-fs.hidden {
  display: none;
}

.doorbell-fs-grid {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doorbell-fs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.doorbell-fs.dual .doorbell-fs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 52px 16px 16px;
}

.doorbell-fs.dual img {
  min-width: 0;
  min-height: 0;
}

.doorbell-fs-miss {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 510;
}

.doorbell-fs-label {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 2;
  margin: 0;
  padding: 8px 14px;
  border-radius: 980px;
  background: rgba(255, 69, 58, 0.9);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
}

#doorbell-fs-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
}

.hist-sheet {
  position: absolute;
  inset: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.hist-sheet.hidden {
  display: none;
}

.hist-card {
  width: min(1020px, 100%);
  height: min(540px, 100%);
  background: var(--grouped);
  border-radius: 22px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.hist-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hist-head-text {
  min-width: 0;
  flex: 1;
}

.hist-head-text .kicker {
  margin: 0;
}

.hist-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.hist-now {
  margin: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 510;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hist-head button {
  flex: none;
}

.hist-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 510;
}

.hist-status.hidden,
.hist-plot.hidden {
  display: none;
}

.hist-plot {
  flex: 1;
  min-height: 180px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  grid-template-rows: minmax(0, 1fr) 20px;
  column-gap: 4px;
}

.hist-plot.no-right {
  grid-template-columns: 54px minmax(0, 1fr);
}

.hist-plot.no-right .hist-y-right {
  display: none;
}

.hist-y {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 4px 4px 4px 0;
  font-size: 10px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.4);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hist-y-right {
  grid-column: 3;
  align-items: flex-start;
  padding: 4px 0 4px 4px;
}

.hist-chart {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
}

.hist-axis {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-width: 0;
}

.hist-tick {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.38);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hist-tick.edge-start {
  transform: none;
}

.hist-tick.edge-end {
  transform: translateX(-100%);
}

.hist-extra:empty {
  display: none;
}

.hist-pv-strings,
.hist-extra {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 2px 0 0;
  flex: none;
}

.hist-extra.fan-log {
  grid-template-columns: 1fr;
  gap: 0;
  max-height: 148px;
  overflow: auto;
  margin-top: 6px;
  padding-right: 2px;
}

.hist-card.hist-card-fan {
  height: min(680px, 100%);
}

.hist-extra.fan-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  max-height: none;
  overflow: visible;
}

.fan-ctrl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.fan-ctrl-top {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.fan-auto,
.fan-power {
  flex: 1;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #2c2c2e;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.fan-auto.on,
.fan-power.on {
  background: rgba(100, 210, 255, 0.22);
  color: #64d2ff;
}

.fan-ctrl-live,
.fan-ctrl-reason,
.fan-ctrl-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.62);
}

.fan-ctrl-hint {
  color: rgba(235, 235, 245, 0.42);
}

.fan-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.72);
}

.fan-field input,
.fan-field select {
  margin-left: auto;
  width: 72px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: #2c2c2e;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fan-field select {
  width: 96px;
}

.fan-field span {
  width: 2.2em;
  color: rgba(235, 235, 245, 0.4);
}

.fan-panel .fan-log,
.fan-panel .hist-fan-empty {
  max-height: 110px;
  overflow: auto;
}

.hist-fan-empty {
  margin: 0;
  font-size: 12px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.42);
}

.hist-fan-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(235, 235, 245, 0.08);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hist-fan-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.hist-fan-row span {
  flex: none;
  width: 7.6em;
  color: rgba(235, 235, 245, 0.46);
  font-weight: 510;
}

.hist-fan-row b {
  flex: none;
  width: 2.4em;
  font-weight: 620;
  color: rgba(235, 235, 245, 0.78);
}

.hist-fan-row.on b,
.hist-fan-row.live b {
  color: #64d2ff;
}

.hist-fan-row em {
  font-style: normal;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.42);
}

.hist-pv-string {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hist-pv-id {
  color: var(--muted);
  font-size: 11px;
  font-weight: 590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-pv-bar {
  height: 4px;
  border-radius: 980px;
  background: rgba(120, 120, 128, 0.22);
  overflow: hidden;
}

.hist-pv-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 214, 10, 0.82);
}

.hist-pv-val {
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hist-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  min-height: 16px;
  flex: none;
}

.hist-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.46);
}

.hist-legend i {
  width: 8px;
  height: 3px;
  border-radius: 99px;
  display: block;
}

.hist-legend i.gas {
  background: #ff9f0a;
}

.hist-legend i.water {
  background: #64d2ff;
}

.hist-legend i.net {
  background: #ff9f0a;
}

.hist-legend i.load {
  background: #ffd60a;
}

.hist-legend i.exp {
  background: #00c7be;
}

.hist-legend i.soc {
  background: #30d158;
}

.hist-legend i.dis {
  background: #ff9f0a;
}

.hist-legend i.chg {
  background: #0a84ff;
}

.hist-legend i.temp {
  background: #ff9f0a;
}

.hist-legend i.hum {
  background: #64d2ff;
}

.hist-legend i.cpu {
  background: #bf5af2;
}

.hist-legend i.sun {
  background: #ffd60a;
}

.hist-legend i.pv1 {
  background: #ff9f0a;
}

.hist-legend i.pv2 {
  background: #ff6482;
}

.hist-legend i.pv3 {
  background: #64d2ff;
}

.hist-legend i.pv4 {
  background: #0a84ff;
}

.hist-legend i.ping {
  background: #64d2ff;
}

.hist-legend i.down {
  background: #30d158;
}

.hist-legend i.up {
  background: #64d2ff;
}

.hist-legend i.fan {
  background: #64d2ff;
  height: 8px;
  border-radius: 2px;
  opacity: 0.7;
}

.house-row.hist-tap,
.climate-tile.hist-tap,
.energy-hero.hist-tap {
  cursor: pointer;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 590;
}

.mast {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  min-height: 0;
}

.mast-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mast-clock {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 14px;
  min-width: 0;
}

.mast-home {
  margin: 0;
  color: var(--tertiary);
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.mast-meta {
  justify-self: end;
  align-self: start;
}

#clock-time {
  margin: 0;
  font-size: 64px;
  font-weight: 670;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

#clock-date {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.atmo {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.weather-line {
  margin: 0;
  color: var(--tertiary);
  font-size: 12px;
  font-weight: 510;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0;
}

.weather-sep {
  margin: 0 7px;
  opacity: 0.55;
}

.weather-sun {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.weather-ico {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-ico-sun {
  fill: currentColor;
  stroke: none;
}

.atmo-chip,
.pill {
  background: var(--fill);
  border: 0;
  border-radius: 980px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 590;
}

.atmo-chip strong {
  color: var(--text);
}

.atmo-chip em {
  font-style: normal;
  font-weight: 510;
  margin-left: 6px;
  font-size: 12px;
}

.atmo-chip.cool {
  background: rgba(10, 132, 255, 0.18);
}

.atmo-chip.cool em {
  color: #64d2ff;
}

.atmo-chip.heat {
  background: rgba(255, 159, 10, 0.2);
}

.atmo-chip.heat em {
  color: #ffd60a;
}

.atmo-chip.warn em {
  color: #ffd60a;
}

.atmo-chip.down {
  background: rgba(255, 69, 58, 0.2);
}

.atmo-chip.down em {
  color: #ff6961;
}

.mast-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mast-meta .pill,
.mast-meta button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 510;
  line-height: 1;
  border-radius: 980px;
  box-sizing: border-box;
}

.mast-meta button,
.mast-meta button.ghost {
  background: transparent;
  color: var(--tertiary);
}

.mast-meta .pill.on {
  color: var(--live);
  background: rgba(48, 209, 88, 0.16);
}

.mast-meta .pill.off {
  color: var(--bad);
  background: rgba(255, 69, 58, 0.16);
}

.mast-meta .btn-full {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.btn-full svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-full .full-exit,
.btn-full.is-full .full-enter {
  display: none;
}

.btn-full.is-full .full-exit {
  display: block;
}

.pill.on {
  color: var(--live);
  background: rgba(48, 209, 88, 0.16);
}

.pill.off {
  color: var(--bad);
  background: rgba(255, 69, 58, 0.16);
}

.pill.dim {
  display: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: var(--tint);
  color: #fff;
  border: 0;
  border-radius: 980px;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 590;
}

button.ghost {
  background: var(--fill);
  color: var(--text);
}

.energy {
  display: grid;
  grid-template-columns: 1.15fr 1.55fr;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.energy.pv-quiet {
  grid-template-columns: 148px minmax(0, 1fr);
}

.energy-hero,
.card,
.cam,
.cam-wait,
.setup-card,
.entity-row {
  background: var(--grouped);
  border-radius: var(--radius);
}

.energy-hero {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.2), transparent 52%),
    var(--grouped);
  min-height: 0;
  overflow: hidden;
}

.hero-value {
  margin: 2px 0 0;
  font-size: 48px;
  font-weight: 670;
  letter-spacing: -0.05em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.hero-value #pv-hero-num {
  display: inline-block;
  min-width: 5ch;
}

.hero-value .hero-unit {
  font-size: 16px;
  color: var(--muted);
  font-weight: 590;
}

.hero-name,
.pv-today {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 510;
}

.pv-strings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  margin-top: 12px;
  padding: 0;
  background: none;
}

.pv-string {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pv-string-id {
  color: var(--tertiary);
  font-size: 10px;
  font-weight: 590;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-string-bar {
  height: 3px;
  border-radius: 980px;
  background: rgba(120, 120, 128, 0.22);
  overflow: hidden;
}

.pv-string-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 980px;
  background: rgba(255, 214, 10, 0.72);
  transform: translateZ(0);
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pv-string-w {
  color: var(--tertiary);
  font-size: 10px;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.energy.pv-quiet .energy-hero {
  justify-content: center;
  padding: 12px 14px;
  background: var(--grouped);
}

.energy.pv-quiet .hero-value {
  font-size: 28px;
}

.energy.pv-quiet .hero-value #pv-hero-num {
  min-width: 0;
}

.energy.pv-quiet .pv-strings {
  display: none;
}

.energy-house {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(78px, 0.72fr) minmax(118px, 1.2fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.energy-house:not(.load-quiet) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.energy-house.load-quiet #load-row {
  display: none;
}

#water-row.water-live .house-value {
  font-size: 28px;
  color: #64d2ff;
}

#water-row.water-hot .house-value {
  font-size: 32px;
}

#water-row.water-live .house-sub {
  color: rgba(100, 210, 255, 0.72);
}

#price-row,
#price-row.price-compact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(132px, 0.28fr) minmax(0, 1fr);
  align-items: stretch;
  column-gap: 12px;
  row-gap: 0;
  flex-direction: unset;
  justify-content: unset;
  padding: 10px 14px 8px;
}

#price-row.price-compact .price-meta {
  min-width: 0;
}

#price-row.price-compact .price-meta .kicker {
  margin-bottom: auto;
}

#price-row.price-compact .house-value {
  font-size: 28px;
}

#price-row.price-compact .price-chart-wrap {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 14px;
  grid-template-columns: 1fr;
  justify-content: unset;
  gap: 0;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

#price-row.price-compact .price-chart-head,
#price-row.price-compact .price-src {
  display: none;
}

#price-row.price-compact .price-chart-axis {
  display: block;
}

#price-row.price-compact .price-chart {
  height: auto;
  min-height: 64px;
}

#price-row .kicker {
  margin-bottom: 0;
}

.price-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.price-chart-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 15px minmax(0, 1fr) 13px 14px;
  align-content: stretch;
}

.price-chart-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 0;
  padding: 0 2px;
}

.price-chart-head.solo {
  grid-template-columns: 1fr auto;
}

.price-day {
  margin: 0;
  font-size: 11px;
  font-weight: 510;
  letter-spacing: 0.01em;
  color: rgba(235, 235, 245, 0.36);
}

.price-day.tomorrow {
  color: rgba(100, 210, 255, 0.55);
}

.price-src {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.price-src span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.4);
}

.price-src i {
  width: 6px;
  height: 3px;
  border-radius: 99px;
  display: block;
}

.price-src i.net {
  background: #ff9f0a;
}

.price-src i.bat {
  background: #30d158;
}

.price-src i.chg {
  background: #0a84ff;
}

.price-src i.sun {
  background: #ffd60a;
}

.price-src i.exp {
  background: #00c7be;
}

.price-chart {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.price-chart-axis {
  position: relative;
  height: 13px;
  min-width: 0;
}

.price-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.34);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.price-tick.edge-start {
  transform: none;
}

.price-tick.tomorrow {
  color: rgba(100, 210, 255, 0.48);
}

.house-row {
  background: var(--grouped);
  border-radius: 16px;
  padding: 8px 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  overflow: hidden;
}

.house-row .kicker {
  margin-bottom: auto;
}

#p1-row .kicker,
#bat-row .kicker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.house-value {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.house-value .unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 590;
}

.house-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 510;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#bat-mode::before {
  content: " · ";
}

#bat-row.bat-watts-off #bat-watts {
  display: none;
}

#bat-row.bat-watts-off #bat-mode::before {
  content: none;
}

#bat-row.bat-mode-off #bat-mode {
  display: none;
}

.soc-track {
  display: block;
  margin-top: 6px;
  height: 5px;
  width: 88px;
  border-radius: 980px;
  background: rgba(120, 120, 128, 0.22);
  overflow: hidden;
}

.soc-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 980px;
  background: #30d158;
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.house-row[data-flow="in"] #p1-dir,
.house-row[data-flow="in"] #bat-watts {
  color: #ff9f0a;
}

.house-row[data-flow="out"] #p1-dir,
.house-row[data-flow="out"] #bat-watts {
  color: #30d158;
}

.house-row[data-level="cheap"] .house-value,
.house-row[data-level="very_cheap"] .house-value {
  color: #30d158;
}

.house-row[data-level="expensive"] .house-value,
.house-row[data-level="very_expensive"] .house-value {
  color: #ff9f0a;
}

.card {
  padding: 14px 14px 12px;
  min-height: 0;
}

.card .name {
  color: var(--muted);
  font-size: 13px;
}

.card .value {
  font-size: 28px;
  font-weight: 630;
  margin-top: 10px;
  letter-spacing: -0.03em;
}

.card .unit {
  font-size: 13px;
  color: var(--muted);
}

.card.wait .value {
  color: var(--wait);
}

.mid {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr) minmax(280px, 320px);
  gap: 12px;
  min-height: 0;
}

.laundry-bar {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.12);
}

.laundry-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0a84ff;
}

.player {
  background: var(--grouped);
  border-radius: var(--radius);
  padding: 6px 12px 6px;
  display: grid;
  grid-template-rows: auto minmax(0, auto) minmax(0, auto) minmax(36px, 1fr);
  align-content: stretch;
  min-height: 0;
  overflow: hidden;
  container-type: size;
  container-name: player;
}

.player .kicker {
  margin-bottom: 4px;
}

.player-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.player-head .kicker {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.player-eq {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  width: 72px;
  flex: none;
  opacity: 1;
}

.player-eq.on {
  display: flex;
}

.player-eq i {
  flex: 1;
  height: 100%;
  margin: 0;
  border-radius: 2px;
  background: #30d158;
  transform: scaleY(0.1);
  transform-origin: center bottom;
  will-change: transform;
  backface-visibility: hidden;
}

.player-now {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  margin-bottom: 6px;
}

.player-art-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  background: #2c2c2e;
}

.player-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-art-wrap.empty img {
  display: none;
}

.player-art-fallback {
  position: absolute;
  inset: 14px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: rgba(235, 235, 245, 0.45);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.player-art-wrap:not(.empty) .player-art-fallback {
  display: none;
}

.player-now-copy {
  min-width: 0;
  flex: 1;
}

.player-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 510;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  min-height: 0;
  margin-bottom: 6px;
}

.player-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 980px;
  min-height: 26px;
  padding: 0 4px;
  background: var(--fill);
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.player-preset.on {
  background: #5c5c5e;
  color: #f2f2f7;
}

.player-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  border-radius: 980px;
  min-height: 26px;
  padding: 0 4px;
  background: var(--fill);
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.player-source.on {
  background: #5c5c5e;
  color: #f2f2f7;
}

.player-source.spotify.on {
  background: rgba(30, 215, 96, 0.28);
  color: #1ed760;
}

.player-ctrl {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  margin-top: 0;
  min-width: 0;
}

.player-play,
.player-mute {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 980px;
  background: #5c5c5e;
  color: #f2f2f7;
  line-height: 0;
  cursor: pointer;
}

.player-play .ico,
.player-mute .ico {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
  flex: none;
}

.player-mute .ico [stroke] {
  fill: none;
}

.player-play .ico-play {
  transform: translateX(1px);
}

.player-play .ico-pause,
.player-play.is-playing .ico-play,
.player-mute .ico-muted,
.player-mute.on .ico-vol {
  display: none;
}

.player-play.is-playing .ico-pause,
.player-mute.on .ico-muted {
  display: block;
}

.player[data-state="paused"] .player-play,
.player[data-state="idle"] .player-play,
.player[data-state="off"] .player-play {
  background: var(--fill);
  color: var(--text);
}

#player-vol {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 36px;
  margin: 0;
  padding: 0;
  background: transparent;
  accent-color: #f2f2f7;
}

.player-mute.on {
  background: var(--fill);
  color: var(--muted);
}

@container player (max-height: 168px) {
  .player-art-wrap {
    width: 40px;
    height: 40px;
  }

  .player-now,
  .player-presets {
    margin-bottom: 4px;
  }

  .player-play,
  .player-mute {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  #player-vol {
    height: 32px;
  }
}

.cameras {
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.climate {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.climate-temps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(72px, 1fr);
  grid-auto-flow: dense;
  gap: 8px;
  min-height: 0;
  transition: grid-template-columns 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.climate-net:empty {
  display: none;
}

.climate.net-alert .climate-temps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.climate-tile {
  background: var(--grouped);
  border-radius: 16px;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  overflow: hidden;
}

.climate-tile .kicker {
  margin-bottom: auto;
}

.climate-tile .house-value {
  font-size: 22px;
}

.climate-temps .climate-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 8px;
  padding: 6px 10px 7px;
}

.climate-temps .climate-tile .kicker {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.climate-temps .climate-tile .house-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 20px;
  white-space: nowrap;
}

.climate-temps .climate-tile .house-hum {
  font-size: 13px;
  font-weight: 510;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.climate-temps .climate-tile .house-sub {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.climate-temps .climate-tile .booster {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 0;
  min-height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 980px;
  background: var(--fill);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 620;
  line-height: 1;
  cursor: pointer;
}

.climate-temps .climate-tile .booster b {
  font-weight: 680;
}

.climate-temps .climate-tile .booster.on {
  background: rgba(255, 159, 10, 0.34);
  color: #ffd60a;
}

.climate-temps .climate-tile .booster:disabled {
  cursor: default;
  opacity: 0.55;
}

.climate-temps .climate-tile.tech {
  grid-column: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 6px 8px 8px;
}

.climate-temps .climate-tile.net {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 1px;
  min-height: 0;
  min-width: 0;
}

.climate-temps .climate-tile.net .kicker {
  grid-column: auto;
}

.climate-temps .climate-tile.net .house-value,
.climate-temps .climate-tile.net .house-sub {
  display: block;
  width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.climate-temps .climate-tile.net .house-value {
  font-size: 16px;
}

.climate-temps .climate-tile.net .house-sub {
  margin: 0;
  padding-top: 1px;
}

.climate-temps .climate-tile.net.wan-new {
  background: rgba(255, 159, 10, 0.22);
}

.climate-temps .climate-tile.net.wan-new .house-value {
  color: #ffd60a;
}

.climate-temps .climate-tile.net.wan-new .house-sub {
  color: rgba(255, 214, 10, 0.86);
  font-weight: 620;
}

.climate.net-alert .climate-temps .climate-tile.net.wan-new,
.climate.net-alert .climate-temps .climate-tile.net.tls-warn {
  background: rgba(255, 159, 10, 0.28);
}

.climate-temps .climate-tile.net.tls-warn {
  background: rgba(255, 159, 10, 0.22);
}

.climate-temps .climate-tile.net.tls-warn .house-value {
  color: #ffd60a;
}

.climate-temps .climate-tile.net.tls-warn .house-sub {
  color: rgba(255, 214, 10, 0.86);
  font-weight: 620;
}

.climate.net-alert .climate-temps .climate-tile.tech {
  grid-column: auto;
}

.climate.net-alert .climate-temps .climate-tile.net {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-height: 72px;
  padding: 8px 12px 10px;
}

.climate.net-alert .climate-temps .climate-tile.net .kicker {
  margin-bottom: auto;
}

.climate.net-alert .climate-temps .climate-tile.net .house-value {
  font-size: 22px;
  justify-self: start;
}

.tech-stats {
  display: grid;
  gap: 1px;
}

.tech-head,
.tech-row {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) 1.85em 2.85em 2.85em;
  align-items: baseline;
  column-gap: 2px;
  font-variant-numeric: tabular-nums;
}

.tech-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tertiary);
}

.tech-head i:nth-child(n + 2),
.tech-row b,
.tech-row span {
  text-align: right;
  white-space: nowrap;
}

.tech-row {
  font-size: 12px;
  font-weight: 640;
  line-height: 1.2;
}

.tech-row em {
  font-style: normal;
  font-weight: 510;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.climate-ico {
  width: 13px;
  height: 13px;
  flex: none;
  fill: currentColor;
}

.climate-tile.fan {
  background: rgba(10, 132, 255, 0.12);
}

.climate-tile.fan .house-sub {
  color: #64d2ff;
}

.climate-tile.cool {
  background: rgba(10, 132, 255, 0.16);
}

.climate-tile.heat {
  background: rgba(255, 159, 10, 0.16);
}

.climate-tile.warn .house-sub {
  color: #ffd60a;
}

.climate-tile.down {
  background: rgba(255, 69, 58, 0.18);
}

.climate-tile.down .house-sub {
  color: #ff6961;
}

.cams {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  height: 100%;
}

.cam,
.cam-wait {
  overflow: hidden;
  position: relative;
  min-height: 0;
  height: 100%;
  background: #111;
  contain: layout paint;
}

.cam {
  cursor: pointer;
}

.cam img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.cam .label,
.cam-wait .label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(28, 28, 30, 0.88);
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 590;
}

.cam .label.motion {
  background: rgba(255, 69, 58, 0.86);
  color: #fff;
}

.cam-wait {
  display: grid;
  place-items: center;
  color: var(--tertiary);
}

.cam-wait .ghost-cam span {
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.lights {
  display: grid;
  grid-template-columns: 0.85fr 1.1fr minmax(248px, 0.9fr);
  gap: 12px;
  min-height: 0;
}

.house-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  align-items: stretch;
  transition: grid-template-columns 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.house-side:has(#laundry-row.open):not(:has(#waste-row[data-soon])),
.house-side:has(#waste-row.open):not(:has(#laundry-row.open)):not(:has(#laundry-row.busy)) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.house-side:has(#laundry-row.open):not(:has(#waste-row[data-soon])) #waste-row,
.house-side:has(#waste-row.open):not(:has(#laundry-row.open)):not(:has(#laundry-row.busy)) #laundry-row {
  display: none;
}

#laundry-row,
#waste-row {
  justify-content: flex-start;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding-bottom: 10px;
}

#laundry-row .kicker {
  margin-bottom: 4px;
}

#laundry-row .laundry-list {
  flex: none;
}

#laundry-row .laundry-more {
  display: none;
}

#laundry-row.open {
  align-self: stretch;
}

#laundry-row.open .kicker {
  margin-bottom: auto;
}

#laundry-row.open .laundry-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#laundry-row.open .laundry-next {
  display: none;
}

#laundry-row.open .laundry-more {
  display: flex;
}

#laundry-row.busy {
  background: rgba(10, 132, 255, 0.16);
}

#laundry-row.planned {
  background: rgba(255, 159, 10, 0.16);
}

.laundry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.laundry-next .house-value {
  font-size: 20px;
}

.laundry-next .house-sub {
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.laundry-more {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.laundry-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name value"
    "sub sub"
    "bar bar";
  column-gap: 8px;
  row-gap: 1px;
  padding: 6px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.laundry-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.laundry-name {
  grid-area: name;
  font-size: 12px;
  font-weight: 590;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.laundry-value {
  grid-area: value;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.laundry-sub {
  grid-area: sub;
  font-size: 11px;
  font-weight: 510;
  color: var(--tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.laundry-line .laundry-bar {
  grid-area: bar;
  margin-top: 4px;
}

.laundry-line.running .laundry-value {
  color: #64d2ff;
}

.laundry-line.planned .laundry-value {
  color: #ffd60a;
}

#waste-row .kicker {
  margin-bottom: 4px;
}

#waste-row .waste-list {
  flex: none;
}

#waste-row .waste-more {
  display: none;
}

#waste-row.open {
  align-self: stretch;
}

#waste-row.open .kicker {
  margin-bottom: auto;
}

#waste-row.open .waste-list {
  flex: 1;
}

#waste-row.open .waste-more {
  display: flex;
}

#waste-row[data-soon] {
  background: rgba(255, 159, 10, 0.22);
}

#waste-row[data-soon="0"] {
  background: rgba(255, 159, 10, 0.34);
}

#waste-row[data-soon] .house-value {
  color: #ffd60a;
}

#waste-row[data-soon] .waste-rel {
  color: rgba(255, 214, 10, 0.86);
  font-weight: 620;
}

#waste-row[data-soon] .waste-tag {
  background: rgba(255, 214, 10, 0.18);
  color: #f5f5f7;
}

.waste-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}

.waste-next .house-value {
  font-size: 20px;
}

.waste-rel {
  margin: 2px 0 6px;
  color: var(--tertiary);
  font-size: 11px;
  font-weight: 510;
}

.waste-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.waste-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  border-radius: 980px;
  background: var(--fill);
  font-size: 11px;
  font-weight: 590;
  color: var(--muted);
}

.waste-tag i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #8e8e93;
}

.waste-tag.gft i { background: #30d158; }
.waste-tag.pmd i { background: #ff9f0a; }
.waste-tag.snoei i { background: #a2845e; }
.waste-tag.rest i { background: #8e8e93; }
.waste-tag.papier i { background: #0a84ff; }
.waste-tag.textiel i { background: #bf5af2; }
.waste-tag.glas i { background: #64d2ff; }
.waste-tag.station i { background: #ffd60a; }

.waste-more {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
}

.waste-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 510;
  color: var(--tertiary);
}

.waste-line span:first-child {
  color: var(--muted);
  white-space: nowrap;
}

.waste-line span:last-child {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.light-room {
  background: var(--grouped);
  border-radius: var(--radius);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.light-tiles {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.light-tools {
  flex: 0 0 auto;
  min-height: 54px;
}

.light-tile {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 8px 14px;
  border: 0;
  border-radius: 16px;
  background: #2c2c2e;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  min-height: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.light-dim {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 4px;
  border-radius: 980px;
  background: rgba(120, 120, 128, 0.28);
  pointer-events: none;
  z-index: 0;
}

.light-dim i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgba(255, 214, 10, 0.85);
}

.light-tile.on .light-dim {
  background: rgba(255, 255, 255, 0.1);
}

.light-tile.on .light-dim i {
  background: rgba(255, 255, 255, 0.28);
}

.light-tile.on.colored .light-dim i {
  background: rgb(var(--light));
}

.light-room-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.light-room-more {
  margin-left: auto;
  color: var(--tertiary);
  font-size: 11px;
  font-weight: 590;
}

.light-room-more::after {
  content: " ›";
}

.room-ico,
.light-ico {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.light-ico {
  width: 16px;
  height: 16px;
  position: relative;
  z-index: 1;
}

.light-tile .light-name,
.light-tile .light-pct {
  position: relative;
  z-index: 1;
}

.light-tile .light-name {
  font-size: 12px;
  font-weight: 590;
  color: var(--muted);
  text-align: left;
  line-height: 1.15;
}

.light-pct {
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--tertiary);
  letter-spacing: -0.02em;
  min-height: 1em;
}

.light-tile.on .light-ico {
  stroke: #f2f2f7;
}

.light-tile.on.colored .light-ico {
  stroke: rgb(var(--light));
}

.light-color-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 980px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: #f4e4c8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.light-tile.on .light-color-dot {
  border-color: rgba(255, 255, 255, 0.4);
}

.light-tile.on {
  background: #5c5c5e;
}

.light-tile.on .light-name {
  color: #f2f2f7;
}

.light-tile.on .light-pct {
  color: rgba(235, 235, 245, 0.64);
}

.light-tile.on.colored {
  background: #5c5c5e;
  box-shadow: inset 0 3px 0 rgb(var(--light));
}

.light-cover .cover-state {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
}

.light-cover[data-open="1"] .ico-cover-shut,
.light-cover:not([data-open="1"]) .ico-cover-open {
  display: none;
}

.light-cover.on .cover-state {
  color: #f2f2f7;
}

.cover-batt {
  margin: 4px 0 0;
  border-radius: 14px;
  background: #2c2c2e;
  color: var(--text);
}

.cover-batt.hidden {
  display: none;
}

.cover-batt summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 620;
}

.cover-batt summary::-webkit-details-marker {
  display: none;
}

.cover-batt-list,
.cover-batt-drawer {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 12px 10px;
}

.cover-batt-drawer {
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: #2c2c2e;
}

.cover-batt-drawer .kicker {
  margin: 0 0 6px;
}

.cover-batt-drawer .cover-batt-list {
  padding: 0;
}

.cover-batt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid rgba(235, 235, 245, 0.08);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cover-batt-row:first-of-type {
  border-top: 0;
}

.cover-batt-row span {
  color: rgba(235, 235, 245, 0.72);
  font-weight: 510;
}

.cover-batt-row b {
  font-weight: 650;
}

.cover-batt-row.low b {
  color: #ff9f0a;
}

.cover-batt-row.wait b {
  color: rgba(235, 235, 245, 0.38);
}

.cover-batt-hint {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 510;
  color: rgba(235, 235, 245, 0.42);
}

.light-room-sheet {
  z-index: 71;
}

.light-room-card {
  width: min(740px, 100%);
  height: auto;
  max-height: min(680px, 100%);
  overflow: auto;
}

.light-room-card .hist-head {
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--grouped);
}

.light-room-scenes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.scene-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.scene-slot .light-tile {
  min-height: 84px;
}

.scene-slot-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.scene-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: #2c2c2e;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 590;
  user-select: text;
}

.scene-save {
  flex: none;
  min-height: 28px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 980px;
  background: #3a3a3c;
  color: var(--text);
  font-size: 11px;
  font-weight: 590;
  cursor: pointer;
}

.scene-save.ok {
  background: #30d158;
  color: #04210c;
}

.light-tiles.light-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: none;
}

.light-tiles.light-detail .light-tile {
  min-height: 88px;
}

.light-color {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.45);
}

.light-color.hidden {
  display: none;
}

.light-color-card {
  width: min(520px, 100%);
  background: var(--grouped);
  border-radius: 22px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.light-color-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.light-color-head .kicker {
  margin: 0;
}

.light-color-title {
  margin: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 650;
}

.light-color-head button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.light-color-kelvin-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--tertiary);
  font-size: 11px;
}

.light-color input[type="range"] {
  width: 100%;
  min-height: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  accent-color: #f2f2f7;
}

#light-color-dim {
  accent-color: #f2f2f7;
}

#light-color-dim-val {
  min-width: 2.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 590;
}

#light-color-kelvin {
  accent-color: #ffd60a;
}

#light-color-hue {
  accent-color: #bf5af2;
}

#light-color-sat {
  accent-color: #ff6482;
}

.light-color-rgb {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.light-color.white-only .light-color-rgb {
  display: none;
}

.light-color-swatches {
  display: flex;
  gap: 8px;
}

.light-swatch {
  flex: 1;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 980px;
  cursor: pointer;
}

.light-tile.wait {
  opacity: 0.38;
  pointer-events: none;
}

.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 12px;
  height: 100%;
  overflow: hidden;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  align-self: center;
}

.setup {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-card {
  width: min(420px, 92%);
  padding: 24px;
  display: grid;
  gap: 12px;
}

.setup-card h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.setup-card p {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input {
  background: var(--grouped-2);
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 0 14px;
}

.error {
  color: var(--bad);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 42vw);
  height: 100%;
  background: rgba(28, 28, 30, 0.94);
  backdrop-filter: saturate(180%) blur(28px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 10px;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.entity-list {
  overflow: auto;
  display: grid;
  gap: 8px;
}

.entity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
}

.entity-row small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

html.phone,
body.phone {
  overflow: auto;
  height: auto;
  min-height: 100%;
  overscroll-behavior-y: contain;
}

body.phone .stage {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  height: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
  transform: none !important;
}

body.phone .mast {
  grid-template-columns: 1fr;
  gap: 10px;
  justify-items: start;
}

body.phone .mast-center {
  align-items: flex-start;
}

body.phone .mast-meta {
  justify-self: start;
  flex-wrap: wrap;
}

body.phone #clock-time {
  font-size: 44px;
}

body.phone .weather-line {
  flex-wrap: wrap;
  white-space: normal;
  row-gap: 4px;
}

body.phone .energy,
body.phone .energy-house,
body.phone .mid,
body.phone .lights,
body.phone .climate {
  display: grid;
  min-height: 0;
}

body.phone .energy,
body.phone .energy.pv-quiet {
  grid-template-columns: 1fr;
}

body.phone .energy-hero {
  min-height: 0;
}

body.phone .energy.pv-quiet .energy-hero {
  padding: 12px 14px 10px;
}

body.phone .energy.pv-quiet .hero-value {
  font-size: 32px;
}

body.phone .hero-value {
  font-size: 40px;
}

body.phone .pv-strings {
  grid-template-columns: 1fr 1fr;
}

body.phone .energy-house,
body.phone .energy-house.load-quiet,
body.phone .energy-house:not(.load-quiet) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
  grid-auto-rows: auto;
}

body.phone .energy-house.load-quiet:not(:has(#water-row)) #gas-row {
  grid-column: 1 / -1;
}

body.phone #water-row.water-live .house-value {
  font-size: 28px;
}

body.phone #water-row.water-hot .house-value {
  font-size: 34px;
}

body.phone .house-row {
  min-height: 88px;
}

body.phone #price-row,
body.phone #price-row.price-compact {
  grid-column: 1 / -1;
  min-height: 148px;
  padding: 10px 12px 8px;
  grid-template-columns: minmax(110px, 0.38fr) minmax(0, 1fr);
}

body.phone #price-row.price-compact .price-chart {
  height: auto;
  min-height: 72px;
}

body.phone .price-chart-wrap {
  min-height: 88px;
}

body.phone .mid {
  grid-template-columns: 1fr;
}

body.phone .cameras {
  min-height: 200px;
  aspect-ratio: 16 / 9;
  height: auto;
}

body.phone .climate {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}

body.phone .climate-temps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
  grid-auto-rows: auto;
}

body.phone .climate-temps .climate-tile.tech {
  grid-column: auto;
}

body.phone .climate-temps .climate-tile.net {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "kicker value"
    "kicker sub";
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 0;
  min-height: 44px;
  padding: 8px 12px;
}

body.phone .climate-temps .climate-tile.net .kicker {
  grid-area: kicker;
  grid-column: auto;
  align-self: center;
  margin-bottom: 0;
}

body.phone .climate-temps .climate-tile.net .house-value {
  grid-area: value;
  font-size: 16px;
  justify-self: end;
  width: auto;
  text-align: right;
}

body.phone .climate-temps .climate-tile.net .house-sub {
  grid-area: sub;
  margin: 0;
  justify-self: end;
  width: auto;
  text-align: right;
}

body.phone .climate-tile {
  min-height: 76px;
}

body.phone .climate.net-alert .climate-temps .climate-tile.net {
  min-height: 76px;
}

body.phone .climate-tile.tech {
  min-height: 96px;
}

body.phone .player {
  min-height: 150px;
  grid-template-columns: minmax(0, 1fr);
}

body.phone .house-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

body.phone .house-side:has(#laundry-row.open),
body.phone .house-side:has(#waste-row.open) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

body.phone #laundry-row,
body.phone #waste-row {
  min-height: 88px;
}

body.phone .lights {
  grid-template-columns: 1fr;
}

body.phone .light-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: none;
}

body.phone .light-tiles.light-scenes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.phone .light-tile {
  min-height: 76px;
}

body.phone .light-color {
  position: fixed;
}

body.phone .light-color-card {
  max-height: calc(86dvh - env(safe-area-inset-bottom));
  overflow-y: auto;
}

body.phone .doorbell-fs {
  position: fixed;
}

body.phone .doorbell-fs.dual .doorbell-fs-grid {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 56px 10px 16px;
}

body.phone .light-room-sheet {
  position: fixed;
  align-items: flex-end;
}

body.phone .light-room-card {
  width: 100%;
  max-height: min(620px, 86dvh);
}

body.phone .light-detail,
body.phone .light-room-card .light-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.phone .light-room-scenes {
  grid-template-columns: 1fr;
}

body.phone .scene-slot .light-tile {
  min-height: 72px;
}

body.phone .hist-sheet {
  position: fixed;
  align-items: flex-end;
  padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
}

body.phone .hist-card {
  width: 100%;
  height: min(620px, 86dvh);
  overflow-y: auto;
}

body.phone .hist-plot {
  min-height: 210px;
  flex: 1 0 210px;
}

body.phone .hist-head h2 {
  font-size: 20px;
}

body.phone .hist-now {
  font-size: 12px;
}

body.phone .hist-extra {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.phone .hist-extra.fan-log {
  grid-template-columns: 1fr;
  max-height: 120px;
}

body.phone .hist-card.hist-card-fan {
  height: min(780px, 92dvh);
}

body.phone .hist-extra.fan-panel,
body.phone .fan-ctrl {
  grid-template-columns: 1fr;
}

body.phone .drawer {
  width: 100%;
}

body.phone .mast-home {
  letter-spacing: 0.28em;
}

.energy-hero,
.house-row,
.climate-tile,
.light-tile,
.light-room {
  container-type: size;
}

.energy-hero[data-fit="1"] .hero-value { font-size: 40px; }
.energy-hero[data-fit="2"] .hero-value { font-size: 34px; }
.energy-hero[data-fit="3"] .hero-value { font-size: 28px; }
.energy-hero[data-fit="1"] { padding: 12px 14px 10px; }
.energy-hero[data-fit="2"],
.energy-hero[data-fit="3"] { padding: 8px 12px 8px; }

.house-row[data-fit="1"],
.climate-tile[data-fit="1"],
.light-tile[data-fit="1"] { padding: 6px 10px 6px; }
.house-row[data-fit="2"],
.climate-tile[data-fit="2"],
.light-tile[data-fit="2"] { padding: 4px 8px 5px; }
.house-row[data-fit="3"],
.climate-tile[data-fit="3"],
.light-tile[data-fit="3"] { padding: 3px 7px 4px; }

.house-row[data-fit="1"] .house-value,
.climate-tile[data-fit="1"] .house-value { font-size: 18px; }
.house-row[data-fit="2"] .house-value,
.climate-tile[data-fit="2"] .house-value { font-size: 16px; }
.house-row[data-fit="3"] .house-value,
.climate-tile[data-fit="3"] .house-value { font-size: 14px; }

.house-row[data-fit="2"] .house-sub,
.climate-tile[data-fit="2"] .house-sub { font-size: 10px; margin-top: 1px; }
.house-row[data-fit="3"] .house-sub,
.climate-tile[data-fit="3"] .house-sub { font-size: 10px; margin-top: 0; }

.climate-temps .climate-tile[data-fit="1"] .house-value { font-size: 16px; }
.climate-temps .climate-tile[data-fit="2"] .house-value { font-size: 15px; }
.climate-temps .climate-tile[data-fit="3"] .house-value { font-size: 14px; }
.climate-temps .climate-tile[data-fit="2"] .booster { min-height: 18px; margin-top: 2px; font-size: 10px; }
.climate-temps .climate-tile[data-fit="3"] .booster { min-height: 16px; }

.player[data-fit="1"] .player-art-wrap { width: 40px; height: 40px; }
.player[data-fit="1"] .player-title { font-size: 14px; }
.player[data-fit="1"] .player-play,
.player[data-fit="1"] .player-mute,
.player[data-fit="1"] #player-vol { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
.player[data-fit="1"] #player-vol { width: auto; }
.player[data-fit="2"] .player-art-wrap { width: 32px; height: 32px; }
.player[data-fit="2"] .player-preset,
.player[data-fit="2"] .player-source { min-height: 22px; font-size: 10px; }
.player[data-fit="2"] { padding: 4px 8px; }
.player[data-fit="3"] .player-presets,
.player[data-fit="3"] .player-art-wrap { display: none; }
.player[data-fit="3"] .player-now { margin-bottom: 2px; }

#laundry-row[data-fit="1"] .laundry-line { padding: 3px 0 2px; }
#laundry-row[data-fit="2"] .laundry-sub { display: none; }
#laundry-row[data-fit="3"] .laundry-bar { display: none; }

.light-tile[data-fit="2"] { padding: 6px 6px 10px; gap: 3px; }
.light-tile[data-fit="3"] { padding: 4px 6px 8px; gap: 2px; }

body.viewer .booster,
body.viewer .player-preset,
body.viewer .player-ctrl,
body.viewer .player-vol,
body.viewer .light-tile,
body.viewer .scene-slot,
body.viewer .fan-ctrl button,
body.viewer .fan-ctrl input,
body.viewer .fan-ctrl select,
body.viewer #light-color input,
body.viewer #light-color button:not(.ghost) {
  pointer-events: none;
  opacity: 0.55;
}

body.viewer .light-room,
body.viewer .hist-tap,
body.viewer #laundry-row,
body.viewer #waste-row,
body.viewer #btn-entities {
  pointer-events: auto;
}
