:root {
  --court: #11875a;
  --court-dark: #0b6844;
  --clay: #b96f39;
  --clay-soft: #fff7f0;
  --ink: #17211c;
  --muted: #65726c;
  --line: #dfe7e2;
  --line-strong: #c9d7cf;
  --soft: #f5f8f6;
  --danger: #d94a57;
  --danger-soft: #fff4f5;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 18%, rgba(217, 255, 79, 0.16) 0 36px, transparent 37px),
    linear-gradient(135deg, rgba(17, 135, 90, 0.05) 25%, transparent 25%) 0 0 / 56px 56px,
    linear-gradient(225deg, rgba(17, 135, 90, 0.04) 25%, transparent 25%) 0 0 / 56px 56px,
    linear-gradient(180deg, #f7faf8 0, #fbfcfb 260px, #ffffff 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(21, 55, 39, 0.05);
}

.topbar-inner {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  color: var(--court-dark);
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(21, 55, 39, 0.16);
}

.brand-text {
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 0;
}

.competition-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.competition-tab {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--court-dark);
  font-weight: 800;
  text-decoration: none;
}

.competition-tab.active,
.competition-tab:hover {
  background: var(--court);
  color: #fff;
  text-decoration: none;
}

.nav-tabs form {
  margin: 0;
}

.nav-tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--court-dark);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-tab.as-button {
  background: transparent;
}

.nav-tab.active,
.nav-tab:hover {
  border-color: var(--court);
  background: var(--court);
  color: #fff;
  transform: translateY(-1px);
}

.page-shell {
  position: relative;
  padding: 28px 0 56px;
  overflow: hidden;
}

.page-shell::before {
  position: absolute;
  inset: 0 0 auto;
  height: 560px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 253, 248, 0.78) 58%, rgba(255, 255, 255, 0.96)),
    url("tennis-hero.png?v=3");
  background-position: center 62%;
  background-size: cover;
  content: "";
  opacity: 0.34;
  pointer-events: none;
}

.page-shell > * {
  position: relative;
  z-index: 1;
}

.page-narrow {
  max-width: 1120px;
}

.home-hero {
  position: relative;
  min-height: 100svh;
  margin-top: -28px;
  overflow: hidden;
  background: #0d3f2f url("tennis-hero.png?v=3") center / cover no-repeat;
}

.home-hero-bg,
.home-hero-overlay {
  position: absolute;
  inset: 0;
}

.home-hero-bg {
  background-image: url("tennis-hero.png?v=3");
  background-position: center 62%;
  background-size: cover;
  transform: scale(1.01);
}

.home-hero-overlay {
  background:
    linear-gradient(90deg, rgba(5, 31, 22, 0.68) 0%, rgba(5, 31, 22, 0.38) 48%, rgba(5, 31, 22, 0.08) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(5, 31, 22, 0.18) 100%);
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 64px;
}

.home-hero-copy {
  max-width: 960px;
  color: #fff;
}

.home-hero-copy .eyebrow {
  color: #bdf3d1;
}

.home-hero h1 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.95;
  text-wrap: balance;
}

.home-lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
  line-height: 1.65;
}

.home-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: 14px;
  margin-top: 34px;
}

.home-choice {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.home-choice:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

.home-choice.primary {
  border-color: rgba(189, 243, 209, 0.9);
  background: rgba(17, 135, 90, 0.86);
}

.home-choice span {
  font-size: 1.45rem;
  font-weight: 900;
}

.home-choice small {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  line-height: 1.45;
}

.home-next-grid {
  display: grid;
  width: min(100%, 900px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.home-next-match {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(5, 31, 22, 0.42);
  backdrop-filter: blur(12px);
}

.home-section-kicker {
  margin-bottom: 10px;
  color: #bdf3d1;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-next-match p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.home-next-list {
  display: grid;
  gap: 8px;
}

.home-next-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.home-next-card:hover {
  border-color: rgba(189, 243, 209, 0.75);
  color: #fff;
  text-decoration: none;
}

.home-next-card strong {
  font-size: 1rem;
  font-weight: 900;
}

.home-next-card small,
.home-next-meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
}

.home-news-section {
  padding: 58px 0 76px;
  background:
    linear-gradient(180deg, rgba(245, 248, 246, 0.98), rgba(255, 252, 246, 0.96)),
    var(--paper);
}

.home-news-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-news-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 950;
}

.news-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.45fr);
  gap: 12px;
  margin-bottom: 18px;
}

