*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background: rgb(var(--bg));
  color: rgb(var(--text));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(100% - 2rem, 720px);
  margin-inline: auto;
  padding: 2rem 0 3rem;
}

header {
  margin-bottom: 1.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: rgb(var(--text-muted));
  background: rgb(var(--bg-elev) / 0.8);
  border: 1px solid rgb(var(--border) / 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-size: var(--text-xs);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgb(var(--border) / 0.25);
}

.badge.live {
  color: rgb(var(--accent));
  border-color: rgb(var(--accent) / 0.35);
}

.badge.stale {
  color: rgb(var(--warning));
  border-color: rgb(var(--warning) / 0.35);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: var(--text-lg);
  font-weight: 600;
}

.subtitle {
  margin: 0;
  color: rgb(var(--text-muted));
  font-size: var(--text-sm);
}

.panel {
  background: rgb(var(--panel));
  border: 1px solid rgb(var(--border) / 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric {
  background: rgb(var(--bg-elev) / 0.6);
  border: 1px solid rgb(var(--border) / 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.metric-label {
  font-size: var(--text-xs);
  color: rgb(var(--text-subtle));
  margin-bottom: 0.25rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
}

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

.metric-value.muted {
  font-size: var(--text-sm);
  color: rgb(var(--text-muted));
}

#chart {
  width: 100%;
  height: 280px;
  display: block;
  border-radius: var(--radius-sm);
  background: rgb(var(--bg-elev) / 0.4);
}

.legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: var(--text-xs);
  color: rgb(var(--text-subtle));
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.swatch.actual {
  background: rgb(var(--accent));
}

.swatch.predicted {
  background: rgb(var(--text-muted));
}

.footer-note {
  margin-top: 1rem;
  font-size: var(--text-xs);
  color: rgb(var(--text-subtle));
}

a.back-link {
  color: rgb(var(--text-muted));
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--dur-2) var(--ease-out);
}

a.back-link:hover {
  color: rgb(var(--accent));
}

@media (min-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
