/*
  Rally design system — "midnight & apricot".

  Deep midnight navy carries the brand (sidebar, primary buttons, ink);
  warm stone is the ground; one soft apricot is the accent, used for the
  moments that should catch the eye (active nav, focus ring, hero highlight,
  the ball's dots). The red "tin line" survives as a tiny eyebrow rule.
  Everything else is quiet: hairlines instead of boxes, big tabular numerals
  instead of chrome.

  Type: Bricolage Grotesque for display, headings and numerals; Instrument
  Sans for UI and body. Both loaded via Google Fonts in layout.tsx <Head>.

  Rules of thumb (see CLAUDE.md → Design system for the long version):
  - One surface level. A <section> is a panel; nothing inside a panel gets its
    own border + background unless it is a control.
  - Tinted fills carry category (event type, box, status); borders carry
    structure; shadow only appears on things that float.
  - Apricot (--lime, name kept from the first pass) is a fill or accent —
    never text on a light surface.
*/

/* Midnight & apricot */
:root {
  /* Ground & surfaces */
  --paper: #f5f3ef; /* warm stone — page ground */
  --paper-raised: #ffffff; /* panels, inputs */
  --paper-sunk: #ece9e2; /* wells, hovered rows, tracks */
  --line: #e5e2db;
  --line-soft: #eeebe5;
  --line-strong: #d2cec4;

  /* Ink */
  --ink: #101828;
  --ink-soft: #3b4658;
  --muted: #667085;
  --muted-2: #9aa3b2;

  /* Brand: midnight navy */
  --court: #0f1b33;
  --court-dark: #0a1224;
  --court-deep: #0f1b33; /* sidebar */
  --court-tint: #dde5f5;

  /* Signature apricot — fills and accents, not text on a light surface */
  --lime: #f6a66b;
  --lime-dark: #e88b45;
  --lime-tint: #fdebdc;

  /* Warm accent: the tin line */
  --ball: #d2533a;
  --ball-dark: #a9402b;
  --ball-tint: #fbe0d6;

  /* Status / category (text on tint pairs all clear 4.5:1) */
  --amber: #7a5410;
  --amber-tint: #fbe7be;
  --red: #a02f22;
  --red-tint: #f6d5cd;
  --gray-tint: #e9e7e1;
  --gray-text: #575e6c;
  --plum: #5b3a94;
  --plum-tint: #e9e1f3;
  --sky: #26469a;
  --sky-tint: #dde5f5;
  --good: #1e6b47;
  --good-tint: #d6ebdf;

  /* Pastel category fills (agenda blocks, box headers) */
  --mint: #dcebe4;
  --peach: #fbe0cc;
  --lilac: #e9e1f3;
  --butter: #fbe7be;
  --mist: #dde5f5;

  /* Chart series — validated colourblind-safe on white */
  --chart-1: #0f9d5f;
  --chart-2: var(--ball);
  --chart-3: #2f5dd0;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  /* Elevation — only for things that float */
  --shadow-pop: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 32px -8px rgba(16, 24, 40, 0.22);

  /* Type */
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 120ms;
  --t-base: 220ms;

  --sidebar-w: 272px;

  color-scheme: light;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
  font-weight: 650;
}

h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

a {
  color: var(--court);
  text-decoration: none;
  font-weight: 600;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

a:hover {
  color: var(--court-dark);
  text-decoration: underline;
}

small {
  color: var(--muted);
}

strong {
  font-weight: 650;
  color: var(--ink);
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12.5px;
  background: var(--paper-sunk);
  padding: 2px 6px;
  border-radius: 5px;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: top var(--t-fast) var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.icon {
  flex-shrink: 0;
}

/* ---------- Marketing footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 40px 28px;
}

/* ---------- Logo & brand ---------- */

.logo-ball {
  fill: var(--court);
}

.logo-dot {
  fill: var(--lime);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  min-width: 0;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand svg {
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand-club {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- App shell: sidebar + main ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  /* Pinned sideways too: if a page ever scrolls horizontally, the menu stays put instead of sliding off the left. */
  left: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 14px 14px;
  background: var(--court-deep);
  color: #a3aec4;
}

.sidebar .logo-ball {
  fill: var(--lime);
}

.sidebar .logo-dot {
  fill: var(--court-deep);
}

.sidebar .brand {
  padding: 2px 10px 22px;
  color: #fff;
}

.sidebar .brand-club {
  color: #7c89a3;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

html[data-area="club"] .side-nav[data-nav="admin"],
html[data-area="admin"] .side-nav[data-nav="club"] {
  display: none;
}

.side-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-label {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #6b7896;
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 500;
  color: #a3aec4;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.side-link .icon {
  color: #7c89a3;
  transition: color var(--t-fast) ease;
}

.side-link:hover .icon {
  color: #dbe1ee;
}

.side-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-weight: 600;
}

.side-link[aria-current="page"] .icon {
  color: var(--lime);
}

.side-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
}

.side-link-admin {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.side-link-go {
  margin-left: auto;
  color: #7c89a3;
  transition: transform var(--t-base) var(--ease);
}

.side-link-admin:hover .side-link-go {
  transform: translateX(3px);
  color: var(--lime);
}

.side-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: -6px 0 -6px;
  font-size: 13px;
  font-weight: 500;
  color: #8b97b0;
}

.side-back:hover {
  color: #fff;
  text-decoration: none;
}

.side-account {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar::after {
  content: "";
  display: block;
  flex-shrink: 0;
  height: 1px;
}

/* Account menu (sidebar footer; panel opens upwards) */

.account-menu {
  position: relative;
}

.account-menu-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.account-menu-trigger:hover,
.account-menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.account-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}

.account-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-role {
  font-size: 12px;
  font-weight: 400;
  color: #7c89a3;
  margin-top: 2px;
}

.account-menu-caret {
  color: #7c89a3;
  transition: transform var(--t-base) var(--ease);
}

.account-menu-trigger[aria-expanded="true"] .account-menu-caret {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 5px;
  display: flex;
  flex-direction: column;
  animation: pop-up var(--t-base) var(--ease);
}

.account-menu-panel[hidden] {
  display: none;
}

.account-menu-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.account-menu-panel a .icon {
  color: var(--muted);
}

.account-menu-panel a:hover {
  background: var(--paper);
  text-decoration: none;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--court);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.sidebar .avatar {
  background: var(--lime);
  color: var(--court-deep);
}

.main {
  min-width: 0;
}

/* Admin pages that lead with a bare <h1> still get the section eyebrow. */
html[data-area="admin"] .page > h1:first-child::before,
html[data-area="admin"] .page > .back-link + h1::before {
  content: "Admin";
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(var(--ball), var(--ball)) left center / 20px 2px no-repeat;
  padding-left: 30px;
}

.page > h1:first-child,
.page > .back-link + h1 {
  margin-bottom: 24px;
}

html[data-area="admin"] .side-nav[data-nav="admin"] {
  gap: 16px;
}

html[data-area="admin"] .side-nav .side-link {
  padding-top: 7px;
  padding-bottom: 7px;
}

.topbar {
  display: none;
}

.scrim {
  display: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}

.icon-btn:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

/* Signed-out / marketing top bar */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.4) blur(10px);
  background: rgba(245, 243, 239, 0.88);
}

.site-header .inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--paper-sunk);
  text-decoration: none;
}

.header-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- Page ---------- */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 48px 112px;
}

.public .page {
  max-width: 1160px;
  padding: 56px 40px 112px;
}

.page > * {
  animation: rise 0.5s var(--ease) both;
}

.page > *:nth-child(2) { animation-delay: 40ms; }
.page > *:nth-child(3) { animation-delay: 80ms; }
.page > *:nth-child(4) { animation-delay: 120ms; }
.page > *:nth-child(n + 5) { animation-delay: 160ms; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pop-up {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

@keyframes pop-down {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

/* Quiet "← Parent" link above the eyebrow: muted text, arrow nudges on hover. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -8px 0 20px -4px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.back-link svg {
  transition: transform var(--t-fast) var(--ease);
}

.back-link:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.045);
  text-decoration: none;
}

.back-link:hover svg {
  transform: translateX(-2px);
}

.public .back-link {
  margin-top: 0;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0 0 28px;
  margin-bottom: 4px;
}

.page-hero h1 {
  margin-bottom: 0;
}

.page-hero .lead {
  margin: 10px 0 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* the tin line — the one recurring mark of the identity */
.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ball);
  flex-shrink: 0;
}

.lead {
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 62ch;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(min(100%, 320px), 440px) 1fr;
  align-items: start;
  gap: 20px;
}

.two-col > section {
  margin-bottom: 0;
}

/* ---------- Sections are panels ---------- */

section {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin: 0 0 20px;
}

section h2 {
  margin-top: 0;
}

section > h2:first-child {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

section section {
  border: none;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ---------- Buttons ---------- */

button,
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  cursor: pointer;
  background: var(--court);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease,
    transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

/* `.btn:hover` (not `a.btn:hover`) so the variant rules below — .btn-ghost:hover, .btn-secondary:hover… — can
   win by coming later. With the extra element selector this one outranked them on links and turned their text white. */
button:hover,
.btn:hover {
  background: #1c2d52;
  color: #fff;
  text-decoration: none;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled {
  background: var(--gray-tint);
  color: var(--muted-2);
  cursor: not-allowed;
  transform: none;
}

button[aria-busy="true"] {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn-secondary[aria-busy="true"]::after,
.btn-ghost[aria-busy="true"]::after,
.btn-danger[aria-busy="true"]::after {
  border-color: var(--line-strong);
  border-top-color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-secondary {
  background: var(--paper-raised);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--paper-raised);
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

.btn-danger {
  background: var(--red-tint);
  color: var(--red);
}

.btn-danger:hover {
  background: #f5c9bd;
  color: var(--red);
}

.btn-accent {
  background: var(--ball);
  color: #fff;
}

.btn-accent:hover {
  background: var(--ball-dark);
  color: #fff;
}

/* A button label with a small second line, e.g. "Book" / "fee applies". */
.btn-stack {
  display: grid;
  justify-items: center;
  line-height: 1.2;
}

.btn-note {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

/* ---------- Forms ---------- */

form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  width: 100%;
  max-width: 440px;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  max-width: none;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  width: 100%;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23727a70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--court);
  flex-shrink: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(246, 166, 107, 0.5);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--court);
  outline-offset: 2px;
  box-shadow: none;
}

input[type="search"] {
  -webkit-appearance: none;
}

input[type="file"] {
  padding: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

input[type="file"]::file-selector-button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-sunk);
  border: none;
  border-radius: 7px;
  padding: 7px 12px;
  margin-right: 12px;
  cursor: pointer;
  transition: background var(--t-fast) ease;
}

input[type="file"]::file-selector-button:hover {
  background: var(--line);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

legend {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}

.score-input {
  width: 60px;
  text-align: center;
  padding: 9px 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

/* Always renders dd/mm/yyyy: the real <input type="date"> sits invisibly on
   top (clicks/typing/picker/validation), this span shows the styled text. */
.date-field {
  position: relative;
  display: block;
  width: 100%;
}

.date-field-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}

.date-field-display {
  display: block;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  pointer-events: none;
}

.date-field-display:empty::before {
  content: "dd/mm/yyyy";
  color: var(--muted-2);
}

.date-field-input:focus + .date-field-display {
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(246, 166, 107, 0.5);
}

/* quickYear DateField: the real input is inert (JS sets tabindex="-1", and
   pointer-events is killed here) — it only carries the value for form
   submission. Safari opens its native picker on any click to a real
   `<input type="date">` with no way for JS to intercept it, so the only way
   to stop that stacking on top of our own calendar is for the real input to
   never receive the click; a `<button>` (reusing .date-field-display) is
   the actual trigger instead. */
.date-field-picker .date-field-input {
  pointer-events: none;
}

/* This is a real <button> so it can take focus/click directly — it also
   matches the generic `button, button:hover` rules further up, whose
   pseudo-class specificity would otherwise beat the plain .date-field-display
   background/color, hence the explicit resets below. */
.date-field-picker .date-field-display {
  pointer-events: auto;
  cursor: pointer;
  text-align: left;
  font-weight: 400;
  width: 100%;
  justify-content: flex-start;
  white-space: normal;
}

.date-field-picker .date-field-display:hover {
  background: var(--paper-raised);
  color: var(--ink);
  border-color: var(--muted);
}

.date-field-picker .date-field-display:focus {
  background: var(--paper-raised);
  color: var(--ink);
  outline: none;
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(246, 166, 107, 0.5);
}

/* Custom calendar for a quickYear DateField — a date of birth's native
   calendar can only page a month at a time, so this one puts an editable
   year field (and a month <select>) right in its own header. Built by
   public/dateField.js; markup mirrors .account-menu-panel. */
.date-field-calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 288px;
  background: var(--paper-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 14px;
  animation: pop-down var(--t-base) var(--ease);
}

.date-field-calendar[hidden] {
  display: none;
}

.date-field-cal-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-field-cal-nav {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.date-field-cal-nav:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

.date-field-cal-month {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
}

.date-field-cal-year {
  width: 68px;
  flex-shrink: 0;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.date-field-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 12px;
}

.date-field-cal-dow {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
  padding: 4px 0;
}

.date-field-cal-day {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--ink);
  cursor: pointer;
}

.date-field-cal-day:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

.date-field-cal-day.is-muted {
  color: var(--muted-2);
}

.date-field-cal-day.is-selected {
  background: var(--court);
  color: #fff;
  font-weight: 700;
}

.date-field-cal-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1.5px var(--court);
}

/* Type-to-search replacement for a plain <select> — the <select> stays in
   the DOM (and submits the form) but is hidden once JS enhances it; without
   JS the ordinary dropdown is shown instead. See partnerSearch.js. */
.combobox {
  position: relative;
  width: 100%;
}

.combobox-input {
  display: none;
}

.combobox.is-enhanced .combobox-select {
  display: none;
}

.combobox.is-enhanced .combobox-input {
  display: block;
}

.combobox-listbox[hidden] {
  display: none;
}

.combobox-listbox {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
  display: block;
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  animation: pop-down var(--t-base) var(--ease);
}

.combobox-option {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.combobox-option.is-active {
  background: var(--court-tint);
  color: var(--court-dark);
}

/* ---------- Admin overview ---------- */

.admin-search {
  position: relative;
}

.admin-search-input {
  width: 100%;
  font-size: 15.5px;
  padding: 14px 16px 14px 46px;
  border-radius: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23727a70' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
}

/* "/" focuses the search — the hint fades once it's in use. */
.admin-search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease);
}

.admin-search-input:focus ~ .admin-search-kbd,
.admin-search-input:not(:placeholder-shown) ~ .admin-search-kbd {
  opacity: 0;
}

@media (max-width: 720px) {
  .admin-search-kbd {
    display: none;
  }
}

.admin-search-results {
  margin: 8px 0 0;
  padding: 5px;
  list-style: none;
  display: block;
  background: var(--paper-raised);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
}

.admin-search-results[hidden] {
  display: none;
}

.admin-search-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  cursor: pointer;
}

.admin-search-result:hover,
.admin-search-result.is-active {
  background: var(--court-tint);
}

.admin-search-result-title {
  font-weight: 650;
  color: var(--ink);
}

.admin-search-result-section {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.admin-search-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
  border: none;
  background: none;
}

.index-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: background var(--t-fast) ease, padding var(--t-base) var(--ease);
}

.index-row:hover {
  background: var(--paper-raised);
  padding-left: 12px;
  padding-right: 12px;
  text-decoration: none;
  color: var(--ink);
}

.index-row .icon {
  color: var(--muted);
}

.index-row:hover .icon,
.index-row:hover .index-go {
  color: var(--court);
}

.index-row strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.index-row small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 1px;
}

.index-go {
  color: var(--muted-2);
  transition: transform var(--t-base) var(--ease), color var(--t-fast) ease;
}

.index-row:hover .index-go {
  transform: translateX(3px);
}

/* Briefly highlight a section landed on via a search result's #anchor. */
section:target {
  animation: target-flash 2.2s ease;
}

@keyframes target-flash {
  from {
    box-shadow: 0 0 0 4px var(--lime);
  }
  to {
    box-shadow: 0 0 0 4px transparent;
  }
}

/* ---------- Tables ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 8px;
  font-size: 14px;
}

thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--ink);
  white-space: nowrap;
}

tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--t-fast) ease;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(15, 27, 51, 0.035);
}

td a {
  font-weight: 600;
  color: var(--ink);
}

td a:hover {
  color: var(--court);
}

td:first-child a,
td:first-child strong {
  font-weight: 650;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

/* ---------- Lists: rows, not cards ---------- */

ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

li:last-child {
  border-bottom: none;
}

