/* ==========================================================================
   FANTASY BOSSES INC — site-assets/archive-data-v3.css
   Stylesheet for the generated league-history archive routes: week pages,
   matchup ("game") pages, manager-season ledgers, and the matchup index.
   Generated by scripts/build_history_routes.py, which emits nested routes
   under the generated seasons tree (weeks and teams subdirectories per year)
   and under the generated matchups index.

   PRIME TIME. The same design layer as the live pages (assets/prime.css):
   ground #0C0D10, cards #14161B with 1px #272B33 borders, one volt accent
   (#D4FF3F) for winners and active states, Archivo condensed headlines and
   Archivo tabular figures, Instrument Sans body. The tokens and chrome rules
   below are ported from assets/prime.css so this stylesheet stays
   self-contained. Token names stay prefixed "history-" (read by
   tests/test_history_routes.py's accessibility check); the --pt-* tokens are
   the Prime originals.

   Every color pair below is WCAG AA verified (4.5 to 1 or better). Volt marks
   winners only; losers stay in muted grey, never red.
   ========================================================================== */

:root {
  /* ---- Prime Time tokens (mirror assets/prime.css) ---- */
  --pt-ac: #D4FF3F;
  --pt-bg: #0C0D10;
  --pt-s1: #14161B;
  --pt-s2: #1C1F26;
  --pt-line: #272B33;
  --pt-line-2: #3A3F49;
  --pt-tx: #F3F1EC;
  --pt-tx2: #B4B9C3;
  --pt-tx3: #8B919D;
  --pt-ink: #0C0D10;
  --pt-radius: 18px;
  --pt-wrap: 1280px;
  --pt-edge: 40px;
  --pt-display: 'Archivo', 'Arial Narrow', sans-serif;
  --pt-body: 'Instrument Sans', system-ui, sans-serif;
  --pt-ease: cubic-bezier(.2, .8, .2, 1);

  /* ---- history-* tokens used by the archive components ---- */
  --history-bg: #0C0D10;               /* ground */
  --history-surface: #14161B;          /* card */
  --history-surface-strong: #1C1F26;   /* inset, tracks, chips */
  --history-text: #F3F1EC;             /* 16.6:1 on ground */
  --history-muted: #B4B9C3;            /* 9.6:1 on ground */
  --history-dim: #8B919D;              /* 6.1:1 on ground, 5.4:1 on card */
  --history-border: #272B33;
  --history-border-strong: #3A3F49;
  --history-link: #D4FF3F;             /* volt: winners, hover, active */
  --history-link-hover: #D4FF3F;
  --history-accent: #D4FF3F;
  --history-ink: #0C0D10;              /* text on volt */
  --history-notice-bg: #1C1F26;
  --history-notice-text: #F3F1EC;
  --history-empty: #B4B9C3;            /* flags empty/unscheduled state */
  --history-max: 1280px;
  --history-font: 'Instrument Sans', system-ui, sans-serif;
  --history-font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --history-ease: cubic-bezier(.2, .8, .2, 1);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  background: var(--history-bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--history-bg);
  color: var(--history-text);
  font-family: var(--history-font);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--history-font-display);
  font-stretch: 68%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.005em;
  color: var(--history-text);
  margin: 0;
  overflow-wrap: anywhere;
}

/* Archivo 84% tabular: every figure on the page. */
.mono, .archive-mono, .archive-number, .archive-score, .archive-roster-totals strong,
.archive-summary-item dd, .archive-margin-line strong {
  font-family: var(--history-font-display);
  font-stretch: 84%;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--history-text);
  text-decoration-color: var(--history-border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--history-link-hover);
  text-decoration-color: currentColor;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--history-accent);
  outline-offset: 3px;
}

::selection {
  background: var(--history-accent);
  color: var(--history-ink);
}

[hidden] {
  display: none !important;
}

.archive-skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--history-accent);
  color: var(--history-ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-140%);
}

