* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(56, 189, 248, 0.12), transparent 30rem),
    radial-gradient(circle at 86% 18%, rgba(52, 211, 153, 0.08), transparent 28rem),
    #0b0f17;
  color: #e5e7eb;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background-color: #111827;
  border-bottom: 1px solid #1f2937;
}

.header-inner {
  display: flex;
  align-items: center;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e5e7eb;
  text-decoration: none;
}

.brand-icon {
  font-size: 24px;
}

.site-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.stats-content {
  padding: 32px 16px;
}

.stats-summary,
.stats-breakdown,
.stats-visuals,
.stats-metrics,
.stats-details {
  margin-bottom: 40px;
}

h2 {
  font-size: 24px;
  margin-bottom: 16px;
}

.section-heading {
  max-width: 860px;
  margin-bottom: 18px;
}

.section-heading p,
.chart-card p {
  color: #9ca3af;
  line-height: 1.6;
  margin: 8px 0 0;
}

.stats-grid,
.breakdown-grid,
.metrics-grid,
.details-grid,
.visual-grid {
  display: grid;
  gap: 16px;
}

.stats-grid,
.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.breakdown-grid,
.details-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.visual-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.stat-card,
.breakdown-card,
.metric-card,
.detail-card,
.chart-card {
  background-color: #1f2937;
  border-radius: 8px;
  padding: 20px;
}

.chart-card {
  background:
    linear-gradient(145deg, rgba(31, 41, 55, 0.96), rgba(15, 23, 42, 0.96)),
    #1f2937;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.chart-card__header h3 {
  margin: 0;
  font-size: 20px;
}

.chart-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 22px;
}

.pie-figure {
  margin: 0;
  text-align: center;
}

.pie-chart {
  display: grid;
  place-items: center;
  inline-size: 148px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(229, 231, 235, 0.18);
  box-shadow: inset 0 0 0 18px #111827, 0 22px 52px rgba(0, 0, 0, 0.28);
  background: conic-gradient(#38bdf8 0 100%);
}

.pie-chart::after {
  content: "";
  inline-size: 64px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.pie-chart--empty {
  background: #374151;
}

.pie-figure figcaption {
  margin-top: 12px;
  color: #9ca3af;
  font-size: 13px;
}

.bar-panel {
  min-width: 0;
}

.stacked-bars {
  display: grid;
  gap: 10px;
}

.bar-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.bar-label,
.bar-total {
  color: #9ca3af;
  font-size: 12px;
}

.bar-total {
  text-align: right;
  font-weight: 700;
}

.bar-track {
  display: flex;
  block-size: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  outline: 1px solid rgba(148, 163, 184, 0.12);
}

.bar-segment {
  display: block;
  min-inline-size: 3px;
  background: var(--segment-color);
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #374151;
  list-style: none;
}

.chart-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #cbd5e1;
  font-size: 13px;
}

.chart-legend li span:nth-child(2) {
  overflow-wrap: anywhere;
}

.legend-swatch {
  inline-size: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.chart-legend strong {
  color: #e5e7eb;
  font-size: 12px;
  white-space: nowrap;
}

.chart-empty {
  color: #9ca3af;
  margin: 0;
}

.stat-card--primary,
.breakdown-card--primary {
  border-left: 4px solid #3b82f6;
}

.stat-card--secondary,
.breakdown-card--secondary {
  border-left: 4px solid #10b981;
}

.stat-card--accent,
.breakdown-card--accent {
  border-left: 4px solid #f59e0b;
}

.stat-label,
.breakdown-label,
.metric-label,
.detail-label {
  font-size: 14px;
  color: #9ca3af;
}

.stat-value,
.breakdown-count,
.metric-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}

.breakdown-list,
.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.breakdown-list li,
.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #374151;
}

.breakdown-list li:last-child,
.detail-list li:last-child {
  border-bottom: none;
}

.breakdown-count,
.detail-value {
  font-weight: 600;
}

.recent-ip-list li {
  align-items: flex-start;
}

.recent-ip-main {
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.recent-ip-meta {
  color: #9ca3af;
  font-size: 13px;
  text-align: right;
}

.metric-card {
  text-align: center;
}

.site-footer {
  background-color: #111827;
  border-top: 1px solid #1f2937;
  padding: 24px 16px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer p {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.site-footer a {
  color: #60a5fa;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  h2 {
    font-size: 20px;
  }

  .visual-grid,
  .chart-layout {
    grid-template-columns: 1fr;
  }

  .chart-layout {
    gap: 18px;
  }

  .pie-chart {
    inline-size: 132px;
  }

  .breakdown-list li,
  .detail-list li {
    flex-direction: column;
    gap: 4px;
  }

  .recent-ip-meta {
    text-align: left;
  }
}