li form {
  gap: 0;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px 5px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  text-transform: capitalize;
  letter-spacing: 0.005em;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-good {
  background: var(--good-tint);
  color: var(--good);
}

.badge-amber {
  background: var(--amber-tint);
  color: var(--amber);
}

.badge-red {
  background: var(--red-tint);
  color: var(--red);
}

.badge-gray {
  background: var(--gray-tint);
  color: var(--gray-text);
}

.badge-ball {
  background: var(--ball-tint);
  color: var(--ball-dark);
}

.badge-plum {
  background: var(--plum-tint);
  color: var(--plum);
}

.badge-sky {
  background: var(--sky-tint);
  color: var(--sky);
}

/* ---------- Callouts: flash / error / info ---------- */

.flash,
.error,
.info-banner {
  position: relative;
  display: block;
  padding: 13px 16px 13px 46px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.45;
  margin-bottom: 20px;
  animation: rise 0.35s var(--ease) both;
}

.flash::before,
.error::before,
.info-banner::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 14px;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--callout-icon) center / contain no-repeat;
  mask: var(--callout-icon) center / contain no-repeat;
}

.flash {
  background: var(--good-tint);
  color: var(--good);
  --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z M8 12.5l3 3 5-6'/%3E%3C/svg%3E");
}

.error {
  background: var(--red-tint);
  color: var(--red);
  --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z M12 8v5 M12 16.2h.01'/%3E%3C/svg%3E");
}

.info-banner {
  background: var(--lime-tint);
  color: var(--court-dark);
  --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z M12 11v5 M12 7.8h.01'/%3E%3C/svg%3E");
}

.info-banner a {
  color: inherit;
  text-decoration: underline;
}

/* ---------- Toasts ---------- */

.toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px 13px 16px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  background: var(--ink);
  color: #f1f4ef;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity var(--t-base) ease, transform var(--t-base) var(--ease);
  pointer-events: auto;
}

.toast-icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  color: var(--lime);
}

.toast-error .toast-icon {
  color: #ff8a6b;
}

.toast-info .toast-icon {
  color: #8fc4ee;
}

.toast-icon path,
.toast-icon circle {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 0.55s 0.12s var(--ease) forwards;
}

.toast-icon path {
  animation-delay: 0.3s;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.toast-visible {
  opacity: 1;
  transform: none;
}

.toast-message {
  flex: 1;
}

.toast-close {
  border: none;
  background: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  opacity: 0.55;
}

.toast-close:hover {
  background: none;
  color: inherit;
  opacity: 1;
}

/* ---------- Hero (club info page + marketing) ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px 0 64px;
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  max-width: 14ch;
  margin: 4px 0 22px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--lime) 62%, var(--lime) 92%, transparent 92%);
  padding: 0 4px;
  margin: 0 -4px;
}

.hero .lead {
  font-size: 19px;
  max-width: 52ch;
  margin-bottom: 0;
}

.hero .actions {
  display: flex;
  gap: 10px;
  padding-top: 30px;
  flex-wrap: wrap;
}

.hero .actions .btn {
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 12px;
}

/* Marketing hero: copy on the left, a live-looking booking grid on the right */

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 56px;
  padding: 24px 0 88px;
}

.hero-split .hero {
  padding: 0;
}

.court-preview {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 60px -30px rgba(16, 24, 40, 0.35);
  transform: rotate(1.2deg);
}

.court-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 17px;
}

.court-preview-head span {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.court-preview-grid {
  display: grid;
  grid-template-columns: 52px repeat(3, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}

.court-preview-grid > b {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.court-preview-grid > time {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 13.5px;
  color: var(--ink);
}

.court-preview-grid > i {
  font-style: normal;
  border-radius: 8px;
  padding: 9px 0;
  text-align: center;
  font-weight: 600;
  background: var(--court-tint);
  color: var(--court);
}

.court-preview-grid > i.x {
  background: var(--paper-sunk);
  color: var(--muted-2);
  font-weight: 500;
}

.court-preview-grid > i.on {
  background: var(--court);
  color: var(--lime);
}

/* Marketing sections */

.band {
  margin: 0 0 20px;
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.band > h2,
.band-head h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 18ch;
  margin-bottom: 14px;
  padding: 0;
  border: none;
}

.band-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 44px;
}

.band-head p {
  margin: 0;
  font-size: 17px;
  max-width: 48ch;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  counter-reset: feature;
}

.feature {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px 18px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.feature::before {
  counter-increment: feature;
  content: counter(feature, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  color: var(--ball);
  padding-top: 2px;
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.feature p {
  margin: 0;
}

.callout-band {
  background: var(--court-deep);
  color: #b4bed2;
  border-radius: 20px;
  padding: 64px 56px;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.callout-band h2 {
  color: #fff;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 14px;
  padding: 0;
  border: none;
}

.callout-band p {
  color: #a3aec4;
  font-size: 17px;
  margin: 0;
}

.callout-band .btn {
  background: var(--lime);
  color: var(--court-deep);
  padding: 15px 26px;
  border-radius: 12px;
  font-size: 15px;
  justify-self: start;
}

.callout-band .btn:hover {
  background: #f9b884;
  color: var(--court-deep);
}

.callout-band::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 2px solid rgba(246, 166, 107, 0.35);
  pointer-events: none;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  padding: 18px 0;
}

.faq details p {
  max-width: 64ch;
  padding-bottom: 8px;
}

/* ---------- Card grids ---------- */

.tile-grid[hidden] {
  display: none;
}

.pricing-grid,
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* Inside a panel a pricing tier is a well, not another bordered card. */
.pricing-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.pricing-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  margin: 0;
}

.pricing-card p {
  margin: 0;
  font-size: 14px;
}

.pricing-card .btn {
  margin-top: 12px;
}

.pricing-card .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
  margin: 6px 0 4px;
}

.pricing-card .price span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--muted);
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 820px;
}

.plan {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.plan h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  margin: 0;
}

.plan .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 12px 0 6px;
}

.plan .price span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--muted);
}

.plan p {
  margin: 0 0 18px;
}

.plan-featured {
  background: var(--court-deep);
  border-color: var(--court-deep);
  color: #fff;
}

.plan-featured h3,
.plan-featured .price {
  color: #fff;
}

.plan-featured p,
.plan-featured .price span {
  color: #a3aec4;
}

.plan-featured .btn {
  background: var(--lime);
  color: var(--court-deep);
}

.plan-featured .btn:hover {
  background: #f9b884;
  color: var(--court-deep);
}

/* Stat strip: one bordered unit split by hairlines, big numerals. Dividers are
   box-shadows on each cell (clipped by the container) so a short last row
   doesn't leave a filled gap. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--paper-raised);
  box-shadow: 1px 1px 0 0 var(--line);
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* Inside a panel the strip drops its own frame — numerals sit on the panel. */
section .stat-grid {
  border: none;
  border-radius: 0;
  margin-bottom: 4px;
  gap: 8px 0;
}

section .stat-card {
  box-shadow: none;
  padding: 4px 20px 8px 0;
  background: none;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.tile {
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}

.tile:hover {
  color: var(--court);
  text-decoration: none;
}

.tile .tile-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.toolbar input[type="search"],
.toolbar input[type="text"] {
  flex: 1;
  width: auto;
  min-width: 180px;
  max-width: 360px;
}

.toolbar .btn-ghost,
.day-nav .btn-ghost {
  border-color: var(--line-strong);
  background: var(--paper-raised);
}

.toolbar .btn-ghost:hover {
  border-color: var(--ink);
  background: var(--paper-raised);
}

/* ---------- Finance dashboard ---------- */

details {
  border-radius: var(--radius-md);
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform var(--t-base) var(--ease);
  vertical-align: 2px;
}

details[open] > summary::before {
  transform: rotate(45deg);
}

details[open] > *:not(summary) {
  animation: rise 0.3s var(--ease) both;
}

.payout-details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.payout-details:first-of-type {
  border-top: 1px solid var(--line);
}

.payout-details summary {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.payout-details table {
  margin-top: 16px;
}

/* ---------- Finance charts ---------- */

.meter-track {
  background: var(--paper-sunk);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease);
}

.stacked-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stacked-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--paper-sunk);
}

.stacked-bar-segment {
  height: 100%;
}

.chart-legend {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 22px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.chart-legend li {
  padding: 0;
  border: none;
  font-size: 13px;
  display: block;
}

.chart-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: middle;
}

.chart-legend-line {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px dashed var(--muted);
  margin-right: 7px;
  vertical-align: middle;
}

.chart-block {
  width: 100%;
}

.column-chart {
  width: 100%;
  height: auto;
  max-height: 240px;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-label {
  font-family: var(--font-body);
  font-size: 9px;
  fill: var(--muted);
}

.chart-prior-marker {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 3 2;
}

/* A button hidden by the "hidden" attribute must stay hidden despite the base button display. */
button[hidden],
.btn[hidden] {
  display: none;
}

/* Social feeds on the club homepage: Facebook and/or Instagram, side by side when there are two */
.social-feed-head {
  margin-bottom: 14px;
}

.social-feed-head h2 {
  margin: 0;
}

.social-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 24px;
  align-items: start;
}

.social-feed-grid.is-single {
  grid-template-columns: minmax(0, 520px);
}

.social-feed-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.social-feed-panel {
  min-width: 0;
}

.social-feed-panel[data-social-feed="instagram"] .social-feed-iframe {
  height: 520px;
}

.social-feed-iframe {
  width: 100%;
  max-width: 500px;
  height: 640px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--paper-sunk);
}

.timeline-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

.chart-target {
  stroke: var(--ball);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.tenure-list {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 18px 0 8px;
  padding: 0;
  list-style: none;
}

.tenure-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  padding: 0;
  border: none;
  font-size: 13px;
  color: var(--muted);
}

.tenure-list strong {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.sparkline {
  width: 100%;
  max-width: 240px;
  height: 48px;
}

.pause-chasing-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pause-chasing-form .date-field {
  width: 130px;
}

.pause-chasing-form .date-field-display {
  padding: 6px 10px;
}

.pause-chasing-form input[type="text"] {
  width: 140px;
  padding: 6px 10px;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

.pagination span.btn-secondary[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

/* ---------- Empty states ---------- */

.agenda-empty,
p.empty {
  text-align: center;
  color: var(--muted);
}

section.agenda-empty {
  padding: 64px 24px;
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}

section.agenda-empty::before,
p.empty::before {
  content: "";
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--paper-sunk)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23727a70' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z M12 5v14 M3 12h6.5 M14.5 12H21'/%3E%3C/svg%3E")
    center no-repeat;
}

p.empty {
  padding: 32px 16px;
  margin: 0;
}

.agenda-empty p {
  margin: 0;
  font-size: 15.5px;
}

/* ---------- Calendar ---------- */

.calendar-feeds {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding: 0 0 22px;
  font-size: 13px;
  color: var(--muted);
}

.legend .dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink-soft);
}

.legend .dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--dot-color, var(--muted-2));
  flex-shrink: 0;
}

.legend .dot.type-club_night { --dot-color: var(--mint); box-shadow: none; }
.legend .dot.type-social { --dot-color: var(--peach); }
.legend .dot.type-intro { --dot-color: var(--mist); }
.legend .dot.type-tournament { --dot-color: var(--lilac); }
.legend .dot.type-agm { --dot-color: var(--butter); }
.legend .dot.type-other { --dot-color: var(--paper-sunk); }

.legend .dot[class*="type-"]::before {
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.16);
}

.spotlight {
  background: var(--court-deep);
  color: #fff;
  border: none;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
}

.spotlight::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px solid rgba(246, 166, 107, 0.35);
  pointer-events: none;
}

.spotlight .eyebrow {
  color: var(--lime);
}

.spotlight .eyebrow::before {
  background: var(--lime);
}

.spotlight h2 {
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
  padding: 0;
  border: none;
}

.spotlight h2 a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(var(--lime), var(--lime)) left bottom / 0 3px no-repeat;
  transition: background-size var(--t-base) var(--ease);
}

.spotlight h2 a:hover,
.spotlight h2 a:focus-visible {
  color: inherit;
  background-size: 100% 3px;
}

.spotlight .spotlight-meta {
  color: #a3aec4;
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
}

.spotlight .btn-accent,
.spotlight .btn {
  flex-shrink: 0;
  background: var(--lime);
  color: var(--court-deep);
  padding: 14px 22px;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

.spotlight .btn:hover {
  background: #f9b884;
  color: var(--court-deep);
}

.agenda-month {
  margin-bottom: 8px;
}

.agenda-month-heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 40px 0 6px;
  padding: 0 0 12px;
  border-bottom: 1.5px solid var(--ink);
}

section > .agenda-month:first-child .agenda-month-heading {
  margin-top: 0;
}

.agenda-day {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.agenda-day:last-child {
  border-bottom: none;
}

.agenda-date {
  padding-top: 6px;
}

.agenda-date-dow {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.agenda-date-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.05;
}

.agenda-day-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Category is a pastel fill, not a coloured stripe (nothing here has a border). */
.agenda-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--tint, var(--paper-sunk));
  border-radius: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
  transition: transform var(--t-base) var(--ease);
}

.agenda-card:hover {
  transform: translateX(3px);
}

.agenda-card.type-club_night { --tint: var(--mint); }
.agenda-card.type-social { --tint: var(--peach); }
.agenda-card.type-intro { --tint: var(--mist); }
.agenda-card.type-tournament { --tint: var(--lilac); }
.agenda-card.type-agm { --tint: var(--butter); }
.agenda-card.type-other { --tint: var(--paper-sunk); }

.agenda-card.status-confirmed { --tint: var(--mint); }
.agenda-card.status-pending_payment { --tint: var(--butter); }
.agenda-card.status-completed { --tint: var(--paper-sunk); }
.agenda-card.status-cancelled { --tint: var(--peach); }
.agenda-card.status-expired { --tint: var(--peach); }
.agenda-card.status-no_show { --tint: var(--paper-sunk); }

.agenda-card .badge {
  background: rgba(255, 255, 255, 0.62);
}

.agenda-card-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  min-width: 78px;
  flex-shrink: 0;
  line-height: 1.25;
}

.agenda-card-time span {
  display: block;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 14px;
  opacity: 0.75;
}

.agenda-card-body {
  flex: 1;
  min-width: 200px;
}

.agenda-card-heading {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
}

.agenda-card-heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.agenda-card-meta {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  opacity: 0.8;
}

.agenda-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.agenda-card-actions small {
  color: var(--ink-soft);
}

.agenda-card .btn-danger {
  background: rgba(255, 255, 255, 0.7);
}

.agenda-card .btn-danger:hover {
  background: #fff;
}

/* ---------- Activity timeline ---------- */

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.timeline-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-filter {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  width: auto;
  max-width: none;
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease, background var(--t-fast) ease;
}

.timeline-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.timeline-filter::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-color, var(--muted-2));
  flex-shrink: 0;
}

.timeline-filter.type-payment { --accent-color: var(--court); }
.timeline-filter.type-booking { --accent-color: var(--sky); }
.timeline-filter.type-match { --accent-color: var(--plum); }
.timeline-filter.type-reminder { --accent-color: #c98a14; }
.timeline-filter.type-admin { --accent-color: var(--muted-2); }

.timeline-filter:hover {
  border-color: var(--accent-color, var(--muted-2));
}

.timeline-filter:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.timeline-filter:has(input:not(:checked)) {
  opacity: 0.65;
}

.timeline-filter:has(input:focus-visible) {
  outline: 2px solid var(--court);
  outline-offset: 2px;
}

.timeline-filter-count {
  color: var(--muted-2);
  font-weight: 700;
}

.timeline-filter:has(input:checked) .timeline-filter-count {
  color: inherit;
  opacity: 0.6;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* One continuous rail behind every dot, instead of a line per item. The `li`
   reset below is needed because the global `li` rule (divider, padding,
   align-items) would otherwise leak into the grid layout. */
.timeline::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 113px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 20px 1fr;
  align-items: start;
  justify-content: normal;
  gap: 2px 14px;
  margin: 0;
  padding: 0 0 6px;
  background: none;
  border: none;
  border-radius: 0;
}

.timeline-item[hidden] {
  display: none;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item.type-payment { --accent-color: var(--court); }
.timeline-item.type-booking { --accent-color: var(--sky); }
.timeline-item.type-match { --accent-color: var(--plum); }
.timeline-item.type-reminder { --accent-color: #c98a14; }
.timeline-item.type-admin { --accent-color: var(--muted-2); }

.timeline-item.status-failed,
.timeline-item.status-cancelled,
.timeline-item.status-defaulted,
.timeline-item.status-lost { --accent-color: var(--red); }

.timeline-time {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 13px;
  color: var(--ink);
  padding-top: 12px;
  text-align: right;
}

.timeline-time span {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.timeline-rail {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-top: 13px;
}

.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-full);
  background: var(--accent-color, var(--muted-2));
  box-shadow: 0 0 0 4px var(--paper-raised);
  flex-shrink: 0;
}

.timeline-card {
  border-radius: var(--radius-md);
  padding: 9px 14px;
  transition: background var(--t-fast) ease;
}

.timeline-item:hover .timeline-card {
  background: var(--paper);
}

.timeline-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--ink);
}

.timeline-meta {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.timeline-empty-filtered {
  padding: 24px 0;
  text-align: center;
}

/* ---------- Bookings ---------- */

.day-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.day-nav .btn-ghost {
  border-color: var(--line-strong);
  background: var(--paper-raised);
}

.day-nav .btn-ghost:hover {
  border-color: var(--ink);
  background: var(--paper-raised);
}

.day-nav .date-chip {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  color: var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 7px 18px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-fast) ease;
}

