:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172722;
  background: #f4f7f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

.page {
  width: min(100% - 32px, 1000px);
  margin: 0 auto;
  padding: 48px 0 28px;
}

.page-header,
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow,
.card-label {
  margin: 0 0 8px;
  color: #537067;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.11em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.subtitle {
  margin-bottom: 0;
  color: #63766f;
}

.status {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid #cfe0d8;
  border-radius: 999px;
  color: #315d4a;
  background: #e8f3ec;
  font-size: 0.85rem;
  font-weight: 650;
}

.status.error {
  border-color: #efc7c0;
  color: #943c31;
  background: #fff0ed;
}

.current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 32px 0 22px;
}

.reading-card,
.history-card {
  border: 1px solid #e1e9e4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 26px rgb(23 39 34 / 4%);
}

.reading-card {
  min-height: 180px;
  padding: 24px;
}

.reading-value {
  margin: 8px 0 4px;
  font-size: clamp(2.7rem, 8vw, 4.2rem);
  font-weight: 680;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.temperature-card .reading-value {
  color: #bd5d3c;
}

.humidity-card .reading-value {
  color: #277c77;
}

.unit {
  margin-left: 6px;
  font-size: 1.55rem;
  font-weight: 550;
  letter-spacing: 0;
}

.reading-meta,
.history-status,
.chart-footnote {
  margin-bottom: 0;
  color: #71817a;
  font-size: 0.9rem;
}

.history-card {
  padding: 26px;
}

.range-control {
  display: grid;
  gap: 5px;
  color: #63766f;
  font-size: 0.8rem;
}

select {
  min-height: 40px;
  padding: 7px 32px 7px 10px;
  border: 1px solid #cddbd4;
  border-radius: 9px;
  color: #20342c;
  background: #fff;
  font: inherit;
}

.history-status {
  min-height: 22px;
  margin-top: 16px;
}

.chart-block {
  margin-top: 24px;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 650;
}

.chart-unit {
  color: #77877f;
  font-size: 0.85rem;
  font-weight: 450;
}

.legend {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.temperature-legend {
  background: #d67550;
}

.humidity-legend {
  background: #368f88;
}

.chart {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.chart-footnote {
  margin-top: 12px;
}

footer {
  padding: 20px 4px 0;
  color: #73827c;
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 24px, 1000px);
    padding-top: 28px;
  }

  .page-header,
  .history-header {
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
  }

  .current-grid {
    gap: 10px;
    margin-top: 22px;
  }

  .reading-card {
    min-height: 152px;
    padding: 16px 13px;
  }

  .card-label {
    font-size: 0.66rem;
  }

  .reading-value {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .unit {
    margin-left: 2px;
    font-size: 1.1rem;
  }

  .reading-meta {
    font-size: 0.78rem;
  }

  .history-card {
    padding: 19px 15px;
  }

  .chart {
    height: 140px;
  }
}
