: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; }
.format-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.format-tab {
  padding: 0.4rem 0.85rem;
  border: 1px solid #3b4d60;
  border-radius: 999px;
  color: #c8d4df;
  text-decoration: none;
  font-weight: 600;
}
.format-tab:hover { border-color: #f2c14e; color: #f2c14e; }
.format-tab.selected {
  background: #f2c14e;
  border-color: #f2c14e;
  color: #101418;
}
.series-tabs {
  margin-top: -0.35rem;
}
.classify-dialog {
  width: min(42rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid #3b4d60;
  border-radius: 12px;
  background: #182028;
  color: #e8edf2;
}
.classify-dialog::backdrop { background: rgb(6 9 12 / 78%); }
.classify-dialog pre {
  white-space: pre-wrap;
  max-height: 18rem;
  overflow: auto;
  padding: 0.75rem;
  background: #131c25;
  border-radius: 6px;
}
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; }
button.secondary, .classify-open.secondary {
  background: #2c3947;
  color: #e8edf2;
  border-color: #3b4d60;
}
td .classify-open + .classify-open,
td .classify-open + button { margin-top: 0.35rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.filters label { margin: 0; min-width: 160px; }
.decklist-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.decklist-cards { list-style: none; margin: 0; padding: 0; }
.decklist-cards li {
  display: grid;
  /* Quantities share a column so the names line up into a readable list. */
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.5rem;
  padding: 0.15rem 0;
}
.decklist-cards .qty { text-align: right; font-variant-numeric: tabular-nums; }
.decklist-cards .average { font-size: 0.8em; font-variant-numeric: tabular-nums; }
.decklist pre {
  white-space: pre-wrap;
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #131c25;
  border-radius: 6px;
  font-size: 0.85em;
}
.table-scroll { overflow-x: auto; }
/* Card names are long and there is one column per card, so headers wrap
   instead of forcing the table wider than the scroll region. */
th.card-name {
  min-width: 7rem;
  max-width: 9rem;
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}
.period-weight { display: block; font-size: 0.8em; }
.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; }
.heatmap-axes { display: flex; flex-direction: column; gap: 0.35rem; width: max-content; min-width: 100%; }
.heatmap-col-axis {
  text-align: center;
  font-weight: 700;
  padding-left: 12rem;
}
.heatmap-row-wrap { display: flex; align-items: stretch; gap: 0.55rem; }
.heatmap-row-axis {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.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-heatmap td.mirror { background: #050607; color: #050607; }
.matchup-cell-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
.matchup-cell-rate { font-size: inherit; }
/* Dimmer than the estimate so a wide interval reads as a caveat on the
   number above it rather than as a second number competing with it. */
.matchup-cell-margin {
  font-size: 0.78em;
  font-weight: 500;
  opacity: 0.75;
}
.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; }
.client-setup .actions { align-items: center; margin: 0 0 0.9rem; }
.client-setup dl { margin: 0 0 0.9rem; }
/* The shared dd size is meant for headline metrics and dwarfs a URL. */
.client-setup dd { font-size: 1rem; }
.client-setup .hint { max-width: 70ch; margin-bottom: 0; }
.client-setup summary { cursor: pointer; color: #8ea0b5; font-size: 0.9rem; margin-bottom: 0.7rem; }
.client-setup summary:hover { color: #c4d0dd; }
.login .hint { margin: 1rem 0 0; padding-top: 0.9rem; border-top: 1px solid #2c3947; }
.steps { margin: 0 0 0.9rem; padding-left: 1.2rem; color: #c4d0dd; font-size: 0.9rem; max-width: 70ch; }
.steps li { margin-bottom: 0.4rem; }
a.button {
  background: #2d6cdf;
  color: white;
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  text-decoration: none;
  font-size: 0.92rem;
}
a.button:hover { background: #3f7ce8; }
code { background: #101820; border: 1px solid #2c3947; border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.92rem; }
.review-detail td { background: #131c25; border-bottom: 1px solid #2c3947; }
.review-evidence {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  padding: 0.5rem 0 0.25rem;
}
.review-evidence h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.review-evidence ul { margin: 0; padding-left: 1.1rem; }
.review-evidence p { margin: 0 0 0.4rem; }
.review-queue tr.current td { color: #f2c14e; }
.game-cards td { background: #131c25; border-bottom: 1px solid #2c3947; }
.game-cards details { margin: 0.15rem 0; }
.game-cards summary { cursor: pointer; color: #c8d4df; }
.game-cards p { margin: 0.45rem 0 0; }
