:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel2: #182130;
  --line: #243044;
  --text: #e7eef8;
  --muted: #8b9bb0;
  --accent: #5b9fd4;
  --near: #3dd68c;
  --mid: #f0b429;
  --far: #8b7cf8;
  --danger: #f07178;
  --good: #7fd99a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Segoe UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: #0d131b;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 15px; letter-spacing: 0.02em; }
.brand span { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.tab.active { color: var(--text); background: var(--panel2); border-color: #35506f; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1.2fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.card h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.card h3 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }
.kpi { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.list { margin: 0; padding-left: 18px; }
.list li { margin: 4px 0; line-height: 1.45; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--muted);
}
.pill.near { color: var(--near); border-color: #245c44; background: #10271d; }
.pill.mid { color: var(--mid); border-color: #6b5420; background: #2a220e; }
.pill.far { color: var(--far); border-color: #3f386e; background: #1a1730; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer;
}
.btn:hover { border-color: #3d5a7a; }
.btn.active { border-color: #4a7aaa; background: #1c2b3d; }
#graph {
  width: 100%; height: 560px; background: #0a1018; border: 1px solid var(--line);
  border-radius: 12px; display: block;
}
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.legend .n { background: var(--near); }
.legend .m { background: var(--mid); }
.legend .f { background: var(--far); }
.legend .c { background: var(--accent); }
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow: auto; }
.event {
  border-left: 3px solid var(--line); padding: 8px 10px; background: var(--panel2); border-radius: 0 8px 8px 0;
}
.event.near { border-left-color: var(--near); }
.event.mid { border-left-color: var(--mid); }
.event.far { border-left-color: var(--far); }
.mono { font-family: var(--mono); font-size: 12px; }
.footer { margin: 24px 0 40px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.hidden { display: none !important; }
.bar {
  height: 8px; background: #1a2433; border-radius: 999px; overflow: hidden; margin-top: 6px;
}
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #2f6ea5, #5b9fd4); }
