/* /automation — climate dashboard, simple and friendly */

.page-head { margin: 8px 0 22px; }
.page-head h1 {
  font-size: clamp(28px, 4.5vw, 36px);
  margin-bottom: 4px;
}
.page-head .sub { color: var(--ink-mute); font-size: 15px; }

/* ===== climate hero ===== */

.climate {
  border-radius: var(--r-xl);
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
}
.climate[data-power="on"] {
  background: linear-gradient(135deg, #FFF8F4 0%, var(--surface) 65%);
  border-color: var(--warm-soft);
}
.climate[data-power="off"] {
  background: var(--surface);
}

.climate-status .eyebrow {
  font-size: 13px; font-weight: 600;
  color: var(--ink-mute); margin-bottom: 6px;
}
.climate-status .word {
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.climate[data-power="on"]  .climate-status .word { color: var(--warm); }
.climate-status .since {
  margin-top: 8px;
  color: var(--ink-mute);
  font-size: 14px;
}
.climate-status .actions {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px;
}

.climate-temp {
  text-align: right;
}
.climate-temp .eyebrow {
  font-size: 13px; font-weight: 600;
  color: var(--ink-mute); margin-bottom: 6px;
}
.climate-temp .num {
  font-size: clamp(54px, 9vw, 84px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--cool);
}
.climate-temp .num .deg { font-size: 0.5em; color: var(--ink-faint); margin-left: 4px; }
.climate-temp .meta {
  margin-top: 10px;
  color: var(--ink-mute);
  font-size: 14px;
}
.climate-temp .source {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 12px;
}

@media (max-width: 720px) {
  .climate { grid-template-columns: 1fr; gap: 14px; padding: 22px; }
  .climate-temp { text-align: left; }
}

/* ===== onboarding (state = unknown) ===== */

.onboarding {
  background: var(--surface);
  border: 1px dashed var(--ink-faint);
  border-radius: var(--r-xl);
  padding: 30px;
  text-align: center;
}
.onboarding h2 { font-size: 22px; margin-bottom: 6px; }
.onboarding p { color: var(--ink-mute); margin-bottom: 20px; }
.onboarding .row { justify-content: center; }

/* ===== auto card ===== */

.auto .head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
}
.auto h2 { font-size: 18px; margin-bottom: 4px; }
.auto .rule {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 540px;
}
.auto .rule b { color: var(--warm); font-weight: 600; }
.auto .rule .cool { color: var(--cool); font-weight: 600; }
.auto .actions { margin-top: 14px; display: flex; gap: 8px; }
.auto[data-on="false"] .rule { color: var(--ink-mute); }

.settings {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.settings h4 {
  font-size: 13px; font-weight: 600; color: var(--ink-mute);
  margin: 0 0 10px;
}
.sec-row {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 8px; margin-bottom: 8px; align-items: center;
}
.sec-row select, .sec-row input { font-size: 14px; padding: 9px 12px; }

/* ===== sensors ===== */

.sensors-list {
  display: grid;
  gap: 10px;
}
.sensor {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  gap: 12px;
}
.sensor.primary {
  border-color: var(--warm-soft);
  background: linear-gradient(180deg, #FFF8F4, var(--surface));
}
.sensor .info .name {
  font-weight: 600; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.sensor .info .meta {
  color: var(--ink-mute); font-size: 13px; margin-top: 2px;
}
.sensor .vals { text-align: right; }
.sensor .vals .temp {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cool);
}
.sensor .vals .extras {
  font-size: 12px; color: var(--ink-mute); margin-top: 2px;
}

/* ===== history ===== */

.history-list {
  list-style: none; padding: 0; margin: 0;
}
.history-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.history-list li:last-child { border-bottom: 0; }
.history-list time {
  color: var(--ink-mute);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.history-list .body { color: var(--ink-soft); font-size: 14.5px; }
.history-list .body .verb {
  font-weight: 600;
  color: var(--ink);
}
.history-list .body .verb.on  { color: var(--warm); }
.history-list .body .verb.off { color: var(--ink-soft); }
.history-list .body .verb.err { color: var(--err); }
.history-list .body .why { color: var(--ink-mute); }
.history-list .empty {
  text-align: center; color: var(--ink-mute); padding: 22px 0;
}

/* ===== drawer ============================================================ */

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 40px rgba(20,16,8,0.10);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.2,.7,.3,1);
  z-index: 30;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.drawer-head h3 { font-size: 18px; }
.drawer-body { padding: 8px 22px 30px; overflow-y: auto; flex: 1; }

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,16,8,0.18);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 20;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.day-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 18px 0 4px;
  padding-top: 8px;
}
.day-label:first-child { margin-top: 6px; }

.drawer .history-list li {
  grid-template-columns: 56px 1fr;
  padding: 10px 0;
  font-size: 14px;
}
.drawer-foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-size: 12.5px;
}