.archive-skip-link:focus {
  transform: translateY(0);
}

a.archive-skip-link:hover,
a.archive-skip-link:focus {
  color: var(--history-ink);
}

.archive-shell,
.pt-wrap {
  width: 100%;
  max-width: var(--pt-wrap);
  margin-inline: auto;
  padding-inline: var(--pt-edge);
}

/* ==========================================================================
   HEADER / CHROME — static copy of the Prime nav (assets/prime.js navHtml)
   ========================================================================== */
.pt-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 80px;
  border-bottom: 1px solid var(--history-border);
  position: relative;
}

.pt-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 700;
  font-size: 17px;
  color: var(--history-text);
  text-decoration: none;
  white-space: nowrap;
}

a.pt-brand:hover {
  color: var(--history-text);
}

/* The official league logo, the night seal. History pages carry no <img>, so the
   mark is a background on an empty span. */
.pt-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: url("/brand/marks/fbi-seal-night.svg") center / cover no-repeat;
}

.pt-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--history-muted);
}

.pt-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.pt-links a:hover {
  color: var(--history-link-hover);
}

.pt-links a[aria-current="page"] {
  color: var(--history-text);
  box-shadow: inset 0 -2px 0 var(--history-accent);
}

.pt-menu-btn {
  display: none;
  margin-left: auto;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--history-border);
  background: transparent;
  color: var(--history-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pt-menu-btn:hover {
  border-color: var(--history-border-strong);
}

/* ---- archive section chips: the archive's own navigation, under the header ---- */
.pt-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding-top: 18px;
}

.pt-sub-k {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--history-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.pt-sub-k:hover {
  color: var(--history-link-hover);
}

.archive-primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.archive-primary-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 0 18px;
  border: 1px solid var(--history-border);
  border-radius: 999px;
  background: transparent;
  color: var(--history-muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 130ms var(--history-ease), border-color 130ms var(--history-ease);
}

.archive-primary-nav a:hover {
  border-color: var(--history-border-strong);
  color: var(--history-text);
}

.archive-primary-nav a[aria-current="page"] {
  background: var(--history-accent);
  border-color: var(--history-accent);
  color: var(--history-ink);
}

.archive-action-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid var(--history-border);
  border-radius: 999px;
  color: var(--history-text);
  font-weight: 700;
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
}

.archive-action-link:hover {
  border-color: var(--history-border-strong);
  color: var(--history-link-hover);
}

/* ==========================================================================
   MAIN / BREADCRUMBS / PAGE HEADER
   ========================================================================== */
.archive-main {
  min-height: 70vh;
  padding-block: 40px 0;
}

.archive-meta {
  color: var(--history-dim);
  font-size: 14px;
  line-height: 1.45;
}

.archive-breadcrumbs {
  margin-bottom: 28px;
}

.archive-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0 0 0 -4px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.archive-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.archive-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 4px;
  color: var(--history-dim);
  text-decoration: none;
}

.archive-breadcrumbs a:hover {
  color: var(--history-link-hover);
}

.archive-breadcrumbs li[aria-current="page"] {
  padding-inline: 4px;
  color: var(--history-text);
}

/* the 4 px link padding plus 4 px here keeps the old 8 px rhythm around each slash */
.archive-breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 4px;
  color: var(--history-border-strong);
}

.archive-page-header {
  max-width: 1000px;
  margin-bottom: 40px;
}

.archive-page-header > p.archive-meta:first-of-type {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--history-dim);
  margin-bottom: 14px;
}

.archive-page-header h1 {
  margin: 0;
  font-size: clamp(46px, 7.4vw, 104px);
  text-wrap: balance;
}

.archive-page-header > p:not(.archive-meta) {
  margin: 22px 0 0;
  max-width: 60ch;
  color: var(--history-muted);
  font-size: 20px;
  line-height: 1.5;
}

