/* climate pane — thermostat surface. Layout unique to this pane; tokens and
   shared primitives only. All classes are scoped to .pane-climate. */

.pane-climate .cl-top,
.pane-climate .cl-split,
.pane-climate .cl-pair {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--gap);
  align-items: stretch;
  min-width: 0;
}
.pane-climate .cl-top,
.pane-climate .cl-split {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.pane-climate .cl-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pane-climate .cl-top > .card,
.pane-climate .cl-split > .card,
.pane-climate .cl-pair > .card {
  grid-column: auto;
  min-width: 0;
  height: 100%;
}
.pane-climate .grid-span {
  grid-column: 1 / -1;
}

/* ---------- thermostat hero ------------------------------------------------ */
.pane-climate .cl-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px 24px;
}
.pane-climate .cl-now {
  min-width: 0;
}
.pane-climate .cl-now-label,
.pane-climate .cl-target-label {
  font-size: 11px;
  color: var(--muted);
}
.pane-climate .cl-temp {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 76px;
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.pane-climate .cl-temp span {
  margin-left: 4px;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.pane-climate .cl-action {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-2);
}
.pane-climate .cl-target {
  text-align: right;
}
.pane-climate .cl-target .ui-stepper {
  justify-content: flex-end;
}
.pane-climate .cl-range {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.pane-climate .cl-statusline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.pane-climate .cl-statusline b {
  font-weight: 500;
  color: var(--text);
}
.pane-climate .mode-row {
  flex-wrap: wrap;
}
.pane-climate .cl-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}
.pane-climate .cl-choice.is-disabled {
  opacity: 0.6;
}
.pane-climate .cl-offline-note {
  margin-top: 14px;
}
.pane-climate .cl-offline-note .notice {
  margin-top: 0;
}
.pane-climate .notice .ic {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---------- conditions + telemetry ---------------------------------------- */
.pane-climate .ui-metrics {
  margin-top: 2px;
}
.pane-climate .cl-foot-note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 72ch;
}

/* ---------- control + settings -------------------------------------------- */
.pane-climate .cl-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 2px;
}
.pane-climate .cl-control-label {
  font-size: 12px;
  color: var(--text-2);
}
.pane-climate .cl-control-row .cl-choice {
  justify-content: flex-start;
}
.pane-climate .cl-pair .cl-choice {
  justify-content: flex-start;
  margin: 2px 0 18px;
}
.pane-climate .cl-pair .cl-choice:last-child {
  margin-bottom: 0;
}
.pane-climate .cl-flags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 24px;
}
.pane-climate .cl-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.pane-climate .cl-toggle-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}
.pane-climate .cl-settings-list .cl-toggle-row:first-child {
  padding-top: 0;
  border-top: 0;
}
.pane-climate .cl-attr-grid {
  margin-top: 8px;
}
.pane-climate .cl-attr-grid .diag-row {
  padding: 7px 0;
}

/* ---------- responsive ----------------------------------------------------- */
@media (max-width: 980px) {
  .pane-climate .cl-top,
  .pane-climate .cl-split,
  .pane-climate .cl-pair {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .pane-climate .cl-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }
  .pane-climate .cl-temp {
    font-size: 58px;
  }
  .pane-climate .cl-temp span {
    font-size: 20px;
  }
  .pane-climate .cl-target {
    text-align: left;
  }
  .pane-climate .cl-target .ui-stepper {
    justify-content: flex-start;
  }
  .pane-climate .cl-range {
    white-space: normal;
  }
  .pane-climate .mode-row .cl-choice,
  .pane-climate .cl-choice {
    justify-content: flex-start;
  }
  .pane-climate .cl-choice {
    gap: 4px;
  }
  .pane-climate .cl-choice .btn {
    padding-left: 8px;
    padding-right: 8px;
  }
  .pane-climate .cl-flags {
    grid-template-columns: 1fr;
  }
}

.live-age {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-left: 6px;
}
