:root {
  --red: #b00020;
  --red-bg: #fdecea;
  --border: #d8dde3;
  --text: #1f2933;
  --muted: #6b7684;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #f7f8fa;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.controls select {
  padding: 0.35rem 0.5rem;
  font-size: 0.95rem;
}

#status {
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.chart-card h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
}

.chart-card canvas {
  max-height: 260px;
}

.table-section h2 {
  font-size: 1rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--red-bg);
  border: 1px solid var(--red);
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

th, td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

th:first-child, td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
}

thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.expected {
  font-weight: normal;
  color: var(--muted);
  font-size: 0.75rem;
}

.cell-missing {
  background: var(--red-bg);
  color: var(--red);
  font-weight: 600;
}
