:root {
  --bg: #0a0a0a;
  --bg-card: #111;
  --fg: #e8e8e8;
  --muted: #666;
  --accent: #00ff88;
  --warn: #ff6b35;
  --border: #222;
  --grid: #1a1a1a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  min-height: 100vh;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Header */
header.main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 span { color: var(--accent); }

/* Status indicator */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.status-dot.error { background: var(--warn); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.card-header h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.card-body { padding: 16px; }

/* Grid layout */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
}

.metric {
  background: var(--bg-card);
  padding: 16px;
}

.metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 20px;
  font-weight: 300;
}

.metric-value.station {
  font-size: 14px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}

.metric-value.accent { color: var(--accent); }
.metric-value.warn { color: var(--warn); }

/* Delay indicator */
.delay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delay-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.delay-bar-fill {
  position: absolute;
  left: 50%;
  height: 100%;
  background: var(--accent);
  transition: all 0.3s;
}

.delay-bar-fill.negative { background: var(--accent); }
.delay-bar-fill.positive { background: var(--warn); }

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--grid);
  color: var(--fg);
}

.data-table tr:hover td { background: var(--grid); }

.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .positive { color: var(--warn); }
.data-table .negative { color: var(--accent); }
.data-table .zero { color: var(--muted); }

/* Graph */
.graph {
  height: 120px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 16px 0;
}

.graph-bar {
  flex: 1;
  min-width: 4px;
  max-width: 20px;
  background: var(--accent);
  transition: height 0.3s;
  position: relative;
}

.graph-bar.negative { background: var(--accent); }
.graph-bar.positive { background: var(--warn); }

.graph-zero {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed var(--muted);
}

.graph-container {
  position: relative;
}

.graph-label {
  position: absolute;
  left: 0;
  font-size: 10px;
  color: var(--muted);
}

.graph-label.top { top: 0; }
.graph-label.bottom { bottom: 0; }
.graph-label.zero { top: 50%; transform: translateY(-50%); }

/* Messages */
.muted { color: var(--muted); }
.warn-text { color: var(--warn); }
.accent-text { color: var(--accent); }

.empty {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Utilities */
.mono { font-family: inherit; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }

/* HTMX loading state */
.htmx-request .status-dot { animation: none; opacity: 0.5; }