.archive-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.archive-context-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--history-border);
  border-radius: 999px;
  background: transparent;
  color: var(--history-muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.archive-context-links a:hover {
  border-color: var(--history-border-strong);
  color: var(--history-text);
}

.archive-section + .archive-section {
  margin-top: 64px;
}

.archive-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.archive-section-header h2 {
  font-size: clamp(34px, 4.2vw, 52px);
}

.archive-section-header p {
  margin: 0;
  text-align: right;
}

/* ==========================================================================
   FRANCHISE MARKS — the team crests (assets/teams/<slug>/). The micro mark is
   for 20-47 px (rows, chips); the full crest raster for 48 px and up. Crests
   are never recoloured and never sit on volt.
   ========================================================================== */
.archive-crest-micro {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 22px;
  vertical-align: -4px;
}

.archive-crest {
  display: block;
  flex: none;
  height: auto;
}

.archive-page-header > .archive-crest {
  width: 72px;
  margin-bottom: 18px;
}

.archive-boss-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--history-text);
  text-decoration: none;
}

.archive-context-links a.archive-boss-chip {
  gap: 10px;
  padding-left: 12px;
  color: var(--history-text);
}

.archive-context-links a.archive-boss-chip:hover span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---- matchups: one page per season, picked from a row of season chips ---- */
.archive-season-picker {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 40px;
}

.archive-season-picker a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 8px 14px;
  border: 1px solid var(--history-border);
  border-radius: 14px;
  background: var(--history-surface);
  color: var(--history-text);
  text-decoration: none;
}

.archive-season-picker a:hover {
  border-color: var(--history-border-strong);
}

