/* Match the newsletter archive's separate results cards. */
:root {
  --history-card-gap: clamp(20px, 3vw, 30px);
  --history-card-padding: clamp(12px, 2.5vw, 22px);
}

:is(.pfl-history-card, .power-historical-summary-block, .best-bets-history-archive,
    .legacy-circa-history, .simulation-history-section, .betting-lab-summary-panel,
    .fantasy-results-roster-shell, .fantasy-results-comparisons, .fantasy-results-lineups,
    [data-agreement-history]) {
  min-width: 0;
  padding: var(--history-card-padding);
  border: 2px solid #30475e;
  border-radius: 12px;
  background: var(--panel, #101a29);
}

:is(.history-card-stack, .power-historical-results, .betting-lab-history-stack,
    .simulation-history-weekly) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--history-card-gap);
}

.power-historical-summary-block > h3,
.history-card-stack > section > h3 {
  margin: 0 0 14px;
}

.simulation-history-weekly {
  margin-top: var(--history-card-gap);
  padding-top: 0;
  border-top: 0;
}
.simulation-history-section + .simulation-history-section { margin-top: 0; }

.legacy-circa-history,
.fantasy-results-comparisons,
.fantasy-results-lineups { margin-top: var(--history-card-gap); }
[data-agreement-history] { margin: 0; }

:is(.pfl-history-card, .power-historical-summary-block, .simulation-history-section,
    .betting-lab-summary-panel, .fantasy-results-roster-shell, .fantasy-results-comparisons,
    .fantasy-results-lineups, [data-agreement-history]) table > thead > tr > th {
  background-color: #172538;
}

@media (max-width: 760px) {
  .betting-lab-workspace:has(.tab-pane.active .betting-lab-history-tabs) {
    grid-template-columns: minmax(0, 1fr);
  }
  .betting-lab-workspace:has(.tab-pane.active .betting-lab-history-tabs) > * {
    min-width: 0;
  }
}

@media (max-width: 540px) {
  :is(.power-historical-summary-block .power-historical-summary,
      .simulation-history-table-wrap) {
    overflow-x: auto;
  }
  :is(.power-historical-summary-block .power-historical-summary,
      .simulation-history-table-wrap) table {
    table-layout: auto !important;
    min-width: 240px !important;
  }
  :is(.power-historical-summary-block .power-historical-summary,
      .simulation-history-table-wrap) table:has(> thead > tr > th:nth-child(4)) {
    min-width: 330px !important;
  }
  :is(.power-historical-summary-block .power-historical-summary,
      .simulation-history-table-wrap) table > :is(thead, tbody) > tr > :is(th, td) {
    width: auto !important;
    padding: 7px 4px;
    font-size: 11px !important;
    letter-spacing: .02em;
    white-space: normal;
  }
  :is(.power-historical-summary-block .power-historical-summary,
      .simulation-history-table-wrap) table > tbody > tr > td:not(:first-child) {
    white-space: nowrap;
  }
}


.contest-history-archive {
  position: relative;
  margin-top: calc(var(--history-card-gap) + 10px);
}

.contest-history-archive::before {
  position: absolute;
  inset: -18px 0 auto;
  border-top: 1px solid #30475e;
  content: "";
}

.contest-issued-card { margin-top: 16px; }
.contest-issued-card summary { cursor: pointer; }
