:root {
  color-scheme: dark;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: #101418;
  color: #e8edf2;
}
body { margin: 0; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #1b232c;
  border-bottom: 1px solid #2c3947;
}
nav { display: flex; gap: 1rem; align-items: center; }
.brand { color: #f2c14e; text-decoration: none; font-weight: 700; }
main { padding: 1.5rem; display: grid; gap: 1rem; }
.card {
  background: #182028;
  border: 1px solid #2c3947;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; }
dt { color: #8ea0b5; font-size: 0.85rem; }
dd { margin: 0; font-size: 1.4rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.4rem 0.3rem; border-bottom: 1px solid #2c3947; }
label { display: grid; gap: 0.35rem; margin-bottom: 0.8rem; }
input, button, textarea, select {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #3b4d60;
  background: #0f151b;
  color: inherit;
}
textarea { width: 100%; box-sizing: border-box; }
button { background: #f2c14e; color: #101418; font-weight: 700; cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.filters label { margin: 0; min-width: 160px; }
.table-scroll { overflow-x: auto; }
.meter {
  display: block;
  width: 110px;
  height: 4px;
  margin-top: 0.2rem;
  background: #2c3947;
}
.meter span { display: block; height: 100%; background: #f2c14e; }
.chart-frame {
  width: 100%;
  min-height: 220px;
  background:
    linear-gradient(to top, #2c3947 1px, transparent 1px) 0 0 / 100% 25%;
}
.chart-frame svg { display: block; width: 100%; height: 280px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.75rem; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-legend-item i { width: 0.8rem; height: 0.8rem; border-radius: 2px; }
.muted { color: #8ea0b5; }
.matchup-heatmap-frame { margin-top: 1rem; }
.matchup-heatmap { width: max-content; min-width: 100%; }
.matchup-heatmap th, .matchup-heatmap td {
  min-width: 7rem;
  height: 3.25rem;
  padding: 0.45rem 0.65rem;
  text-align: center;
  border: 2px solid #182028;
}
.matchup-heatmap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #182028;
}
.matchup-heatmap th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  max-width: 12rem;
  text-align: left;
  background: #182028;
}
.matchup-heatmap td { color: #fff; font-variant-numeric: tabular-nums; font-weight: 700; }
.matchup-heatmap td.empty { background: #202a34; color: #8ea0b5; }
.matchup-cell-button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
.matchup-cell-button:hover, .matchup-cell-button:focus-visible {
  outline: 2px solid #f2c14e;
  outline-offset: 4px;
}
.heatmap-scale {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.65rem;
  color: #8ea0b5;
  font-size: 0.8rem;
}
.heatmap-scale i {
  width: min(15rem, 35vw);
  height: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgb(145 48 61), rgb(51 64 77), rgb(30 126 83));
}
.matchup-details { margin-top: 1rem; }
.matchup-details summary { color: #f2c14e; cursor: pointer; }
.matchup-details table { margin-top: 0.75rem; }
.matchup-dialog {
  width: min(1200px, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  box-sizing: border-box;
  padding: 0;
  overflow: auto;
  border: 1px solid #3b4d60;
  border-radius: 12px;
  background: #182028;
  color: #e8edf2;
}
.matchup-dialog::backdrop { background: rgb(6 9 12 / 78%); }
.matchup-dialog > header {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 1rem 1.25rem;
}
.matchup-dialog h2, .matchup-dialog h3, .matchup-dialog p { margin-top: 0; }
#matchup-detail-content { padding: 1.25rem; }
.matchup-sources { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.source-badge {
  padding: 0.25rem 0.5rem;
  border: 1px solid #3b4d60;
  border-radius: 999px;
  color: #c8d4df;
  font-size: 0.82rem;
}
.matchup-cohorts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.matchup-cohort {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #2c3947;
  border-radius: 10px;
}
.matchup-cohort th { width: 12rem; color: #aebdcb; vertical-align: top; }
.matchup-cohort td { vertical-align: top; }
.card-score-list { margin: 0; padding-left: 1.25rem; }
.card-score-list li { margin-bottom: 0.45rem; }
.card-score-list strong, .card-score-list span { display: block; }
.card-score-list span { font-size: 0.78rem; }
@media (max-width: 800px) {
  .matchup-cohorts { grid-template-columns: 1fr; }
}
.sparkline-card { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.sparkline-card h2 { margin-bottom: 0.25rem; }
.sparkline-card strong { display: block; font-size: 2rem; }
.sparkline-card span { color: #8ea0b5; font-size: 0.85rem; }
.sparkline-card svg { width: min(55%, 320px); height: 72px; overflow: visible; }
.recommendations { margin: 0; padding-left: 1.4rem; }
.recommendations li { padding: 0.45rem 0; }
.recommendations strong, .recommendations span { display: block; }
.recommendations span { color: #8ea0b5; font-size: 0.85rem; }
.inline { display: flex; gap: 0.4rem; }
.inline button { padding: 0.3rem 0.5rem; }
.inline .danger { background: #b83232; color: white; }
.hint { color: #8ea0b5; font-size: 0.85rem; margin: 0 0 0.75rem; max-width: 62ch; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.actions button { padding: 0.3rem 0.5rem; }
.actions .danger { background: #b83232; color: white; }
tr.removed td { opacity: 0.55; }
.tag { background: #b83232; color: white; border-radius: 3px; padding: 0 0.35rem; font-size: 0.7rem; }
.alerts { list-style: none; padding: 0; }
.alerts li { padding: 0.5rem 0; border-bottom: 1px solid #2c3947; }
.critical, .alert.critical { color: #ff8d8d; }
.login { max-width: 420px; margin: 3rem auto; }