.day-nav .date-chip:hover {
  background: var(--court);
}

.date-chip-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
}

.date-chip-label {
  pointer-events: none;
}

.legend .dot.state-available { --dot-color: var(--court); }
.legend .dot.state-booked { --dot-color: var(--red); }
.legend .dot.state-blocked { --dot-color: #c98a14; }
.legend .dot.state-past { --dot-color: var(--muted-2); }
.legend .dot.state-peak_restricted { --dot-color: var(--ball); }

.booking-grid {
  border-collapse: separate;
  border-spacing: 0 6px;
  margin-bottom: 0;
}

.booking-grid thead th {
  border-bottom: none;
  padding: 0 4px 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--ink);
}

.booking-grid thead th:first-child {
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.booking-grid tbody td {
  border-bottom: none;
  padding: 0 4px;
  vertical-align: middle;
}

.booking-grid th:first-child,
.booking-grid td:first-child {
  padding-left: 0;
}

.booking-grid tbody tr:hover {
  background: none;
}

.booking-grid .slot-time {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  width: 84px;
}

.slot-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 46px;
  padding: 6px 8px 6px 14px;
  border-radius: 10px;
}

.slot-cell.is-open {
  padding: 0;
}

/* An open slot is one big tap target: a tinted button that fills the cell and
   inverts to court-green + lime on hover. */
.slot-cell.is-open .btn {
  width: 100%;
  min-height: 46px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  background: var(--court-tint);
  color: var(--court);
}

.slot-cell.is-open .btn:hover {
  background: var(--court);
  color: var(--lime);
}

.slot-cell.is-open .btn-accent {
  background: var(--ball-tint);
  color: var(--ball-dark);
}

.slot-cell.is-open .btn-accent:hover {
  background: var(--ball);
  color: #fff;
}

.slot-cell.is-taken {
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(16, 24, 40, 0.035) 6px 7px), var(--paper);
  padding-left: 14px;
}

.slot-cell.is-taken .badge {
  background: none;
  padding: 0;
  color: var(--muted);
  font-weight: 500;
}

.slot-cell.is-taken .badge::before {
  display: none;
}

.slot-cell.is-taken .badge-red,
.slot-cell.is-taken .badge-amber {
  font-weight: 600;
}

.slot-cell.is-taken .badge-red {
  color: var(--red);
}

.slot-cell.is-taken .badge-amber {
  color: var(--amber);
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
  /* As a flex/grid child it would otherwise stretch to its content and widen the page. */
  min-width: 0;
  max-width: 100%;
}

.table-scroll .booking-grid {
  min-width: 520px;
}

/* "Earlier today" toggle: rows where every court is already past collapse away. */
.past-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.past-toggle-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: none;
  margin: 0 0 12px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--t-fast) ease;
}

.past-toggle-label:hover {
  background: var(--paper-sunk);
}

.past-toggle-label::after {
  content: "Show";
  font-weight: 650;
  color: var(--court);
}

.past-toggle:checked + .past-toggle-label::after {
  content: "Hide";
}

.past-toggle:focus-visible + .past-toggle-label {
  outline: 2px solid var(--court);
  outline-offset: 2px;
}

.booking-grid tr.is-past {
  display: none;
}

.past-toggle:checked ~ .table-scroll .booking-grid tr.is-past {
  display: table-row;
}

/* ---------- Box league ---------- */

.box-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 16px;
}

.box-card:last-child {
  margin-bottom: 0;
}

/* Inside a panel a box is a labelled block, divided by a rule — not a card in a card. */
section .box-card {
  border: none;
  border-radius: 0;
  background: none;
  padding: 26px 0 8px;
  margin: 0;
  border-top: 1px solid var(--line);
}

section .box-card:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.box-card table {
  margin-bottom: 0;
}

.box-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.box-card-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.accent-0 { --accent-color: var(--court); }
.accent-1 { --accent-color: var(--ball); }
.accent-2 { --accent-color: var(--sky); }
.accent-3 { --accent-color: var(--plum); }
.accent-4 { --accent-color: var(--amber); }
.accent-5 { --accent-color: var(--muted-2); }

/* Head-to-head results matrix */

.matrix-table th,
.matrix-table td {
  text-align: center;
  padding: 7px 10px;
  white-space: nowrap;
}

.matrix-table thead th:nth-child(2),
.matrix-table tbody td:nth-child(2) {
  text-align: left;
}

.matrix-table .avatar {
  width: 28px;
  height: 28px;
  font-size: 10.5px;
  margin: 0 auto;
}

.matrix-table tbody tr.is-you {
  background: var(--lime-tint);
}

.matrix-diagonal {
  background: var(--paper-sunk);
}

.matrix-empty {
  color: var(--muted-2);
}

.matrix-win {
  color: var(--good);
  font-weight: 700;
}

.matrix-loss {
  color: var(--muted);
}

.matrix-points {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* ---------- Availability schedule ---------- */

.availability-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 20px;
}

.availability-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}

.availability-legend-swatch.open {
  background: var(--court);
}

.availability-legend-swatch.closed {
  background: var(--paper-sunk);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.availability-mode {
  margin-bottom: 28px;
}

.availability-mode h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
}

.availability-ruler {
  display: grid;
  grid-template-columns: 40px 1fr 160px;
  gap: 12px;
  margin-bottom: 6px;
}

.availability-ruler-track {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted-2);
}

.availability-week {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.availability-day {
  display: grid;
  grid-template-columns: 40px 1fr 160px;
  align-items: center;
  gap: 12px;
}

.availability-day-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
}

.availability-track {
  position: relative;
  height: 14px;
  background: var(--paper-sunk);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.availability-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--court);
  border-radius: var(--radius-full);
}

.availability-day-hours {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.availability-day-hours.availability-closed {
  color: var(--muted-2);
  font-style: italic;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .page {
    padding: 40px 32px 96px;
  }
}

@media (max-width: 960px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(300px, 86vw);
    height: auto;
    transform: translateX(-102%);
    transition: transform 0.3s var(--ease);
    box-shadow: none;
  }

  body.nav-open .sidebar {
    transform: none;
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.3);
  }

  .side-link[aria-current="page"]::before {
    left: -14px;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(8, 14, 28, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.nav-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    height: 60px;
    padding: 0 16px;
    background: rgba(245, 243, 239, 0.9);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .page {
    padding: 28px 20px 88px;
  }

  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-split,
  .band-head,
  .callout-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-split {
    gap: 40px;
  }

  .court-preview {
    transform: none;
  }
}

@media (max-width: 720px) {
  .site-footer .inner {
    padding: 22px 16px 28px;
  }

  .site-header .inner {
    padding: 0 16px;
    gap: 12px;
    min-height: 60px;
  }

  .site-nav {
    display: none;
  }

  .header-account {
    margin-left: auto;
  }

  .public .page {
    padding: 32px 20px 80px;
  }

  h1 {
    font-size: 27px;
  }

  section {
    padding: 20px 18px;
    border-radius: 12px;
  }

  .page-hero {
    padding-bottom: 22px;
    align-items: flex-start;
  }

  .hero {
    padding-bottom: 44px;
  }

  .feature-list,
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .callout-band {
    padding: 40px 26px;
    border-radius: 16px;
  }

  .band {
    padding: 48px 0;
  }

  .table-scroll .booking-grid {
    display: table;
    white-space: normal;
    min-width: 0;
  }

  .table-scroll {
    margin: 0;
    padding: 0;
  }

  .slot-cell {
    padding-left: 10px;
    min-height: 44px;
  }

  .agenda-day {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 16px 0;
  }

  .agenda-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
  }

  .agenda-date-num {
    font-size: 26px;
  }

  .agenda-card {
    padding: 14px 16px;
    gap: 10px 16px;
  }

  .agenda-card-actions {
    margin-left: 0;
    width: 100%;
  }

  .spotlight {
    padding: 28px 24px;
  }

  .spotlight h2 {
    font-size: 26px;
  }

  .timeline::before {
    left: 13px;
  }

  .timeline-item {
    grid-template-columns: 20px 1fr;
    gap: 0 12px;
  }

  .timeline-time {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    padding: 4px 14px 0;
    display: flex;
    gap: 8px;
  }

  .timeline-time span {
    display: inline;
  }

  .timeline-rail {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .timeline-card {
    grid-column: 2;
    grid-row: 2;
  }

  .availability-ruler,
  .availability-day {
    grid-template-columns: 34px 1fr;
  }

  .availability-day-hours {
    grid-column: 2;
    font-size: 12px;
  }

  .availability-ruler > :last-child {
    display: none;
  }

  .stat-card .stat-value {
    font-size: 28px;
  }

  .toast-root {
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .day-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    width: 100%;
  }

  .day-nav-text {
    display: none;
  }

  .day-nav .btn {
    padding: 9px 14px;
  }

  .day-nav .date-chip {
    justify-content: center;
    padding: 9px 10px;
    font-size: 15px;
  }

  .booking-grid {
    border-spacing: 0 5px;
  }

  .booking-grid .slot-time {
    width: 54px;
    font-size: 14px;
  }

  .booking-grid td,
  .booking-grid th {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  .booking-grid th:first-child,
  .booking-grid td:first-child {
    padding-left: 0 !important;
  }

  .slot-cell.is-open .btn {
    padding: 8px 4px;
    font-size: 13px;
  }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Narrow single-column pages (sign-up, find-a-club, setup) ---------- */

.narrow {
  max-width: 600px;
}

.narrow h1 {
  margin-bottom: 14px;
}

a.stat-card {
  color: inherit;
  transition: background var(--t-fast) ease;
}

a.stat-card:hover {
  background: var(--lime-tint);
  color: inherit;
  text-decoration: none;
}

a.stat-card .stat-value {
  transition: transform var(--t-base) var(--ease);
  transform-origin: left;
}

a.stat-card:hover .stat-value {
  transform: scale(1.04);
}

.page > table {
  margin-bottom: 28px;
}

/* A row of key facts (court / date / time on the booking confirmation). */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 28px;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.facts > div {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px 18px 0;
}

.facts-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--ink);
}

/* On a phone, keep court / date / time on one tidy row instead of wrapping and crowding each other. */
@media (max-width: 720px) {
  .facts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 18px;
  }

  .facts > div {
    min-width: 0;
    padding-right: 0;
  }

  .facts-value {
    font-size: 19px;
    overflow-wrap: anywhere;
  }
}


/* =========================================================================
   Second pass: personality — court-line motif, member home, data, motion
   ========================================================================= */

:root {
  /* A top-down squash court: walls, tin, short line, half-court, service boxes. */
  --court-lines-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 340' fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='2'%3E%3Crect x='20' y='20' width='200' height='300'/%3E%3Cpath d='M20 150h200M120 150v170M20 150v60h60v-60M160 150h60v60h-60z'/%3E%3C/svg%3E");
  --court-lines-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 340' fill='none' stroke='%230f1b33' stroke-opacity='.07' stroke-width='2'%3E%3Crect x='20' y='20' width='200' height='300'/%3E%3Cpath d='M20 150h200M120 150v170M20 150v60h60v-60M160 150h60v60h-60z'/%3E%3C/svg%3E");
  --court-illustration: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 340' fill='none' stroke='%239aa3b2' stroke-width='5' stroke-linejoin='round'%3E%3Crect x='20' y='20' width='200' height='300' rx='4'/%3E%3Cpath d='M20 160h200M120 160v160M20 160v56h56v-56M164 160h56v56h-56z'/%3E%3Ccircle cx='158' cy='250' r='14' fill='%23f6a66b' stroke='none'/%3E%3Ccircle cx='153' cy='246' r='2.6' fill='%230f1b33' stroke='none'/%3E%3Ccircle cx='163' cy='255' r='2.6' fill='%230f1b33' stroke='none'/%3E%3C/svg%3E");
}

.sidebar {
  background-image: var(--court-lines-light);
  background-repeat: no-repeat;
  background-position: right -50px bottom 80px;
  background-size: 170px auto;
}

.spotlight,
.callout-band,
.feature-card {
  background-image: var(--court-lines-light);
  background-repeat: no-repeat;
  background-position: right 48px center;
  background-size: auto 150%;
}

.spotlight::after,
.callout-band::after {
  display: none;
}

.hero-split {
  position: relative;
}

.hero-split::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -70px;
  width: 460px;
  height: 650px;
  background: var(--court-lines-dark) center / contain no-repeat;
  pointer-events: none;
}

.hero-split > * {
  position: relative;
}

/* Empty states: a court with a ball on it */
section.agenda-empty::before,
p.empty::before {
  width: 76px;
  height: 106px;
  margin: 0 auto 16px;
  border-radius: 0;
  background: var(--court-illustration) center / contain no-repeat;
}

/* Avatars keep a stable pastel tone per person */
.avatar.tone-0 { background: var(--mint); color: var(--good); }
.avatar.tone-1 { background: var(--peach); color: #8a4515; }
.avatar.tone-2 { background: var(--lilac); color: var(--plum); }
.avatar.tone-3 { background: var(--butter); color: var(--amber); }
.avatar.tone-4 { background: var(--mist); color: var(--sky); }

a.agenda-card {
  color: inherit;
  font-weight: inherit;
}

a.agenda-card:hover {
  text-decoration: none;
  color: inherit;
}

/* ---------- Member home ---------- */

section.feature-card {
  background-color: var(--court-deep);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 40px 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.feature-card .eyebrow {
  color: var(--lime);
}

.feature-card .eyebrow::before {
  background: var(--lime);
}

.feature-time {
  font-family: var(--font-display);
  font-size: clamp(64px, 10vw, 104px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.95;
  color: #fff;
}

.feature-time-empty {
  font-size: clamp(38px, 6vw, 56px);
  letter-spacing: -0.04em;
}

.feature-meta {
  margin: 12px 0 0;
  font-size: 17px;
  color: #a3aec4;
}

.feature-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

.feature-actions .btn {
  background: var(--lime);
  color: var(--court-deep);
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
}

.feature-actions .btn:hover {
  background: #f9b884;
  color: var(--court-deep);
}

.feature-note {
  font-size: 14px;
  color: #a3aec4;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.home-grid > section {
  margin: 0;
}

.league-hero {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.league-rank {
  font-family: var(--font-display);
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--ink);
}

.league-where {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
}

.league-where small {
  display: block;
  font-size: 13px;
  font-weight: 400;
}

.mini-table {
  margin: 0;
}

.mini-table td {
  padding: 10px 12px;
}

.mini-table td:first-child {
  padding-left: 12px;
}

.mini-table td:last-child {
  padding-right: 12px;
}

.mini-table .rank {
  width: 32px;
  color: var(--muted);
  font-weight: 600;
}

.mini-table .num-cell {
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.mini-table .num-cell.strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  width: 48px;
}

.mini-table tr.is-you {
  background: var(--lime-tint);
}

.mini-table tr.is-you td {
  color: var(--ink);
  font-weight: 650;
  border-color: transparent;
}

.mini-table tr.is-you td:first-child {
  border-radius: 8px 0 0 8px;
}

.mini-table tr.is-you td:last-child {
  border-radius: 0 8px 8px 0;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 14px;
}

.section-link .icon {
  transition: transform var(--t-base) var(--ease);
}

.section-link:hover .icon {
  transform: translateX(3px);
}

/* ---------- Stat sparklines & deltas ---------- */

.stat-card .mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  margin-top: 12px;
}

.mini-bars i {
  flex: 1;
  background: var(--line-strong);
  border-radius: 2px;
  transform-origin: bottom;
  animation: grow 0.7s var(--ease) both;
}

.mini-bars i.is-last {
  background: var(--lime-dark);
}

@keyframes grow {
  from {
    transform: scaleY(0.05);
  }
}

.delta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.delta.is-good {
  color: var(--good);
}

.delta.is-bad {
  color: var(--red);
}

.stat-value.is-alert {
  color: var(--red);
}

/* ---------- Booking grid: summary, occupancy, peak, next free ---------- */

.grid-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.next-free {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--t-fast) ease;
}

.next-free:hover {
  background: var(--lime-dark);
  color: var(--ink);
  text-decoration: none;
}

.next-free strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.next-free-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-free .icon {
  transition: transform var(--t-base) var(--ease);
}

.next-free:hover .icon {
  transform: translateX(3px);
}

.grid-summary-count {
  font-size: 14px;
  color: var(--muted);
}

.grid-summary-count strong {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.court-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.occ {
  display: flex;
  gap: 2px;
  height: 6px;
}

.occ i {
  flex: 1;
  border-radius: 2px;
  background: var(--line);
}

.occ i.free {
  background: #b9c7ea;
}

.occ i.taken {
  background: var(--court);
}

.booking-grid .slot-time {
  width: 96px;
}

.peak-tag {
  display: block;
  width: fit-content;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--lime-tint);
  color: #8a4a10;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slot-cell.is-next .btn {
  background: var(--lime);
  color: var(--ink);
  animation: next-pulse 2.6s ease-out infinite;
}

.slot-cell.is-next .btn:hover {
  background: var(--lime-dark);
  color: var(--ink);
}

@keyframes next-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(246, 166, 107, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(246, 166, 107, 0);
  }
}

