/* The free schedule pages: the Schedule Grid at /tools/schedule-grid and each week at /schedule/2026-27/week-N
   (built by packages/billing/scripts/schedulePages.ts). On top of tokens.css and pk.css (the site's look: paper,
   Fraunces headings, the team chips); every colour is a token, so light and dark come from tokens.css. One accent
   (the light days and the picked controls) and the team colours; nothing else is coloured. */

[hidden] { display: none !important; }
.sg .wrap.wide, .sg .wrap.narrow { max-width: calc(var(--wrap) + 2 * var(--g)); }

/* ── Head ───────────────────────────────────────────────────────────── */
.sg-head { padding-top: 4px; padding-bottom: 28px; display: grid; gap: 12px; justify-items: start; }
.sg h1 { font-size: clamp(30px, 4vw, 52px); line-height: 1.04; letter-spacing: -.03em; max-width: 22ch; }
.sg .lede { max-width: 36em; color: var(--dim); }
.dataline { margin: 14px 0 0; font-size: 14px; color: var(--faint); }
.cite { margin: 6px 0 0; font-size: 14px; color: var(--faint); overflow-wrap: anywhere; }
.dates { margin: 0; color: var(--dim); }
.pending { margin: 0 0 4px; padding: 12px 14px; border-left: 4px solid var(--careful); background: var(--careful-tint); border-radius: 0 var(--r-control) var(--r-control) 0; max-width: 44em; }

