:root {
  color-scheme: light;
  --field: #f6f4eb;
  --paper: #fffef8;
  --ink: #202c23;
  --quiet: #505e52;
  --green: #235c41;
  --dark: #143c2c;
  --line: #d5d9cc;
  --line-control: #7a887a;
  --tint: #e9eee3;
  --accent: #f0d78e;
  --focus: #855300;
  font: 100% / 1.5 system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--field); color: var(--ink); }
a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { color: var(--dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(100% - 3rem, 78rem); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 5;
  background: var(--paper);
  padding: 0.55rem 0.85rem;
}
.masthead { background: var(--dark); color: var(--paper); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; font-size: 1.15rem; font-weight: 730; line-height: 1.25; overflow-wrap: anywhere; }
.brand svg { flex: none; color: var(--accent); }
.sign-out { flex: none; }
.sign-out button { background: transparent; border-color: #a6b8aa; color: var(--paper); }
.sign-out button:hover { background: var(--green); }
.masthead :focus-visible { outline-color: var(--accent); }
.league-nav { background: var(--paper); border-bottom: 1px solid var(--line); }
.league-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.35rem; margin-block: 0; padding: 0; list-style: none; }
.league-nav a {
  display: block;
  padding: 0.7rem 0.12rem 0.55rem;
  border-bottom: 3px solid transparent;
  color: var(--quiet);
  font-weight: 650;
  text-decoration: none;
}
.league-nav a:hover { color: var(--dark); background: var(--tint); }
.league-nav a[aria-current] { color: var(--dark); border-color: var(--green); }
.main-content { padding-block: 1.8rem 4rem; }
h1, h2 { margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: 2rem; letter-spacing: -0.035em; }
h2 { font-size: 1.25rem; }
p { max-width: 70ch; }
.snapshot-note { margin: 0.35rem 0 1.3rem; color: var(--quiet); }
.table-guide { margin: 1.35rem 0 0.55rem; color: var(--quiet); font-size: 0.9rem; }
.scroll-hint { display: none; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}
table { width: 100%; border-spacing: 0; font-size: 0.91rem; line-height: 1.35; }
.score-table { min-width: 64rem; }
.player-table { min-width: 46rem; }
td, th { padding: 0.62rem 0.7rem; text-align: left; vertical-align: middle; }
thead th { background: var(--tint); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr { --row: var(--paper); }
tbody tr:nth-child(even) { --row: #f9f9f1; }
tbody tr:focus-within, tbody tr:hover { --row: #edf1e7; }
tbody td, tbody th { background: var(--row); border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
.sticky-col { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); width: 15.5rem; min-width: 15.5rem; overflow-wrap: anywhere; }
.player-table .sticky-col { width: 12rem; min-width: 12rem; }
.rank-team { display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); gap: 0.35rem; align-items: baseline; }
.rank { color: var(--quiet); text-align: right; font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total { font-weight: 750; background: var(--tint); }
.stat-points, .row-detail { display: block; color: var(--quiet); font-size: 0.82rem; font-weight: 450; }
.stat-points { margin-top: 0.18rem; }
.back-link { display: inline-block; margin-bottom: 0.7rem; font-size: 0.9rem; }
.team-line { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.roster-jumps { display: flex; gap: 0 1rem; flex-wrap: wrap; }
.roster-jumps a { padding: 0.55rem 0; }
.roster-jumps span, .section-count { color: var(--quiet); font-size: 0.9rem; font-weight: 500; }
.roster-group { margin-top: 1.7rem; }
.roster-group h2 { margin-bottom: 0.55rem; }
.team-list { list-style: none; padding: 0; max-width: 37rem; border-top: 1px solid var(--line); }
.team-list li { border-bottom: 1px solid var(--line); }
.team-list a { display: block; padding: 0.65rem 0; overflow-wrap: anywhere; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem; }
.field { display: grid; gap: 0.25rem; min-width: 0; }
.field:first-child { flex: 1 1 16rem; max-width: 24rem; }
label { font-size: 0.9rem; font-weight: 650; }
input, select, button {
  border: 1px solid var(--line-control);
  border-radius: 0.28rem;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  padding: 0.45rem 0.65rem;
  min-height: 2.5rem;
}
select { width: 100%; max-width: 15rem; }
input { min-width: 0; width: 100%; }
button { color: var(--paper); background: var(--green); border-color: var(--green); cursor: pointer; font-weight: 660; }
button:hover, button:active { background: var(--dark); }
.clear-filters { display: block; padding: 0.5rem 0.25rem; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.8rem; }
.pagination a { padding-block: 0.45rem; }
.empty-state { background: var(--paper); border: 1px solid var(--line); padding: 1rem; margin: 1.05rem 0 0; max-width: 44rem; }
.empty-state p { margin: 0.3rem 0 0; }
.record { max-width: 42rem; background: var(--paper); border-block: 1px solid var(--line); }
.record > div { display: grid; grid-template-columns: minmax(7rem, 32%) 1fr; gap: 0.65rem; padding: 0.72rem 0.8rem; }
.record > div + div { border-top: 1px solid var(--line); }
.record dt { color: var(--quiet); font-size: 0.9rem; }
.record dd { margin: 0; font-weight: 640; overflow-wrap: anywhere; }
.auth { max-width: 27rem; }
.auth h1 { margin-bottom: 0.5rem; }
.auth form > div { margin-bottom: 0.75rem; }
.auth label { display: block; margin-bottom: 0.2rem; }
.auth .helptext { color: var(--quiet); font-size: 0.9rem; }
.errorlist { color: #82241d; padding-left: 1.25rem; }
@media (max-width: 67rem) {
  .scroll-hint { display: inline; }
}
@media (max-width: 41rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.65rem; }
  .brand { font-size: 1rem; }
  .sign-out button { font-size: 0.88rem; }
  .league-nav ul { gap: 0 0.55rem; }
  .league-nav a { font-size: 0.88rem; }
  .main-content { padding-block: 1.3rem 3rem; }
  h1 { font-size: 1.65rem; }
  td, th { padding-inline: 0.55rem; }
  .sticky-col, .player-table .sticky-col { width: 9.25rem; min-width: 9.25rem; }
  .field:first-child { flex-basis: 100%; max-width: none; }
  .field { flex: 1 1 8rem; }
  select { max-width: none; }
}

.archive-downloads { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.rules-document { max-width: 72ch; overflow-wrap: anywhere; }
.rules-document nav { margin-top: 1.6rem; }
.rules-contents { columns: 2 16rem; padding-left: 1.25rem; }
.rules-contents li { break-inside: avoid; }
.rules-contents a { display: block; padding-block: 0.3rem; }
.rules-section { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }

.ops { overflow-wrap: anywhere; }
.ops-section { margin-top: 1.6rem; }
.ops-section > h2 { margin-bottom: 0.6rem; }
.ops-form { max-width: 42rem; margin-block: 1rem; }
.ops-form > div, .ops-form fieldset > div { margin-bottom: 0.85rem; }
.ops-form label { display: block; margin-bottom: 0.18rem; }
.ops-form fieldset { min-width: 0; border: 1px solid var(--line); }
.ops-form textarea {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line-control);
  border-radius: 0.28rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.ops-form select[multiple] { max-width: 100%; min-height: 8rem; }
.ops-form input[type="checkbox"] { width: 1.15rem; min-height: 1.15rem; vertical-align: middle; }
.ops-form .helptext { display: block; color: var(--quiet); font-size: 0.9rem; }
.ops-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 1rem; }
.ops-roster { min-width: 29rem; }
.ops-status { background: var(--tint); border: 1px solid var(--line); padding: 0.6rem 0.8rem; }
.ops-text { white-space: pre-wrap; }
.ops details { margin-block: 0.75rem; }
.ops summary { color: var(--dark); font-weight: 650; cursor: pointer; }
.ops details .table-scroll { margin-top: 0.55rem; }
.ops-tools { columns: 2 15rem; max-width: 42rem; }
.ops-tools li { break-inside: avoid; padding-block: 0.25rem; }
.ops-ledger { padding-block: 0.65rem; }
.ops-ledger a { display: inline; }
.ops-findings li { margin-bottom: 0.5rem; }
.ops-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ops-form input[type="datetime-local"] { width: auto; max-width: 100%; }

.board-nav { margin-bottom: 1rem; }
.board-list { list-style: none; padding: 0; max-width: 52rem; }
.board-entry { padding: 0.8rem 0; border-block-start: 1px solid var(--line); }
.board-entry .ops-links { margin-block: 0.55rem; }
.board-body { white-space: pre-wrap; overflow-wrap: anywhere; }