/* ---------- Motion: page transitions, progress, skeletons ---------- */

@view-transition {
  navigation: auto;
}

@media (min-width: 961px) {
  .sidebar {
    view-transition-name: sidebar;
  }
}

.site-header {
  view-transition-name: topbar;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.18s;
}

.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--lime);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-progress.is-running {
  opacity: 1;
  width: 82%;
  transition: width 9s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.2s ease;
}

/* Placeholder while something loads: <div class="skeleton" style="height:24px"> */
.skeleton {
  background: linear-gradient(90deg, var(--paper-sunk) 25%, #f7f5f0 50%, var(--paper-sunk) 75%) 0 0 / 200% 100%;
  border-radius: 8px;
  color: transparent;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 960px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-split::before {
    display: none;
  }
  .sidebar {
    background-position: right -60px bottom 100px;
  }
}

@media (max-width: 720px) {
  section.feature-card {
    padding: 28px 24px;
    background-position: right -40px center;
  }
  .grid-summary-count {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slot-cell.is-next .btn {
    animation: none;
  }
}

@media (max-height: 780px) {
  .sidebar {
    background-image: none;
  }
}

html[data-area="admin"] .sidebar {
  background-image: none;
}

/* ---------- Engagement: ratings, badges, feed, tournaments ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row form,
.inline-form {
  margin: 0;
}

.inline-form {
  display: inline-flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-right: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.steps {
  margin: 0 0 12px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.feed-url {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feed-url input {
  flex: 1 1 280px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 13px;
}

/* Ratings */

.rating-value {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.rating-provisional {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-hero .rating-provisional {
  color: var(--muted-2);
}

.form-pips {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 4px;
}

.form-pips i {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

.form-pips i.is-win {
  background: var(--good-tint);
  color: var(--good);
}

.form-pips i.is-loss {
  background: var(--red-tint);
  color: var(--red);
}

.player-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.player-link:hover {
  text-decoration: underline;
}

.person-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.person-hero .avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

table.leaderboard {
  min-width: 460px;
}

table.leaderboard td:first-child {
  width: 44px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

table.leaderboard td:nth-child(n + 3) {
  white-space: nowrap;
}

table.leaderboard tr.is-me td {
  background: var(--lime-tint);
}

section.player-hero {
  display: grid;
  grid-template-columns: minmax(min(100%, 200px), auto) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.player-hero .stat-grid {
  grid-column: 2;
  background: transparent;
  margin: 0;
}

.player-hero .stat-card {
  background: transparent;
  border: none;
  padding: 0;
}

.player-hero .stat-card .stat-value {
  color: #fff;
}

.player-hero .stat-card .stat-label,
.player-hero .stat-card .muted {
  color: #a3aec4;
}

.player-rating-value {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 88px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
}

.player-rating .muted {
  color: #a3aec4;
}

.player-rating .mini-bars {
  margin-top: 14px;
  height: 36px;
}

.player-form {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 720px) {
  section.player-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .player-hero .stat-grid {
    grid-column: 1;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 0;
  }
}

/* Matches */

.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.match-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.match-main {
  flex: 1 1 240px;
}

.match-actions {
  display: flex;
  gap: 8px;
}

.match-actions form {
  margin: 0;
}

section.attention {
  border-left: 4px solid var(--lime);
}

/* Badges */

.badge-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.badge-shelf-compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  margin-bottom: 12px;
}

.badge-tile {
  --tier: var(--butter);
  --tier-ink: var(--amber);
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--paper-sunk);
  color: var(--muted);
  transition: transform var(--t-fast) var(--ease);
}

.badge-tile.tier-silver {
  --tier: var(--mist);
  --tier-ink: var(--sky);
}

.badge-tile.tier-gold {
  --tier: var(--lime-tint);
  --tier-ink: var(--ball-dark);
}

.badge-tile.is-earned {
  background: var(--tier);
  color: var(--tier-ink);
}

.badge-tile.is-earned:hover {
  transform: translateY(-2px);
}

.badge-tile-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--paper-raised);
}

.badge-tile-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.badge-tile.is-locked .badge-tile-name {
  color: var(--ink-soft);
}

.badge-tile-meta {
  font-size: 12px;
  line-height: 1.35;
}

.badge-tile-bar {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--line);
  overflow: hidden;
}

.badge-tile-bar i {
  display: block;
  height: 100%;
  background: var(--chart-1);
}

/* Membership card on the member home page */

section.member-card {
  align-items: center;
  margin-bottom: 20px;
  padding: 28px 32px;
}

.member-card-who {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.member-card-photo {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lime);
}

.member-card-initials {
  display: grid;
  place-items: center;
  background: var(--court);
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.member-card-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.member-card-number {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--lime);
}

.member-card-facts,
.member-card-codes dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
}

.member-card-facts dt,
.member-card-codes dt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.member-card-facts dd,
.member-card-codes dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.member-card-codes {
  flex-basis: 100%;
  padding-top: 18px;
  border-top: 1px solid rgb(255 255 255 / 0.16);
}

.member-card-codes dd {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  section.member-card {
    padding: 22px 20px;
  }

  .member-card-name {
    font-size: 22px;
  }
}

/* Members list: columns picker, and a name cell with the email beneath it */

.nowrap {
  white-space: nowrap;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* One row: the search grows, the columns picker sits at the right. Its panel drops down under the button. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-bar {
  /* Page children animate in (a stacking context each); lift this row so the popover isn't painted under the table below. */
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.list-bar > .list-search {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

.list-bar > .list-search input[type="search"] {
  max-width: 460px;
}

/* Name cell of the members lists: a small photo (or initials) beside the name and, optionally, the email. */
.member-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.member-name .avatar,
.member-photo {
  flex: none;
  width: 32px;
  height: 32px;
}

.member-photo {
  border-radius: 50%;
  object-fit: cover;
}

.cell-wrap {
  overflow-wrap: anywhere;
}

.col-picker {
  position: relative;
  z-index: 30;
  flex: none;
}

.col-picker > summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
}

.col-picker > summary::-webkit-details-marker {
  display: none;
}

.col-picker form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(440px, calc(100vw - 32px));
  padding: 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgb(15 27 51 / 0.14);
}

@media (max-width: 720px) {
  .list-bar {
    flex-wrap: wrap;
  }

  .list-bar > .list-search {
    flex-basis: 100%;
  }

  .col-picker form {
    left: 0;
    right: auto;
  }
}

.col-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Quick-pick links under a group of tick boxes (court blocks) */

.pick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

/* Event attendees */

.ev-attendees summary {
  cursor: pointer;
  list-style: none;
}

.ev-attendees summary::-webkit-details-marker {
  display: none;
}

.ev-attendees summary h2 {
  display: inline-block;
  margin: 0;
}

.ev-attendees summary h2::after {
  content: " ▾";
  color: var(--muted);
}

.ev-attendee-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 20px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

/* What's new */

.whats-new-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}

.whats-new-entry:last-child {
  border-bottom: 0;
}

.whats-new-entry h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.whats-new-entry p {
  margin: 0 0 8px;
}

.whats-new-entry ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.whats-new-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .whats-new-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Feed */

.feed {
  display: grid;
  gap: 0;
}

.feed-card {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.feed-card:last-child {
  border-bottom: none;
}

.feed-card.is-hidden {
  opacity: 0.55;
}

.feed-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--paper-sunk);
  color: var(--ink-soft);
}

.feed-card.type-badge_earned .feed-icon {
  background: var(--lime-tint);
  color: var(--ball-dark);
}

.feed-card.type-match_result .feed-icon,
.feed-card.type-tournament_result .feed-icon {
  background: var(--mint);
  color: var(--good);
}

.feed-card.type-tournament_champion .feed-icon,
.feed-card.type-tournament_open .feed-icon,
.feed-card.type-tournament_draw .feed-icon {
  background: var(--lilac);
  color: var(--plum);
}

.feed-card.type-announcement .feed-icon {
  background: var(--butter);
  color: var(--amber);
}

.feed-card.is-pinned {
  background: var(--lime-tint);
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border-bottom: none;
}

/* Pinned cards are filled blocks, so consecutive ones need air between them
   and the hairline of an unpinned card above would only sit against the fill. */
.feed-card.is-pinned + .feed-card.is-pinned {
  margin-top: 8px;
}

.feed-card:has(+ .feed-card.is-pinned) {
  border-bottom: none;
}

.feed-body {
  flex: 1;
  min-width: 0;
}

.feed-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 500;
}

.feed-title a {
  color: inherit;
  text-decoration: none;
}

.feed-title a:hover {
  text-decoration: underline;
}

.feed-detail {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
}

.clap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.clap:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

.clap.is-on {
  background: var(--ball-tint);
  border-color: var(--ball-tint);
  color: var(--ball-dark);
}

.feed-more {
  text-align: center;
}

/* Tournaments */

.tournament-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.tournament-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}

.tournament-row:hover {
  background: var(--paper-sunk);
}

.tournament-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--lilac);
  color: var(--plum);
}

.tournament-main {
  flex: 1 1 160px;
  display: grid;
  gap: 2px;
  min-width: 0;
}

section.entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--lime-tint);
}

section.entry-card h2 {
  margin: 0 0 4px;
}

.entrant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px 18px;
}

.entrant-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entrant-list li.is-me a {
  font-weight: 600;
}

.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: var(--space-section, 24px);
}

.podium-place {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--paper-sunk);
}

.podium-place.is-first {
  background: var(--court-deep);
  color: #fff;
}

.podium-place.is-first .icon {
  color: var(--lime);
}

.podium-place.is-first strong {
  color: #fff;
}

.podium-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.podium-place.is-first .podium-label {
  color: #a3aec4;
}

.stage h2 {
  margin-top: 0;
}

/* Bracket */

.bracket-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}

.bracket {
  display: grid;
  grid-template-columns: repeat(var(--rounds), minmax(220px, 1fr));
  gap: 28px;
  min-width: min-content;
}

.bracket-round h3 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
  height: calc(100% - 32px);
}

.bracket-third {
  margin-top: 24px;
  max-width: 280px;
}

.bracket-match {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
  overflow: hidden;
}

.bracket-match.is-bye {
  opacity: 0.6;
}

.bracket-side {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
}

.bracket-side + .bracket-side {
  border-top: 1px solid var(--line-soft);
}

.bracket-side.is-winner {
  background: var(--good-tint);
  font-weight: 600;
}

.bracket-side.is-loser {
  color: var(--muted);
}

.bracket-seed {
  flex: none;
  width: 18px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bracket-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-rating,
.bracket-score {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bracket-when {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--paper-sunk);
}

details.bracket-edit {
  padding: 8px 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

details.bracket-edit summary {
  cursor: pointer;
  color: var(--ink-soft);
}

details.bracket-edit[open] {
  min-width: min(100%, 320px);
}

/* ---------- Invitation landing page ---------- */

section.welcome-hero {
  padding: 56px 48px;
  align-items: flex-end;
}

.welcome-hero h1 {
  color: #fff;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  max-width: 14ch;
  margin: 6px 0 18px;
}

.welcome-hero h1 em {
  font-style: normal;
  color: var(--lime);
}

.welcome-hero-copy {
  max-width: 560px;
  position: relative;
}

.welcome-lead {
  margin: 0;
  font-size: 18px;
  color: #c4ccdc;
}

.welcome-lead strong {
  color: #fff;
}

.welcome-note {
  margin: 20px 0 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--lime);
  color: #e3e8f2;
  font-size: 16px;
  font-style: italic;
}

.welcome-hero-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.welcome-facts {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 6vw, 72px);
  padding: 8px 0 28px;
}

.welcome-facts > div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.welcome-facts strong {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.welcome-facts span {
  font-size: 13px;
  color: var(--muted);
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 22px 28px;
}

.welcome-feature h3 {
  margin: 12px 0 4px;
  font-size: 16px;
}

.welcome-feature p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.welcome-feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--lime-tint);
  color: var(--ball-dark);
}

.welcome-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 20px;
  counter-reset: none;
}

.welcome-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.welcome-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--court-deep);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
}

.welcome-steps h3 {
  margin: 4px 0 2px;
  font-size: 16px;
}

.welcome-steps p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.welcome-inline-cta {
  margin-top: 24px;
}

.welcome-inline-cta .btn,
.welcome-final .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.welcome-foot {
  text-align: center;
  font-size: 14px;
}

@media (max-width: 720px) {
  section.welcome-hero {
    padding: 36px 24px;
  }
  .welcome-final {
    grid-template-columns: minmax(0, 1fr);
    padding: 40px 28px;
  }
}

.welcome-tier {
  text-transform: capitalize;
}

/* ---------- Error pages (404 / 403 / 500) ---------- */

section.nf-hero {
  padding: 56px 52px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 40px;
}

.nf-copy {
  flex: 1 1 auto;
  max-width: 500px;
  position: relative;
}

.nf-hero h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 6px 0 16px;
}

.nf-hero h1 em {
  font-style: normal;
  color: var(--lime);
}

.nf-copy p {
  margin: 0 0 12px;
  font-size: 17px;
  color: #c4ccdc;
}

.nf-path code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #a3aec4;
}

.nf-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.nf-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 12px;
}

.nf-actions .btn:not(.btn-ghost) {
  background: var(--lime);
  color: var(--court-deep);
}

.nf-actions .btn:not(.btn-ghost):hover {
  background: #f9b884;
  color: var(--court-deep);
}

.nf-actions .btn-ghost {
  color: #fff;
}

.nf-code {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.4vw, 14px);
  font-family: var(--font-display);
  flex: none;
  font-size: clamp(88px, 11vw, 150px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #fff;
  position: relative;
  user-select: none;
}

.nf-ball {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(64px, 8vw, 100px);
  height: clamp(64px, 8vw, 100px);
  animation: nf-bounce 1.6s cubic-bezier(0.3, 0, 0.7, 1) infinite;
}

.nf-ball .logo {
  width: 100%;
  height: 100%;
}

.nf-ball .logo-ball {
  fill: var(--lime);
}

.nf-ball .logo-dot {
  fill: var(--court-deep);
}

.nf-ball ~ .nf-ball,
.nf-ball ~ .nf-ball .nf-shadow {
  animation-delay: -0.8s; /* the 500's two balls bounce out of step */
}

.nf-shadow {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 70%;
  height: 10px;
  margin-left: -35%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(3px);
  animation: nf-shadow 1.6s cubic-bezier(0.3, 0, 0.7, 1) infinite;
}

@keyframes nf-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-34px);
  }
}

@keyframes nf-shadow {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.7);
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nf-ball,
  .nf-shadow {
    animation: none;
  }
}

.nf-links h2 {
  margin-top: 0;
}

.nf-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.nf-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}

.nf-link:hover {
  background: var(--paper-sunk);
}

.nf-link span {
  flex: 1;
}

.nf-go {
  color: var(--muted);
}

@media (max-width: 860px) {
  section.nf-hero {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
    padding: 36px 26px;
  }
  .nf-code {
    align-self: center;
  }
}

/* ---------- New-member welcome ---------- */

section.mw-hero {
  padding: 56px 52px;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: nowrap;
}

.mw-hero-copy {
  flex: 1 1 auto;
  max-width: 560px;
  position: relative;
}

.mw-hero h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 6px 0 16px;
}

.mw-hero h1 em {
  font-style: normal;
  color: var(--lime);
}

.mw-lead {
  margin: 0;
  font-size: 18px;
  color: #c4ccdc;
}

.mw-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 26px;
}

.mw-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 12px;
}

.mw-actions .btn:not(.btn-ghost) {
  background: var(--lime);
  color: var(--court-deep);
}

.mw-actions .btn:not(.btn-ghost):hover {
  background: #f9b884;
  color: var(--court-deep);
}

.mw-actions .btn-ghost {
  color: #fff;
}

/* A membership "pass" — the moment of arrival. */
.mw-pass {
  position: relative;
  flex: none;
  width: min(300px, 100%);
  padding: 22px 24px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--lime) 0%, #f2b98a 100%);
  color: var(--court-deep);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  transform: rotate(2deg);
  animation: mw-pass-in 700ms var(--ease) both 150ms;
}

.mw-pass-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.mw-pass strong {
  display: block;
  margin: 4px 0 16px;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.mw-pass dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mw-pass dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 27, 51, 0.18);
  font-size: 14px;
}

.mw-pass dt {
  opacity: 0.7;
}

.mw-pass dd {
  margin: 0;
  font-weight: 600;
  text-transform: capitalize;
}

@keyframes mw-pass-in {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(2deg);
  }
}

/* Confetti */
.mw-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.mw-confetti i {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: calc(8px * var(--s));
  height: calc(14px * var(--s));
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  transform: rotate(var(--r));
  animation: mw-fall var(--d) cubic-bezier(0.2, 0.6, 0.4, 1) var(--delay) forwards;
}

@keyframes mw-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(var(--r));
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(460px) translateX(24px) rotate(calc(var(--r) + 540deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mw-confetti {
    display: none;
  }
  .mw-pass {
    animation: none;
  }
}

.mw-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mw-progress-head h2 {
  margin-bottom: 0;
  border: none;
  padding: 0;
}

.mw-meter {
  height: 6px;
  margin: 12px 0 18px;
  border-radius: var(--radius-full);
  background: var(--paper-sunk);
  overflow: hidden;
}

.mw-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--chart-1);
  transition: width var(--t-base) var(--ease);
}

