/* ============================================================
   Home Command — layout & components
   Quiet chrome, one warm moment, everything on a 4px rhythm.
   ============================================================ */
.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: auto;
}

/* ---------- rail ---------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 12px;
  padding-top: max(20px, env(safe-area-inset-top));
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.brand-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.navbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}
.navbtn .ic {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
  transition: color var(--fast) var(--ease);
}
.navbtn:hover {
  color: var(--text);
  background: var(--surface);
}
.navbtn:hover .ic {
  color: var(--text-2);
}
.navbtn.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: transparent;
}
.navbtn.active .ic {
  color: var(--accent);
}
.navbtn.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.rail-foot {
  margin-top: auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.rail-signout {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.rail-signout:hover { color: var(--text); }
.rail-signout:disabled { opacity: .5; cursor: default; }

/* ---------- main ---------- */
.main {
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--pad);
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
}
.main::-webkit-scrollbar {
  width: 10px;
}
.main::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.topbar {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  max-width: var(--content);
  margin: 0 auto 24px;
}
.page-head {
  min-width: 0;
}
.page-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
}
.top-spacer {
  flex: 1;
}
.wx-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 24px;
  border-right: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
}
.wx-inline .ic {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.wx-inline-temp {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
}
.wx-inline-meta {
  color: var(--muted);
}
.clock {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.clock-t {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}
.clock-s {
  color: var(--accent);
  font-size: 14px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-2);
}
.icon-btn .ic {
  width: 16px;
  height: 16px;
}

/* ---------- view + grid ---------- */
.view {
  display: block;
  max-width: var(--content);
  margin: 0 auto;
  animation: rise var(--slow) var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}
.grid.start {
  align-items: start;
}
.card {
  grid-column: span 12;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
  transition: border-color var(--std) var(--ease);
}
.card:hover {
  border-color: var(--line-2);
}
.card.s4 { grid-column: span 4; }
.card.s5 { grid-column: span 5; }
.card.s6 { grid-column: span 6; }
.card.s7 { grid-column: span 7; }
.card.s8 { grid-column: span 8; }

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.card-note {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
}
.dot.accent { background: var(--accent); }
.dot.bad { background: var(--bad); }
.dot.muted { background: var(--muted); }
.dot.none { display: none; }

/* ---------- now / weather / daylight ---------- */
.wx {
  display: flex;
  align-items: center;
  gap: 20px;
}
.wx-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--sky-soft);
  color: var(--sky);
}
.wx-icon .ic {
  width: 22px;
  height: 22px;
}
.wx-temp {
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.wx-temp .unit {
  font-size: 18px;
  color: var(--muted);
  margin-left: 2px;
  letter-spacing: 0;
}
.wx-info {
  min-width: 0;
}
.wx-cond {
  font-size: 14px;
  font-weight: 500;
}
.wx-meta {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
}

.arc {
  margin-top: 24px;
}
.arc svg {
  display: block;
  width: 100%;
  height: 150px;
  overflow: visible;
}
.arc-base {
  fill: none;
  stroke: var(--sky);
  stroke-width: 1;
  opacity: 0.45;
}
.arc-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.arc-tick {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
}
.arc-sun {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 3;
}
.arc-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.arc-labels b {
  font-weight: 500;
  color: var(--text-2);
}
.arc-labels .arc-mid {
  color: var(--sky);
}

/* ---------- timers ---------- */
.timer-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background var(--fast) var(--ease);
}
.timer-row.clickable {
  position: relative;
  padding-right: 16px;
  cursor: pointer;
}
.timer-row.clickable::after {
  content: "›";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition: color var(--fast) var(--ease);
}
.timer-row.clickable:hover {
  background: var(--surface-2);
}
.timer-row.clickable:hover::after {
  color: var(--accent);
}
.timer-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.timer-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
}
.timer-icon .ic {
  width: 16px;
  height: 16px;
}
.timer-icon.accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.timer-icon.sage {
  color: var(--good);
  background: var(--good-soft);
  border-color: transparent;
}
.timer-icon.sky {
  color: var(--sky);
  background: var(--sky-soft);
  border-color: transparent;
}
.timer-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer-detail {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer-eta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timer-eta.accent { color: var(--accent); }
.timer-eta.idle { color: var(--muted); }
.meter {
  grid-column: 2 / -1;
  height: 2px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(calc(var(--p, 0) / 100));
  transition: transform var(--slow) var(--ease);
}

/* ---------- presence ---------- */
.person-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.person-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.avatar.sage {
  color: var(--good);
  background: var(--good-soft);
  border-color: transparent;
}
.avatar.sky {
  color: var(--sky);
  background: var(--sky-soft);
  border-color: transparent;
}
.person-name {
  font-size: 13px;
  font-weight: 500;
}
.person-loc {
  font-size: 12px;
  color: var(--text-2);
}
.person-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.person-status.home {
  color: var(--good);
}
.sensor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.sensor-row .sensor-name {
  flex: 1;
  color: var(--text);
  font-size: 13px;
}

/* signature: a small four-pane window that lights when a room is on */
.room-window {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--surface-2);
  transition: background var(--std) var(--ease), border-color var(--std) var(--ease);
}
.room-window::before,
.room-window::after {
  content: "";
  position: absolute;
  background: var(--line-2);
  transition: background var(--std) var(--ease);
}
.room-window::before {
  left: 2px;
  right: 2px;
  top: 50%;
  height: 1px;
}
.room-window::after {
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 1px;
}
.room-window.lit {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.room-window.lit::before,
.room-window.lit::after {
  background: var(--accent);
}

.now-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.nf-label {
  font-size: 11px;
  color: var(--text-2);
}
.nf-value {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 500;
}
.nf-value.live {
  color: var(--accent);
}
.nf.clickable {
  position: relative;
  cursor: pointer;
  border-radius: var(--r-sm);
  padding-right: 12px;
}
.nf.clickable::after {
  content: "›";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
}
.nf.clickable:hover .nf-label {
  color: var(--text-2);
}
.nf.clickable:hover::after {
  color: var(--accent);
}

.env {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.env-cell {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.env-label {
  font-size: 11px;
  color: var(--text-2);
}
.env-value {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.env-value.accent {
  color: var(--accent);
}
.env-value.sky {
  color: var(--sky);
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mode-label {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-2);
}

/* ---------- rooms ---------- */
.room-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.room-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.room-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
}
.room-icon .ic {
  width: 17px;
  height: 17px;
}
.room-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.room-stat {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
}
.room-stat.bad {
  color: var(--bad);
}
.intents {
  display: flex;
  gap: 6px;
  flex: none;
}
.btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line-2);
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-ink);
  border-color: transparent;
}
.btn.primary:hover {
  opacity: 0.92;
}

