:root {
  --page-bg: #111111;
  --surface: #1f1f1f;
  --surface-alt: #1f1f1f;
  --surface-hover: #262626;
  --line: #3a3a3a;
  --line-strong: #4a4a4a;
  --text-strong: #e7e7e7;
  --text-muted: #8c8c8c;
  --text-soft: #8c8c8c;
  --blue: #57a6ff;
  --blue-soft: rgba(87, 166, 255, 0.12);
  --white: #e7e7e7;
  --green: #3caa5b;
  --serve-indicator: #b7cf15;
  --mobile-rail-peek: 14px;
  --mobile-rail-gap: 2px;
  --mobile-rail-visible-gap-total: 12px;
  --mobile-rail-side-total: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text-strong);
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
}

.page-shell {
  width: min(1280px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.app-shell,
.scoreboard-shell {
  display: grid;
  gap: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.hero-panel {
  padding: 0 10px;
  overflow: visible;
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-controls {
  display: grid;
  gap: 12px;
}

.page-controls-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.hero-filters {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 720px;
  min-width: 0;
}

.filter-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.filter-toolbar-row-tournaments {
  width: 100%;
  overflow: hidden;
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filter-section-label {
  display: none;
  margin: 0;
  padding-left: 2px;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.page-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.filter-toolbar-row-tournaments .filter-group {
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: -4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-toolbar-row-tournaments .filter-group::-webkit-scrollbar {
  display: none;
}

.filter-chip.active {
  border-color: rgba(87, 166, 255, 0.55);
  background: var(--blue-soft);
  color: var(--text-strong);
}

.filter-chip-serve-indicator {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--serve-indicator);
  animation: serve-indicator-pulse 3.5s ease-in-out infinite;
}

.filter-chip-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
}

.filter-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chip-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: inherit;
}

.ph {
  line-height: 1;
  vertical-align: middle;
}

.filter-divider {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  opacity: 0.9;
}

.country-filter {
  position: relative;
}

.country-filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(280px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #151515;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

.country-filter-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.country-filter-panel-title,
.country-filter-empty {
  margin: 0;
  font-size: 0.76rem;
}

.country-filter-panel-title {
  font-weight: 400;
  color: var(--white);
}

.country-filter-empty {
  color: var(--text-muted);
}

.country-filter-clear {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 400;
  cursor: pointer;
}

.country-filter-list {
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.country-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 0.78rem;
  cursor: pointer;
}

.country-filter-option input {
  margin: 0;
  accent-color: #57a6ff;
}

.date-rail {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  align-items: stretch;
  gap: 0;
}

.date-rail-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}

.date-picker-wrap {
  position: relative;
}

.date-year-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 68px;
}

.date-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.date-today-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.date-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.date-picker-trigger.active {
  border-color: rgba(87, 166, 255, 0.55);
  background: var(--blue-soft);
  color: var(--text-strong);
}

.date-picker-trigger .ph {
  font-size: 0.98rem;
}

.date-year-select {
  min-height: 32px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.76rem;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.date-year-select:focus {
  outline: none;
  border-color: rgba(87, 166, 255, 0.55);
  background: var(--blue-soft);
  color: var(--text-strong);
}

.date-year-select-caret {
  position: absolute;
  right: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 24;
  width: min(308px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #151515;
  color: var(--text-strong);
  font-family: inherit;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
}

.date-picker-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.date-picker-title-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  color: var(--text-strong);
  cursor: pointer;
}

.date-picker-title {
  margin: 0;
  text-align: center;
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.date-picker-title-caret {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.date-picker-month-nav {
  display: flex;
  justify-content: center;
}

.date-picker-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
}

.date-picker-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-picker-jump-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 108px);
  gap: 8px;
  margin-bottom: 12px;
}

.date-picker-select-wrap {
  display: grid;
  gap: 6px;
}

.date-picker-select-label {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.date-picker-select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text-strong);
  appearance: none;
  -webkit-appearance: none;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.date-picker-weekdays {
  gap: 4px;
  margin-bottom: 4px;
}

.date-picker-grid {
  gap: 4px;
}

.date-picker-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

.date-picker-day {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  border-radius: 999px;
  color: var(--text-strong);
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.date-picker-day-number {
  font-size: 0.88rem;
  font-weight: 400;
}

.date-picker-day-outside-month {
  color: var(--text-muted);
}

.date-picker-day-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.date-picker-day.active {
  background: var(--text-strong);
  color: var(--page-bg);
}

.date-picker-day-today:not(.active) {
  box-shadow: inset 0 0 0 1px rgba(87, 166, 255, 0.42);
}

.date-picker-day-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
  transform: translateX(-50%);
}

.nav-button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 100%;
  min-height: 54px;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-button .ph {
  font-size: 0.95rem;
}

.topbar-nav-button {
  width: 36px;
  min-height: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-alt);
}

.day-button {
  display: grid;
  gap: 1px;
  justify-items: center;
  align-content: center;
  padding: 7px 2px 8px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  min-height: 54px;
}

.day-button-weekday,
.day-button-date {
  display: block;
  font-size: 0.78rem;
}

.day-button-weekday {
  color: var(--text-muted);
  font-weight: 400;
}

.day-button-date {
  color: var(--text-soft);
  font-weight: 400;
}

.day-button.active {
  border-bottom-color: var(--text-strong);
}

.day-button.active .day-button-weekday,
.day-button.active .day-button-date {
  color: var(--text-strong);
}

.cache-status {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.layout-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}

.tournament-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.layout-switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-width: 32px;
  min-height: 28px;
  padding: 5px 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 400;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.layout-switch-button.active {
  background: var(--blue-soft);
  color: var(--text-strong);
}

.layout-switch-button .ph {
  font-size: 0.95rem;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  cursor: pointer;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.refresh-button .ph {
  font-size: 0.9rem;
}

.refresh-icon-spinning {
  animation: refresh-spin 0.9s linear infinite;
}

@keyframes refresh-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.tournament-card {
  padding: 0;
}

.tournament-list {
  display: grid;
  gap: 12px;
}

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

.tournament-grid-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.tournament-header {
  position: relative;
  padding: 0;
}

.tournament-header::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  border-bottom: 1px solid var(--line);
}

.tournament-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 8px;
  text-align: left;
  cursor: pointer;
}

.tournament-toggle:focus-visible {
  outline: 1px solid rgba(87, 166, 255, 0.75);
  outline-offset: -1px;
}

.tournament-toggle-static {
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .filter-chip:hover {
    background: var(--surface-hover);
    color: var(--white);
  }

  .country-filter-option:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .date-today-button:hover {
    background: var(--surface-hover);
    color: var(--white);
  }

  .date-picker-trigger:hover {
    background: var(--surface-hover);
    color: var(--white);
  }

  .date-picker-nav:hover:not(:disabled) {
    background: var(--surface-hover);
    color: var(--text-strong);
  }

  .date-picker-day:hover:not(.active):not(:disabled) {
    background: var(--surface-hover);
  }

  .nav-button:hover,
  .day-button:hover {
    background: var(--surface-hover);
  }

  .layout-switch-button:hover {
    color: var(--white);
  }

  .refresh-button:hover:not(:disabled) {
    background: var(--surface-hover);
  }

  .tournament-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  .tournament-toggle-static:hover {
    background: transparent;
  }

  .match-group-toggle:hover {
    color: var(--white);
  }
}

.tournament-header h2 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.tournament-title-lead {
  color: var(--text-strong);
}

.tournament-title-short {
  margin-left: 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0;
  color: var(--text-muted);
}

.tournament-toggle-icon {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.match-group-section {
  padding: 10px 12px 12px;
}

.match-group-section + .match-group-section {
  padding-top: 2px;
}

.match-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.match-group-toggle:focus-visible {
  outline: 1px solid rgba(87, 166, 255, 0.75);
  outline-offset: 2px;
}

.match-group-section h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.match-group-section-collapsed h3 {
  margin-bottom: 0;
}

.match-group-toggle-icon {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.match-grid-shell-flat {
  padding: 10px 12px 12px;
}

.match-grid {
  display: grid;
  position: relative;
  gap: 0;
  background: var(--surface);
}

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

.match-card {
  --match-cell-font-size: 0.78rem;
  --score-rail-end-gap: 5px;
  --serve-indicator-gap: 2px;
  padding: 8px 16px 9px 10px;
  min-height: 108px;
  background: var(--surface);
}

.match-card-with-top-border {
  border-top: 1px solid var(--line);
}

.match-card-with-left-border {
  border-left: 1px solid var(--line);
}

.match-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.match-card-context-row {
  margin-bottom: 5px;
}

.match-card-context {
  display: block;
  min-width: 0;
  font-size: var(--match-cell-font-size);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.match-tournament-name {
  color: var(--text-strong);
}

.match-context {
  min-width: 0;
  font-size: var(--match-cell-font-size);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-round {
  color: var(--text-strong);
}

.match-separator,
.match-court,
.match-draw {
  color: var(--text-muted);
}

.match-status {
  flex: 0 0 auto;
  margin-right: var(--score-rail-end-gap);
  font-size: var(--match-cell-font-size);
  font-weight: 400;
  color: var(--text-strong);
  text-align: right;
}

.match-card.status-in .match-status {
  color: var(--green);
}

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

.competitor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.name-copy {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.name-label,
.rank-tag {
  font-weight: 400;
}

.rank-tag {
  color: var(--text-muted);
}

.match-card.status-post .competitor-row.winner .name-label {
  color: var(--text-strong);
  font-weight: 400;
}

.match-card.status-post .competitor-row:not(.winner) .name-label {
  color: var(--text-muted);
}

.match-card.status-in .name-label,
.match-card.status-pre .name-label {
  color: var(--text-strong);
}

.competitor-names {
  display: grid;
  gap: 4px;
}

.name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  font-size: var(--match-cell-font-size);
  line-height: 1.15;
}

.name-leading {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 18px;
  flex: 0 0 18px;
}

.flag {
  width: 18px;
  height: 12px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  background: #0f1217;
  flex: 0 0 auto;
}

.flag-placeholder {
  border-color: transparent;
  background: transparent;
}

.serve-indicator {
  position: absolute;
  top: 50%;
  left: calc(100% + var(--serve-indicator-gap));
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--serve-indicator);
  text-shadow:
    0 0 0 var(--surface),
    0 0 3px rgba(0, 0, 0, 0.4);
}

@keyframes serve-indicator-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.set-scores {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 16px;
  gap: 6px;
  justify-content: end;
  padding-right: var(--score-rail-end-gap);
  padding-top: 1px;
}

.set-score {
  display: inline-flex;
  position: relative;
  justify-content: center;
  min-width: 14px;
  font-size: var(--match-cell-font-size);
  font-weight: 400;
  color: var(--text-muted);
}

.set-score-serving {
  overflow: visible;
}

.set-score sup {
  font-size: 0.56em;
  line-height: 1;
  margin-left: 1px;
}

.match-card.status-post .set-score-winner,
.match-card.status-in .set-score-winner {
  color: var(--text-strong);
}

.set-score-current {
  color: var(--green) !important;
}

.set-score-empty {
  color: transparent;
}

.panel-loading,
.message-panel,
.notice-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
}

.message-panel {
  display: block;
}

.notice-panel {
  padding-top: 10px;
  padding-bottom: 10px;
  border-color: rgba(87, 166, 255, 0.28);
  background: rgba(87, 166, 255, 0.08);
}

.message-panel h2 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 400;
}

.message-panel p,
.loading-copy,
.loading-kicker,
.notice-panel p {
  margin: 0;
}

.loading-kicker {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-strong);
}

.loading-copy,
.message-panel p,
.notice-panel p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(60, 170, 91, 0.14);
}

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