.mw-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.mw-steps li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.mw-steps li:first-child {
  border-top: none;
}

.mw-step-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--lime-tint);
  color: var(--ball-dark);
}

.mw-steps li.is-done .mw-step-icon {
  background: var(--good-tint);
  color: var(--good);
}

.mw-step-body {
  flex: 1 1 180px;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mw-step-body span {
  font-size: 14px;
  color: var(--muted);
}

.mw-steps li.is-done .mw-step-body strong {
  color: var(--ink-soft);
}

section.mw-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--lime-tint);
}

.mw-badge h2 {
  margin: 0 0 6px;
  border: none;
  padding: 0;
}

.mw-badge-tile {
  width: 180px;
}

.mw-ways {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.mw-ways li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.mw-ways li > .icon {
  flex: none;
  margin-top: 2px;
  color: var(--ball-dark);
}

.mw-ways small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 860px) {
  section.mw-hero {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 36px 26px;
  }
  .mw-pass {
    transform: none;
  }
}

/* ---------- Billing & Stripe pages ---------- */

section.bp-hero,
section.sp-hero {
  padding: 52px 52px;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: nowrap;
}

section.bp-hero.is-alert,
section.sp-hero.is-alert {
  background-color: #2a1a26;
}

.bp-hero-copy,
.sp-hero-copy {
  flex: 1 1 auto;
  max-width: 600px;
  position: relative;
}

.bp-hero h1,
.sp-hero h1 {
  color: #fff;
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
  margin: 6px 0 14px;
  max-width: 18ch;
}

.bp-lead,
.sp-lead {
  margin: 0;
  font-size: 17px;
  color: #c4ccdc;
}

.bp-actions,
.sp-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 24px;
}

.bp-actions form,
.sp-actions form {
  margin: 0;
}

.bp-actions .btn,
.sp-actions .btn,
.bp-actions button,
.sp-actions button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 12px;
}

.bp-actions .btn:not(.btn-ghost),
.sp-actions .btn:not(.btn-ghost),
.bp-actions button.btn:not(.btn-ghost) {
  background: var(--lime);
  color: var(--court-deep);
}

.bp-actions .btn:not(.btn-ghost):hover,
.sp-actions .btn:not(.btn-ghost):hover {
  background: #f9b884;
  color: var(--court-deep);
}

.bp-actions .btn-ghost,
.sp-actions .btn-ghost {
  color: #fff;
  background: transparent;
}

.bp-actions .btn-ghost:hover,
.sp-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Days-remaining ring */
.bp-ring {
  position: relative;
  flex: none;
  width: 168px;
  height: 168px;
}

.bp-ring svg {
  width: 100%;
  height: 100%;
}

.bp-ring circle {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.bp-ring-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.bp-ring-fill {
  stroke: var(--lime);
  transition: stroke-dasharray 900ms var(--ease);
}

.bp-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: #fff;
}

.bp-ring .bp-ring-label strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 54px;
  letter-spacing: -0.05em;
  line-height: 1;
}

.bp-ring-label span {
  font-size: 13px;
  color: #a3aec4;
}

.bp-seal {
  flex: none;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 168px;
  height: 168px;
  border-radius: var(--radius-full);
  background: var(--lime);
  color: var(--court-deep);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 8px rgba(246, 166, 107, 0.25), 0 0 0 18px rgba(246, 166, 107, 0.1);
  transform: rotate(-6deg);
  animation: bp-seal-in 700ms var(--ease) both 150ms;
}

@keyframes bp-seal-in {
  from {
    opacity: 0;
    transform: scale(0.7) rotate(-20deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-seal {
    animation: none;
  }
  .bp-ring-fill {
    transition: none;
  }
}

.bp-status .badge {
  font-size: 15px;
}

.bp-usage h2 {
  margin-bottom: 4px;
}

.bp-plans {
  align-items: stretch;
}

.bp-plan-best {
  position: relative;
  background: var(--lime-tint);
  outline: 2px solid var(--lime);
}

.bp-ribbon {
  position: absolute;
  top: -12px;
  right: 18px;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: var(--court-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bp-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.bp-chips span {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--good-tint);
  color: var(--good);
  font-size: 13px;
  font-weight: 600;
}

.bp-included {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 18px 28px;
}

.bp-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.bp-feature > div {
  display: grid;
  gap: 2px;
}

.bp-feature > div span {
  font-size: 14px;
  color: var(--muted);
}

.bp-feature-icon,
.sp-take-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--lime-tint);
  color: var(--ball-dark);
}

.bp-faq details {
  border-top: 1px solid var(--line-soft);
  padding: 12px 0;
}

.bp-faq details:first-child {
  border-top: none;
}

.bp-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.bp-faq p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* Money flow */
.sp-flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.sp-node {
  flex: 1 1 200px;
  max-width: 260px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px 16px;
  border-radius: var(--radius-lg);
  background: var(--paper-sunk);
  text-align: center;
  color: var(--muted);
}

.sp-node strong {
  color: var(--ink);
}

.sp-node > span:last-child {
  font-size: 13.5px;
}

.sp-node-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: var(--radius-full);
  background: var(--paper-raised);
  color: var(--muted);
}

.sp-node.is-done {
  background: var(--good-tint);
}

.sp-node.is-done .sp-node-icon {
  background: var(--good);
  color: #fff;
}

.sp-node.is-todo {
  background: var(--butter);
}

.sp-node.is-todo .sp-node-icon {
  background: var(--amber);
  color: #fff;
}

.sp-arrow {
  align-self: center;
  color: var(--line-strong);
}

.sp-arrow.is-on {
  color: var(--good);
}

@media (max-width: 720px) {
  .sp-arrow {
    transform: rotate(90deg);
    flex-basis: 100%;
    display: grid;
    place-items: center;
  }
}

.sp-fine {
  text-align: center;
  font-size: 13px;
  margin: 0;
}

.sp-takes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px 28px;
}

.sp-take {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.75;
}

.sp-take.is-on {
  opacity: 1;
}

.sp-take > div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sp-take > div span {
  font-size: 14px;
  color: var(--muted);
}

.sp-facts {
  margin-bottom: 14px;
}

section.sp-danger {
  border-color: var(--red-tint);
}

@media (max-width: 860px) {
  section.bp-hero,
  section.sp-hero {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 34px 26px;
  }
}

.sp-facts .facts-value {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: capitalize;
}

.sp-facts .facts-value code {
  text-transform: none;
}

/* ---------- Event permalink & sharing ---------- */

.agenda-card-link {
  color: inherit;
  text-decoration: none;
}

.agenda-card-link:hover {
  text-decoration: underline;
}

.agenda-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

section.ev-hero {
  padding: 48px 48px;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: nowrap;
}

.ev-hero-copy {
  flex: 1 1 auto;
  max-width: 560px;
  position: relative;
}

.ev-hero h1 {
  color: #fff;
  font-size: clamp(32px, 4.6vw, 54px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
  margin: 6px 0 18px;
}

.ev-hero .eyebrow {
  text-transform: capitalize;
}

.ev-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: #dbe1ee;
  font-size: 16px;
}

.ev-facts li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
  border: none;
  color: #dbe1ee;
}

.ev-facts li span {
  color: #dbe1ee;
}

.ev-facts .icon {
  flex: none;
  color: var(--lime);
}

.ev-facts em {
  font-style: normal;
  color: #a3aec4;
}

.ev-ended,
.ev-lead {
  margin: 16px 0 0;
  color: #c4ccdc;
  font-size: 17px;
}

.ev-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 22px;
}

.ev-actions .btn:not(.btn-ghost) {
  background: var(--lime);
  color: var(--court-deep);
}

.ev-actions .btn-ghost {
  color: #fff;
}

/* Sign-up card: a light card sitting on the dark hero */
.su-card {
  position: relative;
  flex: none;
  width: min(320px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: var(--paper-raised);
  color: var(--ink);
  display: grid;
  gap: 10px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
}

.su-card p {
  margin: 0;
}

.su-big {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.su-big.is-going {
  font-size: 26px;
  color: var(--good);
}

.su-card .muted {
  font-size: 14px;
}

.su-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 12px;
}

.su-meter-wrap {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.su-meter {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--paper-sunk);
  overflow: hidden;
}

.su-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--chart-1);
}

.ev-description {
  margin: 0;
  max-width: 68ch;
  font-size: 17px;
  white-space: pre-line;
}

.ev-share h2 {
  margin-top: 0;
}

.ev-link {
  margin: 14px 0 0;
}

.ev-link code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--paper-sunk);
  font-size: 13px;
  color: var(--ink-soft);
}

/* Share buttons */
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--paper-raised);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.share-btn[hidden] {
  display: none;
}

.share-btn:hover {
  color: #fff;
  border-color: transparent;
}

.share-btn.is-whatsapp:hover {
  background: #25d366;
}

.share-btn.is-facebook:hover {
  background: #1877f2;
}

.share-btn.is-x:hover,
.share-btn.is-email:hover {
  background: var(--ink);
}

.share-btn.is-copy:hover,
.share-btn.is-native:hover {
  background: var(--court);
}

.share-btn.is-copied {
  background: var(--good-tint);
  border-color: transparent;
  color: var(--good);
}

/* "Share" dropdown on list cards — opens with no JavaScript */
.share-menu {
  position: relative;
}

.share-menu > summary {
  list-style: none;
  cursor: pointer;
}

.share-menu > summary::-webkit-details-marker {
  display: none;
}

.share-menu > summary .icon {
  vertical-align: -3px;
  margin-right: 4px;
}

.share-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-pop);
}

.share-menu-panel .share-btn {
  padding: 9px;
}

@media (max-width: 860px) {
  section.ev-hero {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 34px 24px;
  }
  .su-card {
    width: 100%;
  }
}

/* ---------- Printable box-league sheet (A4 noticeboard) ---------- */

.sheet-body {
  background: var(--paper-sunk);
}

.sheet-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 210mm;
  margin: 20px auto;
}

.sheet-hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
}

/* The A4 preview is a fixed 210mm: on a phone it scrolls inside this wrapper, not the page. */
.sheet-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 40px;
  padding: 12mm 12mm 10mm;
  background: var(--paper-raised);
  color: var(--ink);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid var(--court);
  padding-bottom: 5mm;
  margin-bottom: 5mm;
}

.sheet-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.sheet-head h1 {
  margin: 1mm 0;
  font-size: 34px;
  color: var(--court);
}

.sheet-dates,
.sheet-updated {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.sheet-updated {
  font-size: 11px;
  color: var(--muted);
}

.sheet-box {
  margin-bottom: 6mm;
  break-inside: avoid;
}

.sheet-box-page {
  break-after: page;
}

.sheet-box-bar {
  display: flex;
  align-items: center;
  background: var(--court);
  color: #fff;
  padding: 2.2mm 3.5mm;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-box-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  margin-right: auto;
}

.sheet-box-meta {
  opacity: 0.75;
  margin-right: auto;
}

.sheet-box-pts {
  width: 28mm;
  text-align: center;
  font-weight: 700;
}

table.sheet-grid {
  margin: 0;
  table-layout: fixed;
}

.sheet-grid th,
.sheet-grid td {
  padding: 0;
  height: 9.5mm;
  text-align: center;
  font-size: 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-top: none;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.sheet-grid thead th {
  height: auto;
  border: none;
  border-bottom: 1.5px solid var(--court);
  padding: 1.5mm 0;
  background: none;
}

.sheet-grid tbody tr:last-child td {
  border-bottom: 1.5px solid var(--court);
}

.sheet-grid .sg-pos {
  width: 8mm;
  border-left: none;
  border-right: none;
  color: var(--muted);
  font-weight: 600;
}

.sheet-grid .sg-name {
  width: 44mm;
  text-align: left;
  font-weight: 500;
  font-size: 14px;
  border-left: none;
  border-right: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-grid thead .sg-name,
.sheet-grid thead .sg-phone,
.sheet-grid thead .sg-pts,
.sheet-grid thead .sg-rank {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.sg-num,
.sg-init {
  display: block;
  line-height: 1.5;
}

.sg-num {
  font-weight: 700;
}

.sg-init {
  color: var(--court);
  font-size: 11px;
  font-weight: 700;
}

.sheet-grid .sg-phone {
  width: 28mm;
  font-size: 11px;
}

.sheet-grid .sg-self {
  background: var(--paper-sunk);
}

.sheet-grid .sg-played {
  color: var(--ink-soft);
  font-weight: 500;
}

.sheet-grid .sg-won {
  font-weight: 700;
  color: var(--good);
  background: var(--good-tint);
}

.sheet-grid .sg-booked {
  font-size: 8.5px;
  line-height: 1.25;
  color: var(--ink-soft);
  white-space: normal;
}

.sg-booked span {
  display: block;
  color: var(--muted);
}

.sheet-grid .sg-pts {
  width: 15mm;
  font-weight: 700;
  font-size: 14px;
}

.sheet-grid .sg-rank {
  width: 13mm;
  font-weight: 700;
}

.sheet-grid tbody .sg-pts,
.sheet-grid tbody .sg-rank {
  background: var(--court-tint);
}

.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  align-items: flex-end;
  margin-top: 6mm;
  padding-top: 3mm;
  border-top: 1px solid var(--line-strong);
  font-size: 10.5px;
  color: var(--ink-soft);
  break-inside: avoid;
}

.sheet-rules ul {
  display: block;
  list-style: disc;
  margin: 0.5mm 0 0;
  padding-left: 4mm;
}

.sheet-rules li {
  display: list-item;
  font-size: inherit;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.sheet-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1mm;
  width: 28mm;
  text-align: center;
  font-size: 9px;
  flex-shrink: 0;
}

.sheet-qr-code {
  width: 24mm;
  height: 24mm;
}

.sheet-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4mm;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 1.5mm;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: var(--court);
}

.sheet-promo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8mm;
  margin-top: 5mm;
  padding: 4mm 5mm;
  background: var(--court) var(--court-lines-light) right center / auto 200% no-repeat;
  color: #fff;
  font-size: 11px;
  break-inside: avoid;
}

.sheet-promo strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--lime);
}

.sheet-promo-url {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--lime);
  white-space: nowrap;
}

/* Score entry on a phone: the player's name gets its own line and the game boxes
   share the row beneath it, so there's no sideways scrolling to reach game 5. */
@media (max-width: 720px) {
  table.score-grid,
  table.score-grid thead,
  table.score-grid tbody {
    display: block;
    overflow: visible;
    white-space: normal;
  }

  table.score-grid tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
  }

  table.score-grid th,
  table.score-grid td {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 0 6px;
    border: 0;
    text-align: center;
  }

  table.score-grid thead th:first-child {
    display: none;
  }

  table.score-grid tbody td:first-child {
    flex: 0 0 100%;
    padding: 12px 0 6px;
    text-align: left;
  }

  table.score-grid .score-input {
    width: 100%;
  }
}

/* Welcome checklist: when the step's button won't fit beside the text it drops
   underneath, lined up with the text rather than the icon. */
@media (max-width: 720px) {
  .mw-steps li > :last-child:not(.mw-step-body) {
    margin-left: 54px;
  }
}

/* ---------- Mobile hardening (phones and tablets) ---------- */

/* Wide data tables scroll sideways in place rather than widening the page. This
   covers bare tables too (admin lists sit directly on the page, not in a panel)
   and tablets in portrait, where the sidebar is already a drawer. */
