/* Group table hierarchy: the table owns the full available height, while
   ranking context and exceptional decisions stay readable without competing
   with the fixture workbench. */
.schedule-centre-page .compact-standings-panel {
  position: relative;
  min-width: 0;
}

.schedule-centre-page .compact-standings-grid {
  min-height: 0;
}

.schedule-centre-page .compact-standings-grid > article {
  display: grid;
  grid-template-rows: auto repeat(var(--standing-row-count, 8), minmax(0, 1fr));
  height: 100%;
  min-height: 0;
  overflow: visible;
}

.schedule-centre-page .compact-standings-grid article > header.group-standing-head,
.schedule-centre-page .compact-standing-row {
  grid-template-columns: 20px minmax(0, 1fr) 108px 52px !important;
  gap: 4px;
}

.schedule-centre-page .compact-standing-row {
  z-index: 0;
  min-height: 0 !important;
  padding: 5px 7px;
}

.schedule-centre-page .compact-standing-row:hover,
.schedule-centre-page .compact-standing-row:focus-within {
  z-index: 20;
}

.schedule-centre-page .standing-record-heading,
.schedule-centre-page .standing-record {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.schedule-centre-page .standing-record-heading span,
.schedule-centre-page .standing-record-heading b,
.schedule-centre-page .standing-record span,
.schedule-centre-page .standing-record b {
  min-width: 0;
}

.schedule-centre-page .standing-team {
  min-width: 0;
}

.schedule-centre-page .standing-team-copy {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.schedule-centre-page .standing-team-main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.schedule-centre-page .standing-team-main > b {
  display: block;
  width: min(100%, 10em);
  min-width: 0;
  max-width: 10em;
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-centre-page .standing-rank-flags {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.schedule-centre-page .standing-head-to-head,
.schedule-centre-page .standing-needs-decision {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 1px 4px;
  border: 1px solid rgba(115, 190, 255, .42);
  background: rgba(72, 145, 210, .12);
  color: #b9ddff;
  text-overflow: ellipsis;
}

.schedule-centre-page .standing-needs-decision {
  border-color: rgba(255, 155, 125, .5);
  background: rgba(203, 87, 64, .12);
  color: #ffc0ad;
}

.schedule-centre-page .standing-adjustment-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.schedule-centre-page .standing-points-adjustment {
  cursor: help;
  min-height: 22px;
  font-size: 12px;
  outline: none;
}

.schedule-centre-page .standing-points-adjustment:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.schedule-centre-page .standing-adjustment-tooltip {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 8px);
  left: 0;
  display: grid;
  visibility: hidden;
  box-sizing: border-box;
  width: min(310px, calc(100vw - 32px));
  max-height: 190px;
  gap: 7px;
  padding: 11px 12px;
  overflow-y: auto;
  border: 1px solid rgba(118, 199, 219, .5);
  background: linear-gradient(145deg, #102d40, #061522);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .52);
  color: #d9e8ed;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  white-space: normal;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}

.schedule-centre-page .compact-standings-grid > article:nth-child(even) .standing-adjustment-tooltip {
  right: 0;
  left: auto;
}

.schedule-centre-page .standing-adjustment-wrap:hover .standing-adjustment-tooltip,
.schedule-centre-page .standing-points-adjustment:focus + .standing-adjustment-tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.schedule-centre-page .standing-adjustment-tooltip > strong {
  color: #f0f8fb;
  font-size: 13px;
}

.schedule-centre-page .standing-adjustment-reason {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(147, 191, 209, .14);
  color: #b8cbd3;
  font-size: 13px;
  line-height: 1.45;
}

.schedule-centre-page .standing-adjustment-reason > b {
  color: #d8ff99;
  font-variant-numeric: tabular-nums;
}

.schedule-centre-page .standings-ranking-note {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 16px 8px;
  border-top: 1px solid rgba(142, 181, 200, .14);
  background: rgba(2, 14, 24, .38);
  color: #8fa5b1;
}

.schedule-centre-page .standings-ranking-note > strong {
  flex: 0 0 auto;
  color: #c0d1d8;
  font-size: 13px;
}

.schedule-centre-page .standings-ranking-note ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-centre-page .standings-ranking-note li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8fa5b1;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.schedule-centre-page .standings-ranking-note li > b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(145, 188, 205, .28);
  color: #c8d9df;
  font-size: 12px;
  place-items: center;
}

@media (min-width: 2400px) {
  .schedule-centre-page .compact-standings-grid article > header.group-standing-head,
  .schedule-centre-page .compact-standing-row {
    grid-template-columns: 28px minmax(0, 1fr) 144px 70px !important;
    gap: 7px;
  }

  .schedule-centre-page .standing-rank-flags { font-size: 14px; }
  .schedule-centre-page .standing-team-main > b { font-size: 17px; }
  .schedule-centre-page .standing-head-to-head,
  .schedule-centre-page .standing-needs-decision { padding: 2px 6px; }
  .schedule-centre-page .standing-adjustment-tooltip { width: 380px; padding: 15px 16px; }
  .schedule-centre-page .standing-adjustment-tooltip > strong { font-size: 16px; }
  .schedule-centre-page .standing-adjustment-reason { font-size: 15px; }
  .schedule-centre-page .standings-ranking-note { min-height: 44px; padding: 8px 20px 10px; gap: 14px; }
  .schedule-centre-page .standings-ranking-note > strong { font-size: 15px; }
  .schedule-centre-page .standings-ranking-note li { gap: 6px; font-size: 14px; }
  .schedule-centre-page .standings-ranking-note li > b { width: 21px; height: 21px; font-size: 13px; }
}

@media (max-width: 1380px) {
  .schedule-centre-page .compact-standings-grid article > header.group-standing-head,
  .schedule-centre-page .compact-standing-row {
    grid-template-columns: 20px minmax(0, 1fr) 96px 46px !important;
    gap: 3px;
  }

  .schedule-centre-page .standing-record-heading span,
  .schedule-centre-page .standing-record-heading b { font-size: 10px; }
  .schedule-centre-page .standing-team-main > b { font-size: 12px; }
  .schedule-centre-page .standing-rank-flags { font-size: 12px; }
  .schedule-centre-page .standings-ranking-note { padding-inline: 10px; }
}

@media (max-width: 760px) {
  .schedule-centre-page .compact-standings-grid > article:not(.is-selected-group) {
    display: none;
  }

  .schedule-centre-page .compact-standings-grid > article {
    min-height: 430px;
  }

  .schedule-centre-page .compact-standing-row {
    min-height: 48px !important;
  }

  .schedule-centre-page .standing-team-main { gap: 3px; }
  .schedule-centre-page .standing-team-main > b { max-width: 10em; }
  .schedule-centre-page .standing-rank-flags { font-size: 12px; }
  .schedule-centre-page .standing-points-adjustment { min-height: 22px; font-size: 12px; }
  .schedule-centre-page .standing-adjustment-tooltip {
    right: auto !important;
    left: 50% !important;
    width: min(280px, calc(100vw - 24px));
    transform: translate(-50%, 4px);
  }

  .schedule-centre-page .standing-adjustment-wrap:hover .standing-adjustment-tooltip,
  .schedule-centre-page .standing-points-adjustment:focus + .standing-adjustment-tooltip {
    transform: translate(-50%, 0);
  }

  .schedule-centre-page .standings-ranking-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px 10px;
  }

  .schedule-centre-page .standings-ranking-note ol { gap: 4px 8px; }
  .schedule-centre-page .standings-ranking-note li { font-size: 12px; }
}