.news-admin-form label,
.news-edit-panel label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.news-admin-text {
  grid-column: 1 / -1;
}

.news-admin-form .btn {
  justify-self: start;
}

.news-grid {
  display: grid;
  gap: 12px;
}

.news-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.news-card time {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--court);
  font-size: 0.76rem;
  font-weight: 900;
}

.news-card h3 {
  margin: 0;
  color: var(--court-dark);
  font-size: 1.2rem;
  font-weight: 950;
}

.news-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.news-edit-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.news-edit-panel summary {
  color: var(--court);
  cursor: pointer;
  font-weight: 900;
}

.news-edit-panel form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

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

.news-more-button {
  margin-top: 16px;
}

.page-wide {
  max-width: 1280px;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--court);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-count,
.metric-strip {
  color: var(--muted);
  font-weight: 700;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.metric-strip {
  display: flex;
  gap: 18px;
}

.metric-strip strong,
.page-count strong {
  color: var(--ink);
}

.surface {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(14, 45, 30, 0.06);
}

.view-note {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 700;
}

.compact-surface h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin: 0;
}

.table-view-switch {
  margin-bottom: 14px;
}

.table-view-button.nav-tab {
  appearance: none;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--court-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.table-view-button.nav-tab.active,
.table-view-button.nav-tab:hover {
  border-color: var(--court);
  background: var(--court);
  color: #fff;
  transform: translateY(-1px);
}

.table-view-panel[hidden] {
  display: none;
}

.standings-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.standings-table td,
.standings-table th {
  padding: 14px 12px;
}

.doubles-name-stack {
  display: inline-grid;
  gap: 2px;
  align-items: center;
  justify-items: inherit;
  line-height: 1.08;
}

.doubles-name-stack span {
  display: block;
}

.head-to-head-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  -webkit-overflow-scrolling: touch;
}

.head-to-head-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
}

.head-to-head-table th,
.head-to-head-table td {
  min-width: 82px;
  max-width: 92px;
  height: 44px;
  padding: 5px 6px;
  border-right: 1px solid #cddbd3;
  border-bottom: 1px solid #cddbd3;
  text-align: center;
  vertical-align: middle;
}

.head-to-head-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 56px;
  background: #eef7f2;
  color: var(--court-dark);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: normal;
}

.head-to-head-column-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.head-to-head-table-doubles .head-to-head-column-name,
.head-to-head-table-doubles .head-to-head-name .participant-link {
  justify-items: center;
  overflow-wrap: normal;
  word-break: normal;
}

.head-to-head-corner,
.head-to-head-name {
  position: sticky;
  left: 0;
  min-width: 138px;
  max-width: 154px;
  text-align: left;
}

.head-to-head-corner {
  z-index: 4;
  background: #e2efe8;
  text-transform: uppercase;
}

.head-to-head-name {
  z-index: 3;
  background: #f8fbf9;
  box-shadow: 10px 0 18px rgba(14, 45, 30, 0.07);
  white-space: normal;
}

.head-to-head-table tbody tr:nth-child(even) .head-to-head-name {
  background: #f1f7f4;
}

.head-to-head-table tbody tr:nth-child(even) td {
  background: #fbfdfb;
}

.head-to-head-table tbody tr:hover .head-to-head-name,
.head-to-head-table tbody tr:hover td {
  background: #fff7f0;
}