.archive-picker-year {
  font-family: var(--history-font-display);
  font-stretch: 68%;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.archive-season-picker a[aria-current="page"] {
  border-color: var(--history-accent);
  background: var(--history-accent);
  color: var(--history-ink);
}

.archive-season-picker a[aria-current="page"] .archive-meta {
  color: var(--history-ink);
}

@media (max-width: 1100px) {
  .archive-season-picker {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .archive-season-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================================
   SUMMARY GRID — manager-season ledger stat tiles
   ========================================================================== */
.archive-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.archive-summary-item {
  min-width: 0;
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--history-border);
  border-radius: var(--pt-radius);
  background: var(--history-surface);
}

.archive-summary-item dt {
  color: var(--history-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-summary-item dd {
  margin: 12px 0 0;
  font-size: 34px;
  line-height: 1;
  color: var(--history-text);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   WEEK PAGE — matchup card grid
   ========================================================================== */
.archive-matchup-list,
.archive-roster-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 0;
  list-style: none;
}

.archive-matchup-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  border: 1px solid var(--history-border);
  border-radius: var(--pt-radius);
  background: var(--history-surface);
  transition: border-color 130ms var(--history-ease);
}

.archive-matchup-summary:hover {
  border-color: var(--history-border-strong);
}

.archive-matchup-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archive-matchup-side:last-of-type {
  text-align: right;
  align-items: flex-end;
}

.archive-manager-name {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--history-muted);
  font-family: var(--history-font-display);
  font-stretch: 68%;
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: .95;
}

.archive-matchup-side.is-winner .archive-manager-name {
  color: var(--history-text);
}

.archive-matchup-side:last-of-type .archive-manager-name {
  flex-direction: row-reverse;
}

.archive-matchup-side .archive-team-name {
  padding-left: 30px;
}

.archive-matchup-side:last-of-type .archive-team-name {
  padding-left: 0;
  padding-right: 30px;
}

.archive-team-name {
  display: block;
  margin-top: 4px;
  color: var(--history-dim);
  font-size: 15px;
  line-height: 1.35;
}

.archive-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 26px;
  white-space: nowrap;
}

.archive-score-value {
  color: var(--history-dim);
}

.archive-score-value.is-winner {
  color: var(--history-link);
}

.archive-score-sep {
  color: var(--history-border-strong);
  font-weight: 400;
}

/* Win / Loss labels stay in the page for assistive technology only. */
.archive-result {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.archive-matchup-summary .archive-action-link {
  padding: 0 20px;
  font-size: 15px;
}

@media (max-width: 900px) {
  .archive-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-matchup-summary {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .archive-matchup-summary .archive-action-link {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
  }
}

/* ==========================================================================
   MATCHUP PAGE — gamecenter scoreline hero
   ========================================================================== */
.archive-score-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--history-border);
  border-radius: var(--pt-radius);
  background: var(--history-surface);
  overflow: hidden;
}

.archive-score-card {
  padding: 28px 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.archive-score-card:first-child {
  border-right: 1px solid var(--history-border);
}

.archive-score-card:last-child {
  border-left: 1px solid var(--history-border);
  text-align: right;
  align-items: flex-end;
}

.archive-score-card.is-winner {
  box-shadow: inset 0 4px 0 var(--history-accent);
}

.archive-score-card .archive-meta {
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-score-card.is-winner .archive-meta {
  color: var(--history-link);
}

.archive-score-card h2 {
  font-size: clamp(32px, 3.6vw, 48px);
  color: var(--history-muted);
}

.archive-score-card .archive-crest {
  width: 64px;
  margin-bottom: 10px;
}

.archive-score-card h2 a {
  color: inherit;
  text-decoration: none;
}

.archive-score-card h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.archive-score-card.is-winner h2 {
  color: var(--history-text);
}

.archive-score-card .archive-team-name {
  font-size: 16px;
}

.archive-score-card .archive-score {
  display: block;
  margin-top: 12px;
  font-family: var(--history-font-display);
  font-stretch: 68%;
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 800;
  line-height: .9;
  color: var(--history-dim);
}

.archive-score-card.is-winner .archive-score {
  color: var(--history-link);
}

.archive-score-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: var(--history-surface-strong);
  color: var(--history-dim);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-margin-line {
  margin: 18px 0 0;
  color: var(--history-muted);
  font-size: 16px;
}

.archive-margin-line strong {
  color: var(--history-text);
}

@media (max-width: 620px) {
  .archive-score-grid {
    grid-template-columns: 1fr;
  }

  .archive-score-card:first-child,
  .archive-score-card:last-child {
    border: none;
    text-align: left;
    align-items: flex-start;
  }

  .archive-score-card:first-child {
    border-bottom: 1px solid var(--history-border);
  }

  .archive-score-vs {
    padding: 10px 0;
  }
}

/* ==========================================================================
   ROSTER CARD — box score
   ========================================================================== */
.archive-roster-card {
  border: 1px solid var(--history-border);
  border-radius: var(--pt-radius);
  background: var(--history-surface);
  overflow: hidden;
}

.archive-roster-card.is-winner {
  border-color: var(--history-accent);
}

.archive-roster-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--history-border);
}

.archive-roster-header h3 {
  font-size: 34px;
}

.archive-roster-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 0 26px;
  color: var(--history-text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.archive-roster-details > summary::-webkit-details-marker {
  display: none;
}

.archive-roster-details > summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.archive-roster-details[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.archive-roster-details > summary:hover {
  color: var(--history-link-hover);
}

.archive-roster-details[open] > summary {
  border-bottom: 1px solid var(--history-border);
}

.archive-roster-id {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.archive-roster-id .archive-crest {
  width: 48px;
}

.archive-roster-header h3 a {
  color: var(--history-text);
  text-decoration: none;
}

/* Plain links in table cells, the roster sentence and the score-card and
   roster headings get a 44 px hit area that does not grow the row. */
.archive-table :is(th, td) a:not([class]),
.archive-roster-status a:not([class]),
.archive-roster-header h3 a:not([class]),
.archive-score-card h2 a:not([class]) {
  position: relative;
}

/* an atomic box, so a link that wraps onto two lines keeps one rectangle */
.archive-table :is(th, td) a:not([class]) {
  display: inline-block;
  max-width: 100%;
}

/* "Box score" in the roster sentence moves to the next line whole */
.archive-roster-status a:not([class]) {
  display: inline-block;
  white-space: nowrap;
}

.archive-table :is(th, td) a:not([class])::after,
.archive-roster-status a:not([class])::after,
.archive-roster-header h3 a:not([class])::after,
.archive-score-card h2 a:not([class])::after {
  content: "";
  position: absolute;
  inset: -13px -6px;
}

.archive-roster-header h3 a:hover {
  color: var(--history-link-hover);
}

.archive-roster-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 28px;
  text-align: right;
}

.archive-roster-totals strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  color: var(--history-text);
}

.archive-roster-totals .archive-meta {
  letter-spacing: .08em;
  text-transform: uppercase;
}

.archive-roster-status {
  margin: 0;
  padding: 14px 26px;
  border-bottom: 1px solid var(--history-border);
  color: var(--history-muted);
  font-size: 16px;
}

.archive-roster-status a {
  font-weight: 700;
}

/* the opponent's team name sits inside the sentence, not on its own line */
.archive-roster-status .archive-team-name {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.archive-notice {
  margin: 0;
  padding: 14px 26px;
  border-bottom: 1px solid var(--history-border);
  border-left: 3px solid var(--history-accent);
  background: var(--history-notice-bg);
  color: var(--history-notice-text);
  font-weight: 600;
  font-size: 16px;
}

.archive-lineup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.archive-lineup-grid > .archive-table-region {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--history-border);
}

.archive-lineup-grid > .archive-table-region:first-child {
  border-right: 1px solid var(--history-border);
}

.archive-lineup-grid > .archive-table-region:last-child {
  border-bottom: none;
}

.archive-lineup-grid > .archive-table-region--bench {
  background: transparent;
}

@media (max-width: 900px) {
  .archive-lineup-grid {
    grid-template-columns: 1fr;
  }

  .archive-lineup-grid > .archive-table-region:first-child {
    border-right: none;
  }

  .archive-lineup-grid > .archive-table-region:last-child {
    border-bottom: none;
  }
}

/* ==========================================================================
   TABLES — starters / bench / ledger / matchup index
   ========================================================================== */
.archive-table-region {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--history-border);
  border-radius: var(--pt-radius);
  background: var(--history-surface);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--history-border-strong) transparent;
}

