*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

a { color: var(--club-ink); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--ball);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ball); color: var(--ink); padding: var(--space-2) var(--space-3);
}
.skip-link:focus { left: var(--space-3); z-index: 10; }

/* The front wall: club colour ending in the red tin line */
.wall {
  background: var(--club);
  color: var(--on-club);
  border-bottom: var(--tin-line) solid var(--tin);
}
.wall__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.wall__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-2);
  letter-spacing: 0.01em;
  color: var(--on-club);
  text-decoration: none;
  line-height: 1;
}
.wall__nav { display: flex; gap: var(--space-3); font-size: var(--step--1); }
.wall__nav a, .wall__nav button {
  color: var(--on-club); background: none; border: 0; padding: 0;
  font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em;
}

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(var(--step-3), 7vw, var(--step-4));
  line-height: 0.95;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.005em;
}

.lede {
  max-width: var(--measure);
  font-size: var(--step-1);
  color: var(--muted);
  margin: 0 0 var(--space-5);
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-2);
  margin: var(--space-5) 0 var(--space-3);
}

p { max-width: var(--measure); }

/* Club list: a ruled list, not cards */
.club-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.club-list li { border-bottom: 1px solid var(--rule); }
.club-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) 0;
  color: var(--ink); text-decoration: none;
}
.club-list__name {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1.1;
}
.club-list a:hover .club-list__name { color: var(--club-ink); text-decoration: underline; text-decoration-thickness: 2px; }
.club-list__short { color: var(--muted); font-size: var(--step--1); }

/* Empty states give direction, not mood */
.empty {
  max-width: var(--measure);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--rule);
}
.empty p { margin: 0 0 var(--space-2); }

.button {
  display: inline-block;
  background: var(--club); color: var(--on-club);
  border: 0; border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  font: 600 var(--step-0) var(--font-body);
  text-decoration: none; cursor: pointer;
}
.button:hover { background: color-mix(in srgb, var(--club) 85%, #000); }
.button--quiet { background: transparent; color: var(--club-ink); box-shadow: inset 0 0 0 2px var(--club-ink); }

/* Forms (sign-in pages) */
.panel { max-width: 28rem; }
.panel form p, .panel form div { margin: 0 0 var(--space-3); }
.panel label { display: block; font-weight: 600; margin-bottom: var(--space-1); }
.panel input[type=email], .panel input[type=text], .panel input[type=password] {
  width: 100%; font: inherit; padding: 0.65rem 0.75rem;
  border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink);
}
.panel input:focus-visible { border-color: var(--club); outline-offset: 0; }
.panel button, .panel input[type=submit] {
  background: var(--club); color: var(--on-club); border: 0; border-radius: var(--radius);
  padding: 0.7rem 1.2rem; font: 600 var(--step-0) var(--font-body); cursor: pointer;
}
.panel ul.errorlist, .errorlist { color: var(--tin); padding-left: 1.1rem; }

.messages { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.messages li { border-left: 4px solid var(--ball); background: var(--paper); padding: var(--space-2) var(--space-3); }
.messages li.error { border-left-color: var(--tin); }

footer.site {
  max-width: var(--page); margin: 0 auto; padding: var(--space-4);
  color: var(--muted); font-size: var(--step--1); border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
}
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--ink); }

@media (max-width: 36rem) {
  .wall__inner { padding: var(--space-3); }
  main { padding: var(--space-4) var(--space-3) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---- Manage screens: quiet, dense, readable ---- */
.muted { color: var(--muted); }

.subnav { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--rule); margin: calc(-1 * var(--space-3)) 0 var(--space-5); overflow-x: auto; }
.subnav a { padding: var(--space-2) 0; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--club); }

.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.page-head .title { margin: 0; }
.page-head--small { margin: var(--space-5) 0 var(--space-3); }
.page-head--small h2 { margin: 0; }
.page-head--small span { display: flex; gap: var(--space-3); align-items: baseline; }

.data { width: 100%; border-collapse: collapse; margin: 0 0 var(--space-4); background: var(--paper); }
.data th, .data td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data th { font-size: var(--step--1); color: var(--muted); font-weight: 600; background: var(--wall); }
.data .num { text-align: right; }
.data tr.inactive td { color: var(--muted); }
@media (max-width: 40rem) {
  .data { display: block; overflow-x: auto; }
}

.status { display: inline-block; font-size: var(--step--1); font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--wall); border: 1px solid var(--rule); }
.status--active, .status--new { border-color: var(--club-ink); color: var(--club-ink); }
.status--finished, .status--existing { color: var(--muted); }
.status--problem { border-color: var(--tin); color: var(--tin); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-3) var(--space-4); margin: 0 0 var(--space-4); }
.facts div { border-top: 1px solid var(--rule); padding-top: var(--space-2); }
.facts dt { font-size: var(--step--1); color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Teams: numbered like the draw sheet, the team number in scoreboard type */
.teams { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--space-4) var(--space-5); }
.team { border-top: 3px solid var(--ink); padding-top: var(--space-2); }
.team__head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-2); }
.team__no { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); line-height: 0.9; color: var(--club-ink); min-width: 1.4ch; }
.team__name { font-weight: 600; color: var(--ink); }
.lineup { list-style: none; margin: 0; padding: 0; }
.lineup li { display: flex; gap: var(--space-2); padding: 0.2rem 0; border-bottom: 1px dotted var(--rule); }
.lineup__pos { width: 1.5ch; color: var(--muted); font-weight: 600; }
.lineup li.reserve { color: var(--muted); }
.warning { font-size: var(--step--1); border-left: 3px solid var(--ball); padding-left: var(--space-2); margin: var(--space-2) 0 0; }

/* Forms */
.form { max-width: 36rem; }
.form--wide { max-width: none; }
.field { margin: 0 0 var(--space-3); }
.field label { display: block; font-weight: 600; margin-bottom: var(--space-1); }
.field--check { display: flex; align-items: center; gap: var(--space-2); }
.field--check label { margin: 0; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .search input, .members select, .members input[type=number] {
  width: 100%; font: inherit; padding: 0.55rem 0.7rem; border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink);
}
.members input[type=number] { max-width: 6rem; }
.field input:focus-visible, .field select:focus-visible, .search input:focus-visible { border-color: var(--club); outline-offset: 0; }
.field--error input, .field--error select { border-color: var(--tin); }
.help { font-size: var(--step--1); color: var(--muted); margin: var(--space-1) 0 0; }
.actions { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-4); }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-3); max-width: 36rem; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0 var(--space-3); margin: var(--space-3) 0; }
details { margin: 0 0 var(--space-4); }
details summary { cursor: pointer; font-weight: 600; color: var(--club-ink); }
.options { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-3); margin: 0 0 var(--space-3); background: var(--paper); }
.options legend { font-weight: 600; padding: 0 var(--space-1); }
.search { max-width: 24rem; margin: 0 0 var(--space-3); }
.search label { display: block; font-weight: 600; margin-bottom: var(--space-1); }
.club-list__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; }