@media (max-width: 960px) {
  table:not(.booking-grid):not(.sheet-grid) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

/* iOS Safari zooms the page when a control under 16px is focused, and doesn't
   zoom back out. Force 16px on every touch device (and any narrow window). */
@media (pointer: coarse), (max-width: 720px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Comfortable touch targets: 44px is the Apple/Material minimum. */
@media (pointer: coarse), (max-width: 720px) {
  button,
  .btn,
  .btn-secondary,
  .btn-ghost,
  .btn-danger,
  .btn-accent,
  .back-link,
  .brand,
  .section-link,
  .agenda-card-link,
  summary,
  .pagination a {
    min-height: 44px;
  }

  .section-link,
  .agenda-card-link,
  summary,
  a.btn-secondary,
  a.btn-ghost,
  a.btn-danger,
  a.btn-accent {
    display: inline-flex;
    align-items: center;
  }

  .back-link {
    margin-bottom: 12px;
  }

  label:has(> input[type="checkbox"]),
  label:has(> input[type="radio"]) {
    min-height: 44px;
  }

  .site-footer a {
    display: inline-block;
    padding: 12px 0;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 24px;
    height: 24px;
  }

  small {
    font-size: 12px;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  /* "Page 1 of 4 · 81 transactions" gets its own line above the prev/next buttons. */
  .pagination > span.muted {
    order: -1;
    flex: 1 1 100%;
    text-align: center;
  }

  /* A long button label wraps instead of spilling out of its card. */
  button,
  .btn {
    white-space: normal;
    text-align: center;
    max-width: 100%;
  }

  .sp-hero-copy {
    min-width: 0;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  .no-print {
    display: none !important;
  }

  .sheet-body {
    background: #fff;
  }

  .sheet-scroll {
    overflow: visible;
  }

  .sheet {
    margin: 0;
  }

  .sheet,
  .sheet * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- Courts: first-run setup & the courts admin ---------- */

/* Segmented "pick one" controls: pills for short labels, choice cards when a
   little explanation helps. The radio is visually hidden; the label is the control. */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.chip-row > label.chip {
  width: auto;
  max-width: none;
  min-height: 44px;
  padding: 0 18px;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--paper-raised);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.chip-row > label.chip:hover {
  border-color: var(--muted);
}

.chip-row > label.chip:has(input:checked) {
  background: var(--court);
  border-color: var(--court);
  color: var(--paper-raised);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 10px;
  width: 100%;
}

.choice-grid > label.choice {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: none;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.choice-grid > label.choice:hover {
  border-color: var(--muted);
}

.choice-grid > label.choice:has(input:checked) {
  border-color: var(--court);
  box-shadow: 0 0 0 3px var(--lime);
}

.choice small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.chip:has(input:focus-visible),
.choice:has(input:focus-visible) {
  outline: 2px solid var(--court);
  outline-offset: 2px;
}

/* A week at a glance: seven hairline tracks, open hours filled in (06:00–24:00) */
.mini-week {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-top: 8px;
}

.mini-week i {
  position: relative;
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--paper-sunk);
}

.mini-week b {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: var(--court);
}

/* Court count: a big numeral, plus the tiles it conjures up */
.court-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 10px;
  width: 100%;
}

.court-tiles > label.court-tile {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  max-width: none;
  padding: 4px 8px 4px 12px;
  border-radius: var(--radius-md);
  background: var(--mint);
  animation: pop-up var(--t-base) var(--ease) both;
}

.court-tiles > label.court-tile:nth-child(5n + 2) { background: var(--peach); }
.court-tiles > label.court-tile:nth-child(5n + 3) { background: var(--lilac); }
.court-tiles > label.court-tile:nth-child(5n + 4) { background: var(--butter); }
.court-tiles > label.court-tile:nth-child(5n + 5) { background: var(--mist); }

.court-tile svg {
  flex-shrink: 0;
  color: var(--court);
}

.court-tile input {
  border-color: transparent;
  background: transparent;
  padding: 9px 6px;
  font-family: var(--font-display);
  font-weight: 650;
}

.court-tile input:hover {
  border-color: transparent;
}

.court-tile input:focus {
  background: var(--paper-raised);
}

/* The courts admin: one ruled row per court */
.court-list {
  display: grid;
  width: 100%;
}

.court-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.court-row > .court-order {
  grid-row: 1 / span 2;
}

.court-row > .court-actions {
  grid-column: 2;
}

.court-row:first-child {
  border-top: 0;
}

.court-row.is-archived .court-fields {
  opacity: 0.6;
}

.court-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.court-order form {
  gap: 0;
}

.court-order .btn {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.court-fields {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.court-fields input[name="name"] {
  flex: 1 1 170px;
  width: auto;
  font-family: var(--font-display);
  font-weight: 650;
}

.court-fields input[name="notes"] {
  flex: 2 1 220px;
  width: auto;
}

.court-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.court-actions form {
  flex-direction: row;
}

.court-count {
  font-size: 13px;
  color: var(--muted);
}

.court-add {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}

.court-add input {
  flex: 1 1 200px;
  width: auto;
  max-width: 320px;
}

/* Wide enough (past the sidebar) for name, notes and actions on one line */
@media (min-width: 1280px) {
  .court-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .court-row > .court-order {
    grid-row: auto;
  }

  .court-row > .court-actions {
    grid-column: auto;
    justify-content: flex-end;
  }
}

.legend .dot.state-closed { --dot-color: var(--muted-2); }

/* ---------- Onboarding: focus mode ----------
   Signed-in first-run screens drop all navigation. Dark = the stage (welcome,
   celebration); light = quick-fire questions, one per screen. */

body.focus {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.focus-dark {
  background: var(--court);
  color: var(--paper-raised);
}

/* the court-line motif, kept faint so the hero court is the star */
body.focus-dark::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--court-lines-light) center top / 560px auto;
  opacity: 0.4;
  pointer-events: none;
}

.focus-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(20px, 4vw, 48px);
}

.focus-bar .brand {
  padding: 0;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: inherit;
}

.focus-club {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.focus-dark .logo-ball {
  fill: var(--lime);
}

.focus-dark .logo-dot {
  fill: var(--court);
}

.focus-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Steps: all stacked without JS; one at a time with it */
.ob-step {
  width: 100%;
}

form.is-enhanced .ob-step {
  display: none;
}

form.is-enhanced .ob-step.is-current {
  display: block;
}

form:not(.is-enhanced) [data-next],
form:not(.is-enhanced) [data-back] {
  display: none;
}

.ob-step.is-entering[data-dir="fwd"] {
  animation: ob-in-fwd 0.45s var(--ease) both;
}

.ob-step.is-entering[data-dir="back"] {
  animation: ob-in-back 0.45s var(--ease) both;
}

@keyframes ob-in-fwd {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
}

@keyframes ob-in-back {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
}

.ob-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

/* The welcome stage */
.ob-hero {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 96px) 72px;
}

.ob-hero-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 900px;
}

.ob-copy {
  position: relative;
  z-index: 1;
}

.ob-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  animation: ob-rise 0.7s var(--ease) both;
}

.ob-eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ball);
}

.ob-title {
  margin: 0 0 22px;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--paper-raised);
  outline: none;
}

.ob-word {
  display: inline-block;
  animation: ob-rise 0.85s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 85ms + 150ms);
}

.ob-accent {
  color: var(--lime);
}

@keyframes ob-rise {
  from {
    opacity: 0;
    transform: translateY(0.5em);
  }
}

.ob-sub {
  max-width: 46ch;
  margin: 0 0 30px;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: color-mix(in srgb, var(--paper-raised) 72%, transparent);
  animation: ob-rise 0.8s var(--ease) 0.7s both;
}

.ob-sub strong {
  color: var(--paper-raised);
}

.ob-error {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--red-tint);
  color: var(--red);
  font-weight: 600;
}

/* Buttons on the dark stage: apricot pill, or a quiet outline */
.ob-go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--lime);
  color: var(--court);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  animation: ob-rise 0.8s var(--ease) 1s both;
}

.ob-go:hover {
  background: var(--lime-dark);
  color: var(--court);
  text-decoration: none;
}

.ob-go.ob-go-quiet {
  background: transparent;
  border-color: color-mix(in srgb, var(--paper-raised) 35%, transparent);
  color: var(--paper-raised);
}

.ob-go.ob-go-quiet:hover {
  background: color-mix(in srgb, var(--paper-raised) 10%, transparent);
  color: var(--paper-raised);
}

[data-next].ob-go {
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime) 55%, transparent);
  animation: ob-rise 0.8s var(--ease) 1s both, ob-pulse 2.4s ease-out 2.2s infinite;
}

@keyframes ob-pulse {
  to {
    box-shadow: 0 0 0 18px color-mix(in srgb, var(--lime) 0%, transparent);
  }
}

.ob-name {
  max-width: 600px;
  margin-bottom: 22px;
}

.ob-name input {
  padding: 8px 0 12px;
  border: none;
  border-bottom: 2px solid color-mix(in srgb, var(--paper-raised) 40%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--paper-raised);
  font-family: var(--font-display);
  font-size: clamp(26px, 4.4vw, 44px);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ob-name input:hover {
  border-color: color-mix(in srgb, var(--paper-raised) 40%, transparent);
  border-bottom-color: var(--lime);
}

.ob-name input:focus {
  border-bottom-color: var(--lime);
  box-shadow: none;
}

.ob-name input::placeholder {
  color: color-mix(in srgb, var(--paper-raised) 35%, transparent);
}

/* A court that draws itself, then a ball drops in and starts rallying */
.ob-art {
  position: relative;
  display: flex;
  justify-content: center;
}

.ob-art::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lime) 26%, transparent), transparent);
  animation: ob-glow 5s ease-in-out infinite alternate;
}

@keyframes ob-glow {
  from {
    opacity: 0.5;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

.court-art {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: auto;
  overflow: visible;
}

.court-art .ln {
  stroke: var(--paper-raised);
  stroke-opacity: 0.6;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.1s var(--ease) forwards;
}

.court-art .ln:nth-child(1) { animation-delay: 0.2s; }
.court-art .ln:nth-child(2) { animation-delay: 0.7s; }
.court-art .ln:nth-child(3) { animation-delay: 0.9s; }
.court-art .ln:nth-child(4) { animation-delay: 1.1s; }
.court-art .ln:nth-child(5) { animation-delay: 1.2s; }

.court-art .ball {
  transform-box: fill-box;
  transform-origin: center;
  animation: ob-drop 1.6s var(--ease) 1.5s both, ob-rally 8s ease-in-out 3.4s infinite;
}

.court-art .ball circle {
  fill: var(--lime);
}

.court-art .ball .dot {
  fill: var(--court);
}

@keyframes ob-drop {
  0% { opacity: 0; transform: translateY(-300px); }
  12% { opacity: 1; }
  50% { transform: translateY(0); }
  66% { transform: translateY(-48px); }
  82% { transform: translateY(0); }
  91% { transform: translateY(-14px); }
  100% { transform: translateY(0); }
}

@keyframes ob-rally {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-70px, -90px); }
  50% { transform: translate(34px, -150px); }
  75% { transform: translate(-36px, -50px); }
}

@media (prefers-reduced-motion: reduce) {
  .court-art .ball {
    animation: none;
  }
  .ob-art::before,
  [data-next].ob-go {
    animation: none;
  }
}

@media (max-width: 860px) {
  .ob-hero {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    padding-bottom: 40px;
  }

  .ob-art {
    order: -1;
  }

  .court-art {
    max-width: 150px;
  }
}

/* The quick-fire questions */
.ob-wizard {
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: clamp(8px, 4vh, 40px) 24px 72px;
}

.ob-wizard > form[data-steps] {
  width: 100%;
  max-width: 720px;
  align-items: stretch;
  gap: 0;
}

.ob-progress {
  display: flex;
  gap: 6px;
  margin-bottom: clamp(28px, 6vh, 56px);
}

.ob-progress i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--paper-sunk);
  transition: background var(--t-base) var(--ease);
}

.ob-progress i.is-done {
  background: var(--lime);
}

.ob-q {
  margin: 0 0 30px;
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  outline: none;
}

.ob-hint {
  margin: 18px 0 0;
  color: var(--muted);
}

.ob-cta {
  padding: 15px 26px;
  border-radius: var(--radius-full);
  font-size: 16px;
}

.ob-nav .btn-ghost {
  padding: 15px 18px;
  border-radius: var(--radius-full);
}

.ob-skip {
  display: block;
  margin-top: 30px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ob-skip:hover {
  background: none;
  color: var(--ink);
}

form.is-enhanced .stepper {
  display: flex;
}

.stepper {
  display: none;
  align-items: center;
  gap: 22px;
}

.stepper .btn {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 26px;
  line-height: 1;
}

.stepper output {
  min-width: 2ch;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(88px, 18vw, 150px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stepper output.bump {
  animation: ob-bump 0.35s var(--ease);
}

@keyframes ob-bump {
  from {
    transform: scale(1.2);
  }
}

.stepper-quip {
  display: none;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

form.is-enhanced .stepper-quip {
  display: block;
}

.pips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  margin-top: 22px;
}

.pip {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--mint);
  color: var(--court);
  animation: pop-up var(--t-base) var(--ease) both;
}

.pip:nth-child(5n + 2) { background: var(--peach); }
.pip:nth-child(5n + 3) { background: var(--lilac); }
.pip:nth-child(5n + 4) { background: var(--butter); }
.pip:nth-child(5n + 5) { background: var(--mist); }

.chip-row-big > label.chip {
  min-height: 56px;
  padding: 0 26px;
  font-size: 17px;
}

.ob-wizard .choice-grid > label.choice {
  padding: 18px 20px;
}

.ob-wizard .choice strong {
  font-size: 17px;
}

/* Finish line */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  animation: ob-fall 3.4s var(--ease) var(--delay) both;
}

.confetti i.tone-lime { background: var(--lime); }
.confetti i.tone-mint { background: var(--mint); }
.confetti i.tone-peach { background: var(--peach); }
.confetti i.tone-lilac { background: var(--lilac); }
.confetti i.tone-butter { background: var(--butter); }
.confetti i.tone-mist { background: var(--mist); }

@keyframes ob-fall {
  0% { opacity: 0; transform: translate(0, -10px); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 100vh); }
}

.court-tiles-done {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 6px;
}

.court-tiles-done > .court-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--mint);
  color: var(--court);
  font-family: var(--font-display);
  font-weight: 650;
  animation: pop-up 0.5s var(--ease) both;
  animation-delay: calc(700ms + var(--n, 0) * 80ms);
}

.court-tiles-done > .court-tile:nth-child(5n + 2) { background: var(--peach); }
.court-tiles-done > .court-tile:nth-child(5n + 3) { background: var(--lilac); }
.court-tiles-done > .court-tile:nth-child(5n + 4) { background: var(--butter); }
.court-tiles-done > .court-tile:nth-child(5n + 5) { background: var(--mist); }

.ob-done .ob-nav .ob-go {
  animation-delay: 1.4s;
}

.ob-wizard .choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .ob-wizard .choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Breathing room between stacked controls inside a setup step */
.ob-step .chip-row + .court-tiles {
  margin-top: 20px;
}

/* =========================================================================
   Club public page (/info): animated hero, live court strip, ticker,
   features, steps, tiers, fees. Scroll reveals use CSS view timelines where
   supported and simply render in place where they aren't.
   ========================================================================= */

/* ---------- Hero ---------- */

section.info-hero {
  padding: 56px 48px;
  align-items: center;
  gap: 32px 48px;
  flex-wrap: nowrap;
  margin-bottom: 0;
  border-radius: 24px 24px 0 0;
  background-image: none;
}

.info-hero-copy {
  position: relative;
  max-width: 600px;
}

.info-hero h1 {
  color: #fff;
  font-size: clamp(42px, 6.6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.96;
  max-width: 11ch;
  margin: 6px 0 22px;
}

.info-hero h1 .word {
  display: inline-block;
  animation: word-in 0.8s var(--ease) both;
  animation-delay: calc(120ms + var(--i, 0) * 90ms);
}

.info-hero h1 em {
  position: relative;
  font-style: normal;
  color: var(--lime);
}

.info-hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.04em;
  height: 0.09em;
  border-radius: 99px;
  background: var(--lime);
  transform-origin: left;
  animation: underline-in 0.7s var(--ease) 1s both;
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.55em) rotate(4deg);
  }
}

@keyframes underline-in {
  from {
    transform: scaleX(0);
  }
}

.info-lead {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: #c4ccdc;
  max-width: 46ch;
  animation: rise 0.7s var(--ease) 0.7s both;
}

.info-hero-actions {
  margin-top: 30px;
  animation: rise 0.7s var(--ease) 0.85s both;
}

.info-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.info-hero-actions .btn .icon {
  transition: transform var(--t-base) var(--ease);
}

.info-hero-actions .btn:hover .icon {
  transform: translateX(4px);
}

.info-hero .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.info-hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
  color: #fff;
}

.info-pills {
  list-style: none;
  flex-direction: row;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  animation: rise 0.7s var(--ease) 1s both;
}

.info-pills li {
  border: none;
  justify-content: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 11px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #e3e8f2;
  font-size: 13.5px;
  font-weight: 500;
}

.info-pills .icon {
  color: var(--lime);
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  flex: none;
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lime);
  animation: live-ping 1.8s ease-out infinite;
}

@keyframes live-ping {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(3.2);
  }
}

.info-hero-art {
  flex: 0 0 min(34%, 300px);
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}

.info-hero-art .court-art {
  max-width: 280px;
  transition: transform 0.25s var(--ease);
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.info-hero-art .court-art .ball {
  cursor: pointer;
}

.info-hero-art.is-hit .court-art .ball {
  animation: ball-hit 0.9s cubic-bezier(0.3, 0.8, 0.4, 1) both;
}

@keyframes ball-hit {
  0% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-90px, -210px) scale(0.8, 1.25); }
  40% { transform: translate(60px, -280px) scale(1.2, 0.8); }
  60% { transform: translate(-40px, -120px) scale(0.9, 1.1); }
  80% { transform: translate(14px, -20px) scale(1.25, 0.8); }
  100% { transform: translate(0, 0) scale(1); }
}

.info-hero-hint {
  position: absolute;
  bottom: -6px;
  left: 50%;
  translate: -50% 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  animation: rise 0.6s var(--ease) 3.2s both, hint-fade 0.5s 9s forwards;
  pointer-events: none;
}

@keyframes hint-fade {
  to {
    opacity: 0;
  }
}

/* ---------- Ticker ---------- */

