:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #17202a;
  --text: #18212b;
  --muted: #66717f;
  --line: #d9e0e7;
  --blue: #2864b4;
  --green: #1e8f5a;
  --amber: #b7791f;
  --red: #b23b3b;
  --shadow: 0 16px 40px rgba(30, 42, 55, 0.08);
  --rank-icon-size: 40px;
  --rank-icon-width: 140px;
  --rank-icon-cell-width: 156px;
  --rank-icon-preview-size: 56px;
  --rank-icon-preview-width: 196px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body.is-dialog-open {
  overflow: hidden;
}

body.is-auth-locked .app-shell {
  visibility: hidden;
}

button,
select,
input,
textarea {
  font: inherit;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  max-width: 100%;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  background: var(--surface-strong);
  color: #eef3f8;
  min-width: 0;
  overflow: hidden;
  padding: 24px 18px;
}

.sidebar-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  margin-bottom: 28px;
  min-width: 0;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand strong,
.brand span {
  display: block;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
}

.brand span {
  color: #9cadbd;
  font-size: 13px;
}

.sidebar-collapse-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  align-self: start;
  border: 1px solid #344255;
  border-radius: 8px;
  background: #253241;
  color: #ffffff;
  cursor: pointer;
}

.sidebar-collapse-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell.is-sidebar-collapsed .sidebar {
  padding: 24px 12px;
}

