/*
  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;
}

/* ---------- 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;
  height: 100vh;
  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: 11px;
  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(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;
}

button:hover,
a.btn:hover {
  background: #1c2d52;
  color: #fff;
  text-decoration: none;
}

button:active,
a.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;
}

.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 {
  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: 11.5px;
  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: 11px;
  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;
  margin-bottom: 36px;
  max-width: 640px;
}

.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;
}

.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;
}

.admin-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 56px;
}

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

.index-group h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 19px;
}

.index-group h2 span {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.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: 11.5px;
  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(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(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: 11.5px;
  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;
}

.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 .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: 11.5px;
  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: 11.5px;
  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;
}

.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;
  }
  .admin-groups {
    gap: 40px 40px;
  }
}

@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: 1fr;
  }

  .admin-groups {
    grid-template-columns: 1fr;
  }

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

  .hero-split {
    gap: 40px;
  }

  .court-preview {
    transform: none;
  }
}

@media (max-width: 720px) {
  .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: 1fr;
  }

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

  .band {
    padding: 48px 0;
  }

  /* Wide data tables scroll sideways inside their panel rather than the page. */
  section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .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: 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: 11.5px;
  }

  .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: 11.5px;
  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);
}


/* =========================================================================
   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: 11px;
  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: 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;
}
