/* History shares the site's red palette and works without JavaScript. */
.history-picker {
  display: none;
}
.history-picker-row,
.history-step-links {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.history-picker-row select {
  flex: 1;
  min-width: 0;
}
.history-step-links {
  justify-content: space-between;
}
.history-step-links [aria-disabled] {
  opacity: 0.45;
  cursor: default;
}
@media (max-width: 700px) {
  .history-page .history-results table {
    min-width: 0;
  }
  .history-page .history-results th {
    white-space: normal;
    font-size: 0.6rem;
    letter-spacing: 0.01em;
    padding: 10px 4px;
  }
  .history-page .history-results td {
    font-size: 0.72rem;
    padding: 12px 4px;
  }
  .history-page .history-weeks {
    display: none;
  }
  .history-page .history-picker {
    display: block;
    margin: 0 0 24px;
  }
}
.history-page {
  padding-top: 52px;
  padding-bottom: 30px;
}
.history-heading,
.history-result-heading,
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.history-heading {
  margin-bottom: 28px;
}
.history-heading h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.05em;
}
.history-heading .lead {
  max-width: 600px;
}
.history-heading > a {
  flex-shrink: 0;
}
.history-weeks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.history-weeks a {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  text-decoration: none;
}
.history-weeks a:hover {
  border-color: var(--accent);
  background: var(--panel-high);
}
.history-weeks a[aria-current] {
  border-color: var(--brand);
  box-shadow: inset 0 3px 0 var(--brand);
  background: #29171c;
}
.history-weeks small {
  color: var(--muted);
}
.site-header a[aria-current] {
  color: var(--accent);
}
.history-results {
  padding: 26px;
}
.history-result-heading h2 {
  margin: 8px 0 0;
}
.history-window {
  margin: 12px 0 24px;
}
.history-results table {
  min-width: 520px;
}
.history-results th {
  white-space: nowrap;
}
.history-results tbody tr:nth-child(-n + 3) .rank {
  color: var(--accent);
}
.history-meta {
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
@media (max-width: 850px) {
  .history-weeks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 520px) {
  .history-page {
    padding-top: 30px;
  }
  .history-results {
    padding: 18px 12px;
  }
  .history-weeks a {
    padding: 14px 12px;
  }
  .history-weeks strong {
    font-size: 0.9rem;
  }
  .history-result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