.head-to-head-played {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.head-to-head-table td.head-to-head-won {
  background: #f1faf5;
}

.head-to-head-table td.head-to-head-lost {
  background: #fff8f0;
}

.head-to-head-score {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.head-to-head-set {
  display: inline-flex;
  min-width: 28px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  line-height: 1;
  white-space: nowrap;
}

.head-to-head-set.set-won {
  border-color: rgba(17, 135, 90, 0.36);
  background: #dff4e8;
  color: var(--court-dark);
}

.head-to-head-set.set-lost {
  border-color: rgba(185, 111, 57, 0.32);
  background: #fff1e3;
  color: #724121;
}

.head-to-head-set.set-draw {
  border-color: rgba(101, 114, 108, 0.28);
  background: #f0f3f2;
  color: var(--muted);
}

.head-to-head-empty {
  color: rgba(101, 114, 108, 0.72);
  font-weight: 800;
}

.head-to-head-table tbody tr td.head-to-head-self,
.head-to-head-table tbody tr:nth-child(even) td.head-to-head-self,
.head-to-head-table tbody tr:hover td.head-to-head-self {
  background: #bfc7c3;
  box-shadow: inset 0 0 0 1px rgba(11, 104, 68, 0.08);
}

.head-to-head-summary,
.head-to-head-points,
.head-to-head-rank {
  min-width: 52px;
  max-width: 58px;
}

.head-to-head-table thead .head-to-head-summary {
  background: #fff3e8;
  color: var(--ink);
}

.head-to-head-table thead .head-to-head-rank-head {
  background: #e4f7e8;
}

.head-to-head-table td.head-to-head-points {
  background: #fff8f0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.head-to-head-table td.head-to-head-rank {
  background: #effaf0;
}

.head-to-head-table-doubles th,
.head-to-head-table-doubles td {
  width: 94px;
  min-width: 94px;
  max-width: 94px;
  height: 56px;
}

.head-to-head-table-doubles .head-to-head-corner,
.head-to-head-table-doubles .head-to-head-name {
  width: 126px;
  min-width: 126px;
  max-width: 126px;
  height: 56px;
  text-align: center;
}

.head-to-head-table-doubles thead th {
  height: 58px;
}

.head-to-head-table-doubles .head-to-head-name .participant-link {
  display: grid;
}

.head-to-head-table tr:last-child th,
.head-to-head-table tr:last-child td {
  border-bottom: 0;
}

.head-to-head-table th:last-child,
.head-to-head-table td:last-child {
  border-right: 0;
}

.form-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.form-badge {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.form-badge.win {
  background: var(--court);
}

.form-badge.loss {
  background: var(--danger);
}

.form-badge.draw {
  background: #b89225;
}

.rank,
.points {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--court-dark);
  font-weight: 800;
}

.points {
  background: var(--court);
  color: #fff;
}

.player-add-grid,
.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.3fr auto;
  gap: 10px;
  align-items: end;
}

.extra-slot-form {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1fr 1.1fr 1.1fr minmax(160px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
}

.admin-settings-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}

.settings-grid label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.player-cards {
  display: grid;
  gap: 10px;
}

.player-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.player-card:hover,
.schedule-card:hover,
.result-card:hover,
.match-card:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.player-readonly {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.player-readonly strong {
  color: var(--ink);
}

.participant-link {
  color: var(--court-dark);
  font-weight: 900;
  text-decoration: none;
  text-underline-offset: 4px;
}

.participant-link:hover {
  color: var(--court);
  text-decoration: underline;
}

.edit-name-field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.player-edit-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.3fr auto;
  gap: 10px;
}

.team-add-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.team-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px;
}

.team-card {
  align-items: start;
}

.team-readonly {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 2.3fr);
  gap: 18px;
  align-items: start;
  color: var(--muted);
  min-width: 0;
}