/* "?" help */
.label-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.label-row label { margin: 0; }
.help-btn {
  inline-size: 1.4rem; block-size: 1.4rem; border-radius: 50%; border: 2px solid var(--club-ink);
  background: var(--paper); color: var(--club-ink); font: 700 0.8rem/1 var(--font-body); cursor: pointer; padding: 0;
}
.help-btn:hover { background: var(--club-ink); color: var(--paper); }
.help-pop {
  max-width: min(26rem, 90vw); margin: auto; padding: var(--space-4); border: 0; border-top: var(--tin-line) solid var(--ball);
  border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 12px 40px rgb(30 22 48 / 0.25);
}
.help-pop::backdrop { background: rgb(30 22 48 / 0.35); }
.help-pop p { margin: 0 0 var(--space-3); }
.help-close { font: 600 var(--step--1) var(--font-body); background: var(--club); color: var(--on-club); border: 0; border-radius: var(--radius); padding: 0.45rem 0.9rem; cursor: pointer; }
.form-section { border-top: 1px solid var(--rule); padding-top: var(--space-4); }
.field textarea { width: 100%; font: inherit; padding: 0.55rem 0.7rem; border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink); }

/* Fixtures */
.crumb { margin: 0 0 var(--space-2); font-size: var(--step--1); }
.head-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--space-5); margin-bottom: var(--space-5); }
.setup-grid h2 { margin-top: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.plain-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); border-top: 1px solid var(--rule); }
.plain-list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.link-button { background: none; border: 0; padding: 0; color: var(--club-ink); text-decoration: underline; cursor: pointer; font: inherit; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.inline-form .field { margin: 0; flex: 1 1 10rem; }
.stack { border-top: 1px solid var(--rule); padding: var(--space-3) 0; }
.stack p { margin-top: 0; }
.rounds { list-style: none; padding: 0; margin: 0; }
.round h3 { font-weight: 600; margin: var(--space-4) 0 var(--space-2); display: flex; align-items: baseline; gap: var(--space-2); }
.round__no { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); color: var(--club-ink); min-width: 2ch; }
.gap { margin: var(--space-4) 0; padding: var(--space-2) var(--space-3); border-left: 4px solid var(--tin); background: var(--paper); font-weight: 600; }
.fixtures-table td:first-child { white-space: nowrap; width: 1%; }
.fx-no { font-weight: 700; color: var(--muted); }

/* Scoring formats */
.format-list { list-style: none; padding: 0; margin: 0; }
.format-list li { border-top: 3px solid var(--ink); padding: var(--space-3) 0 var(--space-4); }
.format-list__head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.format-list__name { font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.format-list p { margin: var(--space-1) 0; }
.format-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-2) 0; }
.format-facts dt { font-size: var(--step--1); color: var(--muted); }
.format-facts dd { margin: 0; }
.format-list__foot { font-size: var(--step--1); color: var(--muted); display: flex; gap: var(--space-3); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 48rem; }
.field-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 56rem; align-items: end; }
.field--span2 { grid-column: span 2; }
@media (max-width: 40rem) { .field-row--3, .field-row--4, .field-row { grid-template-columns: 1fr; } .field--span2 { grid-column: auto; } }
.align-end { margin-top: 1.7rem; }
.radios ul, .radios div { list-style: none; padding: 0; margin: 0; }
.radios label { font-weight: 400; display: flex; gap: var(--space-2); align-items: center; }
fieldset.field { border: 0; padding: 0; }
.pp-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-3); }
.pp-cell { display: grid; gap: var(--space-1); width: 5.5rem; }
.pp-cell label { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); line-height: 1; }
.pp-cell--win label { color: var(--club-ink); }
.pp-cell input { width: 100%; font: inherit; padding: 0.45rem 0.5rem; border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); text-align: center; }
.fill { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-3); }
.h-help { display: inline-flex; vertical-align: middle; }
.form-section { display: flex; align-items: center; gap: var(--space-2); }

.title--sm { font-size: clamp(var(--step-2), 5vw, var(--step-3)); }
.radios > div { display: grid; gap: var(--space-2); }
.radios input[type=radio] { width: auto; margin: 0; accent-color: var(--club-ink); }
.hc-table input { width: 5.5rem; font: inherit; padding: 0.4rem 0.5rem; border: 2px solid var(--rule); border-radius: var(--radius); text-align: right; background: var(--paper); }
.row-error td { background: color-mix(in srgb, var(--tin) 6%, var(--paper)); }
.error-text { color: var(--tin); }
.calc-result { margin-top: var(--space-3); }
.button--quiet:hover, .button--quiet:focus-visible { background: color-mix(in srgb, var(--club-ink) 10%, transparent); color: var(--club-ink); }

/* Results */
.result-banner { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: baseline; background: var(--paper); border-left: 6px solid var(--club); padding: var(--space-3) var(--space-4); }
.result-banner strong { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); line-height: 1; margin-left: var(--space-2); color: var(--club-ink); }
.result-type { max-width: 30rem; }
.rubber { border: 0; border-top: 3px solid var(--ink); padding: var(--space-3) 0 var(--space-2); margin: 0 0 var(--space-3); }
.rubber--error { border-top-color: var(--tin); }
.rubber legend { font-weight: 700; display: flex; align-items: baseline; gap: var(--space-2); padding: 0; }
.rubber__no { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); color: var(--club-ink); }
.rubber__players { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 var(--space-3); }
.games { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.game { display: flex; align-items: center; gap: var(--space-1); }
.game__no { font-weight: 700; color: var(--muted); min-width: 2ch; }
.score-input { width: 3.6rem; font: 600 var(--step-1) var(--font-body); text-align: center; padding: 0.4rem 0.2rem; border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.score-input:focus-visible { border-color: var(--club); outline-offset: 0; }
.ladder .pos { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--club-ink); }
.ladder .total { font-weight: 700; }
.line-head { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); color: var(--club-ink); margin: var(--space-4) 0 var(--space-2); }