.ticker {
  overflow: hidden;
  background: var(--lime);
  color: var(--court-deep);
  border-radius: 0 0 24px 24px;
  margin: 0 0 28px;
  padding: 14px 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 38s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker ul {
  display: flex;
  flex-direction: row;
  flex: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ticker li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: none;
  color: inherit;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.ticker li::after {
  content: "";
  width: 9px;
  height: 9px;
  margin: 0 26px;
  border-radius: 50%;
  background: var(--court-deep);
  box-shadow: 3px 3px 0 -2px var(--lime);
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Stats ---------- */

.info-stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 8vw, 110px);
  padding: 20px 0 36px;
}

.info-stats > div {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.info-stats strong {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.info-stats span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Live court strip ---------- */

.info-live-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.info-live-head h2 {
  margin: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border-radius: var(--radius-full);
  background: var(--lime-tint);
  color: var(--court);
  font-size: 14px;
  font-weight: 500;
}

.live-pill .live-dot,
.live-pill .live-dot::after {
  background: var(--lime-dark);
}

.live-pill strong {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.snap {
  display: grid;
  gap: 8px;
  min-width: calc(56px + var(--cols) * 76px);
}

.snap-row {
  display: grid;
  grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.snap-head span {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.snap-row time {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.snap-cell {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  animation: pop-up 0.5s var(--ease) both;
  animation-delay: calc(200ms + var(--i, 0) * 45ms);
}

.snap-cell.is-open {
  background: var(--lime-tint);
  color: var(--court);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) ease, box-shadow var(--t-base) var(--ease);
}

a.snap-cell.is-open:hover {
  background: var(--lime);
  color: var(--court-deep);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(232, 139, 69, 0.8);
}

.snap-cell.is-taken {
  background: var(--paper-sunk);
  color: var(--muted);
  font-weight: 500;
}

.snap-cell.is-closed {
  color: var(--muted-2);
  font-weight: 400;
}

.info-live-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  font-size: 14px;
}

.info-live-foot .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ---------- Features ---------- */

.info-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 28px 32px;
  margin-top: 8px;
}

.info-feature h3 {
  margin: 14px 0 4px;
  font-size: 17px;
}

.info-feature p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.info-feature-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.info-feature:hover .info-feature-icon {
  transform: rotate(-8deg) scale(1.12);
}

.info-feature-icon.tone-mint { background: var(--mint); color: var(--good); }
.info-feature-icon.tone-peach { background: var(--peach); color: #8a4515; }
.info-feature-icon.tone-lilac { background: var(--lilac); color: var(--plum); }
.info-feature-icon.tone-butter { background: var(--butter); color: var(--amber); }
.info-feature-icon.tone-mist { background: var(--mist); color: var(--sky); }
.info-feature-icon.tone-ball { background: var(--ball-tint); color: var(--ball-dark); }

.info-more {
  margin: 18px 0 0;
  font-weight: 600;
}

.info-more a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-more .icon {
  transition: transform var(--t-base) var(--ease);
}

.info-more a:hover .icon {
  transform: translateX(4px);
}

/* ---------- Steps ---------- */

.info-steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 28px 24px;
  position: relative;
}

.info-steps li {
  position: relative;
  display: block;
  padding: 0;
  border: none;
}

.info-step-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--court-deep);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 0 6px var(--paper-raised);
}

.info-steps li:last-child .info-step-num {
  background: var(--lime);
  color: var(--court-deep);
}

/* the rally line running from step to step */
.info-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 44px;
  right: -24px;
  border-top: 2px dashed var(--line-strong);
}

.info-steps h3 {
  margin: 14px 0 4px;
  font-size: 17px;
}

.info-steps p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- Tiers ---------- */

.info-cycle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--ink-soft);
}

.info-cycle .icon {
  flex: none;
  margin-top: 2px;
  color: var(--ball-dark);
}

.info-tiers .pricing-card {
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), background var(--t-base) ease;
}

.info-tiers .pricing-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.info-tiers .pricing-card:hover {
  transform: translateY(-4px);
  background: var(--lime-tint);
  box-shadow: 0 22px 36px -24px rgba(15, 27, 51, 0.45);
}

.info-tiers .pricing-card:hover::before {
  transform: scaleX(1);
}

.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.info-tag {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Fees ---------- */

.info-fee-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.info-fee {
  display: grid;
  gap: 2px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background: var(--mint);
  color: var(--ink);
  transition: transform var(--t-base) var(--ease);
}

.info-fee.is-guests {
  background: var(--peach);
}

.info-fee:hover {
  transform: translateY(-3px) rotate(-0.6deg);
}

.info-fee span {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.info-fee strong {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.info-fee small {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- Find us ---------- */

.info-find ul {
  list-style: none;
  flex-direction: row;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 36px;
  margin: 8px 0 0;
  padding: 0;
}

.info-find li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: none;
  color: var(--ink);
  gap: 10px;
  font-weight: 500;
}

.info-find .icon {
  color: var(--ball-dark);
  flex: none;
}

/* ---------- Closing call to action ---------- */

.info-final .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.info-final .btn .icon {
  transition: transform var(--t-base) var(--ease);
}

.info-final .btn:hover .icon {
  transform: translateX(4px);
}

/* Mobile: a join bar that appears once the hero's button has scrolled away */
.info-sticky {
  display: none;
}

/* ---------- Scroll reveals (progressive enhancement) ---------- */

@supports (animation-timeline: view()) {
  .info-live,
  .info-features .info-feature,
  .info-steps li,
  .info-tiers .pricing-card,
  .info-fee,
  .info-find,
  .info-faq,
  .info-final,
  .agenda-day-events > * {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }

  .info-stats > div {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  section.info-hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    padding: 36px 24px 44px;
  }

  .info-hero-art {
    flex: none;
    align-self: center;
    width: 120px;
  }

  .info-hero-hint {
    display: none;
  }

  .info-steps li:not(:last-child)::before {
    display: none;
  }
}

@media (max-width: 720px) {
  .info-hero-actions {
    width: 100%;
  }

  .info-hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .info-fee-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-stats {
    gap: 24px;
  }

  .info-live-foot .btn {
    margin-left: 0;
  }

  .info-sticky {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 30;
    transform: translateY(160%);
    transition: transform 0.4s var(--ease);
  }

  .info-sticky.is-shown {
    transform: none;
  }

  .info-sticky .btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--lime);
    color: var(--court-deep);
    border-radius: 14px;
    box-shadow: 0 18px 30px -12px rgba(15, 27, 51, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .live-dot::after,
  .info-hero-hint {
    animation: none;
  }

  .ticker {
    mask-image: none;
  }

  .ticker-track {
    flex-wrap: wrap;
    width: auto;
  }

  .ticker ul:last-child {
    display: none;
  }

  .info-hero-art.is-hit .court-art .ball {
    animation: none;
  }
}

/* ---------- Sortable table headers (templates/listControls.tsx) ---------- */

th.sortable a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

th.sortable a:hover {
  color: var(--ink);
  text-decoration: none;
}

th.sortable a.is-sorted {
  color: var(--ink);
}

.sort-arrow {
  font-size: 11px;
  opacity: 0.35;
  transition: opacity var(--t-fast) ease;
}

th.sortable a:hover .sort-arrow,
th.sortable a.is-sorted .sort-arrow {
  opacity: 1;
}

.list-search .btn-ghost {
  text-decoration: none;
}

/* =========================================================================
   Club microsite — the public pages a club owns (/, /about, /news, /contact…).
   The club's own name and mark lead; Rally steps back to the footer. Owners
   choose a tone (hero + closing band) from a short vetted list and upload
   photos — layout, type and spacing stay ours, so it always looks like this.
   ========================================================================= */

/* ---------- Tones: dark enough for white text (≥ 12:1), calm beside apricot ---------- */

[data-tone="midnight"] { --tone-bg: #0f1b33; }
[data-tone="forest"] { --tone-bg: #12301f; }
[data-tone="ocean"] { --tone-bg: #0a2e3d; }
[data-tone="plum"] { --tone-bg: #281a42; }
[data-tone="burgundy"] { --tone-bg: #3a1220; }
[data-tone="graphite"] { --tone-bg: #1c2027; }

body.public section.info-hero,
body.public .callout-band {
  background-color: var(--tone-bg, var(--court-deep));
}

/* ---------- Club header ---------- */

.club-brand {
  gap: 12px;
}

.club-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.club-monogram {
  display: inline-grid;
  place-items: center;
  width: var(--mark, 36px);
  height: var(--mark, 36px);
  border-radius: 50%;
  background: var(--court);
  color: var(--lime);
  font-family: var(--font-display);
  font-size: calc(var(--mark, 36px) * 0.38);
  font-weight: 750;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.club-name {
  font-size: 17px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  white-space: normal;
  max-width: 24ch;
}

.site-header .inner {
  gap: 28px;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper-sunk);
}

.site-menu {
  display: none;
  position: relative;
}

.site-menu summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--ink);
}

.site-menu summary::-webkit-details-marker {
  display: none;
}

.site-menu summary:hover,
.site-menu[open] summary {
  background: var(--paper-sunk);
}

.site-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  animation: pop-down 0.18s var(--ease);
}

.site-menu-panel a {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 550;
  color: var(--ink);
}

.site-menu-panel a:hover {
  background: var(--paper-sunk);
  text-decoration: none;
}

@media (max-width: 960px) {
  .site-header .site-nav {
    display: none;
  }

  .site-menu {
    display: block;
  }
}

@media (max-width: 520px) {
  .site-header .site-signin {
    display: none;
  }

  .club-name {
    font-size: 15px;
    max-width: 16ch;
  }
}

/* ---------- Club footer ---------- */

.club-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-sunk);
  margin-top: 0;
}

.club-footer .inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 40px 28px;
}

.club-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 36px 48px;
}

.club-footer h3 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.club-footer ul {
  margin: 0;
  gap: 2px;
}

.club-footer li {
  padding: 0;
  border: none;
  justify-content: flex-start;
}

.club-footer li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-weight: 500;
  color: var(--ink-soft);
}

.club-footer-about p {
  margin: 14px 0 0;
  max-width: 32ch;
  color: var(--muted);
  white-space: pre-line;
}

.club-footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.club-footer .powered {
  color: var(--muted);
  font-weight: 500;
}

.club-footer .powered strong {
  color: var(--ink);
}

@media (max-width: 720px) {
  .club-footer .inner {
    padding: 36px 20px 24px;
  }

  .club-footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .club-footer li a {
    padding: 9px 0;
  }
}

/* ---------- Hero with a photo ---------- */

.info-hero h1.is-custom {
  font-size: clamp(38px, 5.6vw, 76px);
  max-width: 13ch;
  line-height: 1;
}

.info-hero-photo {
  position: relative;
  flex: 0 0 min(40%, 420px);
  margin: 0;
  aspect-ratio: 4 / 5;
  max-height: 520px;
  animation: rise 0.9s var(--ease) 0.4s both;
}

.info-hero-photo::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 2px solid var(--lime);
  border-radius: 22px;
  opacity: 0.8;
}

.info-hero-photo img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  background: var(--paper-sunk);
}

@media (max-width: 860px) {
  .info-hero-photo {
    flex: none;
    align-self: stretch;
    aspect-ratio: 16 / 10;
    max-height: 280px;
  }

  .info-hero-photo::before {
    inset: 10px -8px -10px 10px;
  }
}

/* ---------- "Come and try us" ---------- */

.try-us {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px 56px;
  align-items: center;
}

.try-us h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  border: none;
  padding: 0;
  margin-bottom: 12px;
}

.try-us p {
  max-width: 52ch;
}

.try-us .btn {
  margin-top: 6px;
}

.try-us-next .eyebrow {
  margin-bottom: 10px;
}

.try-us-next .agenda-card {
  margin: 0;
}

@media (max-width: 860px) {
  .try-us {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- About teaser, story, highlights ---------- */

.about-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 56px;
  align-items: center;
}

.about-teaser h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  border: none;
  padding: 0;
  margin-bottom: 14px;
}

.about-teaser:not(:has(.photo-mosaic)) {
  grid-template-columns: minmax(0, 1fr);
}

.site-highlights {
  margin: 18px 0 8px;
  gap: 0;
}

.site-highlights li {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-weight: 500;
}

.site-highlights .icon {
  color: var(--good);
  margin-top: 2px;
}

.photo-mosaic {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  aspect-ratio: 5 / 4;
}

.photo-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--paper-sunk);
}

.photo-mosaic img:first-child {
  grid-row: 1 / 3;
}

.photo-mosaic.count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.photo-mosaic.count-1 img:first-child {
  grid-row: auto;
}

.photo-mosaic.count-2 {
  grid-template-rows: 1fr;
}

.photo-mosaic.count-2 img:first-child {
  grid-row: auto;
}

@media (max-width: 860px) {
  .about-teaser {
    grid-template-columns: minmax(0, 1fr);
  }
}

.about-story {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 32px 56px;
  align-items: start;
}

.about-facts .facts {
  margin-bottom: 8px;
}

@media (max-width: 860px) {
  .about-story {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Owner-written text */
.prose p {
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 68ch;
}

.prose p:first-child {
  font-size: 18.5px;
  color: var(--ink);
}

.prose ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
  list-style: disc;
  display: block;
}

.prose li {
  display: list-item;
  border: none;
  padding: 3px 0;
  font-size: 16px;
}

.prose a {
  text-decoration: underline;
}

/* ---------- Gallery + lightbox ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  grid-auto-rows: 180px;
  gap: 10px;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--paper-sunk);
  cursor: zoom-in;
}

.gallery-item.is-feature {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  font-size: 13px;
  font-weight: 550;
  color: #fff;
  background: linear-gradient(to top, rgba(15, 27, 51, 0.72), transparent);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus-visible .gallery-caption {
  opacity: 1;
}

.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(10, 18, 36, 0.92);
}

.lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 56px 20px 72px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-caption {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  color: #c4ccdc;
}

.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox .lb-next { right: 16px; top: 50%; translate: 0 -50%; }

@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 130px;
  }
}

/* ---------- Find us + map ---------- */

.find-us {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px 44px;
  align-items: start;
}

.find-us-copy .info-find,
.find-us ul {
  flex-direction: column;
  gap: 2px;
}

.find-us li {
  padding: 8px 0;
  align-items: flex-start;
  gap: 12px;
}

.find-us li .icon {
  margin-top: 2px;
}

.find-us-notes {
  margin: 14px 0 18px;
}

.find-us-notes p,
.find-us-notes p:first-child {
  font-size: 14.5px;
  color: var(--ink-soft);
}

.find-us-map {
  position: relative;
  align-self: stretch;
  min-height: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-sunk);
}

.find-us-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.85);
}

@media (max-width: 860px) {
  .find-us {
    grid-template-columns: minmax(0, 1fr);
  }

  .find-us-map {
    min-height: 240px;
  }
}

/* ---------- Contact / enquiry form ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 961px) {
  .contact-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }

  .contact-grid .find-us {
    grid-template-columns: minmax(0, 1fr);
  }
}

.enquiry-form label {
  max-width: none;
}

.enquiry-form .muted {
  font-weight: 400;
}

.enquiry-note {
  font-size: 13px;
  color: var(--muted);
  margin: -6px 0 0;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.enquiry-sent {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.enquiry-sent-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--good);
  margin-bottom: 10px;
}

.enquiry-sent .agenda-card {
  width: 100%;
  margin-bottom: 14px;
}

/* ---------- Reveals, reduced motion ---------- */

@supports (animation-timeline: view()) {
  .try-us,
  .about-teaser,
  .find-us {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .info-hero-photo,
  .gallery-item img {
    animation: none;
    transition: none;
  }
}

/* ---------- Website admin (/admin/website) — tab strip also serves member sections ---------- */

.web-tabs,
.section-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 22px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.web-tabs::-webkit-scrollbar,
.section-tabs::-webkit-scrollbar {
  display: none;
}

.web-tabs a,
.section-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}

.web-tabs a:hover,
.section-tabs a:hover {
  color: var(--ink);
  text-decoration: none;
}

.web-tabs a[aria-current="page"],
.section-tabs a[aria-current="page"] {
  color: var(--ink);
}

.web-tabs a[aria-current="page"]::after,
.section-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--court);
}

.web-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--lime);
  color: var(--court-deep);
  font-size: 11.5px;
  font-weight: 700;
}

.web-form label {
  max-width: 640px;
}

.web-form label small {
  font-weight: 400;
  color: var(--muted);
}

.web-form section > .muted {
  margin-top: -6px;
}

/* ---------- Image upload field ---------- */

.image-field {
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin-bottom: 20px;
}

.image-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.image-field-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.image-field-preview {
  width: 148px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--paper-sunk);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.image-field-preview.is-square {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.image-field-preview[hidden] {
  display: none;
}

.image-field-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.image-field-controls small {
  color: var(--muted);
}

.image-field-remove {
  font-size: 13px !important;
  color: var(--ink-soft) !important;
}

@media (max-width: 560px) {
  .image-field-row {
    flex-direction: column;
  }
}

/* ---------- Tone picker ---------- */

.tone-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tone-choice {
  position: relative;
  flex-direction: row !important;
  align-items: center !important;
  width: auto !important;
  gap: 10px !important;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  font-size: 14px !important;
  font-weight: 550 !important;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.tone-choice:hover {
  border-color: var(--muted);
}

.tone-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tone-choice:has(input:checked) {
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(246, 166, 107, 0.5);
}

.tone-choice:has(input:focus-visible) {
  outline: 2px solid var(--court);
  outline-offset: 2px;
}

.tone-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tone-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 8px 0 0 -4px var(--lime);
  margin-right: 6px;
}

/* ---------- Readiness checklist ---------- */

.readiness-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.readiness-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
  border: none;
  padding: 0;
  margin: 0 0 4px;
}

