:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --surface: #131722;
  --text: #e6eaf2;
  --muted: #8b93a7;
  --dim: #6b7385;
  --border: #1e2533;
  --accent: #3b82f6;
  --up: #f0483e;
  --down: #1fb86c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; }
#app { max-width: 1100px; margin: 0 auto; padding: 12px 14px 28px; }
header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.hd-top { display: flex; align-items: center; gap: 8px; }
.hd-sub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: #1c2c48; color: #93c5fd; font-size: 12px; white-space: nowrap; }
.badge.ok { background: rgba(31,184,108,.15); color: #4ade80; }
.badge.err { background: rgba(240,72,62,.15); color: #fb7185; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.live { background: var(--down); box-shadow: 0 0 0 3px rgba(31,184,108,.2); }
.caliber { color: var(--dim); }
.hero { margin-bottom: 12px; }
.hero-label { font-size: 15px; font-weight: 700; }
.hero-note { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.collect-note {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35);
  color: #fbbf24; font-size: 12px; line-height: 1.5;
}
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px 6px 4px; margin-bottom: 14px;
}
.main-chart { width: 100%; height: min(58vh, 520px); min-height: 340px; }
.heatmap-wrap { margin-bottom: 8px; }
.heatmap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.summary-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.heatmap-hint { color: var(--dim); font-size: 11px; margin-bottom: 8px; }
.heatmap-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.lg-bar {
  width: 72px; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #1fb86c, #1e2533 50%, #f0483e);
  border: 1px solid var(--border);
}
body.mode-volume .lg-bar { background: linear-gradient(90deg, #1e2533, #f97316); }
body.mode-volume .lg-out { color: #8b93a7; }
body.mode-volume .lg-in { color: #f97316; }
.lg-out { color: #1fb86c; }
.lg-in { color: #f0483e; }
.heatmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 900px) { .heatmap { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .heatmap { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .main-chart { min-height: 300px; height: 50vh; }
}
.heat-cell {
  border-radius: 10px; padding: 10px 8px; min-height: 64px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  border: 1px solid rgba(255,255,255,.06);
  min-width: 0;
}
.heat-name {
  font-size: 12px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.heat-val {
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.heat-cell.muted .heat-name, .heat-cell.muted .heat-val { color: var(--muted); text-shadow: none; }
footer { margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.foot-note { margin-top: 6px; color: var(--dim); }