.team-readonly .team-name {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-members {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.team-member-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.4fr) minmax(120px, 0.8fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.team-member-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-member-name {
  color: var(--ink);
  font-weight: 700;
}

.team-member-email,
.team-member-phone {
  color: var(--muted);
}

.day-list,
.round-list {
  display: grid;
  gap: 16px;
}

.day-block,
.round-block {
  padding: 14px;
}

.day-title,
.round-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--soft), #fff);
}

.day-title h2,
.round-title h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.day-title span,
.round-title span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.day-meta-form {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(140px, 220px) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

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

.schedule-card,
.result-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.time-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf5ef;
  color: var(--court-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.schedule-pair-form {
  display: grid;
  gap: 10px;
}

.schedule-participant-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.schedule-participant-card,
.readonly-participant {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.schedule-participant-card {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 248, 246, 0.72);
}

.schedule-participant-card strong,
.readonly-participant strong {
  min-width: 0;
  color: var(--court-dark);
  overflow-wrap: anywhere;
}

.mini-rank {
  display: inline-flex;
  min-width: 30px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 135, 90, 0.16);
  border-radius: 999px;
  background: #eaf5ef;
  color: var(--court-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.form-strip.mini {
  gap: 3px;
  margin-left: auto;
}

.form-strip.mini .form-badge {
  width: 21px;
  height: 21px;
  font-size: 0.62rem;
}

.remove-scheduled-term-form {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.remove-scheduled-term-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(168, 59, 59, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #a83b3b;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(24, 36, 30, 0.08);
}

.remove-scheduled-term-button:hover {
  border-color: rgba(168, 59, 59, 0.48);
  background: #fff4f2;
}

.match-meta-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 8px;
  align-items: center;
  padding-right: 32px;
}

.schedule-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.time-input {
  max-width: 180px;
  border-color: #d7eadf;
  background: #eaf5ef;
  color: var(--court-dark);
  font-weight: 800;
}

.match-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.match-share-actions .btn {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.match-share-actions .btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.copy-feedback {
  min-height: 18px;
  margin-top: 5px;
  color: var(--court-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.schedule-change-mailer {
  display: grid;
  max-width: 420px;
  gap: 8px;
}

.schedule-change-mailer label,
.schedule-change-card h3 {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-change-summary-grid,
.schedule-change-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.schedule-change-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.schedule-change-summary-grid > div,
.schedule-change-groups > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 251, 246, 0.72);
}

.schedule-change-summary-grid h3,
.schedule-change-groups h3,
.schedule-change-groups p {
  margin: 0;
}

.schedule-change-summary-grid span,
.schedule-change-groups p {
  color: var(--muted);
  font-weight: 700;
}

.schedule-change-notice-list {
  display: grid;
  gap: 8px;
}

.schedule-change-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-change-notice input {
  margin-top: 4px;
}

.schedule-change-notice span {
  display: grid;
  gap: 2px;
}

.schedule-change-notice small {
  color: var(--muted);
  font-weight: 700;
}

.schedule-change-notice.is-disabled {
  background: rgba(250, 247, 241, 0.86);
}

.schedule-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.readonly-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.readonly-match > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.match-note {
  margin-top: 8px;
  color: var(--muted);
}

.match-list {
  display: grid;
  gap: 8px;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.match-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

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

.match-pair {
  font-weight: 800;
}

.match-pair strong,
.match-player-selects span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.score-chip {
  min-width: 104px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--court-dark);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.score-set-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.score-set-strip.inline {
  margin-left: 4px;
  vertical-align: middle;
}

.score-set-chip {
  display: inline-grid;
  min-width: 46px;
  min-height: 34px;
  place-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(11, 104, 68, 0.18);
  border-radius: 8px;
  background: #f2fbf5;
  color: var(--court-dark);
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1;
}

.winner-name {
  color: var(--court-dark);
  font-weight: 950;
}

.loser-name {
  color: #8a958f;
  font-weight: 650;
}

.winner-trophy {
  margin-left: 2px;
  font-size: 0.9em;
}

.status {
  color: var(--clay);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.status.done {
  color: var(--court-dark);
}

.status.partial {
  color: var(--clay);
}

.score-form {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

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

.result-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-form {
  display: grid;
  gap: 10px;
}

.match-player-selects {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
}

.sets-grid.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
}

.sets-grid label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.score-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.score-pair input {
  min-width: 0;
  padding: 7px 8px;
  text-align: center;
}

.match-bottom-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 8px;
}

.status-note {
  margin: -2px 0 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.note-input {
  background: var(--soft);
}

.readonly-result,
.muted-text {
  color: var(--muted);
}

.email-recipients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.email-recipients span,
.email-recipient-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--court-dark);
  font-weight: 700;
}

.email-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.email-recipient-chip span {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.email-recipient-chip span:last-child {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(217, 74, 87, 0.12);
  color: var(--danger);
  text-align: center;
  line-height: 18px;
}

.email-recipient-chip:hover {
  border-color: rgba(217, 74, 87, 0.35);
  background: var(--danger-soft);
}

.email-recipient-chip.removed {
  display: none;
}

.email-recipient-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
}

.email-subject {
  margin-bottom: 10px;
}

.email-body {
  min-height: 680px;
  resize: vertical;
  white-space: pre-wrap;
}

.email-new-results {
  display: grid;
  gap: 8px;
}

.email-new-results div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.email-new-results span {
  color: var(--court-dark);
  font-weight: 800;
}

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

.email-action-row form {
  margin: 0;
}

.send-email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.email-profile-select {
  width: auto;
  min-width: 180px;
}

.email-config-note {
  flex: 1 1 280px;
}

.email-status-note {
  margin-top: 12px;
}

.email-table-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mark-sent-form {
  margin-top: 10px;
}

.auth-page {
  max-width: 520px;
}

.admin-danger-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border-color: #f0c8cd;
  background: linear-gradient(180deg, #fff, var(--danger-soft));
}

.admin-danger-zone h2 {
  margin-bottom: 6px;
}

.admin-danger-zone p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.login-card {
  margin-top: 40px;
}

.login-card h1 {
  margin-bottom: 16px;
}

.login-card form {
  display: grid;
  gap: 10px;
}

.login-card .muted-text {
  margin: 14px 0 0;
  font-size: 0.9rem;
}

.participant-header {
  align-items: center;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-stat-grid div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.detail-stat-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-stat-grid strong {
  color: var(--court-dark);
  font-size: 1.65rem;
  font-weight: 900;
}

.detail-stat-grid small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.success-stat {
  position: relative;
  overflow: hidden;
}

.success-stat i {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 48%, transparent 50%),
    conic-gradient(var(--court) calc(var(--value) * 1%), rgba(11, 104, 68, 0.12) 0);
}

.team-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.team-detail-member {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.team-detail-member strong {
  color: var(--ink);
}

.team-detail-member span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.detail-match-list {
  display: grid;
  gap: 10px;
}

.detail-match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-match-card h3 {
  margin: 10px 0 0;
  font-size: 1rem;
  font-weight: 900;
}

.detail-match-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-match-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.detail-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-form-row > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.position-chart-wrap {
  height: 210px;
}

.position-chart-wrap canvas {
  max-height: 210px;
}

.chart-empty-state,
.stat-note {
  margin: 10px 0 0;
  max-width: 660px;
  line-height: 1.5;
}

.pwa-install-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(189, 243, 209, 0.44);
  border-radius: 8px;
  background: rgba(5, 31, 22, 0.94);
  color: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.pwa-install-banner[hidden] {
  display: none;
}

.pwa-install-banner strong {
  flex: 1;
  font-size: 0.95rem;
}

.pwa-install-banner button {
  white-space: nowrap;
}

.archive-page-header,
.archive-season-header {
  align-items: end;
}

.archive-lead {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.archive-all-time-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.archive-all-time-card h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.35rem;
}

.archive-all-time-card p {
  margin: 0;
  color: var(--muted);
}

.archive-all-time-preview {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-all-time-preview li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
}

.archive-all-time-preview span {
  color: var(--court-dark);
  font-weight: 900;
}

.archive-all-time-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-all-time-preview em {
  color: var(--muted);
  font-style: normal;
}

.archive-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 14px;
}

.archive-card h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.18rem);
  line-height: 1.18;
}

.archive-card-top,
.archive-card-champion,
.archive-meta-grid,
.archive-opponent-summary-grid,
.archive-player-stat-grid {
  display: grid;
  gap: 10px;
}

.archive-card-top {
  align-items: start;
}

.archive-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.archive-year {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--court-dark);
  color: #fff;
  font-weight: 900;
}

.archive-format {
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: right;
}

.archive-card-champion {
  gap: 2px;
  padding: 12px;
  border: 1px solid rgba(17, 135, 90, 0.18);
  border-radius: 8px;
  background: #f4fbf7;
}

.archive-card-champion span,
.archive-meta-grid span,
.archive-meta-grid dt,
.archive-player-stat-grid dt,
.archive-player-stat-grid span,
.archive-opponent-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-card-champion strong,
.archive-meta-grid strong,
.archive-meta-grid dd,
.archive-player-stat-grid dd,
.archive-player-stat-grid strong,
.archive-opponent-summary strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.archive-meta-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.archive-meta-grid > div,
.archive-player-stat-grid > div,
.archive-opponent-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.archive-meta-grid dt,
.archive-player-stat-grid dt {
  margin-bottom: 4px;
}

.archive-meta-grid dd,
.archive-player-stat-grid dd {
  margin: 0;
  font-weight: 900;
  line-height: 1.1;
}

.archive-top3-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.archive-top3-panel > span,
.archive-panel-block > h3 {
  margin: 0;
  color: var(--court-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archive-top3 {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-top3 li {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-weight: 700;
}

.archive-top3 span {
  width: 28px;
  color: var(--court-dark);
  font-weight: 900;
}

.archive-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.archive-open-button {
  margin-top: auto;
}

.archive-notes {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.archive-notes p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f1ddca;
  border-radius: 8px;
  background: var(--clay-soft);
  color: #724121;
  font-weight: 700;
}

.archive-final-standings,
.archive-stage {
  margin-bottom: 18px;
}

.archive-stage-switch {
  margin-bottom: 14px;
}

.archive-standings-table .rank {
  min-width: 34px;
}

.archive-matrix-scroll {
  margin-top: 6px;
}

.archive-head-to-head-table td {
  min-width: 116px;
  height: auto;
  vertical-align: top;
}

.archive-h2h-cell-list {
  display: grid;
  gap: 5px;
}

.archive-h2h-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.archive-h2h-chip .head-to-head-score {
  flex-wrap: nowrap;
}

.archive-h2h-chip .head-to-head-set {
  min-width: 32px;
}

.super-tiebreak-set {
  outline: 1px dashed rgba(11, 104, 68, 0.28);
  outline-offset: 1px;
}

.archive-h2h-chip.won {
  background: #e8f7ee;
  color: var(--court-dark);
}

.archive-h2h-chip.lost {
  background: #fff0ef;
  color: #9b323a;
}

.archive-h2h-chip.draw {
  background: #fff7d7;
  color: #765a08;
}

.archive-h2h-chip.unplayed {
  background: #f0f3f2;
  color: var(--muted);
}

.archive-h2h-chip.walkover {
  background: #fff4e8;
  color: #8a4b12;
}

.archive-h2h-chip small {
  font-size: 0.64rem;
  text-transform: uppercase;
}

.archive-player-section {
  margin-bottom: 18px;
}

.archive-player-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin: 0;
}

.archive-player-stat-grid > div,
.archive-opponent-summary {
  display: grid;
  gap: 3px;
}

.archive-panel-block {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.archive-player-stat-grid small,
.archive-opponent-summary small {
  color: var(--muted);
  font-weight: 700;
}

.archive-table-scroll {
  overflow-x: auto;
}

.archive-mini-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.archive-mini-table th,
.archive-mini-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.archive-mini-table th {
  background: #eef8f3;
  color: var(--court-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-mini-table tr:last-child td {
  border-bottom: 0;
}

.archive-season-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.archive-season-badge-grid span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.archive-season-badge-grid strong {
  color: var(--court-dark);
  font-size: 0.86rem;
}

.archive-season-badge-grid em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.archive-history-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-history-strip span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.archive-history-strip strong {
  color: var(--court-dark);
}

.archive-h2h-list {
  display: grid;
  gap: 10px;
}

.archive-opponent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.archive-opponent-card summary {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(2, minmax(92px, auto)) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.archive-opponent-card summary::-webkit-details-marker {
  display: none;
}

.archive-opponent-card summary span {
  display: grid;
  gap: 2px;
}

.archive-opponent-name strong {
  color: var(--ink);
}

.archive-opponent-metric small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-opponent-metric strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.archive-opponent-card summary small {
  color: var(--muted);
  font-weight: 700;
}

.archive-win-rate {
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f7ee;
  color: var(--court-dark);
  font-weight: 900;
}

.archive-match-list {
  display: grid;
  gap: 6px;
  padding: 0 14px 14px;
}

.archive-match-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.archive-match-row span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.archive-match-row strong {
  white-space: nowrap;
}

.archive-match-row em {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.archive-match-row em.won {
  background: #e8f7ee;
  color: var(--court-dark);
}

.archive-match-row em.lost {
  background: #fff0ef;
  color: #9b323a;
}

.archive-match-row em.draw {
  background: #fff7d7;
  color: #765a08;
}

.archive-match-row em.unplayed {
  background: #f0f3f2;
  color: var(--muted);
}

.archive-match-row em.walkover {
  background: #fff4e8;
  color: #8a4b12;
}

.match-archive-h2h {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 135, 90, 0.16);
  border-radius: 8px;
  background: #f4fbf7;
}

.match-archive-h2h span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-archive-h2h strong {
  display: block;
  margin-top: 2px;
  color: var(--court-dark);
  font-size: 0.95rem;
}

.match-archive-record {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 4px;
}

.match-archive-record strong {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  margin: 0;
}

.match-archive-record em {
  color: var(--court-dark);
  font-style: normal;
  font-weight: 900;
}

.match-archive-form {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.all-time-points-panel {
  display: grid;
  gap: 16px;
}

.all-time-toolbar {
  display: flex;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
}

.all-time-search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 320px);
}

.all-time-search span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.all-time-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.all-time-points-table .all-time-top {
  background: #f4fbf7;
}

.all-time-player-cell {
  display: grid;
  gap: 2px;
}

.all-time-player-cell span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.all-time-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 900px) {
  .home-hero-inner {
    align-items: flex-end;
    padding-top: 96px;
    padding-bottom: 42px;
  }

  .home-hero h1 {
    font-size: clamp(2.7rem, 14vw, 4.5rem);
  }

  .home-choice-row {
    grid-template-columns: 1fr;
  }

  .home-next-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .home-news-header,
  .news-admin-form {
    grid-template-columns: 1fr;
  }

  .home-news-header {
    align-items: start;
    flex-direction: column;
  }

  .page-header,
  .topbar-inner {
    align-items: start;
    flex-direction: column;
  }

  .brand {
    font-size: 1.02rem;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .nav-tabs {
    width: 100%;
  }

  .nav-tab {
    flex: 1;
  }

  .player-add-grid,
  .team-add-grid,
  .extra-slot-form,
  .player-edit-grid,
  .team-edit-grid,
  .settings-grid,
  .admin-settings-grid,
  .admin-danger-zone,
  .day-meta-form,
  .player-card,
  .player-readonly,
  .schedule-grid,
  .match-summary,
  .match-meta-row,
  .match-player-selects,
  .schedule-participant-strip,
  .team-readonly,
  .sets-grid.compact,
  .match-bottom-row,
  .schedule-note-row,
  .schedule-change-summary-grid,
  .schedule-change-groups,
  .send-email-form,
  .detail-stat-grid,
  .archive-opponent-summary-grid,
  .team-detail-grid,
  .detail-match-card {
    grid-template-columns: 1fr;
  }

  .email-profile-select,
  .send-email-form .btn {
    width: 100%;
  }

  .send-email-form {
    align-items: stretch;
    flex-direction: column;
  }

  .score-chip,
  .score-set-strip,
  .status,
  .detail-match-side {
    width: fit-content;
    justify-items: start;
    text-align: left;
  }

  .readonly-match {
    grid-template-columns: 1fr;
  }

  .readonly-match > span {
    justify-self: start;
  }

  .readonly-participant {
    width: 100%;
  }

  .archive-page-header,
  .archive-season-header {
    align-items: start;
  }

  .archive-match-row,
  .archive-opponent-card summary,
  .archive-all-time-card,
  .match-archive-h2h {
    grid-template-columns: 1fr;
  }

  .archive-all-time-card .btn {
    width: 100%;
  }

  .all-time-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .all-time-sort {
    justify-content: flex-start;
  }

  .match-archive-form {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .table-view-switch {
    display: flex;
    width: 100%;
  }

  .table-view-button {
    flex: 1 1 0;
    padding-right: 10px;
    padding-left: 10px;
    text-align: center;
  }

  .standings-table .optional-stat {
    display: none;
  }

  .standings-table td,
  .standings-table th {
    padding: 12px 7px;
  }

  .standings-table th {
    font-size: 0.68rem;
  }

  .form-badge {
    width: 22px;
    height: 22px;
    font-size: 0.68rem;
  }

  .head-to-head-table th,
  .head-to-head-table td {
    min-width: 72px;
    max-width: 82px;
    height: 42px;
    padding: 5px 5px;
    font-size: 0.72rem;
  }

  .head-to-head-table thead th {
    height: 52px;
    font-size: 0.68rem;
  }

  .head-to-head-corner,
  .head-to-head-name {
    min-width: 112px;
    max-width: 124px;
  }

  .head-to-head-table-doubles th,
  .head-to-head-table-doubles td {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    height: 54px;
    font-size: 0.66rem;
  }

  .head-to-head-table-doubles .head-to-head-corner,
  .head-to-head-table-doubles .head-to-head-name {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    height: 54px;
  }

  .head-to-head-score {
    gap: 3px;
  }

  .head-to-head-set {
    min-width: 26px;
    min-height: 20px;
    padding: 1px 3px;
    border-radius: 5px;
  }

  .head-to-head-summary,
  .head-to-head-points,
  .head-to-head-rank {
    min-width: 46px;
    max-width: 50px;
  }
}

@media (max-width: 420px) {
  .surface.table-view-panel {
    padding: 12px;
  }

  .head-to-head-table th,
  .head-to-head-table td {
    min-width: 66px;
    max-width: 74px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .head-to-head-corner,
  .head-to-head-name {
    min-width: 102px;
    max-width: 112px;
  }

  .head-to-head-table-doubles .head-to-head-corner,
  .head-to-head-table-doubles .head-to-head-name {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
  }

  .head-to-head-table-doubles th,
  .head-to-head-table-doubles td {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    font-size: 0.62rem;
  }

  .head-to-head-set {
    min-width: 24px;
    font-size: 0.66rem;
  }
}