.readiness-head p {
  margin: 0;
}

.readiness-fill {
  background: var(--lime);
}

.readiness-list {
  margin: 18px 0 0;
}

.readiness-list li {
  gap: 14px;
  justify-content: flex-start;
}

.readiness-list li > div {
  flex: 1;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.readiness-list strong {
  font-size: 14.5px;
}

.readiness-list small {
  color: var(--muted);
}

.readiness-tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: #fff;
  flex-shrink: 0;
}

.readiness-list li.is-done .readiness-tick {
  background: var(--good);
  border-color: var(--good);
}

.readiness-list li.is-done strong {
  color: var(--muted);
  font-weight: 550;
}

/* ---------- Photo manager ---------- */

.photo-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 22px 18px;
}

.photo-admin {
  display: grid;
  gap: 10px;
  align-content: start;
}

.photo-admin img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--paper-sunk);
}

.photo-admin-caption {
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
}

.photo-admin-caption input {
  min-width: 0;
}

.photo-admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.photo-admin-actions form {
  display: block;
}

.photo-admin-actions form:last-child {
  margin-left: auto;
}

/* ---------- Enquiries ---------- */

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions form {
  display: block;
}

.enquiry-message {
  max-width: 320px;
  white-space: pre-line;
  color: var(--ink-soft);
}

.facts dt,
.facts dd {
  margin: 0;
}

/* A form made of panels: the panels fill the page, the save button stays put. */
form.web-form {
  align-items: stretch;
  gap: 0;
}

form.web-form > button[type="submit"] {
  align-self: flex-start;
}

.site-menu summary::before,
.site-menu summary::marker {
  content: none;
  display: none;
}

/* ---------- News ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  border: none;
  padding: 0;
}

.info-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.info-more-link .icon {
  transition: transform var(--t-base) var(--ease);
}

.info-more-link:hover .icon {
  transform: translateX(4px);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 32px 24px;
  margin-bottom: 24px;
}

section .post-grid {
  margin-bottom: 4px;
}

.post-card {
  display: grid;
  align-content: start;
  gap: 14px;
  color: inherit;
  font-weight: inherit;
}

.post-card:hover {
  text-decoration: none;
  color: inherit;
}

.post-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--tint, var(--mist));
}

.post-card-media.cat-news { --tint: var(--mist); }
.post-card-media.cat-results { --tint: var(--mint); }
.post-card-media.cat-social { --tint: var(--peach); }
.post-card-media.cat-tournament { --tint: var(--lilac); }

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.post-card:hover .post-card-media img {
  transform: scale(1.04);
}

.post-card-mark {
  position: absolute;
  inset: 0;
  background: var(--court-illustration) center / auto 78% no-repeat;
  opacity: 0.55;
}

.post-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--muted);
}

.post-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 8px 0 6px;
}

.post-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.post-card.is-featured {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  margin-bottom: 36px;
}

.post-card.is-featured .post-card-media {
  aspect-ratio: 4 / 3;
}

.post-card.is-featured h3 {
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.post-card.is-featured p {
  font-size: 16.5px;
}

@media (max-width: 760px) {
  .post-card.is-featured {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

.chip-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.chip-filters a {
  padding: 7px 15px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper-raised);
}

.chip-filters a:hover {
  border-color: var(--muted);
  text-decoration: none;
}

.chip-filters a[aria-current="true"] {
  background: var(--court);
  border-color: var(--court);
  color: #fff;
}

.post {
  max-width: 740px;
  margin: 0 auto 56px;
}

.post-head h1 {
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin: 14px 0 26px;
}

.post-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
  background: var(--paper-sunk);
}

.post-body p {
  font-size: 17.5px;
  line-height: 1.7;
}

.post-body p:first-child {
  font-size: 19px;
}

.post-foot {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.news-teaser h2 {
  border: none;
}

/* ---------- People ---------- */

.people h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  border: none;
  padding: 0;
  margin-bottom: 22px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 28px 24px;
}

.person {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.person-photo,
.person-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-sunk);
}

.person-avatar {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.person-body h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 2px 0 0;
}

.person-role {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.person-body p {
  font-size: 14px;
  margin: 0 0 8px;
}

.person-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Public documents ---------- */

.public-docs h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  border: none;
  padding: 0;
  margin-bottom: 16px;
}

.doc-list {
  margin: 0;
}

.doc-list li {
  gap: 14px;
  justify-content: flex-start;
}

.doc-list li a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  color: var(--ink);
}

.doc-list .icon {
  color: var(--muted);
}

.doc-title {
  overflow-wrap: anywhere;
}

.doc-list small {
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .doc-list li {
    flex-wrap: wrap;
  }

  .doc-list small {
    display: none;
  }
}

/* ---------- Coaching ---------- */

.programme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.programme {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 26px 28px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.programme header {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.programme h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.programme-audience {
  padding: 3px 11px;
  border-radius: var(--radius-full);
  background: var(--mist);
  color: var(--sky);
  font-size: 12.5px;
  font-weight: 650;
}

.programme p {
  margin: 0 0 6px;
  font-size: 15px;
}

.programme-facts {
  margin: 0 0 6px;
  display: grid;
  gap: 8px;
}

.programme-facts div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.programme-facts dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.programme-facts dd {
  margin: 0;
  font-weight: 550;
  color: var(--ink);
}

.programme .btn {
  justify-self: start;
}

.programme-teaser h2 {
  margin: 0;
}

.programme-rows {
  margin: 0;
}

.programme-rows li {
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.programme-rows strong {
  font-size: 16px;
}

.enquiry-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--mist);
  color: var(--ink);
  font-size: 14px;
}

.enquiry-context .icon {
  color: var(--sky);
}

/* ---------- Website admin: manage lists ---------- */

.section-actions {
  margin: 0 0 18px;
}

.manage-list {
  margin: 0;
}

.manage-row {
  display: block;
  padding: 0;
}

.manage-row summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.manage-row summary .badge {
  margin-left: auto;
}

.manage-thumb,
.manage-row .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.manage-title {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.manage-title small {
  color: var(--muted);
}

.manage-form {
  padding: 4px 0 8px 34px;
}

.manage-actions {
  display: flex;
  gap: 8px;
  padding: 0 0 18px 34px;
}

.manage-actions form {
  display: block;
}

.manage-actions form:last-child {
  margin-left: auto;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.danger-zone {
  margin-top: 28px;
}

.site-nav a {
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .site-header .inner {
    gap: 16px;
  }

  .site-nav a {
    padding: 8px 9px;
    font-size: 14px;
  }
}

/* A story with no photo gets a slim tinted band with the court line-drawing, not a big empty block. */
.post-card-media:not(:has(img)) {
  aspect-ratio: 16 / 6;
}

.post-card-media:not(:has(img)) .post-card-mark {
  background-size: auto 190%;
  background-position: 50% 62%;
  opacity: 0.4;
}

.post-card.is-featured .post-card-media:not(:has(img)) {
  aspect-ratio: 4 / 3;
}

/* ---------- Teams & results ---------- */

.team-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 20px;
}

.team-head h2 {
  margin: 0 0 4px;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
  border: none;
  padding: 0;
}

.team-head p {
  margin: 0;
}

.team-record {
  display: flex;
  gap: clamp(16px, 4vw, 40px);
  margin: 0;
}

.team-record div {
  display: grid;
  gap: 2px;
}

.team-record dt {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.team-record dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.team-next {
  margin-bottom: 22px;
}

.team-next .agenda-card {
  margin: 0;
}

.team-results-h {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 4px;
}

.results {
  margin: 0;
}

.result {
  display: block;
  padding: 0;
}

.result-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto 76px;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
}

.result-main time {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.result-title {
  display: grid;
  gap: 1px;
  font-weight: 600;
  color: var(--ink);
}

.result-title small {
  font-weight: 450;
}

.result-score {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.result-main .badge {
  justify-self: end;
}

.result-report {
  padding: 0 0 14px 106px;
}

.result-report summary {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
}

.result-report .prose {
  padding-top: 8px;
}

.result-report .prose p,
.result-report .prose p:first-child {
  font-size: 15px;
}

@media (max-width: 640px) {
  .result-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "date badge" "title score";
    gap: 4px 12px;
  }

  .result-main time { grid-area: date; }
  .result-main .badge { grid-area: badge; }
  .result-title { grid-area: title; }
  .result-score { grid-area: score; }

  .result-report {
    padding-left: 0;
  }
}

.results-teaser h2 {
  margin: 0;
}

/* ---------- Sponsors & links ---------- */

.sponsors h2,
.useful-links h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  border: none;
  padding: 0;
  margin-bottom: 18px;
}

.sponsor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 36px;
  margin: 0;
}

.sponsor-row li {
  padding: 0;
  border: none;
}

.sponsor-row a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  transition: color var(--t-base) ease;
}

.sponsor-row a:hover {
  color: var(--ink);
  text-decoration: none;
}

.sponsor-row img {
  max-height: 48px;
  max-width: 160px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter var(--t-base) ease, opacity var(--t-base) ease;
}

.sponsor-row a:hover img {
  filter: none;
  opacity: 1;
}

/* ---------- Website admin: teams, links, domain ---------- */

.manage-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  color: var(--ink);
}

.manage-link:hover {
  text-decoration: none;
  color: var(--court);
}

.manage-row:has(.manage-actions.inline) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.manage-row:has(.manage-actions.inline) .manage-link {
  flex: 1;
}

.manage-actions.inline {
  padding: 0;
}

.manage-date {
  min-width: 82px;
  font-size: 13px;
  color: var(--muted);
}

.manage-thumb.is-contain {
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--paper-sunk);
}

form.flush {
  padding-left: 0;
}

.score-pair {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 640px;
}

.score-pair label {
  max-width: 160px;
}

.score-note {
  margin-top: -8px;
}

.domain-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.domain-head h2 {
  margin: 0;
  border: none;
  padding: 0;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.03em;
}

section code {
  overflow-wrap: anywhere;
}

/* Twelve tabs: let them wrap on a desktop-sized page, scroll sideways on a phone. */
@media (min-width: 721px) {
  .web-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 0;
  }
}

/* ---------- Member nav: unread dot + phone tab bar ---------- */

.new-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: var(--radius-full);
  background: var(--ball);
}

.new-dot-corner {
  position: absolute;
  top: -1px;
  right: -1px;
  margin: 0;
  box-shadow: 0 0 0 2px var(--court-deep);
}

.account-menu-trigger .avatar,
.icon-btn[data-nav-toggle] {
  position: relative;
}

.icon-btn[data-nav-toggle] .new-dot-corner {
  top: 6px;
  right: 6px;
  box-shadow: 0 0 0 2px var(--paper);
}

/* Phones only: the five sections as a bottom bar. The sidebar drawer stays for account and admin. */
.tabbar {
  display: none;
}

@media (max-width: 720px) {
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--court-deep);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* One bar per area: the club's five sections, or the admin's four plus More. */
  html[data-area="admin"] .tabbar[data-tabbar="club"],
  html[data-area="club"] .tabbar[data-tabbar="admin"] {
    display: none;
  }

  /* "More" is a button, so undo the global button look. */
  button.tab-link {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 11.5px;
    font-weight: 550;
    color: #a3aec4;
  }

  button.tab-link:hover {
    background: transparent;
    color: #fff;
  }

  .tab-link {
    position: relative;
  }

  .tab-link .nav-count {
    position: absolute;
    top: 3px;
    left: calc(50% + 6px);
    margin: 0;
    min-width: 18px;
    height: 18px;
  }

  .tab-link .new-dot-corner {
    top: 7px;
    left: calc(50% + 10px);
    right: auto;
    box-shadow: 0 0 0 2px var(--court-deep);
  }

  /* A count says more than a dot: show one or the other. */
  .tab-link .nav-count:not([hidden]) ~ .new-dot {
    display: none;
  }

  /* On admin pages the bar's More button replaces the top bar's menu button. */
  html[data-area="admin"] .topbar [data-nav-toggle] {
    display: none;
  }

  .tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    border-radius: var(--radius-md);
    font-size: 11.5px;
    font-weight: 550;
    color: #a3aec4;
    white-space: nowrap;
  }

  .tab-link:hover {
    color: #fff;
    text-decoration: none;
  }

  .tab-link .icon {
    color: #7c89a3;
  }

  .tab-link[aria-current="page"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
  }

  .tab-link[aria-current="page"] .icon {
    color: var(--lime);
  }

  /* Room for the bar so the end of a page is never hidden behind it. */
  body.app .page {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* ---------- Admin nav: search, attention counts, settings ---------- */

/* The settings search lives at the top of the admin sidebar; results open inline beneath it (the
   sidebar scrolls, so a floating panel would be clipped). */
.sidebar .admin-search {
  /* A little in from the nav pills' edges, but wide enough for the whole placeholder. */
  margin: 0 6px 4px;
}

.sidebar .admin-search-input {
  font-size: 14px;
  padding: 9px 32px 9px 36px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.06);
  background-position: 12px center;
  background-size: 17px;
  color: #fff;
}

.sidebar .admin-search-input::placeholder {
  color: #7c89a3;
}

.sidebar .admin-search-kbd {
  right: 9px;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #7c89a3;
}

.sidebar .admin-search-results {
  position: static;
  margin: 6px 0 0;
}

.sidebar .admin-search-result {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
}

.sidebar .admin-search-result-title {
  font-size: 14px;
}

.sidebar .admin-search-result-section {
  text-align: left;
  font-size: 12.5px;
}

/* A count of things waiting, e.g. disputed results. Filled in by public/adminBadges.js. */
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--lime);
  color: var(--court-deep);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.nav-count[hidden] {
  display: none;
}

.side-link-admin .nav-count {
  margin-left: auto;
}

.side-link-admin .nav-count + .side-link-go {
  margin-left: 8px;
}

/* Settings sits apart at the foot of the admin sidebar. */
.side-group-settings {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.attention-list {
  margin-top: 4px;
}

.attention-list .index-row:last-child {
  border-bottom: none;
}

/* A count on a tab (e.g. Transactions 2) — the tab that holds the work. */
.section-tabs .nav-count {
  margin-left: 0;
  background: var(--lime);
  color: var(--court-deep);
}

/* The "what to do" label on a needs-attention row. */
.index-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--court);
  white-space: nowrap;
}

.index-row:hover .index-action .index-go {
  transform: translateX(3px);
}

.attention-callout a {
  font-weight: 600;
}

/* A small count beside a section heading, e.g. "Waiting to pay 3". */
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--lime);
  color: var(--court-deep);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  vertical-align: middle;
}

/* "Pause chasing…" opens its little form in place under the button. */
.pause-chasing > summary {
  display: inline-flex;
}

.pause-chasing > summary::before {
  display: none;
}

.pause-chasing[open] .pause-chasing-form {
  margin-top: 10px;
}

.pause-chasing-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

/* ---------- Work lists: the things an admin has to do, one row each, actions always in view ---------- */

.work-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.work-main strong,
.work-main a strong {
  display: block;
  font-size: 15.5px;
}

.work-main small,
.work-meta small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.work-meta {
  font-size: 14.5px;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.work-actions form {
  margin: 0;
}

/* A message or note belonging to the row, shown in full beneath it. */
.work-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--paper);
  font-size: 14px;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .work-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-actions {
    justify-content: flex-start;
  }

  .work-actions .btn,
  .work-actions button {
    min-height: 40px;
  }
}

/* ---------- Jump links on long admin pages ---------- */

.jump-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: -6px 0 20px;
}

.jump-links-label {
  margin-right: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.jump-links a {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
}

.jump-links a:hover {
  background: var(--paper-raised);
  text-decoration: none;
}

/* Touch screens have no "/" key and are forced to 16px text: drop the hint and give the words its room. */
@media (pointer: coarse), (max-width: 720px) {
  .sidebar .admin-search-kbd {
    display: none;
  }

  .sidebar .admin-search-input {
    padding-right: 12px;
  }
}

/* ---------- Social graphics (admin) ---------- */

/* A picture on the left, what to do with it on the right; stacked on a phone. */
.social-card {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* Several pictures in one panel (every team result, every badge…) are separated by a hairline, not run together. */
.social-card + .social-card {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.social-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--court);
}

/* The controls are a column with even breathing room: paragraphs, the size picker, the buttons and the caption each get
   the same gap, rather than leaning on each element's own margins (which left Download touching the picker and Copy
   touching the caption box). */
.social-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.social-controls > *,
.social-controls fieldset > p {
  margin: 0;
}

.social-controls > fieldset,
.social-controls > label {
  align-self: stretch;
}

.social-controls > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-controls textarea {
  min-height: 140px;
}

.social-controls .facts {
  margin: 0;
  align-self: stretch;
}

@media (max-width: 720px) {
  .social-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}