.room-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.room-tile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 180px;
}
.room-tile-top .room-name {
  font-size: 14px;
}
.room-tile .intents {
  justify-content: flex-end;
  margin-left: auto;
}

/* ---------- house model / zones ---------- */
.zone-block {
  margin-bottom: 32px;
}
.zone-block:last-child {
  margin-bottom: 0;
}
.zone-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.zone-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.zone-note {
  font-size: 12px;
  color: var(--muted);
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.room-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.room-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.room-card-info {
  flex: 1;
  min-width: 0;
}
.room-card .room-name {
  font-size: 14px;
}
.room-card .room-stat {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
}
.room-card .intents {
  margin-top: auto;
}
.room-card .intents .btn {
  height: 26px;
}
.planned-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.planned-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-right: 2px;
}
.plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.plan-chip .ic {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

/* ---------- Rupert ---------- */
.detail-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}
body.detail-open .app {
  grid-template-columns: 1fr;
}
body.detail-open .rail,
body.detail-open .topbar {
  display: none;
}
body.detail-open .main {
  padding: 0;
}
.detail-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.detail-top .icon-btn {
  width: 36px;
  height: 36px;
}
.detail-heading {
  flex: 1;
  min-width: 0;
}
.detail-kicker {
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--muted);
}
.detail-heading h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.detail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.detail-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.detail-tab {
  height: 40px;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 -2px transparent;
  transition: color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.detail-tab:hover {
  color: var(--text);
}
.detail-tab.active {
  color: var(--text);
  box-shadow: inset 0 -2px var(--accent);
}
.map-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.map-wrap {
  height: 460px;
  overflow: auto;
}
.map-canvas {
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
}
.rupert-map {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-2);
}
.map-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  color: var(--muted);
}
.map-fallback[hidden] {
  display: none;
}
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-deep);
}
.map-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.map-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.map-btn .ic {
  width: 14px;
  height: 14px;
}
.map-zoom {
  min-width: 34px;
  padding: 0 2px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.map-full-head {
  display: none;
}
.map-frame.expanded {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: var(--bg);
}
.map-frame.expanded .map-full-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
}
.map-full-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.map-frame.expanded .map-wrap {
  height: calc(100dvh - 56px);
}
.map-frame.expanded .map-controls {
  top: auto;
  right: 16px;
  bottom: 16px;
}
.map-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  background: var(--bg-deep);
  border: 1px solid var(--line-2);
  font-size: 11px;
  color: var(--text-2);
}
.rupert-state {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.rupert-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.metric {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.metric span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}
.metric b {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.progress {
  height: 4px;
  margin-top: 16px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(calc(var(--p, 0) / 100));
  transition: transform var(--slow) var(--ease);
}
.status-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.status-foot.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.status-foot span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
}
.status-foot b {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.btn .ic {
  width: 14px;
  height: 14px;
}
.mini-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.mini-head span:last-child {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.shortcut-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.shortcut-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shortcut-row .shortcut {
  width: auto;
  min-width: 180px;
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.text-btn:hover {
  color: var(--text-2);
}
.text-btn .ic {
  width: 13px;
  height: 13px;
}
.room-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.room-toolbar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.room-toolbar .text-btn {
  margin-top: 0;
}
.room-pick {
  display: flex;
  align-items: center;
  flex: none;
}
.room-pick input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.rupert-room-info {
  flex: 1;
  min-width: 0;
}
.care-alert {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--bad);
  font-size: 12px;
}
.shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.shortcut .ic {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.shortcut:hover {
  background: var(--surface);
  border-color: var(--line-2);
}
.rupert-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.rupert-room {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
}
.rupert-room.active {
  border-color: var(--accent);
}
.rupert-room-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rupert-room-head > div:first-child {
  flex: 1;
  min-width: 0;
}
.rupert-room.active .room-name {
  color: var(--accent);
}
.rupert-room .btn {
  height: 26px;
}
.room-details {
  margin-top: 6px;
}
.settings-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.settings-group:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.settings-group > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}
.settings-group > summary::-webkit-details-marker {
  display: none;
}
.settings-group > summary .chev {
  width: 13px;
  height: 13px;
  color: var(--muted);
  transition: transform var(--fast) var(--ease);
}
.settings-group[open] > summary .chev {
  transform: rotate(90deg);
}
.group-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin-top: 8px;
}
.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 190px);
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.field:first-child {
  border-top: 0;
}
.field-label {
  font-size: 12px;
  color: var(--text-2);
}
.input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.toggle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin-top: 8px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.toggle-row:nth-child(1),
.toggle-row:nth-child(2) {
  border-top: 0;
}
.toggle-label {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
}
.toggle {
  width: 28px;
  height: 16px;
  flex: none;
  padding: 2px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}
.toggle span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
.toggle.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.toggle.on span {
  transform: translateX(12px);
  background: var(--accent);
}
.diag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.diag-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.diag-row:nth-child(1),
.diag-row:nth-child(2) {
  border-top: 0;
}
.diag-name {
  color: var(--text-2);
}
.diag-value {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.diag-value.warn { color: var(--accent); }
.diag-value.bad { color: var(--bad); }
.adv-form { margin-top: 10px; }
.adv-title {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-2);
}
.adv-title:first-child { margin-top: 0; }
.adv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.adv-row .input {
  flex: 1;
  min-width: 0;
  width: 72px;
}
.adv-row .btn { flex: none; }
.behavior-card,
.diagnostics-card {
  align-self: start;
}
.bad-note {
  margin-top: 12px;
  margin-bottom: 0;
  color: var(--bad);
}

/* ---------- device detail helpers ---------- */
.climate-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.climate-temp {
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.climate-temp span {
  margin-left: 2px;
  font-size: 22px;
  color: var(--muted);
}
.climate-cond {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
}
.climate-target {
  text-align: right;
}
.target-label {
  font-size: 11px;
  color: var(--text-2);
}
.target-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.target-stepper b {
  min-width: 74px;
  text-align: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.target-range {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.setting-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.setting-row:first-child {
  padding-top: 0;
  border-top: 0;
}
.setting-row .mode-label {
  margin-right: auto;
}
.mode-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.washer-hero {
  display: flex;
  align-items: center;
  gap: 32px;
}
.washer-ring {
  position: relative;
  width: 220px;
  height: 220px;
  flex: none;
}
.washer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 8;
}
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p, 0));
  transition: stroke-dashoffset var(--slow) var(--ease);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}