@media (max-width: 1120px) {
  .page-shell {
    width: min(100vw - 16px, 1280px);
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 12px, 1280px);
    padding-top: 14px;
  }

  .page-title {
    flex: 1 1 auto;
    font-size: 1.02rem;
  }

  .mobile-topbar {
    display: grid;
    gap: 10px;
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding-inline: 4px;
    box-sizing: border-box;
  }

  .mobile-topbar-title-row {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .mobile-topbar .page-title {
    flex: none;
    text-align: center;
  }

  .mobile-topbar-controls-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-topbar-controls-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .mobile-topbar-controls-group-left {
    justify-content: flex-start;
    grid-column: 1;
  }

  .mobile-topbar-controls-spacer {
    grid-column: 2;
    width: 100%;
    min-width: 0;
  }

  .mobile-topbar-controls-group-right {
    justify-content: flex-end;
    grid-column: 3;
  }

  .page-controls,
  .page-controls-main,
  .hero-actions,
  .hero-filters,
  .filter-toolbar-row {
    justify-content: flex-start;
  }

  .page-controls {
    gap: 12px;
  }

  .page-controls-main {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .hero-filters {
    display: grid;
    gap: 8px;
    flex: none;
    width: 100%;
  }

  .filter-toolbar-row {
    width: 100%;
  }

  .mobile-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .mobile-filter-row::-webkit-scrollbar {
    display: none;
  }

  .mobile-filter-row .filter-group {
    flex-wrap: nowrap;
    overflow: visible;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .mobile-filter-row .country-filter {
    position: relative;
    flex: 0 0 auto;
    width: auto;
  }

  .mobile-filter-row .filter-chip-dropdown {
    width: auto;
  }

  .mobile-filter-divider {
    align-self: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1;
  }

  .filter-section-label {
    display: block;
  }

  .filter-divider {
    display: none;
  }

  .filter-group {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: -4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .filter-group .filter-chip {
    flex: 0 0 auto;
  }

  .filter-chip {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .country-filter {
    width: 100%;
  }

  .filter-chip-dropdown {
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }

  .country-filter-panel {
    left: 0;
    right: auto;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  .hero-actions {
    gap: 10px;
    width: 100%;
    justify-content: space-between;
  }

  .cache-status {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hero-panel {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .date-rail-mobile {
    display: block;
    overflow: hidden;
  }

  .date-rail-mobile .date-rail-list {
    display: flex;
    gap: var(--mobile-rail-gap);
    overflow-x: auto;
    padding: 0 var(--mobile-rail-peek);
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--mobile-rail-peek);
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .date-rail-mobile .date-rail-list::-webkit-scrollbar {
    display: none;
  }

  .date-rail-mobile .day-button {
    flex: 0 0 calc((100% - var(--mobile-rail-visible-gap-total) - var(--mobile-rail-side-total)) / 5);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .nav-button {
    min-height: 48px;
  }

  .topbar-nav-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    flex: 0 0 32px;
    border-radius: 999px;
  }

  .topbar-chip-button,
  .topbar-year-control .date-year-select {
    min-height: 32px;
    height: 32px;
    font-size: 0.74rem;
  }

  .topbar-year-control {
    min-width: 58px;
    flex: 0 0 auto;
  }

  .topbar-chip-button {
    padding-inline: 10px;
  }

  .topbar-year-control .date-year-select {
    min-width: 58px;
    padding: 0 22px 0 10px;
  }

  .day-button {
    min-height: 48px;
    padding: 0 1px;
    border-radius: 8px 8px 0 0;
  }

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

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

  .tournament-header h2 {
    font-size: 1rem;
  }
}

@media (max-width: 560px) {
  .mobile-topbar .page-title {
    font-size: 0.96rem;
  }

  .date-today-button {
    min-height: 32px;
    padding: 0 14px;
  }

  .day-button-weekday,
  .day-button-date {
    font-size: 0.66rem;
  }

  .date-rail-mobile .day-button {
    flex-basis: calc((100% - var(--mobile-rail-visible-gap-total) - var(--mobile-rail-side-total)) / 5);
  }

  .filter-chip {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 0.77rem;
  }

  .filter-section-label {
    font-size: 0.61rem;
  }

  .match-group-section,
  .match-grid-shell-flat,
  .tournament-header {
    padding-left: 10px;
    padding-right: 10px;
  }

  .tournament-header::after {
    left: 10px;
    right: 10px;
  }

  .tournament-toggle {
    padding-left: 0;
    padding-right: 0;
  }

  .match-card {
    --match-cell-font-size: 0.74rem;
    padding-left: 8px;
    padding-right: 8px;
    min-height: 96px;
  }

  .set-scores {
    grid-auto-columns: 14px;
    gap: 5px;
  }
}