.archive-table-region:focus-visible {
  outline-offset: -2px;
}

.archive-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.4;
}

.archive-table--ledger,
.archive-table--index {
  min-width: 900px;
}

.archive-table caption {
  padding: 18px 22px 4px;
  color: var(--history-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
}

.archive-table th,
.archive-table td {
  padding: 13px 14px;
  border-top: 1px solid var(--history-border);
  text-align: left;
  vertical-align: middle;
}

.archive-table :is(th, td):first-child {
  padding-left: 22px;
}

/* a crest that sits inline before a name in a cell keeps a word space from it */
.archive-table td > .archive-crest-micro {
  margin-right: 6px;
}

/* row headers are short labels (slot, "Week 12"); they never break mid-label */
.archive-table tbody th[scope="row"] {
  white-space: nowrap;
}

.archive-table :is(th, td):last-child {
  padding-right: 22px;
}

.archive-table td {
  color: var(--history-muted);
}

.archive-table thead th {
  height: 52px;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--history-dim);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-top: none;
  border-bottom: 1px solid var(--history-border);
  white-space: nowrap;
}

.archive-table tbody tr:first-child th,
.archive-table tbody tr:first-child td {
  border-top: none;
}

.archive-table tbody tr:hover td,
.archive-table tbody tr:hover th {
  background: rgba(255, 255, 255, .025);
}

.archive-table-region--bench .archive-table tbody td {
  color: var(--history-dim);
}

.archive-table-region--bench .archive-table {
  font-size: 15px;
}