.ring-state {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ring-time {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ring-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.washer-metrics {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.washer-metrics.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.notice {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}
.notice-list {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.notice-list > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}
.notice-list b {
  font-weight: 500;
  color: var(--text);
}
.notice-list span {
  color: var(--text-2);
}
.event-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.event-line .event-time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.event-line.bad {
  color: var(--bad);
}
.delay-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.delay-row .input {
  width: 80px;
  flex: none;
}
.field-unit {
  font-size: 12px;
  color: var(--muted);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.setting-title {
  font-size: 13px;
  font-weight: 500;
}
.setting-block p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

/* ---------- systems ---------- */
.stat {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.stat:first-of-type {
  border-top: 0;
  padding-top: 0;
}
a.stat {
  cursor: pointer;
  transition: background var(--fast) var(--ease);
  border-radius: var(--r-sm);
}
a.stat:hover {
  background: var(--surface-2);
}
a.stat:hover .stat-arrow {
  opacity: 1;
}
.stat-icon {
  color: var(--muted);
  display: flex;
}
.stat-icon .ic {
  width: 16px;
  height: 16px;
}
.stat.ok .stat-icon {
  color: var(--good);
}
.stat.warn .stat-icon {
  color: var(--accent);
}
.stat.bad .stat-icon {
  color: var(--bad);
}
.stat-label {
  font-size: 13px;
  font-weight: 500;
}
.stat-desc {
  font-size: 12px;
  color: var(--text-2);
}
.stat-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.stat-value.ok { color: var(--good); }
.stat-value.warn { color: var(--accent); }
.stat-value.bad { color: var(--bad); }
.stat-arrow {
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
  display: flex;
}
.stat-arrow .ic {
  width: 14px;
  height: 14px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}
.link .ic {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.link:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line-2);
}
.link:hover .ic {
  color: var(--text-2);
}

.urows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.urow {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.urow:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.head-note {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 16px;
  max-width: 72ch;
}

/* ---------- planned ---------- */
.ghosts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.ghost {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 16px;
  min-height: 116px;
  background: transparent;
}
.ghost-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.ghost-top .ic {
  width: 16px;
  height: 16px;
}
.ghost-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.ghost-title {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
}
.ghost-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- media ---------- */
.media-device {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.media-info {
  flex: 1;
  min-width: 0;
}
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.media-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.media-volume input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.vol-pct {
  min-width: 36px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.media-source {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.media-source label {
  font-size: 12px;
  color: var(--text-2);
}
.media-source .input {
  max-width: 240px;
}
.media-mute {
  width: 30px;
  height: 30px;
}
.remote-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.65);
}
.remote-panel {
  width: min(440px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.remote-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.remote-head h2 {
  font-size: 18px;
  font-weight: 500;
}
.remote-head .icon-btn {
  margin-left: auto;
}
.remote-dpad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 64px);
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
}
.remote-key {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.remote-key:hover {
  background: var(--surface);
  border-color: var(--accent);
}
.remote-key .ic {
  width: 20px;
  height: 20px;
}
.remote-key.up { grid-area: 1 / 2; }
.remote-key.left { grid-area: 2 / 1; }
.remote-key.ok { grid-area: 2 / 2; background: var(--accent-soft); border-color: transparent; }
.remote-key.right { grid-area: 2 / 3; }
.remote-key.down { grid-area: 3 / 2; }
.remote-section-label {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.remote-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.remote-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.remote-numbers .btn {
  width: 100%;
}
.remote-row .btn {
  flex: 1;
  min-width: 70px;
}
.remote-text {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.remote-text .input {
  flex: 1;
}
.remote-apps {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.remote-apps .input {
  flex: 1;
}

/* ---------- media / tasks ---------- */
.nowplaying {
  display: flex;
  align-items: center;
  gap: 16px;
}
.np-art {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--sky-soft);
  color: var(--sky);
}
.np-art .ic {
  width: 22px;
  height: 22px;
}
.np-title {
  font-size: 15px;
  font-weight: 500;
}
.np-meta {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
}
.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.task:first-child {
  border-top: 0;
  padding-top: 0;
}
.task .chk {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  color: var(--bg);
}
.task .chk .ic {
  width: 12px;
  height: 12px;
  stroke-width: 2;
  opacity: 0;
}
.task.done .chk {
  background: var(--good);
  border-color: var(--good);
}
.task.done .chk .ic {
  opacity: 1;
}
.task.done .tn {
  color: var(--muted);
}

/* ---------- gate / toast ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}
.gate[hidden] {
  display: none;
}
.gate-card {
  text-align: center;
  max-width: 440px;
}
.gate-brand {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
}
.gate h1 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 10px;
}
.gate p {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.gate code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--std) var(--ease), transform var(--std) var(--ease);
  pointer-events: none;
}
.toast .ic {
  width: 14px;
  height: 14px;
  color: var(--good);
}
.toast.show {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
  .card.s4,
  .card.s5 { grid-column: span 6; }
  .card.s7,
  .card.s8 { grid-column: span 12; }
}
@media (max-width: 1180px) {
  .card.rupert-status { grid-column: span 12; }
}
@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .main {
    grid-row: 1;
    min-height: 0;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: 16px;
  }
  .topbar {
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    margin-bottom: 16px;
  }
  .top-spacer {
    display: none;
  }
  .page-head {
    flex: 1;
    min-width: 0;
  }
  .page-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .wx-inline {
    order: 2;
    padding-right: 12px;
    flex: none;
  }
  .topbar .clock {
    display: none;
  }
  .topbar .icon-btn {
    order: 3;
  }
  .page-title {
    font-size: 24px;
  }
  .wx-inline {
    padding-right: 12px;
  }
  .wx-inline-meta {
    display: none;
  }
  .clock-t {
    font-size: 18px;
  }
  .rail {
    grid-row: 2;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--bg-deep);
  }
  .brand,
  .rail-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    flex: 1;
    gap: 2px;
  }
  .navbtn {
    flex: 1;
    min-width: 0;
    height: 48px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
    font-size: 10px;
    font-weight: 400;
    text-align: center;
  }
  .navbtn .ic {
    width: 18px;
    height: 18px;
  }
  .navbtn.active::before {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .card,
  .card.s4,
  .card.s5,
  .card.s6,
  .card.s7,
  .card.s8 {
    grid-column: span 1;
    padding: 16px;
  }
  .room-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .room-row .intents {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 8px;
  }
  .room-icon {
    width: 28px;
    height: 28px;
  }
  .wx-temp {
    font-size: 40px;
  }
  .map-wrap {
    height: 240px;
  }
  .detail-shell {
    padding: max(16px, env(safe-area-inset-top)) 16px 32px;
  }
  .detail-top {
    gap: 12px;
  }
  .detail-top .icon-btn {
    width: 40px;
    height: 40px;
    order: -1;
  }
  .detail-tab {
    height: 44px;
  }
  .btn {
    height: 38px;
  }
  .map-btn {
    width: 36px;
    height: 36px;
  }
  .detail-meta {
    font-size: 10px;
  }
  .detail-heading h1 {
    font-size: 20px;
  }
  .rupert-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .rupert-metrics .metric:last-child {
    grid-column: 1 / -1;
  }
  .climate-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.climate-temp {
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.climate-temp span {
  margin-left: 2px;
  font-size: 22px;
  color: var(--muted);
}
.climate-cond {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
}
.climate-target {
  text-align: right;
}
.target-label {
  font-size: 11px;
  color: var(--text-2);
}
.target-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.target-stepper b {
  min-width: 74px;
  text-align: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.target-range {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.setting-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.setting-row:first-child {
  padding-top: 0;
  border-top: 0;
}
.setting-row .mode-label {
  margin-right: auto;
}
.mode-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.washer-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  .washer-ring {
    width: 180px;
    height: 180px;
    align-self: center;
  }
  .washer-metrics {
    width: 100%;
  }
  .washer-metrics.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notice-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .rupert-room-grid,
  .fields,
  .toggle-list,
  .diag-grid {
    grid-template-columns: 1fr;
  }
  .remote-overlay {
    padding: 12px;
  }
  .remote-panel {
    padding: 16px;
  }
  .remote-dpad {
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(3, 56px);
  }
  .media-actions {
    width: 100%;
  }
  .media-actions .btn {
    flex: 1;
  }
  .rupert-room-grid {
    gap: 8px;
  }
  .field {
    grid-template-columns: minmax(0, 1fr) minmax(100px, 150px);
  }
  .toast {
    left: 16px;
    right: 16px;
    bottom: 84px;
    justify-content: center;
  }
}
@media (min-width: 1600px) {
  :root {
    --pad: 40px;
    --gap: 20px;
  }
}
