:root {
  --bg: #f7f7f8;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --status-neutral: #6b7280;
  --status-idle: #b45309;
  --status-active: #16a34a;
  --status-error: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --card-bg: #1c1c1e;
    --text: #f2f2f2;
    --text-muted: #9ca3af;
    --border: #2e2e30;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0;
}

.connection {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.connection-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--status-neutral);
}

.connection-dot[data-state="connected"] {
  background: var(--status-active);
}

.connection-dot[data-state="connecting"] {
  background: var(--status-idle);
}

.connection-dot[data-state="disconnected"] {
  background: var(--status-error);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.card .value {
  font-size: 1.6rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card .meta {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.forecast-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.forecast-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.chart-container {
  position: relative;
  width: 50%;
  aspect-ratio: 32 / 9;
  max-width: 100%;
}

.forecast-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .card .value {
    font-size: 1.3rem;
  }
}
