:root {
  --bg: #090d12;
  --panel: #0f151d;
  --panel-border: #1c2733;
  --text: #e6edf3;
  --muted: #6b7c8c;
  --teal: #29e2c4;
  --amber: #ffb238;
  --danger: #ff5d5d;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.scanline {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  opacity: 0.5;
  animation: sweep 6s linear infinite;
  z-index: 50;
  pointer-events: none;
}
@keyframes sweep {
  0% { transform: translateY(0); opacity: 0; }
  5% { opacity: 0.6; }
  50% { transform: translateY(50vh); }
  95% { opacity: 0.6; }
  100% { transform: translateY(100vh); opacity: 0; }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--panel-border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { color: var(--teal); font-size: 22px; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
}
.brand-title span { color: var(--teal); }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(255,93,93,0.6);
}
.dot.ok { background: var(--teal); animation: pulse 2s infinite; }
.dot.bad { background: var(--danger); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(41,226,196,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(41,226,196,0); }
  100% { box-shadow: 0 0 0 0 rgba(41,226,196,0); }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 18px 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin: 0;
}
.panel-note { font-size: 10px; color: var(--muted); }

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

.traffic-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.traffic-readout {
  display: flex;
  gap: 32px;
}

.traffic-totals {
  display: flex;
  gap: 28px;
}
.total-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.total-value { font-size: 15px; font-weight: 600; }
.total-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 600px) {
  .traffic-totals { gap: 16px; flex-wrap: wrap; }
  .total-item { align-items: flex-start; }
}
.readout { display: flex; align-items: baseline; gap: 6px; }
.readout .arrow { font-size: 18px; }
.readout.down .arrow { color: var(--teal); }
.readout.up .arrow { color: var(--amber); }
.readout .value { font-size: 26px; font-weight: 600; }
.readout .unit { font-size: 12px; color: var(--muted); }
.readout .label { font-size: 10px; color: var(--muted); margin-left: 4px; text-transform: uppercase; }

.big-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: var(--teal);
}
.sub-line { font-size: 11px; color: var(--muted); margin-top: 4px; }

.system-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sys-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.sys-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.sys-value { font-size: 14px; font-weight: 600; text-align: right; }

.foot {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 12px;
}
