:root {
  --bg: #070b14;
  --bg-glow: #10203a;
  --panel: rgba(17, 26, 43, 0.78);
  --panel-border: rgba(148, 163, 184, 0.14);
  --text: #e8eefc;
  --muted: #8fa0bb;
  --temp: #ff8a4c;
  --hum: #3dd6c4;
  --ok: #34d399;
  --warn: #fbbf24;
  --error: #f87171;
  --radius: 18px;
  font-family: "Inter", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(61, 214, 196, 0.12), transparent 60%),
    radial-gradient(800px 500px at 90% 0%, rgba(255, 138, 76, 0.12), transparent 55%),
    linear-gradient(180deg, #070b14 0%, #0a1120 55%, #070b14 100%);
  background-attachment: fixed;
}

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

/* Header */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(17, 26, 43, 0.6);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 12px currentColor;
}

.status.ok {
  color: var(--ok);
}

.status.ok::before {
  background: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.warn::before {
  background: var(--warn);
}

.status.error {
  color: var(--error);
}

.status.error::before {
  background: var(--error);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

.card::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.35;
  pointer-events: none;
}

.card-temp::after {
  background: var(--temp);
}

.card-hum::after {
  background: var(--hum);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-label {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-temp {
  background: var(--temp);
  box-shadow: 0 0 10px var(--temp);
}

.dot-hum {
  background: var(--hum);
  box-shadow: 0 0 10px var(--hum);
}

.value {
  margin: 18px 0 6px;
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.card-temp .value {
  color: var(--temp);
}

.card-hum .value {
  color: var(--hum);
}

.unit {
  margin-left: 4px;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
}

.hint,
.sub,
.footnote {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.meta-value {
  margin: 22px 0 8px;
  font-size: 20px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

/* Chart panel */
.panel {
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

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

h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.45);
}

.ranges button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.ranges button:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
}

.ranges button.active {
  color: #06111d;
  background: linear-gradient(135deg, #7ce7db, #4cc7e8);
  font-weight: 600;
}

.chart-wrap {
  position: relative;
  height: clamp(260px, 42vh, 380px);
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Author `display` above overrides the UA `[hidden] { display: none }` rule,
   so the placeholder stays visible and covers the chart unless we win the cascade. */
.empty[hidden] {
  display: none;
}

.footnote {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 760px) {
  .page {
    width: min(100% - 22px, 680px);
    padding-top: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .ranges {
    width: 100%;
    justify-content: space-between;
  }

  .ranges button {
    flex: 1;
    padding-inline: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
