.stats-section { display: grid; gap: 18px; margin-bottom: 28px; }
.stats-section h2 { margin-bottom: 0; font-size: 24px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.metric-card { padding: 20px; min-width: 0; }
.metric-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.metric-card h3 { margin-bottom: 0; font-size: 15px; }
.metric-card strong { display: block; margin: 10px 0 4px; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.metric-card p { margin-bottom: 12px; font-size: 13px; }
.trend-up, .trend-down { font-size: 13px; font-weight: 700; white-space: nowrap; }
.trend-up { color: var(--ok); }
.trend-down { color: #ff5d5d; }
.stats-layout { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 2fr); gap: 16px; align-items: stretch; }
.rank-card, .chart-card { padding: 20px; }
.rank-card h3, .chart-card h3 { margin-bottom: 4px; font-size: 18px; }
.rank-list { display: grid; gap: 10px; margin-top: 18px; max-height: 360px; overflow: auto; }
.rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(24px, auto);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-muted);
}
.rank-badge {
  position: relative;
  display: block;
  justify-self: center;
  align-self: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #10131a;
  font-weight: 800;
}
.rank-badge > span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}
.rank-badge--muted { background: color-mix(in srgb, var(--muted) 28%, transparent); color: var(--text); }
.rank-item strong, .rank-item span { display: block; overflow-wrap: anywhere; }
.rank-item strong { color: var(--text); font-weight: 800; }
.rank-item span { color: color-mix(in srgb, var(--text) 72%, var(--muted)); font-size: 13px; }
.rank-item b { justify-self: end; color: var(--text); font-size: 16px; line-height: 1; white-space: nowrap; }
.empty { margin-bottom: 0; }
.chart-card { min-height: 420px; }
.stats-chart { position: relative; height: 330px; margin-top: 18px; }
.stats-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: color-mix(in srgb, var(--border) 75%, transparent); stroke-dasharray: 4 4; }
.chart-axis { stroke: color-mix(in srgb, var(--muted) 70%, transparent); stroke-width: 1.2; }
.chart-label { fill: var(--muted); font-size: 12px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-bar { fill: color-mix(in srgb, var(--accent) 72%, #1598ff); rx: 4; }
.chart-hit { fill: transparent; cursor: crosshair; }
.stats-tooltip {
  position: fixed;
  z-index: 30;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, #000 8%);
  box-shadow: var(--shadow);
  pointer-events: none;
  font-size: 13px;
}
.node-table { overflow: auto; }
.node-table table { min-width: 720px; }

@media (max-width: 980px) {
  .metric-grid, .stats-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .metric-card strong { font-size: 25px; }
  .chart-card { min-height: 340px; }
  .stats-chart { height: 260px; }
}