.app-shell.is-sidebar-collapsed .sidebar-header {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.is-sidebar-collapsed .brand {
  justify-content: center;
  margin-bottom: 12px;
}

.app-shell.is-sidebar-collapsed .brand-logo {
  width: 40px;
  height: 40px;
}

.app-shell.is-sidebar-collapsed .brand-text {
  display: none;
}

.app-shell.is-sidebar-collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

.menu-toggle {
  display: none;
}

.nav {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 6px;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c7d1dc;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav-item.nav-group-start {
  margin-top: 16px;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.nav-item:hover,
.nav-item.active {
  background: #253241;
  color: #ffffff;
}

.nav-item:focus-visible,
.sidebar-collapse-toggle:focus-visible,
.menu-toggle:focus-visible {
  outline: 2px solid #8dc0ff;
  outline-offset: 2px;
}

.nav-item:focus-visible {
  outline-offset: -2px;
}

.app-shell.is-sidebar-collapsed .nav {
  justify-items: center;
}

.app-shell.is-sidebar-collapsed .nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 52px;
  padding: 0;
}

.app-shell.is-sidebar-collapsed .nav-label {
  display: none;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.current-user {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  justify-content: flex-end;
  gap: 12px;
  width: min(100%, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
  line-height: 1.15;
}

.current-user-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.current-user span {
  color: var(--muted);
  font-size: 12px;
}

.current-user strong {
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user.is-error {
  border-color: #efc7c7;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.danger-button {
  border-color: #efc7c7;
  color: var(--red);
}

.ghost-button.small {
  min-height: 34px;
  padding: 0 10px;
}

.primary-button.small {
  min-height: 34px;
  padding: 0 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

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

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.is-hidden {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 12px;
}

.panel-header select {
  max-width: 210px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 10px;
}

.rating-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  margin-left: auto;
}

.rating-controls select {
  flex: 0 1 210px;
  min-width: 150px;
}

.rating-panel-header {
  align-items: flex-start;
}

.rating-panel-header .rating-controls {
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  margin-left: 0;
}

.rating-league-bubbles {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.rating-league-chip {
  min-height: 34px;
}

.rating-league-empty {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.rating-panel-header .rating-controls select {
  flex: 0 1 230px;
  min-width: 180px;
}

.segmented-control {
  display: inline-flex;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
  padding: 2px;
}

.segmented-control-button {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.segmented-control-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(30, 42, 55, 0.12);
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.rating-table-shell {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.rating-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
}

.ratings-pagination,
.rank-history-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.rank-history-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rank-history-header {
  align-items: flex-start;
  margin-bottom: 0;
}

.rank-history-search {
  flex: 0 1 360px;
  min-width: 220px;
}

.rank-history-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 11px;
  font: inherit;
}

.rank-history-table-shell {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.rank-history-table {
  min-width: 640px;
}

.rank-history-rank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-with-rank {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.rank-changes-panel {
  display: grid;
  gap: 10px;
}

#rank-changes-panel.span-3 {
  overflow-x: hidden;
}

.rank-changes-table-shell {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.rank-changes-table {
  min-width: 520px;
}

.charts-panel {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow: hidden;
}

.charts-header {
  align-items: flex-start;
}

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

.charts-year-filters,
.chart-league-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chart-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 5px 11px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.chart-filter-chip.active {
  border-color: var(--blue);
  background: #eef5ff;
  color: var(--text);
  font-weight: 700;
}

.league-chip {
  border-color: color-mix(in srgb, var(--league-color) 28%, var(--line));
}

.league-chip.active {
  border-color: var(--league-color);
  background: color-mix(in srgb, var(--league-color) 12%, #ffffff);
}

.league-chip-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--league-color);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.chart-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.charts-new-teams-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 14px;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.chart-card-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.chart-bars-shell {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-y: hidden;
  padding: 18px 4px 0;
}

.chart-bars-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.chart-y-axis {
  position: relative;
  height: 210px;
  padding-top: 26px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.chart-y-axis-scale {
  position: relative;
  width: 100%;
  height: 100%;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chart-y-tick {
  position: absolute;
  right: 0;
  bottom: var(--tick-position);
  width: 100%;
  transform: translateY(50%);
  text-align: right;
}

.chart-y-tick::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 6px;
  border-top: 1px solid var(--line);
}

.chart-y-tick span {
  display: inline-block;
  max-width: 40px;
  padding-right: 9px;
  white-space: nowrap;
}

.chart-bars {
  --chart-group-width: 74px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--chart-group-width);
  align-items: stretch;
  gap: 8px;
  min-width: max-content;
  min-height: 250px;
}

.chart-bars.has-year-labels {
  min-height: 268px;
}

.chart-bucket {
  display: grid;
  grid-template-rows: minmax(190px, 1fr) auto;
  gap: 8px;
  min-width: 0;
  border-radius: 8px;
  padding: 4px 2px 0;
}

.chart-bars.has-year-labels .chart-bucket {
  gap: 24px;
}

.chart-bucket.selected {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px #bfd7ff;
}

.chart-bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 210px;
  border-bottom: 1px solid var(--line);
  padding: 26px 6px 0;
}

.chart-bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex: 1 1 0;
  min-width: 18px;
  max-width: 32px;
  height: var(--bar-height);
  min-height: 8px;
  border: 0;
  border-radius: 6px 6px 2px 2px;
  background: #86aee2;
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.chart-bar.is-current-period {
  background: #2864b4;
}

.chart-bar.is-past-period {
  background: #77a5db;
}

.chart-bar.is-future-period {
  background: #cbd5e1;
}

.chart-bar.has-segments {
  background: #cbd5e1;
}

.chart-bar-stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  border-radius: inherit;
  overflow: hidden;
}

.chart-bar-segment {
  flex: 0 0 var(--segment-size);
  min-height: 0;
  background: var(--segment-color);
  opacity: var(--segment-opacity, 1);
}

.chart-bar-segment + .chart-bar-segment {
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.chart-bar:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.chart-bar-value {
  position: absolute;
  top: -22px;
  left: 50%;
  z-index: 1;
  max-width: 54px;
  transform: translateX(-50%);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.chart-bar-year-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.chart-bars.is-weekly .chart-bar-value {
  display: block;
}

.chart-bucket-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.chart-empty {
  display: grid;
  min-width: 260px;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
}

.charts-new-teams-table-shell {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.charts-new-teams-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.charts-new-teams-table th,
.charts-new-teams-table td {
  min-width: 0;
  overflow: hidden;
}

.charts-new-teams-table th:nth-child(1),
.charts-new-teams-table td:nth-child(1) {
  width: 48%;
}

.charts-new-teams-table th:nth-child(2),
.charts-new-teams-table td:nth-child(2) {
  width: 30%;
}

.charts-new-teams-table th:nth-child(3),
.charts-new-teams-table td:nth-child(3) {
  width: 22%;
}

.charts-new-team-name-cell {
  min-width: 0;
}

.charts-new-team-name-cell .team-detail-link {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--blue);
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: left;
}

.charts-new-teams-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.charts-new-teams-pagination span {
  white-space: nowrap;
}

.league-name-with-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.league-name-with-color::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--league-color);
}

.game-analytics-panel {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow: hidden;
}

.game-analytics-header {
  align-items: flex-start;
}

.game-analytics-controls select {
  min-width: 180px;
}

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

.game-analytics-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.game-analytics-block.span-full {
  grid-column: 1 / -1;
}

.game-analytics-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.game-analytics-block-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.game-analytics-block-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.game-analytics-table-shell {
  width: 100%;
  min-width: 0;
  min-height: 180px;
  overflow-x: auto;
}

.game-analytics-block.is-loading .game-analytics-table-shell {
  opacity: 0.65;
}

.game-analytics-table {
  min-width: 360px;
}

.attendance-table {
  min-width: 520px;
}

.game-analytics-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.game-analytics-pagination span {
  white-space: nowrap;
}

.game-analytics-export-status {
  min-width: 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.teams-analytics-panel {
  display: grid;
  gap: 14px;
}

.teams-analytics-header {
  align-items: flex-start;
}

.teams-analytics-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 1.2fr) minmax(92px, 0.5fr) minmax(92px, 0.5fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.teams-analytics-search {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.teams-analytics-filters label,
.teams-analytics-search-field,
.teams-analytics-page-size {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.teams-analytics-filters select,
.teams-analytics-filters input,
.teams-analytics-search input,
.teams-analytics-page-size select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.teams-analytics-table-shell {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.teams-analytics-table {
  min-width: 720px;
}

.teams-analytics-pagination {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.teams-analytics-page-size {
  width: 124px;
  margin-right: auto;
}

.team-detail-link {
  display: inline-flex;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 2px 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.team-detail-link:hover,
.team-detail-link:hover .team-with-rank > span:last-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.team-detail-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(40, 100, 180, 0.24);
  outline-offset: 3px;
}

.team-detail-link .team-with-rank,
.team-name-unavailable .team-with-rank {
  min-width: 0;
}

.team-detail-link .team-with-rank > span:last-child,
.team-name-unavailable .team-with-rank > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-name-unavailable {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-name-unavailable small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.team-detail-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.team-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.team-detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.team-detail-back {
  flex: 0 0 auto;
}

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

.team-detail-heading h2 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.team-detail-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.team-detail-leagues {
  display: grid;
  grid-template-columns: minmax(0, max-content) 96px max-content;
  grid-auto-rows: minmax(34px, auto);
  align-items: start;
  column-gap: 14px;
  row-gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.team-league-row {
  display: contents;
}

.team-league-filter {
  min-width: 0;
  max-width: 100%;
  justify-self: start;
}

.team-league-filter:disabled {
  cursor: default;
  opacity: 0.72;
}

.team-league-filter:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

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

.team-league-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  min-width: 0;
}

.team-league-rank .rank-icon {
  --rank-icon-size: 32px;
  --rank-icon-width: 96px;
}

.team-league-score {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 4px;
  min-width: 86px;
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.team-league-score strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

#team-detail-content {
  display: grid;
  gap: 0;
  min-width: 0;
}

.team-detail-section {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.team-detail-section:last-child {
  padding-bottom: 0;
}

.team-detail-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
}

.team-detail-section-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.team-detail-table-shell {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.team-about-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.team-about-item {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.team-about-item:last-child {
  border-right: 0;
}

.team-about-item dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.team-about-item dd {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.team-about-item:last-child dd {
  font-weight: 600;
}

.team-detail-statistics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.team-detail-statistic {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.team-detail-statistic:last-child {
  border-right: 0;
}

.team-detail-statistic dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.team-detail-statistic dd {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.team-detail-statistic:last-child dd {
  font-size: 14px;
}

.team-weekly-chart {
  display: grid;
  min-width: 0;
  border-top: 1px solid var(--line);
}

.team-weekly-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(180px, 1.5fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.team-weekly-label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-weekly-label strong,
.team-weekly-label span {
  overflow-wrap: anywhere;
}

.team-weekly-label strong {
  font-size: 13px;
}

.team-weekly-label span {
  color: var(--muted);
  font-size: 12px;
}

.team-weekly-delta {
  font-weight: 800;
}

.team-weekly-delta.is-positive {
  color: var(--green);
}

.team-weekly-delta.is-neutral {
  color: var(--amber);
}

.team-weekly-delta.is-negative {
  color: var(--red);
}

.team-weekly-progress-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.team-weekly-progress-wrap {
  position: relative;
  min-width: 0;
  height: 20px;
}

.team-weekly-row progress {
  display: block;
  width: 100%;
  height: 20px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eef3;
  accent-color: #d7e0e8;
}

.team-weekly-row progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e9eef3;
}

.team-weekly-row progress::-webkit-progress-value {
  border-radius: 999px;
  background: #d7e0e8;
}

.team-weekly-row progress::-moz-progress-bar {
  border-radius: 999px;
  background: #d7e0e8;
}

.team-weekly-progress-label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max(var(--team-weekly-fill), 92px);
  max-width: 100%;
  height: 20px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.team-weekly-row progress.attendance-strong {
  accent-color: var(--green);
}

.team-weekly-row progress.attendance-strong::-webkit-progress-value {
  background: var(--green);
}

.team-weekly-row progress.attendance-strong::-moz-progress-bar {
  background: var(--green);
}

.team-weekly-row progress.attendance-good {
  accent-color: #9bd7ad;
}

.team-weekly-row progress.attendance-good::-webkit-progress-value {
  background: #9bd7ad;
}

.team-weekly-row progress.attendance-good::-moz-progress-bar {
  background: #9bd7ad;
}

.team-weekly-row progress.attendance-watch {
  accent-color: #eadf8a;
}

.team-weekly-row progress.attendance-watch::-webkit-progress-value {
  background: #eadf8a;
}

.team-weekly-row progress.attendance-watch::-moz-progress-bar {
  background: #eadf8a;
}

.team-weekly-row progress.attendance-low {
  accent-color: #9fc8ec;
}

.team-weekly-row progress.attendance-low::-webkit-progress-value {
  background: #9fc8ec;
}

.team-weekly-row progress.attendance-low::-moz-progress-bar {
  background: #9fc8ec;
}

.team-weekly-row progress.attendance-minimal {
  accent-color: #f0b37e;
}

.team-weekly-row progress.attendance-minimal::-webkit-progress-value {
  background: #f0b37e;
}

.team-weekly-row progress.attendance-minimal::-moz-progress-bar {
  background: #f0b37e;
}

.team-weekly-leagues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.team-weekly-league-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border: 1px solid rgba(var(--team-weekly-league-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--team-weekly-league-rgb), 0.12);
  color: var(--team-weekly-league-text);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.team-detail-games-table {
  min-width: 860px;
}

.team-detail-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.props-panel {
  display: grid;
  gap: 16px;
}

.props-table-shell {
  width: 100%;
  overflow-x: auto;
}

.props-table {
  min-width: 760px;
}

.props-action-cell {
  text-align: right;
}

.props-history {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.props-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.props-history-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: normal;
  word-break: normal;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.activity-table td:nth-child(5),
.activity-table th:nth-child(5) {
  white-space: normal;
}

.activity-table {
  min-width: 0;
  table-layout: fixed;
}

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

.activity-table tbody {
  display: grid;
  gap: 10px;
}

.activity-table tr {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.activity-table td,
.activity-table th,
.activity-table td:nth-child(n + 3),
.activity-table th:nth-child(n + 3) {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-bottom: 0;
  padding: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.activity-table td::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.activity-value-cell {
  grid-column: span 2;
}

.activity-cell-content {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.activity-value-cell .activity-cell-content {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.activity-details-cell {
  grid-column: 1 / -1;
}

.activity-table .activity-value-cell .activity-cell-content {
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.activity-table .reference-empty-cell {
  grid-column: 1 / -1;
  min-height: 48px;
  place-items: center;
}

.rank-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--rank-icon-width);
  width: var(--rank-icon-width);
  height: var(--rank-icon-size);
  color: #344255;
  white-space: nowrap;
  vertical-align: middle;
}

.rank-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.rank-icon-placeholder {
  color: #8a96a8;
  line-height: 1;
}

.rank-icon-table-cell {
  width: var(--rank-icon-cell-width);
  min-width: var(--rank-icon-cell-width);
  text-align: center !important;
}

.rank-icon-table-cell .rank-icon {
  margin-inline: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #edf2f7;
  color: #344255;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.status-pill.green {
  background: #e4f5ed;
  color: var(--green);
}

.status-pill.amber {
  background: #fff3d8;
  color: var(--amber);
}

.status-pill.blue {
  background: #e4effc;
  color: var(--blue);
}

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

.game-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.game-item:hover {
  border-color: var(--blue);
  background: #f8fbff;
}

.game-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.game-item strong {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.game-item-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--league-color, var(--blue));
}

.game-item-title {
  min-width: 0;
  color: inherit;
}

.game-item-meta,
.game-item-status {
  color: var(--muted);
  font-size: 13px;
}

.game-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-panel-header {
  align-items: flex-start;
}

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

.calendar-nav-button {
  min-width: 34px;
  padding: 0 8px;
  font-size: 20px;
  line-height: 1;
}

.calendar-month-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.calendar-view {
  min-width: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: minmax(88px, 0.72fr) repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.calendar-week-header,
.calendar-weekday,
.calendar-week-status,
.calendar-day {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-weekday {
  min-height: 36px;
  display: grid;
  place-items: center;
  background: #f6f8fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-week-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 8px;
  color: #344255;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.calendar-week-status-past {
  background: #edf2f7;
  color: #66717f;
}

.calendar-week-status-past.is-past {
  background: #eef0f3;
  color: #697180;
}

.calendar-week-status-current {
  background: #e4f5ed;
  color: var(--green);
}

.calendar-week-status-planning {
  background: #e7f2ff;
  color: #2864b4;
}

.calendar-week-status-approved {
  background: #fff3d8;
  color: var(--amber);
}

.calendar-week-status-none {
  background: #ffffff;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  min-height: 104px;
  border-top: 0;
  border-left: 0;
  background: #ffffff;
  color: var(--text);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover,
.calendar-day.is-selected {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.calendar-day.is-muted {
  background: #f8fafc;
  color: #9aa5b2;
}

.calendar-day.has-events .calendar-day-number {
  color: var(--blue);
}

.calendar-day-number {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
}

.calendar-day.is-today .calendar-day-number {
  background: #c62828;
  color: #ffffff;
}

.calendar-day-events {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.calendar-event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border-radius: 6px;
  background: #eef2f7;
  color: #334155;
  padding: 3px 5px;
  font-size: 11px;
  line-height: 1.2;
}

.calendar-event-status-draft,
.calendar-event-status-none {
  background: #eef2f7;
  color: #334155;
}

.calendar-event-status-approved {
  background: #fef3c7;
  color: #713f12;
}

.calendar-event-status-completed {
  background: #dcfce7;
  color: #14532d;
}

.calendar-event-status-cancelled {
  background: #fee2e2;
  color: #7f1d1d;
}

.calendar-event-chip.is-past {
  opacity: 0.55;
}

.calendar-event-chip.is-overdue {
  background: #5f1021;
  color: #ffffff;
  opacity: 1;
}

.calendar-event-league-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--league-color, #6b7280);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.calendar-event-chip b,
.calendar-event-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.calendar-day-details {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.calendar-day-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-day-details-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-day-details h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.calendar-day-games {
  display: grid;
  gap: 8px;
}

.calendar-detail-game {
  display: grid;
  gap: 5px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.calendar-detail-game:hover,
.calendar-detail-game:focus-visible {
  border-color: rgba(79, 70, 229, 0.42);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.12);
  transform: translateY(-1px);
}

.calendar-detail-game strong {
  line-height: 1.25;
}

.calendar-detail-game span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.calendar-game-modal {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 20px;
}

.calendar-game-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.46);
}

.calendar-game-modal-panel {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.22);
  padding: 18px;
}

.calendar-game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-game-modal-header h2 {
  font-size: 18px;
}

.calendar-game-form {
  display: grid;
  gap: 14px;
}

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

.calendar-date-field input[readonly] {
  background: #f6f8fb;
  color: var(--muted);
}

.calendar-results-field {
  grid-column: 1 / -1;
  align-self: start;
  min-width: 0;
}

.calendar-results-upload-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.calendar-results-upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px dashed #b8c7d8;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.calendar-results-upload:hover {
  border-color: var(--blue);
  background: #eef5ff;
}

.calendar-results-replace {
  min-height: 34px;
}

.calendar-results-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.calendar-results-list-section {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-results-list-header,
.calendar-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(128px, auto);
  align-items: center;
  gap: 12px;
}

.calendar-results-list-header {
  min-height: 36px;
  padding: 7px 10px;
  background: #f4f7fa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-results-list-header span:nth-child(2),
.calendar-results-list-header span:nth-child(3) {
  text-align: right;
}

.calendar-results-list {
  display: grid;
  max-height: 320px;
  min-width: 0;
  overflow-y: auto;
}

.calendar-result-row {
  min-height: 52px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.calendar-result-row:first-child {
  border-top: 0;
}

.calendar-result-row.is-editing {
  align-items: start;
  background: #f7fbff;
}

.calendar-result-team,
.calendar-result-team-name,
.calendar-result-edit-field {
  min-width: 0;
}

.calendar-result-team {
  display: grid;
  gap: 4px;
}

.calendar-result-team-name {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.calendar-result-score {
  justify-self: end;
  color: #155e4b;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calendar-result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.calendar-result-edit-field {
  display: grid;
  gap: 4px;
}

.calendar-result-edit-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.calendar-result-edit-field input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

.calendar-result-preview-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.calendar-results-state {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.calendar-results-state.error {
  color: var(--red);
}

.calendar-results-feedback {
  display: block;
  min-height: 0;
  padding: 0 10px;
}

.calendar-results-feedback:not(:empty) {
  padding-top: 9px;
  padding-bottom: 9px;
  border-top: 1px solid var(--line);
}

.calendar-game-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.season-lock {
  display: grid;
  gap: 10px;
}

.season-lock strong {
  font-size: 22px;
  line-height: 1.1;
}

.season-lock span {
  color: var(--muted);
}

.season-lock .primary-button {
  justify-self: start;
}

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

.reference-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 196px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.reference-card h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.2;
}

.reference-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.reference-count {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.reference-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.reference-card-footer span {
  color: var(--muted);
  font-size: 13px;
}

.references-panel .panel-header {
  align-items: flex-start;
}

.section-path {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.path-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.path-button:hover {
  text-decoration: underline;
}

.reference-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.reference-status {
  min-height: 40px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #edf2f7;
  color: #344255;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.35;
}

.reference-status.error {
  border-color: #efc7c7;
  background: #fff1f1;
  color: var(--red);
}

.reference-status.success {
  border-color: #bbe4cc;
  background: #e4f5ed;
  color: var(--green);
}

.reference-empty {
  grid-column: 1 / -1;
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.reference-detail {
  display: block;
}

.reference-table-shell {
  min-width: 0;
  overflow-x: auto;
}

.reference-table {
  min-width: 720px;
}

.staff-members-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.staff-members-filter-group {
  display: grid;
  gap: 6px;
}

.staff-members-filter-group > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.staff-members-kind-filter {
  justify-content: flex-start;
}

.staff-members-role-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-members-role-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 6px 9px;
  font-size: 13px;
  cursor: pointer;
}

.staff-members-role-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.reference-table th,
.reference-table td,
.reference-table td:nth-child(n + 3),
.reference-table th:nth-child(n + 3) {
  white-space: normal;
}

.reference-meta-cell {
  white-space: nowrap !important;
  color: var(--muted);
}

.reference-actions-column {
  width: 220px;
}

.reference-actions-cell {
  white-space: nowrap !important;
}

.reference-actions-cell .ghost-button {
  margin: 0 6px 6px 0;
}

.season-history-section {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.season-history-header,
.season-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.season-history-header h3 {
  margin: 0;
  font-size: 20px;
}

.season-history-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.season-history-page-size select {
  min-width: 84px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.season-history-table {
  min-width: 840px;
}

.season-history-pagination {
  color: var(--muted);
  font-weight: 700;
}

.season-actions-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.season-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.season-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.season-inline-field {
  display: grid;
  gap: 4px;
  min-width: 104px;
  color: var(--muted);
  font-size: 12px;
}

.season-inline-field input {
  width: 104px;
}

.season-finish-popup {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.season-finish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.season-meta-line,
.rating-season-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.season-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.season-compact-list,
.season-qualifiers {
  display: grid;
  gap: 8px;
}

.season-compact-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.season-compact-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.season-qualifier-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.season-qualifier-group strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.season-qualifier-group ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 13px;
}

.season-empty {
  min-height: 64px;
}

.reference-empty-cell {
  height: 96px;
  color: var(--muted);
  text-align: center;
}

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

.league-tier-icon-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.league-tier-icon-cell .rank-icon {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.league-tier-icon-filename {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.reference-modal {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 20px;
}

.reference-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.44);
}

.reference-modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.22);
  padding: 18px;
}

.reference-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reference-form h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
}

.field select {
  appearance: auto;
}

.field select[multiple] {
  min-height: 124px;
}

.staff-role-grades-cell {
  display: inline;
  color: var(--text);
}

.staff-role-grades-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.staff-role-grades-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.staff-role-grades-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.staff-role-grades-list {
  display: grid;
  gap: 8px;
}

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

.staff-role-grade-row .field {
  min-width: 0;
}

.staff-role-grade-remove,
.staff-role-grade-add {
  min-height: 38px;
}

.staff-role-grades-empty {
  min-height: 48px;
}

.reference-computed-field input[readonly] {
  background: #f6f8fb;
  color: var(--muted);
}

.reference-color-control {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.reference-color-control input[type="color"] {
  min-height: 38px;
  padding: 4px;
  cursor: pointer;
}

.reference-color-preview,
.reference-color-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field .reference-color-preview {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.reference-color-preview::before,
.reference-color-swatch {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  background: var(--reference-color, #6b7280);
}

.reference-color-value span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reference-color-option {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: var(--reference-color, #6b7280);
  cursor: pointer;
}

.reference-color-option.is-selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--blue);
}

.reference-color-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field-hint.error {
  color: var(--red);
}

.field-hint.success {
  color: var(--green);
}

.league-tier-icon-field {
  min-width: 0;
}

.league-tier-icon-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.league-tier-icon-preview img {
  width: var(--rank-icon-preview-width);
  height: var(--rank-icon-preview-size);
  flex: 0 0 var(--rank-icon-preview-width);
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.league-tier-icon-preview span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.league-tier-icon-upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px dashed #b8c7d8;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  padding: 8px 10px;
}

.league-tier-icon-upload:hover {
  border-color: var(--blue);
  background: #eef5ff;
}

.league-tier-icon-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.league-tier-icon-replace {
  justify-self: start;
  min-height: 34px;
}

.reference-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.44);
}

.confirm-modal-panel {
  position: relative;
  width: min(380px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.22);
  padding: 18px;
}

.confirm-modal-panel h2 {
  font-size: 18px;
}

.confirm-modal-panel p {
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.4;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.5);
}

#login-modal .auth-modal-backdrop {
  background: var(--bg);
}

.auth-modal-panel {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.22);
  padding: 18px;
}

.team-action-modal-panel {
  width: min(560px, 100%);
}

.team-action-modal .reference-form-actions .primary-button,
.team-action-modal .reference-form-actions .ghost-button {
  width: auto;
}

.team-action-modal input[readonly] {
  background: #f6f8fb;
  color: var(--muted);
}

.team-merge-options {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.team-merge-option {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.team-merge-option strong {
  font-size: 14px;
  line-height: 1.25;
}

.team-merge-option span,
.team-merge-options-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.team-merge-option.active {
  border-color: var(--blue);
  background: #eef5ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.team-merge-option:disabled {
  cursor: default;
  opacity: 0.72;
}

.team-merge-option:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.team-merge-options-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
}

.auth-form-header {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.auth-form-header h2 {
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form .primary-button {
  width: 100%;
}

progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #edf2f7;
}

progress::-webkit-progress-bar {
  background: #edf2f7;
}

progress::-webkit-progress-value {
  background: var(--green);
}

progress::-moz-progress-bar {
  background: var(--green);
}

@media (max-width: 980px) {
  .metrics,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-panel-header {
    flex-direction: column;
  }

  .rating-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-analytics-header {
    flex-direction: column;
  }

  .charts-header {
    flex-direction: column;
  }

  .charts-controls {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
  }

  .charts-bucket-control {
    flex: 0 0 auto;
    width: auto;
  }

  .charts-year-filters {
    flex: 0 1 auto;
    width: auto;
  }

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

  .game-analytics-controls {
    width: 100%;
    justify-content: stretch;
  }

  .game-analytics-controls select {
    flex: 1 1 180px;
  }

  .game-analytics-grid {
    grid-template-columns: 1fr;
  }

  .game-analytics-block-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .game-analytics-block-actions {
    margin-left: auto;
  }

  .teams-analytics-header {
    flex-direction: column;
  }

  .teams-analytics-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teams-analytics-search {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .teams-analytics-filters .primary-button {
    width: 100%;
  }

  .teams-analytics-pagination {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .teams-analytics-page-size {
    width: 100%;
    margin-right: 0;
  }

  .team-detail-statistics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-detail-statistic:nth-child(3) {
    border-right: 0;
  }

  .team-detail-statistic:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .team-detail-statistic:last-child {
    border-right: 0;
  }

  .rating-panel-header .segmented-control {
    width: 100%;
    min-width: 0;
  }

  .rating-panel-header .segmented-control-button {
    flex: 1 1 0;
    min-width: 0;
  }

  .rating-controls {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .rating-controls select {
    flex: 1 1 180px;
  }

  .rating-panel-header .rating-controls select {
    max-width: none;
  }

  .rank-history-header {
    flex-direction: column;
  }

  .rank-history-search {
    flex-basis: auto;
    width: 100%;
    min-width: 0;
  }

  .calendar-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .calendar-grid {
    grid-template-columns: minmax(72px, 0.8fr) repeat(7, minmax(0, 1fr));
  }

  .calendar-week-status,
  .calendar-day {
    min-height: 88px;
  }

  .calendar-week-status {
    font-size: 12px;
  }

  .calendar-day {
    padding: 6px;
  }

  .calendar-event-chip {
    padding: 2px 4px;
  }

}

@media (max-width: 700px) {
  .app-shell,
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .app-shell.is-sidebar-collapsed .sidebar {
    z-index: 5;
    width: 100%;
    height: auto;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 14px;
  }

  .sidebar.is-menu-open {
    height: 100vh;
    height: 100dvh;
  }

  .sidebar-header,
  .app-shell.is-sidebar-collapsed .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 12px;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .brand,
  .app-shell.is-sidebar-collapsed .brand {
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .app-shell.is-sidebar-collapsed .brand-text {
    display: block;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    gap: 4px;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid #344255;
    border-radius: 8px;
    background: #253241;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
  }

  .nav {
    display: none;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    max-width: 100%;
    margin-top: 12px;
  }

  .app-shell.is-sidebar-collapsed .nav {
    justify-items: stretch;
  }

  .sidebar.is-menu-open .nav {
    display: grid;
  }

  .nav-item,
  .app-shell.is-sidebar-collapsed .nav-item {
    grid-template-columns: 22px minmax(0, 1fr);
    justify-items: stretch;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    text-align: left;
    line-height: 1.2;
  }

  .app-shell.is-sidebar-collapsed .nav-label {
    display: inline;
  }

  .team-detail-panel {
    overflow-x: hidden;
  }

  .team-detail-header {
    display: grid;
  }

  .team-detail-title-row {
    display: grid;
    gap: 10px;
  }

  .team-detail-actions {
    justify-content: flex-start;
  }

  .team-detail-back {
    justify-self: start;
  }

  .team-about-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-about-item:nth-child(even) {
    border-right: 0;
  }

  .team-about-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .team-weekly-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .team-weekly-progress-column {
    padding-top: 0;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    column-gap: 10px;
    row-gap: 6px;
  }

  .actions {
    align-self: end;
    flex: 0 1 auto;
    justify-content: flex-end;
    width: auto;
    max-width: min(64vw, 260px);
    margin-left: 0;
  }

  .current-user {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-width: 0;
    width: auto;
    max-width: 100%;
    padding: 6px;
  }

  .current-user-info:nth-of-type(n + 2),
  .current-user span {
    display: none;
  }

  .current-user strong {
    font-size: 13px;
  }

  .current-user .ghost-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    padding: 0 9px;
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  :root {
    --rank-icon-size: 34px;
    --rank-icon-width: 119px;
    --rank-icon-cell-width: 135px;
  }

  .sidebar,
  .app-shell.is-sidebar-collapsed .sidebar {
    padding: 16px 14px;
  }

  .brand,
  .app-shell.is-sidebar-collapsed .brand {
    min-height: 44px;
    margin-bottom: 0;
  }

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

  .nav {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .nav-item {
    min-height: 46px;
    padding: 8px;
  }

  .workspace {
    padding: 18px 14px;
  }

  .game-analytics-controls select {
    min-width: 0;
    width: 100%;
  }

  .charts-controls {
    align-items: center;
    justify-content: flex-start;
  }

  .charts-bucket-control,
  .charts-year-filters {
    width: auto;
  }

  .chart-card {
    padding: 12px;
  }

  .chart-card-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .chart-filter-chip {
    min-height: 34px;
  }

  .game-analytics-block {
    padding: 12px;
  }

  .game-analytics-block-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .game-analytics-pagination {
    justify-content: space-between;
  }

  .game-analytics-pagination span {
    order: -1;
    flex: 1 0 100%;
    text-align: center;
  }

  .game-analytics-pagination .ghost-button {
    flex: 1 1 100px;
  }

  .teams-analytics-search {
    grid-template-columns: 1fr;
  }

  .teams-analytics-search .primary-button,
  .teams-analytics-search .ghost-button {
    width: 100%;
  }

  .team-detail-heading h2 {
    font-size: 20px;
  }

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

  .team-about-item,
  .team-about-item:nth-child(even) {
    border-right: 0;
  }

  .team-about-item:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

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

  .team-detail-statistic,
  .team-detail-statistic:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .team-detail-statistic:nth-child(even) {
    border-right: 0;
  }

  .team-detail-statistic:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .team-detail-statistic:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .team-detail-pagination {
    justify-content: space-between;
  }

  .team-detail-pagination .ghost-button {
    flex: 0 1 auto;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    column-gap: 10px;
    row-gap: 6px;
  }

  .references-panel .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    align-self: end;
    flex: 0 1 auto;
    justify-content: flex-end;
    width: auto;
    max-width: min(64vw, 260px);
    margin-left: 0;
  }

  .current-user {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-width: 0;
    width: auto;
    max-width: 100%;
    padding: 6px;
  }

  .current-user-info:nth-of-type(n + 2),
  .current-user span {
    display: none;
  }

  .current-user strong {
    font-size: 13px;
  }

  .current-user .ghost-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    padding: 0 9px;
    font-size: 13px;
  }

  .reference-toolbar {
    width: 100%;
    justify-content: stretch;
  }

  .primary-button,
  .ghost-button {
    flex: 1;
  }

  h1 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .data-table {
    min-width: 620px;
  }

  .activity-table {
    min-width: 0;
  }

  .activity-table tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-value-cell,
  .activity-details-cell {
    grid-column: 1 / -1;
  }

  .rating-table {
    min-width: 520px;
  }

  .panel {
    overflow-x: auto;
  }

  .panel.team-detail-panel {
    overflow-x: hidden;
  }

  .rating-table-shell {
    overflow-x: auto;
  }

  .ratings-pagination,
  .rank-history-pagination {
    width: 100%;
    justify-content: space-between;
  }

  .ratings-pagination span,
  .rank-history-pagination span {
    flex: 0 0 auto;
    text-align: center;
  }

  .segmented-control {
    width: 100%;
    min-width: 0;
  }

  .segmented-control-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
    white-space: nowrap;
  }

  .charts-panel .charts-bucket-control {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    max-width: 100%;
  }

  .charts-panel .charts-bucket-control .segmented-control-button {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
  }

  .calendar-panel {
    overflow-x: hidden;
  }

  .calendar-toolbar {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
  }

  .calendar-toolbar #calendar-refresh-button {
    grid-column: 1 / -1;
  }

  .calendar-month-title {
    justify-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .calendar-grid {
    grid-template-columns: minmax(54px, 0.86fr) repeat(7, minmax(0, 1fr));
  }

  .calendar-weekday {
    min-height: 30px;
    font-size: 11px;
  }

  .calendar-week-status,
  .calendar-day {
    min-height: 66px;
  }

  .calendar-week-status {
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1.15;
  }

  .calendar-day {
    gap: 3px;
    padding: 4px 3px;
  }

  .calendar-day-number {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  .calendar-event-chip {
    display: flex;
    gap: 3px;
    padding: 2px 3px;
    font-size: 10px;
  }

  .calendar-event-league-dot {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
  }

  .calendar-event-chip span {
    display: none;
  }

  .calendar-event-more {
    font-size: 10px;
  }

  .calendar-day-details-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-day-details-actions {
    width: 100%;
    justify-content: stretch;
  }

  .calendar-day-details-actions .primary-button {
    flex: 1;
  }

  .calendar-game-modal {
    align-items: end;
    padding: 12px;
  }

  .reference-modal {
    align-items: end;
    padding: 12px;
  }

  .reference-modal-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .reference-form-actions {
    flex-direction: column-reverse;
  }

  .reference-form-actions .primary-button,
  .reference-form-actions .ghost-button {
    width: 100%;
  }

  .calendar-game-modal-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .calendar-game-form-grid {
    grid-template-columns: 1fr;
  }

  .calendar-results-replace {
    width: 100%;
  }

  .calendar-results-upload-actions {
    grid-template-columns: 1fr;
  }

  .calendar-results-list-header {
    display: none;
  }

  .calendar-result-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 76px;
  }

  .calendar-result-team {
    grid-column: 1 / -1;
  }

  .calendar-result-score {
    justify-self: start;
    font-size: 17px;
  }

  .calendar-result-actions {
    justify-self: end;
  }

  .calendar-game-modal-actions {
    flex-direction: column-reverse;
  }

  .calendar-game-modal-actions .primary-button,
  .calendar-game-modal-actions .ghost-button {
    width: 100%;
  }

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

  .staff-role-grade-row {
    grid-template-columns: 1fr;
  }

}
