* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  color: #1a1a1a;
  background: #fafafa;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0 2rem;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 3rem;
}
header h1 { font-size: 1.25rem; font-weight: 600; }
header nav a { font-size: 0.85rem; color: #666; text-decoration: none; }
section { margin-bottom: 5rem; }
section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

/* Section 1 */
#chart-s1 { margin-bottom: 1rem; }
.s1-cards { font-size: 0.9rem; color: #555; margin-bottom: 0.75rem; }
.metrics-table { border-collapse: collapse; font-size: 0.85rem; margin-bottom: 1rem; }
.metrics-table th { text-align: left; padding: 0.25rem 1rem 0.25rem 0; font-weight: 500; color: #555; }
.metrics-table td { padding: 0.25rem 0; font-variant-numeric: tabular-nums; }
.s1-note { font-size: 0.8rem; color: #888; max-width: 600px; line-height: 1.5; }

/* Section 2: bucketed explorer */
.bucket { margin-bottom: 3rem; }
.bucket h3 { font-size: 0.95rem; font-weight: 600; color: #444; margin-bottom: 0.75rem; }
.bucket-chart { margin-bottom: 0.5rem; }
.bucket-table { border-collapse: collapse; font-size: 0.82rem; width: 100%; margin-top: 0.5rem; }
.bucket-table th { text-align: left; padding: 0.3rem 0.75rem 0.3rem 0; font-weight: 500; color: #666; border-bottom: 1px solid #e0e0e0; }
.bucket-table td { padding: 0.4rem 0.75rem 0.4rem 0; font-variant-numeric: tabular-nums; }
.bucket-row { cursor: pointer; transition: background 0.12s; }
.bucket-row:hover { background: #f5f7fa; }
.bucket-row.is-selected { background: #e8eef5; }
.bucket-row.is-selected td { font-weight: 600; }
.bucket-row.is-best.is-selected { background: rgba(39, 174, 96, 0.12); }
.bucket-row.is-selected:hover { background: #dde6f0; }
.bucket-row.is-best.is-selected:hover { background: rgba(39, 174, 96, 0.18); }
.bucket-row:focus-visible { outline: 2px solid #4a90e2; outline-offset: -2px; }
.row-swatch {
  display: inline-block;
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.4rem;
}
.best-pill { display: inline-block; background: #27ae60; color: #fff; font-size: 0.68rem; font-weight: 600; padding: 1px 7px; border-radius: 10px; margin-left: 0.4rem; vertical-align: middle; }

/* Accessibility: data tables for screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
