:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #2f81f7;
  --positive: #2ea043;
  --neutral: #8b98a5;
  --negative: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 24px 32px 8px;
}

h1 { margin: 0; font-size: 22px; }

.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

main { padding: 16px 32px 32px; }

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.controls label { color: var(--muted); font-size: 14px; }

.controls input {
  background: var(--panel);
  border: 1px solid #30363d;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 280px;
  font-size: 14px;
}

.controls button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.controls button:disabled { opacity: 0.5; cursor: not-allowed; }

.status { font-size: 13px; padding: 4px 10px; border-radius: 12px; }
.status--idle { color: var(--muted); background: #21262d; }
.status--connecting { color: #d29922; background: #2d2410; }
.status--live { color: var(--positive); background: #10261a; }
.status--error { color: var(--negative); background: #2d1413; }

.chart {
  background: var(--panel);
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 16px;
}

canvas { width: 100%; height: auto; display: block; }

.legend {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-size: 13px;
}

.legend__item { display: inline-flex; align-items: center; }
.legend__item::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  display: inline-block;
}
.legend__item--positive::before { background: var(--positive); }
.legend__item--neutral::before { background: var(--neutral); }
.legend__item--negative::before { background: var(--negative); }