.archive-table .archive-number {
  text-align: right;
  white-space: nowrap;
  color: var(--history-text);
}

.archive-table-region--bench .archive-table .archive-number {
  color: var(--history-muted);
}

.archive-table thead th.archive-number {
  color: var(--history-dim);
}

.archive-slot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--history-border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--history-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
}

.archive-table-region--bench .archive-slot-chip {
  border-color: var(--history-border);
  color: var(--history-dim);
}

.archive-empty-slot,
.archive-unscheduled-text {
  color: var(--history-empty);
  font-weight: 700;
  font-style: italic;
  font-family: var(--history-font);
}

/* ---- matchup index filter toolbar ---- */
.archive-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px);
  gap: 14px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--history-border);
  border-radius: var(--pt-radius);
  background: var(--history-surface);
}

.archive-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.archive-field label {
  color: var(--history-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-control {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--history-border-strong);
  border-radius: 14px;
  background: var(--history-bg);
  color: var(--history-text);
  font: inherit;
  font-size: 16px;
}

.archive-control::placeholder {
  color: var(--history-dim);
  opacity: 1;
}

.archive-control:focus-visible {
  border-color: var(--history-accent);
}

.archive-filter-count {
  min-height: 24px;
  margin: 0 0 14px;
  color: var(--history-dim);
  font-size: 14px;
}

.archive-table--index tbody tr[hidden] {
  display: none;
}

.archive-table--index td.is-winner {
  color: var(--history-link);
  font-weight: 700;
}

.archive-table--index th[scope="row"] {
  white-space: nowrap;
}

.archive-table--index th[scope="row"] .archive-meta {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Phones: each game becomes a two-line scoreboard, no sideways scroll. */
@media (max-width: 640px) {
  .archive-table--index {
    display: block;
    min-width: 0;
  }

  .archive-table--index thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .archive-table--index tbody {
    display: block;
  }

  .archive-table--index caption {
    display: block;
    text-align: left;
  }

  .archive-table--index tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--history-border);
  }

  .archive-table--index tbody tr:last-child {
    border-bottom: 0;
  }

  .archive-table--index tbody :is(th, td) {
    padding: 0;
    border: 0;
  }

  .archive-table--index tbody :is(th, td):first-child,
  .archive-table--index tbody :is(th, td):last-child {
    padding: 0;
  }

  .archive-table--index tbody th[scope="row"] {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }

  .archive-table--index tbody th[scope="row"] a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .archive-table--index tbody th[scope="row"] a::after {
    inset: 0 -6px;
  }
}

/* ==========================================================================
   FOOTER — static copy of the Prime footer (assets/prime.js footHtml)
   ========================================================================== */
.archive-foot-note {
  margin: 56px 0 0;
}

.pt-foot {
  margin-top: 120px;
  border-top: 1px solid var(--history-border);
  padding: 48px 0 64px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.pt-foot-meta {
  margin: 12px 0 0;
  color: var(--history-dim);
  font-size: 15px;
}

.pt-foot-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pt-foot-links {
  display: flex;
  gap: 0 28px;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--history-muted);
}

.pt-foot-more {
  font-weight: 500;
  color: var(--history-dim);
  font-size: 15px;
}

.pt-foot-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.pt-foot-links a:hover {
  color: var(--history-link-hover);
}

/* ==========================================================================
   RESPONSIVE — 1100px nav / 900px / 640px / 320px floor
   ========================================================================== */
@media (max-width: 1100px) {
  .pt-links {
    display: none;
  }

  .pt-menu-btn {
    display: inline-flex;
    align-items: center;
  }

  .pt-nav.is-open .pt-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    background: var(--history-surface);
    border: 1px solid var(--history-border);
    border-radius: 0 0 var(--pt-radius) var(--pt-radius);
    padding: 8px 20px 16px;
  }

  .pt-nav.is-open .pt-links a {
    min-height: 52px;
    border-bottom: 1px solid var(--history-border);
  }

  .pt-nav.is-open .pt-links a:last-child {
    border-bottom: 0;
  }

  .pt-nav.is-open .pt-links a[aria-current="page"] {
    box-shadow: inset 4px 0 0 var(--history-accent);
    padding-left: 14px;
    color: var(--history-accent);
  }
}