/* Public pages */
.table-scroll { overflow-x: auto; margin-bottom: var(--space-4); }
.table-scroll .data { margin-bottom: 0; }
@media (max-width: 40rem) { .opt { display: none; } }
.ladder td a { color: var(--ink); text-decoration-color: var(--rule); }
.ladder td a:hover { color: var(--club-ink); text-decoration-color: currentColor; }
.next-up { background: var(--paper); border-top: var(--tin-line) solid var(--ball); padding: var(--space-3) var(--space-4); margin: 0 0 var(--space-4); }
.next-up h2 { margin-top: 0; }
.next-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
.next-list li { padding: var(--space-1) 0; border-bottom: 1px dotted var(--rule); }
.fixture-cards { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
.fixture-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.fc-head { font-size: var(--step--1); }
.fc-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-3); align-items: center; font-weight: 600; }
.fc-teams a { color: var(--ink); }
.fc-right { text-align: right; }
.fc-win { color: var(--club-ink) !important; }
.fc-us { color: var(--club-ink); }
.fc-score { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); white-space: nowrap; }
.fixture-card details { margin: var(--space-2) 0 0; }
.fixture-card summary { font-size: var(--step--1); }
.rubber-list { list-style: none; padding: 0; margin: var(--space-2) 0 0; }
.rubber-list li { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: var(--space-2); align-items: baseline; padding: var(--space-1) 0; border-top: 1px dotted var(--rule); font-size: var(--step--1); }
.rl-pos { font-weight: 700; color: var(--muted); }
.rl-right { text-align: right; }
.rl-win { font-weight: 700; }
.rl-scores { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; font-variant-numeric: tabular-nums; }
.g-home { font-weight: 600; }
.print-link { font-size: var(--step--1); font-weight: 400; margin-left: auto; }
.team-title { display: flex; align-items: baseline; gap: var(--space-2); }
/* Run sheet */
.rs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); }
.rs-match { break-inside: avoid; margin: var(--space-4) 0; }
.rs-match h2 { font-size: var(--step-1); margin: 0 0 var(--space-2); }
.rs-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rs-table th, .rs-table td { border: 1px solid var(--ink); padding: 0.45rem; text-align: left; }
.rs-g, .rs-box { width: 3.2rem; text-align: center; }
.rs-pos { width: 2.5rem; text-align: center; font-weight: 700; }
@media print {
  .wall, .subnav, footer.site, .no-print, .skip-link { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .rs-table th, .rs-table td { border-color: #000; }
}

/* Scorer match list */
.score-fixtures { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.score-fixture h3 { margin: 0 0 var(--space-2); font-size: var(--step-0); }
.score-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.score-line { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--paper); border: 2px solid var(--rule); color: var(--ink); text-decoration: none; min-height: 3.4rem; }
.score-line:hover { border-color: var(--club-ink); }
.sl-pos { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); color: var(--club-ink); }
.sl-status { font-weight: 700; font-size: var(--step--1); }
.score-line--todo .sl-status { color: var(--club-ink); }
.score-line--live { border-color: var(--ball); }
.score-line--live .sl-status { color: var(--ink); background: var(--ball); padding: 0.1rem 0.5rem; border-radius: 999px; }
.score-line--done { background: var(--wall); }
.score-line--done .sl-status { color: var(--muted); font-weight: 600; }
.code-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: var(--space-3) 0; }
.code-actions form { margin: 0; }
.panel .code-actions button { background: none; color: var(--club-ink); padding: 0; text-decoration: underline; font-weight: 400; }
.control-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.control-time { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); }
.control .inline-form { align-items: flex-end; }
.control .minutes { width: 5rem; }
.row-running td { background: color-mix(in srgb, var(--ball) 12%, var(--paper)); }
.control-cd { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); }
.time-group { margin: 0 0 var(--space-4); padding-left: var(--space-3); border-left: 4px solid var(--rule); }
.time-group--now { border-left-color: var(--ball); }
.time-head { display: flex; align-items: baseline; gap: var(--space-2); margin: var(--space-2) 0; }
.time-head__t { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); line-height: 1; }
.tag-chip { background: var(--ball); color: var(--ink); font-weight: 800; font-size: var(--step--1); padding: 0.1rem 0.6rem; border-radius: 999px; }
.tag-chip--next { background: var(--paper); border: 2px solid var(--ink); }
.starts-in { font-weight: 700; color: var(--club-ink); }
.score-fixture h4 { margin: 0 0 var(--space-2); }
.score-comps { margin-top: 0; }
.score-comp-name { margin: 0 0 var(--space-3); font-size: var(--step-1); }
.score-dates { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-4); }
.score-dates select { font-size: var(--step-0); font-weight: 700; padding: 0.55rem 0.7rem; min-height: 2.9rem; border-radius: var(--radius); border: 2px solid var(--rule); background: var(--paper); color: var(--ink); max-width: 100%; }
.score-dates__step { min-width: 2.9rem; min-height: 2.9rem; display: inline-grid; place-items: center; font-size: var(--step-1); padding: 0; }
.notice { background: var(--wall); border-left: 4px solid var(--ball); padding: var(--space-2) var(--space-3); border-radius: var(--radius); margin: 0 0 var(--space-4); }
.score-done { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 2px solid var(--rule); }
.score-done__h { margin: 0; font-size: var(--step-1); }
.score-done__note { margin: var(--space-1) 0 var(--space-3); font-size: var(--step--1); }
.score-done .score-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); row-gap: 0.2rem; }
.score-done .sl-names { flex: 1 1 11rem; }
.score-done .sl-status { margin-left: auto; white-space: nowrap; }
.sl-fixture { display: block; font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.steps { max-width: var(--measure); padding-left: 1.2rem; display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }

/* Reports */
.report { margin-bottom: var(--space-5); }
.rep th, .rep td { padding: 0.35rem 0.5rem; }
.rep .small { font-size: var(--step--1); color: var(--muted); }
.nowrap { white-space: nowrap; }
.rep tfoot th { text-align: left; font-weight: 600; }
.rep-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--space-3); }
.rep-members { margin: var(--space-1) 0 0; padding-left: 1.4rem; }
.print-bar { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.print-bar select { font: inherit; padding: 0.4rem 0.6rem; border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.print-only { display: none; }

@media print {
  .print-only { display: block; }
  .no-print, .crumb, .title, .warning, .subnav { display: none !important; }
  body { background: #fff; }
  main { padding: 0 !important; max-width: none !important; }
  .report[hidden] { display: none !important; }
}

/* Reports laid out for paper. The page script adds .print-layout while printing, sizes each
   report to the sheet (A3 or A4 landscape) and scales it to fill exactly one page. */
body.print-layout .print-only { display: block; }
body.print-layout .table-scroll { overflow: visible; }
body.print-layout .report { margin: 0; break-inside: avoid; }
body.print-layout .report + .report { break-before: page; }
body.print-layout .report-head { font-size: 10pt; color: #444; margin: 0 0 3mm; display: flex; justify-content: space-between; gap: 6mm; }
body.print-layout .rep { width: 100%; font-size: 12pt; border-collapse: collapse; }
body.print-layout .rep th, body.print-layout .rep td { padding: 1.2mm 2.6mm; border-bottom: 0.3mm solid #bbb; line-height: 1.2; }
body.print-layout .rep thead th { white-space: nowrap; font-size: 10.5pt; background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body.print-layout .rep tbody tr:nth-child(even) td { background: #f6f6f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body.print-layout .rep .total { font-weight: 700; }
body.print-layout .rep a { color: inherit; text-decoration: none; }
body.print-layout .report--teams .rep { font-size: 15pt; }
body.print-layout .report--teams .rep th, body.print-layout .report--teams .rep td { padding: 2.2mm 3mm; }
body.print-layout .report--teams .rep tfoot td, body.print-layout .report--teams .rep tfoot th { font-size: 11pt; padding: 1.3mm 3mm; }
body.print-layout .report h2 { font-size: 18pt; margin: 0 0 3mm; }
body.print-layout .report h3 { font-size: 14pt; margin: 3mm 0 1.5mm; }
body.print-layout .rep-line + .rep-line { margin-top: 3mm; }
body.print-layout .rep-teams { grid-template-columns: repeat(4, 1fr); font-size: 13pt; }
body.print-layout .presentations { grid-template-columns: repeat(3, 1fr); font-size: 13pt; }
}
/* Finals */
.finals-format { margin-bottom: var(--space-2); }
.seeds { list-style: none; padding: 0; display: grid; gap: var(--space-1); margin: 0 0 var(--space-4); }
.seeds li { display: flex; gap: var(--space-2); align-items: baseline; font-weight: 600; }
.seeds .team__no { font-size: var(--step-2); }
.finals-week { border-top: 3px solid var(--ink); padding-top: var(--space-2); margin-bottom: var(--space-4); }
.finals-week--done { border-top-color: var(--club-ink); }
.finals-matches { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.finals-match { display: grid; grid-template-columns: 11rem 1fr auto; gap: var(--space-3); align-items: baseline; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.finals-stage { font-weight: 700; color: var(--club-ink); }
.finals-teams { font-weight: 600; }
.finals-result { display: flex; gap: var(--space-3); align-items: baseline; font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); }
.finals-result a { font-family: var(--font-body); font-weight: 400; font-size: var(--step-0); }
.champion { font-size: var(--step-2); background: var(--paper); border-left: 6px solid var(--ball); padding: var(--space-3); }
@media (max-width: 40rem) { .finals-match { grid-template-columns: 1fr; } }
.fc-stage { color: var(--club-ink); }
.round__finals { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--ink); background: var(--ball); padding: 0 0.5rem; border-radius: var(--radius); }

/* Finals layout chart */
.finals-weeks { display: grid; gap: var(--space-2); margin: var(--space-3) 0 var(--space-4); }
.finals-weekbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; background: var(--paper); border: 1px solid var(--rule); border-left: 5px solid var(--rule); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.finals-weekbar--done { border-left-color: var(--club-ink); }
.finals-weekbar form { margin: 0; }
.bracket { margin: var(--space-4) 0 var(--space-5); }
.bracket__title { font-size: var(--step-2); margin: 0 0 var(--space-2); }
.bracket__grid { position: relative; display: grid; grid-template-columns: repeat(var(--weeks), minmax(11.5rem, 1fr)) minmax(9rem, 0.8fr); gap: 0 2.5rem; overflow-x: auto; padding: 0 var(--space-1) var(--space-2) 0; }
.bracket__lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.bracket__line { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.bracket__line--loser { stroke: var(--tin); stroke-dasharray: 7 5; }
.bracket__col { display: flex; flex-direction: column; }
.bracket__week { font-weight: 800; margin: 0 0 var(--space-2); min-height: 2.6em; }
.bracket__matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: var(--space-4); }
.bm { position: relative; z-index: 1; background: var(--paper); border: 2px solid var(--rule); border-radius: var(--radius); padding: var(--space-2); }
.bm--done { border-color: var(--club-ink); }
.bm--bye { opacity: .6; border-style: dashed; }
.bm__label { margin: 0 0 var(--space-1); font-size: var(--step--1); font-weight: 700; color: var(--club-ink); }
.bm__team { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0.3rem 0.4rem; border-radius: 4px; font-weight: 600; }
.bm__team + .bm__team { border-top: 1px solid var(--rule); }
.bm__team--won { background: color-mix(in srgb, var(--ball) 28%, var(--paper)); font-weight: 800; }
.bm__team--tbc { color: var(--muted); font-weight: 400; font-style: italic; }
.bm__pts { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); line-height: 1; }
.bm__link { display: inline-block; margin-top: var(--space-1); font-size: var(--step--1); }
.bm--champ { text-align: center; padding: var(--space-3); border-width: 3px; }
.bm--champ.bm--done { border-color: var(--ball); background: color-mix(in srgb, var(--ball) 18%, var(--paper)); }
.bm__champ { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); }
.legend { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.legend__solid, .legend__dashed { display: inline-block; width: 2.5rem; height: 0; border-top: 3px solid var(--ink); }
.legend__dashed { border-top: 3px dashed var(--tin); margin-left: var(--space-3); }
@media print {
  @page { size: A3 landscape; margin: 12mm; }
  .bracket { break-inside: avoid; }
  .bracket__grid { overflow: visible; }
  .bm__link { display: none; }
}
.paste-ratings { margin-bottom: var(--space-4); }
.paste-ratings textarea { width: 100%; font: inherit; padding: 0.5rem; border: 2px solid var(--rule); border-radius: var(--radius); }
/* Archive / delete */
.comp-admin { margin-top: var(--space-5); border-top: 3px solid var(--rule); padding-top: var(--space-3); }
.comp-admin__row { display: grid; grid-template-columns: 16rem 1fr; gap: var(--space-3); align-items: center; margin-bottom: var(--space-3); }
.comp-admin__row form { margin: 0; }
.comp-admin__row .help { margin: 0; }
@media (max-width: 40rem) { .comp-admin__row { grid-template-columns: 1fr; } }
.button--danger { background: var(--tin); border-color: var(--tin); color: #fff; }
.button--danger:hover, .button--danger:focus-visible { background: color-mix(in srgb, var(--tin) 85%, #000); color: #fff; }
.danger-box { border-left: 6px solid var(--tin); background: var(--paper); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); max-width: var(--measure); }
.danger-box ul { margin: var(--space-2) 0; }
.past { margin-top: var(--space-4); }
.past summary { font-weight: 700; cursor: pointer; }
.club-list--past { margin-top: var(--space-2); }
.comp-admin__row .button { width: 100%; justify-content: center; text-align: center; }
.who-when { margin-top: var(--space-4); }
.who-when summary { font-weight: 700; cursor: pointer; }
.live-links { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.presentations { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--space-4); }
.presentation h3 { margin-top: 0; }
.award { margin: var(--space-2) 0 0; }
.award-players { margin: 0; padding-left: 1.2rem; color: var(--muted); }


/* Competition setup */
.form--setup { max-width: 52rem; }
.setup-section { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); padding: var(--space-3) var(--space-4) var(--space-2); margin: 0 0 var(--space-4); }
.setup-section > legend { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); padding: 0 var(--space-2); }
.setup-sub { margin: var(--space-3) 0 var(--space-1); font-size: var(--step-0); }
.setup-row { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
.setup-row > .field { flex: 1 1 12rem; }
.setup-panel { border-left: 3px solid var(--rule); padding-left: var(--space-3); margin-top: var(--space-3); }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-2); }
.choice-card { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; align-items: baseline; border: 2px solid var(--rule); border-radius: var(--radius); padding: var(--space-2) var(--space-3); cursor: pointer; background: var(--paper); }
.choice-card input { grid-row: 1 / 3; }
.choice-card__title { font-weight: 800; }
.choice-card__text { color: var(--muted); font-size: var(--step--1); }
.choice-card.is-on { border-color: var(--club-ink); box-shadow: 0 0 0 1px var(--club-ink) inset; }
.time-list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: var(--space-1) 0; }
.time-chip { display: inline-flex; align-items: center; gap: 0.2rem; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.1rem 0.2rem 0.1rem 0.4rem; background: #fff; }
.time-chip input { border: 0; font: inherit; padding: 0.2rem; }
.event-days { display: grid; gap: var(--space-2); margin: var(--space-1) 0; }
.event-day { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-2); background: #fff; }
.event-day input[type=date] { font: inherit; font-weight: 700; padding: 0.3rem 0.4rem; }
.event-day .time-list { margin: 0; flex: 1 1 18rem; }
.icon-button { border: 0; background: transparent; font: inherit; font-size: 1.2rem; line-height: 1; padding: 0.2rem 0.4rem; cursor: pointer; color: var(--muted); }
.icon-button:hover { color: var(--tin); }
.button--small { padding: 0.25rem 0.7rem; font-size: var(--step--1); }
.court-picks { border-collapse: collapse; margin: var(--space-2) 0; }
.court-picks th, .court-picks td { padding: 0.35rem 0.9rem 0.35rem 0; text-align: left; }
.court-picks th { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.court-picks input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
.actions--sticky { position: sticky; bottom: 0; background: var(--bg, #f4f4f6); padding: var(--space-2) 0; border-top: 1px solid var(--rule); }
.rows { list-style: none; padding: 0; display: grid; gap: var(--space-1); max-width: 26rem; }
.rows .row { display: flex; gap: var(--space-1); align-items: center; }
.rows .row input { flex: 1; font: inherit; padding: 0.4rem 0.5rem; border: 2px solid var(--rule); border-radius: var(--radius); }
.template-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--space-3); margin: var(--space-3) 0; }
.template-card { border: 2px solid var(--rule); border-radius: var(--radius); background: var(--paper); display: flex; flex-direction: column; }
.template-card:hover, .template-card:focus-within { border-color: var(--club-ink); }
.template-card--own { border-style: dashed; }
.template-card__main { display: grid; gap: var(--space-1); padding: var(--space-3); text-decoration: none; color: inherit; flex: 1; }
.template-card__name { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); }
.template-card__text { color: var(--muted); }
.template-card__edit { padding: 0 var(--space-3) var(--space-2); font-size: var(--step--1); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Pickers inside fields: compact, not full width */
.field .time-chip input[type=time], .field .event-day input[type=date] { width: auto; border: 0; padding: 0.25rem 0.3rem; background: transparent; }
.field .event-day input[type=date] { border: 2px solid var(--rule); background: var(--paper); font-weight: 700; }
.field .time-list { display: flex; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 2px solid var(--club-ink); border-radius: var(--radius); overflow: hidden; margin-right: var(--space-3); }
.segmented button { font: inherit; font-weight: 600; border: 0; background: var(--paper); color: var(--club-ink); padding: 0.4rem 0.8rem; cursor: pointer; }
.segmented button + button { border-left: 2px solid var(--club-ink); }
.segmented button[aria-pressed="true"] { background: var(--club-ink); color: var(--paper); }
.rep-division { margin: var(--space-4) 0 var(--space-1); }
.report-head { display: none; }
body.print-layout .report-head { display: flex; }
/* On paper, three or more lines sit two side by side so the text can be bigger */
body.print-layout .rep-lines--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm 8mm; align-items: start; }
body.print-layout .rep-lines--grid .rep-line + .rep-line { margin-top: 0; }
body.print-layout .rep-lines--grid .rep th, body.print-layout .rep-lines--grid .rep td { padding: 1mm 1.4mm; }
.fit-mark { height: 0; margin: 0; padding: 0; }
body.print-layout .report + .fit-mark + .report { break-before: page; }
.lbl-short { display: none; }
body.print-layout .lbl-long { display: none; }
body.print-layout .lbl-short { display: inline; }
body.print-layout .rep-lines--grid .rep td.num, body.print-layout .rep-lines--grid .rep th.num { padding-left: 1.2mm; padding-right: 1.2mm; }
/* Colour pickers show the colour */
.field input[type=color]:not([type=checkbox]):not([type=radio]):not([type=file]) { width: 7rem; height: 2.6rem; padding: 0.2rem; cursor: pointer; }
.field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.field input[type=color]::-webkit-color-swatch { border: 0; border-radius: calc(var(--radius) - 2px); }
.field input[type=color]::-moz-color-swatch { border: 0; border-radius: calc(var(--radius) - 2px); }
/* Bulk delete on Players */
.bulk-bar { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-2); }
.check-col { width: 2.2rem; }
.check-col input { width: 1.15rem; height: 1.15rem; }
.button--danger:disabled { opacity: 0.4; cursor: not-allowed; }
/* Teams on the reports page: names line up by position */
.team-sheet { min-width: 40rem; }
.team-sheet tbody th { text-align: left; font-weight: 700; white-space: nowrap; font-size: var(--step-0); color: var(--ink); background: transparent; }
.team-sheet__no { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--club-ink); color: var(--paper); font-size: var(--step--1); margin-right: 0.3rem; }
.team-sheet td { white-space: nowrap; }
body.print-layout .no-print-layout { display: none; }
body.print-layout .rep-teams.print-only { display: grid; }

/* Score sheets: one A4 portrait page per match */
.ss-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.ss-toolbar p { margin: var(--space-1) 0; }
.ss-page { background: #fff; color: #000; width: 100%; max-width: 192mm; margin: 0 auto var(--space-5); padding: 8mm; box-shadow: 0 1px 6px rgb(0 0 0 / .15); font-size: 9.5pt; }
.ss-head { text-align: center; margin-bottom: 3mm; }
.ss-tour { margin: 0; font-weight: 700; font-size: 11pt; }
.ss-event { margin: 0.5mm 0 2mm; font-size: 12pt; font-weight: 800; }
.ss-event span { font-weight: 400; }
.ss-meta { margin: 0 auto; border-collapse: collapse; }
.ss-meta th, .ss-meta td { border: 0.3mm solid #000; padding: 0.6mm 4mm; text-align: center; }
.ss-meta th { font-size: 8pt; font-weight: 600; background: #eee; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.ss-meta td { font-weight: 700; font-size: 10.5pt; min-width: 12mm; }
.ss-match { margin-top: 3mm; break-inside: avoid; }
.ss-line { margin: 0 0 0.8mm; font-weight: 800; font-size: 9pt; }
.ss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.ss-player { margin: 0 0 1mm; display: flex; align-items: center; gap: 2mm; min-height: 5mm; }
.ss-who { flex: 1; min-width: 0; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 2mm; }
.ss-serve--l { order: 0; } .ss-serve--r { order: 2; }
.ss-player strong { font-size: 11pt; }
.ss-start { font-size: 8.5pt; color: #333; }
.ss-start { font-weight: 700; }
.ss-serve { font-size: 8pt; display: inline-flex; align-items: center; gap: 1mm; }
.ss-box { display: inline-block; width: 3.6mm; height: 3.6mm; border: 0.3mm solid #000; vertical-align: middle; }
.ss-box--wide { width: 14mm; height: 6mm; }
.ss-games { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ss-games thead th { height: 0; padding: 0; border: 0; }
.ss-games .ss-g { width: 6.5mm; font-size: 7.5pt; text-align: left; font-weight: 700; }
.ss-games .ss-pgm { width: 6.5mm; height: auto; padding-bottom: 0.5mm; font-size: 7.5pt; text-align: center; }
.ss-pt { border: 0.25mm solid #777; text-align: center; font-size: 6.5pt; color: #888; height: 6.2mm; padding: 0; }
.ss-tot { border: 0.4mm solid #000; height: 6.2mm; }
.ss-total { text-align: right; font-size: 7.5pt; font-weight: 600; padding-right: 1.5mm; }
.ss-page--teams .ss-pt, .ss-page--teams .ss-tot { height: 4.7mm; }
.ss-page--teams .ss-match { margin-top: 1.5mm; padding-top: 1mm; border-top: 0.3mm solid #999; }
.ss-page--teams .ss-player { margin-bottom: 0.5mm; }
.ss-page--teams .ss-sign { margin-top: 1.2mm; }
.ss-page--teams .ss-sign i { height: 4mm; }
.ss-page--teams .ss-rules { margin-top: 1.5mm; }
.ss-page:not(.ss-page--teams) .ss-pt, .ss-page:not(.ss-page--teams) .ss-tot { height: 9mm; font-size: 7.5pt; }
.ss-page:not(.ss-page--teams) .ss-player strong { font-size: 13pt; }
.ss-page:not(.ss-page--teams) .ss-match { margin-top: 6mm; }
.ss-teamtotal { display: flex; gap: 3mm; align-items: center; justify-content: flex-end; margin-top: 3mm; font-weight: 700; }
.ss-sign { display: flex; gap: 6mm; margin-top: 2.5mm; font-size: 8.5pt; }
.ss-sign span { flex: 1; display: flex; gap: 2mm; align-items: flex-end; }
.ss-sign i, .ss-card-result i { flex: 1; border-bottom: 0.3mm solid #000; height: 5mm; }
.ss-rules { margin: 3mm 0 0; font-size: 8pt; color: #222; text-align: center; }
.ss-card { margin-top: 6mm; padding-top: 4mm; border-top: 0.4mm dashed #000; text-align: center; position: relative; }
.ss-cut { position: absolute; top: -2.6mm; left: 50%; transform: translateX(-50%); background: #fff; padding: 0 2mm; margin: 0; font-size: 7pt; color: #555; }
.ss-card-name { margin: 2.5mm 0 0; font-size: 14pt; font-weight: 800; }
.ss-versus { margin: 1mm 0; font-size: 9pt; color: #444; }
.ss-card-result { display: flex; gap: 2mm; align-items: flex-end; max-width: 120mm; margin: 4mm auto 0; }
@media print {
  .ss-page { box-shadow: none; margin: 0; padding: 0; max-width: none; break-after: page; }
  .ss-page:last-child { break-after: auto; }
}
.ov-url { width: 100%; min-width: 18rem; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.cb-mark { font-size: 0.65em; font-weight: 700; color: var(--muted, #666); margin-left: 0.15em; }
.cb-notes { margin: 0.4rem 0 1rem; padding-left: 1.1rem; font-size: 0.92rem; color: var(--muted, #555); }
.cb-notes li { margin: 0.15rem 0; }
.countback-summary { margin: 0.5rem 0 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--club-ink); background: var(--paper); border-radius: var(--radius); font-size: 0.95rem; }
[data-countback-more][hidden] { display: none; }
.setup-row[data-countback-steps] { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.setup-row[data-countback-steps] > .field[hidden] { display: none; }

/* Countback working */
.cb-working { margin: 0 0 var(--space-4); font-size: 0.92rem; }
.cb-working summary { cursor: pointer; color: var(--club-ink); font-weight: 600; }
.cb-tie { margin: var(--space-3) 0; }
.cb-tie h4 { margin: 0 0 0.35rem; font-size: 0.98rem; }
.cb-table th[scope=row] { font-weight: 500; text-align: left; white-space: normal; min-width: 11rem; }
.cb-table td { white-space: nowrap; }
.cb-table tr.cb-decides th, .cb-table tr.cb-decides td { font-weight: 700; background: var(--paper); }
.cb-table tr.cb-place th, .cb-table tr.cb-place td { border-top: 2px solid var(--rule); font-weight: 700; }
.cb-between-head { margin: 0.5rem 0 0.15rem; font-weight: 600; }
.cb-between { margin: 0; padding-left: 1.1rem; }
.cb-key { color: var(--muted); margin: 0.5rem 0 0; }

/* --- Play On Squash: header extras --- */
.jump-form select { font: inherit; font-size: var(--step--1); padding: 0.15rem 0.35rem; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--on-club) 40%, transparent); background: transparent; color: var(--on-club); max-width: 11rem; }
.jump-form select option { color: var(--ink); background: var(--paper); }
.nav-count { display: inline-block; min-width: 1.2em; padding: 0 0.35em; border-radius: 999px; background: var(--ball); color: var(--ink);
  font-size: 0.75rem; font-weight: 700; text-align: center; }
.platform-banner { margin-bottom: var(--space-4); }
.narrow { max-width: 28rem; }

/* --- Front page --- */
.site-home > section { margin-bottom: var(--space-6); }
.hero { padding: var(--space-5) 0 var(--space-4); max-width: 44rem; }
.hero__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 9vw, var(--step-4)); line-height: 0.95;
  color: var(--club-ink); margin: 0 0 var(--space-3); letter-spacing: 0.01em; }
.hero__title::after { content: ""; display: block; width: 4.5rem; height: 6px; margin-top: var(--space-3); background: var(--tin); border-radius: 3px; }
.hero__lede { font-size: var(--step-1); line-height: 1.45; margin: 0 0 var(--space-4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.login-panel { max-width: 36rem; border-top: 4px solid var(--club); }
.login-form label { font-weight: 600; display: block; margin-bottom: var(--space-1); }
.addr-input { display: flex; align-items: stretch; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.addr-input:focus-within { outline: 3px solid var(--ball); outline-offset: 1px; }
.addr-input input { border: 0; flex: 1; min-width: 0; padding: 0.6rem 0.75rem; font: inherit; font-size: var(--step-1); }
.addr-input input:focus { outline: none; }
.addr-input span { display: flex; align-items: center; padding: 0 0.75rem; background: var(--wall); color: var(--muted); white-space: nowrap; }
.login-form__buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 var(--space-2); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3) var(--space-4); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.feature-list li { padding-left: var(--space-3); border-left: 3px solid var(--ball); line-height: 1.45; }
.feature-list strong { display: block; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.legal { max-width: 44rem; line-height: 1.55; }
.legal h2 { margin-top: var(--space-5); }

/* --- Platform admin --- */
.hq-stats { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hq-stats li { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.hq-stats strong { font-family: var(--font-display); font-size: var(--step-1); margin-right: 0.2em; }
.hq-stats__warn { border-color: var(--tin) !important; }
.hq-stats__new { border-color: var(--ball) !important; }
.hq-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.hq-filter input[type=search] { flex: 1; min-width: 12rem; }
.hq-filter .segmented a { padding: 0.35rem 0.7rem; text-decoration: none; color: var(--ink); }
.hq-filter .segmented a[aria-current] { background: var(--club); color: var(--on-club); }
.hq-table th[scope=row] { font-weight: 600; }
.hq-status, .pay { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: var(--step--1); font-weight: 600; white-space: nowrap; }
.hq-status--active { background: #e3f3e6; color: #1d5b2a; }
.hq-status--deactivated { background: #fdeccc; color: #6b4300; }
.hq-status--archived { background: #e8e5ee; color: var(--muted); }
.pay--ok { background: #e3f3e6; color: #1d5b2a; }
.pay--soon { background: #fdeccc; color: #6b4300; }
.pay--due { background: #fdeccc; color: #6b4300; }
.pay--overdue { background: #f8dcda; color: #8c1d16; }
.home-box { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-4); }
.join-panel { max-width: 48rem; border-top: 4px solid var(--ball); }
.hq-filter .segmented a + a { border-left: 2px solid var(--club-ink); }
.jump-form { display: flex; align-items: center; }
.my-clubs { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hq-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 var(--space-3); }
.hq-detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr); gap: var(--space-5); align-items: start; }
@media (max-width: 52rem) { .hq-detail { grid-template-columns: 1fr; } }
.hq-detail .form-section { margin-bottom: var(--space-3); }
.hq-detail__side h2 { margin-top: 0; }
.hq-detail__side h2 + * { margin-top: 0; }
.hq-inline { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-2) 0 var(--space-4); }
.hq-inline label { flex: 1 1 100%; }
.hq-inline input:not([type=hidden]) { flex: 1 1 12rem; min-width: 0; padding: 0.45rem 0.6rem; font: inherit; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.hq-filter input[type=search] { padding: 0.45rem 0.6rem; font: inherit; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.login-panel h2, .join-panel h2 { margin-top: 0; }
.join-panel .hq-row { max-width: none; }
.hq-detail .form-section, .hq-detail .form { max-width: none; width: 100%; box-sizing: border-box; }
/* --- Log in and the club picker --- */
.login-page { display: flex; justify-content: center; padding: var(--space-5) 0; }
.login-page .login-panel { width: 100%; max-width: 26rem; }
.title--small { font-size: var(--step-2); margin: 0 0 var(--space-3); }
.login-form .field input { width: 100%; box-sizing: border-box; }
.login-form__buttons { align-items: center; }
.picker-backdrop { display: flex; justify-content: center; align-items: flex-start; padding: var(--space-6) 0; min-height: 60vh;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--club) 10%, transparent), transparent 70%); }
.picker { width: 100%; max-width: 30rem; background: var(--paper); border-radius: 14px; padding: var(--space-4);
  box-shadow: 0 18px 50px rgba(25, 12, 50, 0.22), 0 2px 6px rgba(25, 12, 50, 0.12); border-top: 4px solid var(--club); }
.picker h1 { margin: 0; font-size: var(--step-2); }
.picker > .muted { margin: 0.2rem 0 var(--space-3); }
.picker__list { list-style: none; padding: 0; margin: 0 0 var(--space-3); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.picker__list li + li { border-top: 1px solid var(--rule); }
.picker__list a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); color: var(--ink); text-decoration: none; }
.picker__list a:hover, .picker__list a:focus-visible { background: var(--wall); }
.picker__badge { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 8px; display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.02em; }
.picker__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.picker__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__text span { color: var(--muted); font-size: var(--step--1); }
.picker__go { font-size: 1.6rem; color: var(--muted); }
.picker__out { text-align: right; }
/* --- Members and roles --- */
.member-list li { display: block; }
.member-list__who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.member-list__who > span:first-child { flex: 1 1 100%; }
.member-list__more summary { cursor: pointer; color: var(--club-ink); font-size: var(--step--1); margin-top: 0.25rem; }
.member-list__actions { display: flex; gap: var(--space-4); }
.status--key { background: #fff3cf; }
.roles-table th[scope=row] { font-weight: 600; min-width: 14rem; text-align: left; }
.roles-table th[scope=row] .muted { font-weight: 400; font-size: var(--step--1); }
.roles-table__role { text-align: center; min-width: 7rem; }
.roles-table__cell { text-align: center; }
.roles-table__cell input { width: 1.2rem; height: 1.2rem; }
.role-form { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.perm-picks { border: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.perm-pick { display: flex; gap: 0.5rem; align-items: flex-start; }
/* --- Logo --- */
.wall__brand--logo { display: inline-flex; align-items: center; gap: 0.6rem; }
.wall__brand--logo img { width: 40px; height: 40px; display: block; }
.hero { position: relative; }
.hero__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.hero__head .hero__title { margin: 0; }
.hero__logo { flex: none; width: clamp(60px, 14vw, 108px); height: auto; filter: drop-shadow(0 6px 14px rgba(26, 42, 77, 0.18)); }
.login-logo { display: block; margin: 0 0 var(--space-2); }
.footer-brand { display: inline-flex; align-items: center; gap: 0.4rem; }
.wall__inner { align-items: center; }
.wall__nav { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.wall__nav a, .wall__nav button { white-space: nowrap; }
.wall__brand--logo span { white-space: nowrap; }
@media (max-width: 30rem) {
  .wall__brand--logo { font-size: var(--step-1); gap: 0.45rem; }
  .wall__brand--logo img { width: 32px; height: 32px; }
  .wall__nav { gap: var(--space-2) var(--space-3); }
}
/* --- Product page (/product/) --- */
.pr { --pr-navy: #1a2a4d; --pr-blue: #2f6fd6; --pr-red: #c8323c; --pr-orange: #e07b17; --pr-green: #2e8f43;
  display: grid; gap: var(--space-6); }
.pr-kicker { margin: 0 0 var(--space-2); font-size: var(--step--1); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tin); }
.pr-h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 4.5vw, var(--step-3)); line-height: 1; margin: 0 0 var(--space-3); text-wrap: balance; letter-spacing: 0.01em; }
.pr-shot { display: block; max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 1px 2px rgba(26, 42, 77, 0.12), 0 14px 34px rgba(26, 42, 77, 0.16); background: var(--paper); }
.pr-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pr-btn { font-size: var(--step-0); padding: 0.7rem 1.2rem; }

.pr-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-5); align-items: center; }
.pr-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 0.92; margin: 0 0 var(--space-3); color: var(--pr-navy); text-wrap: balance; letter-spacing: 0.01em; }
.pr-lede { font-size: var(--step-1); line-height: 1.45; margin: 0 0 var(--space-4); max-width: 34rem; }
.pr-runs { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pr-runs li { padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); font-size: var(--step--1); font-weight: 600; }
.pr-hero__art { position: relative; padding: 0 0 12% 0; min-width: 0; }
.pr-shot--board { width: 100%; }
.pr-shot--phone { position: absolute; right: -2%; bottom: 0; width: 27%; border: 5px solid #11182b; border-radius: 22px; }
.pr-shot--strip { position: absolute; left: 4%; bottom: 4%; width: 66%; background: transparent; box-shadow: none; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }

.pr-kinds__grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); align-items: start; }
.pr-kind { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: var(--space-4); border-top: 5px solid var(--k); }
.pr-kind--blue { --k: var(--pr-blue); } .pr-kind--orange { --k: var(--pr-orange); } .pr-kind--green { --k: var(--pr-green); }
.pr-kind h3 { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); margin: 0 0 var(--space-1); }
.pr-kind p { margin: 0 0 var(--space-3); color: var(--muted); }
.pr-kind ul, .pr-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.pr-kind li, .pr-list li { padding-left: 1.4rem; position: relative; line-height: 1.4; }
.pr-kind li::before, .pr-list li::before { content: ""; position: absolute; left: 0.15rem; top: 0.5em; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--k, var(--tin)); }

.pr-feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-5); align-items: center; }
.pr-feature--flip .pr-feature__art { order: 2; }
.pr-feature__text p { font-size: var(--step-0); line-height: 1.55; max-width: 34rem; }
.pr-feature__text .pr-list { margin-top: var(--space-3); }
.pr-feature__art { position: relative; min-width: 0; }
.pr-feature__art--phones { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); max-width: 30rem; justify-self: center; }
.pr-feature__art--phones .pr-shot { border: 5px solid #11182b; border-radius: 22px; }
.pr-feature__art--phones .pr-shot:first-child { margin-top: 12%; }
.pr-shot--float { position: absolute; left: -3%; bottom: -9%; width: 72%; background: transparent; box-shadow: none; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }
.pr-feature__art--pair { padding-bottom: 6%; }
.pr-shot--small { position: absolute; right: -3%; bottom: -6%; width: 30%; border: 5px solid #11182b; border-radius: 22px; }

.pr-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.pr-steps li { counter-increment: s; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: var(--space-4) var(--space-3) var(--space-3); display: grid; gap: 0.3rem; position: relative; }
.pr-steps li::before { content: counter(s); font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--pr-navy); }
.pr-steps strong { font-size: var(--step-1); }
.pr-steps span { color: var(--muted); }

.pr-faq { max-width: 48rem; }
.pr-faq details { border-top: 1px solid var(--rule); padding: var(--space-3) 0; }
.pr-faq details:last-child { border-bottom: 1px solid var(--rule); }
.pr-faq summary { cursor: pointer; font-weight: 700; font-size: var(--step-1); list-style-position: outside; }
.pr-faq details p { margin: var(--space-2) 0 0; max-width: 40rem; }

.pr-cta { background: var(--pr-navy); color: #eef1f8; border-radius: 14px; padding: var(--space-5) var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between;
  background-image: linear-gradient(90deg, var(--pr-blue) 0 25%, var(--pr-red) 25% 50%, var(--pr-orange) 50% 75%, var(--pr-green) 75%); background-size: 100% 6px; background-repeat: no-repeat; background-position: bottom; }
.pr-cta h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); line-height: 1; margin: 0 0 var(--space-2); }
.pr-cta p { margin: 0; opacity: 0.9; }
.pr-btn--light { background: #fff; color: var(--pr-navy); border-color: #fff; }
.pr-btn--outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }

@media (max-width: 52rem) {
  .pr { gap: var(--space-5); }
  .pr-hero, .pr-feature { grid-template-columns: 1fr; }
  .pr-feature--flip .pr-feature__art { order: 0; }
  .pr-hero__art { padding-bottom: 16%; }
}

/* Header: product link and a Club Log In button */
.wall__nav .wall__login { background: #fff; color: var(--club); text-decoration: none; padding: 0.35rem 0.8rem; border-radius: var(--radius); font-weight: 700; }
.wall__nav .wall__login:hover { background: var(--ball); color: var(--ink); }
.home-more { margin: var(--space-3) 0 0; }
/* --- Demo clubs --- */
.demo-note { background: #fff6d8; border: 1px solid #ecd27a; border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-4); line-height: 1.5; }
.demo-note code, .try-demo code { background: rgba(26, 42, 77, 0.08); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.95em; white-space: nowrap; }
.try-demo { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: var(--space-4); border-top: 5px solid var(--ball); }
.try-demo__head h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); line-height: 1; margin: 0 0 var(--space-2); }
.try-demo__head p { margin: 0 0 var(--space-4); max-width: 46rem; }
.try-demo__clubs { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); align-items: start; }
.try-demo__club { border: 1px solid var(--rule); border-radius: 10px; padding: var(--space-3); background: var(--wall); min-width: 0; }
.try-demo__club h3 { margin: 0 0 var(--space-2); font-size: var(--step-1); }
.try-demo__club dl { margin: 0 0 var(--space-3); display: grid; gap: 0.3rem; }
.try-demo__club dl div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.try-demo__club dt { color: var(--muted); }
.try-demo__club dd { margin: 0; }
.try-demo__go { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.try-demo__go form { margin: 0; }
.try-demo__club .help { margin: var(--space-2) 0 0; }
.try-demo__pw-head dt { font-weight: 700; color: var(--ink) !important; margin-top: 0.3rem; }