.sg-sec, .sg-week { position: relative; padding-top: 36px; padding-bottom: 36px; }
/* A hairline, edge to edge, as on every page of the site. */
.sg-sec::before, .sg-week::before { content: ''; position: absolute; top: 0; left: 50%; width: 100vw; margin-left: -50vw; height: 1px; background: var(--line); }
.sg-sec:last-child { padding-bottom: 48px; }
.sg-h2 { margin: 0 0 14px; font-family: var(--font-brand); font-weight: 800; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.sg-sec p { max-width: 40em; }
.count { font-weight: 500; color: var(--faint); font-size: 14px; margin-left: 4px; }
.hint { margin: 0; font-size: 14px; color: var(--dim); }

/* ── The team chip: the app's tricode in team colour (packages/brand/src/teams.ts), the same in both themes ── */
.tc { display: inline-block; padding: 2px 5px 1px; border-radius: var(--r-sticker); background: var(--tc, var(--surface-2)); color: var(--tc-ink, var(--text)); box-shadow: inset 0 0 0 1px var(--chip-edge); font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .04em; line-height: 1.25; white-space: nowrap; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }

/* ── The week chips: the page's one main control ─────────────────────── */
.weeks { margin: 0 calc(-1 * var(--g)) 18px; padding: 4px var(--g) 8px; overflow-x: auto; scrollbar-width: thin; }
.weeks ol { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.weeks li { flex: none; }
.weeks a { position: relative; display: grid; place-items: center; min-width: 58px; min-height: 52px; padding: 6px 8px; border-radius: var(--r-control); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); text-decoration: none; }
.weeks a:hover { border-color: var(--text); }
.weeks a b { font: 800 16px/1 var(--font-display); letter-spacing: .04em; white-space: nowrap; }
.weeks a small { font-size: 11.5px; font-weight: 600; color: var(--dim); white-space: nowrap; margin-top: 3px; }
.weeks a[aria-current='true'] { background: var(--surface-ink); border-color: var(--surface-ink); color: var(--text-on-ink); }
.weeks a[aria-current='true'] small { color: var(--text-on-ink); opacity: .85; }
/* This week: a dot under its chip. */
.weeks a.is-now::after { content: ''; position: absolute; bottom: -7px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.now-tag { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 2px 8px; border-radius: var(--r-sticker); background: var(--accent); color: var(--accent-ink); font: 750 12px/1.4 var(--font-body); letter-spacing: .04em; text-transform: uppercase; }
.week-view { display: grid; gap: 16px; min-height: 120px; }
.more-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }

/* ── A week at a glance: games per team, the light days, every team day by day ── */
.wk-answer { display: grid; gap: 20px; }
.wk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.wk-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.wk-card h2, .wk-card h3 { margin: 0 0 4px; font-family: var(--font-brand); font-weight: 800; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.wk-note, .wk-none { margin: 0; font-size: 14px; color: var(--dim); }
.wk-rows { list-style: none; margin: 0; padding: 0; }
.wk-rows > li { display: grid; gap: 8px; padding: 12px 0 0; }
.wk-rows > li + li { margin-top: 12px; border-top: 1px solid var(--line); }
.wk-n { margin: 0; font-size: 15px; }
.wk-n span { margin-left: 6px; font-size: 14px; color: var(--faint); }

/* ── Tables ─────────────────────────────────────────────────────────── */
/* position: the screen-reader text inside is placed absolutely; the box must hold it, or it widens the page. */
.grid-scroll, .rank-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.grid-scroll:focus-visible, .rank-scroll:focus-visible { outline-offset: 2px; }
.grid, .rank, .days, .b2bs { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.grid { width: 100%; }
.grid caption, .rank caption { caption-side: top; padding: 10px 12px; text-align: left; font-size: 14px; font-weight: 600; color: var(--dim); }
.grid th, .grid td { min-width: 44px; height: 36px; padding: 0 2px; border-top: 1px solid var(--line); text-align: center; }
.grid thead th { height: auto; padding: 6px 2px; vertical-align: bottom; white-space: nowrap; font-size: 12px; color: var(--dim); font-weight: 600; }
.grid .wk { display: block; font-size: 13px; font-weight: 750; color: var(--text); }
.grid .wd { display: block; font-size: 11px; font-weight: 500; color: var(--faint); }
/* The team column stays put while the rest scrolls. */
.grid th[scope='row'], .grid .team-h { position: sticky; left: 0; z-index: 1; min-width: 52px; padding: 0 6px 0 10px; background: var(--surface); border-right: 1px solid var(--line); text-align: left; }
.grid td { font-size: 15px; font-weight: 600; }

/* A week, day by day: compact, so a one-week week fits a phone. */
.tdays th, .tdays td { min-width: 0; padding: 0 3px; }
.tdays td { height: 34px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tdays .wk { font-size: 12.5px; }
.tdays td.g, .tdays th.g { min-width: 40px; font-size: 15px; font-weight: 800; border-right: 1px solid var(--line); }
.tdays th.g { font-size: 11px; font-weight: 650; }
.tdays .at { font-size: .82em; font-weight: 500; }
.tdays thead th.lt { background: var(--accent-tint); box-shadow: inset 0 -3px 0 var(--accent); }
.tdays thead th.lt .wd { color: var(--dim); }
@media (max-width: 480px) {
  .tdays th, .tdays td, .tdays thead th { padding-left: 1px; padding-right: 1px; }
  .tdays td { font-size: 11.5px; letter-spacing: -.02em; }
  .tdays th[scope='row'], .tdays .team-h { min-width: 0; padding: 0 3px 0 6px; }
  .tdays td.g, .tdays th.g { min-width: 32px; }
  .tdays .wd { font-size: 10.5px; }
  /* Edge to edge on a phone: the gutters go to the table. */
  .wk-answer .grid-scroll { margin: 0 calc(-1 * var(--g)); border-left: 0; border-right: 0; border-radius: 0; }
}
/* On a wide screen the table keeps to its own width, so a row is easy to follow across. */
@media (min-width: 900px) {
  .wk-answer .grid-scroll, .rank-scroll { width: fit-content; max-width: 100%; }
  .tdays { width: auto; }
  .tdays td, .tdays thead th { min-width: 76px; }
  .tdays th[scope='row'], .tdays .team-h { min-width: 64px; }
  .rank { width: auto; }
  .rank th, .rank td { min-width: 64px; padding: 8px 14px; }
}
/* Where the games count drops, a firmer line. */
.tdays tr.brk > * { border-top: 2px solid var(--line-strong); }

/* The whole season. */
.grid td.hi { background: var(--accent-tint); font-weight: 750; }
.grid td.lo { color: var(--faint); font-weight: 450; }
.grid .star, .note .star { color: var(--careful-text); font-weight: 800; }
.note { margin: 12px 0 0; font-size: 14px; color: var(--dim); max-width: 60em; }
.grid thead button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 100%; min-width: 44px; min-height: 44px; padding: 2px; border: 0; border-radius: var(--r-control); background: none; color: inherit; font: inherit; cursor: pointer; }
.grid thead .team-h button { align-items: flex-start; }
.grid thead button:hover { background: var(--surface-2); }
.grid th[aria-sort] .wk::after { content: ' ↓'; }
.grid th[aria-sort='ascending'] .wk::after { content: ' ↑'; }
/* This week's column head: underlined. */
.grid thead th.now { box-shadow: inset 0 -3px 0 var(--accent); }

/* ── More: the views that aren't the week ─────────────────────────────── */
/* The disclosures look like the FAQ's (pk.css .faq); the More section carries .faq for that. */
.sg .faq { border-top: 0; }
.sg-more summary .count { margin-right: auto; }
.more-body { display: grid; gap: 12px; padding: 0 0 24px; }
.more-body > p { margin: 0; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.presets button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); color: var(--text); font: 600 15px/1.2 var(--font-body); cursor: pointer; }
.presets button:hover { border-color: var(--text); }
.presets button[aria-pressed='true'] { background: var(--surface-ink); border-color: var(--surface-ink); color: var(--text-on-ink); }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pick-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.pick-row select { min-height: 44px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); color: var(--text); font: 500 15px var(--font-body); }
.rank { width: 100%; }
.rank th, .rank td { padding: 8px; border-top: 1px solid var(--line); text-align: center; white-space: nowrap; }
.rank thead th { font-size: 13px; color: var(--dim); font-weight: 650; vertical-align: bottom; }
.rank th[scope='row'] { text-align: left; }
.rank .total { font-weight: 800; font-size: 16px; }
@media (max-width: 480px) { .rank th, .rank td { padding: 8px 4px; } .rank caption { padding: 10px 8px; } }

/* A week's page: its two small tables under More. */
.days, .b2bs { width: 100%; }
.days th, .days td, .b2bs th, .b2bs td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; }
.days thead th, .b2bs thead th { font-size: 13px; color: var(--dim); }
.days tr.light th, .days tr.light td { background: var(--accent-tint); }
.prevnext { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; width: 100%; margin: 8px 0 0; }
.prevnext a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); color: var(--text); font-weight: 650; text-decoration: none; }
.prevnext a:hover { border-color: var(--text); }
.faq-sec details p { max-width: 40em; }