@media (max-width: 900px) {
  .archive-roster-header {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-roster-totals {
    justify-content: flex-start;
    text-align: left;
  }

  .archive-filter-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pt-sub {
    gap: 0;
  }

  .archive-primary-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: calc(100% + var(--pt-edge) * 2);
    margin-inline: calc(var(--pt-edge) * -1);
    padding: 0 var(--pt-edge) 6px;
    scrollbar-width: none;
  }

  .archive-primary-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --pt-edge: 18px;
  }

  body {
    font-size: 16px;
  }

  .pt-nav {
    gap: 12px;
    min-height: 68px;
  }

  .archive-main {
    padding-block: 28px 0;
  }

  .archive-page-header > p:not(.archive-meta) {
    font-size: 18px;
    margin-top: 18px;
  }

  .archive-foot-note {
    margin-top: 44px;
  }

  .pt-foot {
    margin-top: 88px;
  }

  .archive-section + .archive-section {
    margin-top: 48px;
  }

  .archive-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .archive-section-header p {
    text-align: left;
  }

  .archive-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .archive-summary-item {
    padding: 16px;
  }

  .archive-summary-item dd {
    font-size: 28px;
  }

  /* Phones: a two-line scoreboard, each franchise beside its own score. */
  .archive-matchup-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "away away-score" "home home-score" "link link";
    gap: 14px 16px;
    text-align: left;
    padding: 18px;
  }

  .archive-matchup-summary > .archive-matchup-side:first-child {
    grid-area: away;
  }

  .archive-matchup-summary > .archive-matchup-side:last-of-type {
    grid-area: home;
    text-align: left;
    align-items: flex-start;
  }

  .archive-matchup-side:last-of-type .archive-manager-name {
    flex-direction: row;
  }

  .archive-matchup-side:last-of-type .archive-team-name {
    padding-left: 30px;
    padding-right: 0;
  }

  .archive-matchup-summary > .archive-score {
    display: contents;
  }

  .archive-matchup-summary .archive-score-value {
    align-self: start;
    justify-self: end;
    font-size: 28px;
    line-height: 1;
  }

  .archive-matchup-summary .archive-score-value:first-child {
    grid-area: away-score;
  }

  .archive-matchup-summary .archive-score-value:last-child {
    grid-area: home-score;
  }

  .archive-matchup-summary .archive-score-sep {
    display: none;
  }

  .archive-matchup-summary .archive-action-link {
    grid-area: link;
  }

  .archive-score {
    justify-content: flex-start;
  }

  .archive-roster-header {
    padding: 18px;
  }

  .archive-roster-header h3 {
    font-size: 30px;
  }

  .archive-roster-status,
  .archive-notice {
    padding: 14px 18px;
  }

  .archive-score-card {
    padding: 22px 18px 20px;
  }

  .archive-table {
    font-size: 15px;
  }

  .archive-table th,
  .archive-table td {
    padding: 12px 10px;
  }

  .archive-table :is(th, td):first-child {
    padding-left: 16px;
  }

  .archive-table :is(th, td):last-child {
    padding-right: 16px;
  }

  .archive-table caption {
    padding: 16px 16px 4px;
  }
}

@media (max-width: 360px) {
  .pt-brand {
    font-size: 15px;
    gap: 8px;
  }

  .pt-mark {
    width: 32px;
    height: 32px;
  }

  .pt-menu-btn {
    padding: 0 14px;
  }
}

/* Windows High Contrast: the current-section fill is dropped by the mode. */
@media (forced-colors: active) {
  .archive-primary-nav a[aria-current="page"] {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
