:root {
  color-scheme: light;
  --bg: #eef3f0;
  --ink: #17212a;
  --muted: #667684;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(90, 110, 126, 0.2);
  --shadow: 0 18px 50px rgba(42, 58, 69, 0.14);
  --warm: #f06b42;
  --cool: #2775c7;
  --fresh: #158f80;
  --gold: #b6811f;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(145deg, #f6f4ef 0%, #e8f1f0 48%, #edf1f7 100%);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--fresh);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.subtitle {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
}

.controls {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(16px);
}

.range-button {
  min-width: 56px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.range-button.is-active {
  color: white;
  background: var(--ink);
  box-shadow: 0 8px 22px rgba(23, 33, 42, 0.18);
}

.stats,
.chart-grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
}

.stat-card,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  min-height: 150px;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
}

.stat-card.warm::before {
  background: var(--warm);
}

.stat-card.cool::before {
  background: var(--cool);
}

.stat-card.fresh::before {
  background: var(--fresh);
}

.stat-card.neutral::before {
  background: var(--gold);
}

.stat-card span,
.panel-heading p,
.sensor-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-size: 2.5rem;
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.chart-grid {
  grid-template-columns: 1.35fr 0.9fr;
  margin-bottom: 16px;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin-top: 4px;
  font-size: 1.2rem;
}

.panel-heading > span {
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.chart-wrap {
  height: 330px;
}

.primary-panel .chart-wrap {
  height: 390px;
}

.sensor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sensor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.56);
}

.sensor-row strong,
.sensor-row span {
  display: block;
}

.sensor-row strong {
  margin-bottom: 5px;
}

.sensor-row b {
  font-size: 1.35rem;
  white-space: nowrap;
}

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats,
  .chart-grid,
  .sensor-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .controls {
    width: 100%;
  }

  .range-button {
    flex: 1;
  }

  .stat-card {
    min-height: 132px;
  }

  .chart-wrap,
  .primary-panel .chart-wrap {
    height: 300px;
  }
}
