.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.header-venue {
  margin-left: auto;
  min-width: 0;
  width: min(340px, 42vw);
}
.header-venue select {
  width: 100%;
  font-size: 13px;
  font-weight: 400;
  padding: 7px 9px;
}
.masthead {
  gap: 18px;
  padding-block: 6px;
}
.page-heading > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 14px;
}
.page-heading h1 {
  margin: 0;
  font-size: 21px;
}
.page-heading {
  padding-top: 6px;
}
#subtitle {
  font-size: 12px;
}
#filters {
  margin-top: 4px;
}
#filters:has(> [hidden]):not(:has(> :not([hidden]))) {
  display: none;
}
#filters > label:first-child {
  flex: 0 1 240px;
}
#races {
  margin-top: 4px;
  padding: 5px 0 0;
  gap: 6px;
}
#races a {
  padding: 6px 11px;
  font-size: 12px;
}
.race {
  margin: 8px 0 12px;
  border-radius: 8px;
}
.race-heading {
  padding: 8px 10px;
  gap: 8px 14px;
  flex-wrap: wrap;
}
.race-heading > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  flex: 1;
}
.race-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}
.race-heading p {
  margin: 0;
  font-size: 11px;
}
.official-time {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin-left: auto;
  gap: 6px;
}
.official-time strong {
  display: inline;
  font-size: 17px;
  font-weight: 500;
}
.official-time small {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}
.odds-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 10px;
  justify-items: center;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
}
.provider-tab {
  color: #42cb9b;
}
.provider-ladbrokes {
  color: #ff525c;
}
.race-weather {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  align-items: baseline;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.race-weather-label,
.race-weather-reading b {
  font-weight: 500;
  color: #cbd5df;
}
.race-runners table {
  white-space: normal;
}
.race-runners th {
  padding: 4px 8px;
}
.race-runners td {
  padding: 3px 8px;
}
.race-runners th[data-column="win"],
.race-runners th[data-column="place-odds"] {
  width: 226px;
  text-align: center;
}
.race-runners .bib {
  width: 23px;
  height: 26px;
  font-size: 12px;
}
.runner-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}
.runner-identity small {
  color: var(--muted);
  font-size: 10px;
}
.runner-time {
  white-space: nowrap;
}
.race-runners [data-column="margin"] {
  white-space: nowrap;
}
.combined-odds {
  min-width: 210px;
  width: 100%;
}
.combined-quotes {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 10px;
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
}
/* Keep missing quotes in their own bookmaker column at every screen width. */
.odds-legend > .provider-tab,
.combined-quotes > .provider-tab {
  grid-column: 1;
  grid-row: 1;
}
.odds-legend > .provider-ladbrokes,
.combined-quotes > .provider-ladbrokes {
  grid-column: 2;
  grid-row: 1;
}
.combined-quotes small {
  font-size: 9px;
  opacity: 0.8;
}
.combined-quotes b {
  font-size: 11px;
  font-weight: 500;
}
.inline-market-label {
  display: none;
}
.race-photos {
  padding: 7px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.race-photos h3 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}
.race-photos p {
  margin: 0;
  font-size: 11px;
}
.race-photos .photo-controls {
  margin-left: auto;
  gap: 8px;
}
.race-photos .photo-controls button,
.race-photos .photo-controls a {
  padding: 4px 7px;
  font-size: 11px;
}
.race-photos .photo-frame {
  flex-basis: 100%;
  margin: 0;
}
@media (max-width: 900px) {
  .header-venue select {
    font-size: 16px;
  }
  .race-runners th[data-column="win"],
  .race-runners th[data-column="place-odds"] {
    width: 226px;
  }
}
@media (max-width: 700px) {
  .race-runners {
    max-width: 100%;
    overscroll-behavior-x: contain;
  }
  .race-runners table {
    min-width: 760px;
    white-space: nowrap;
  }
  .race-runners th,
  .race-runners td {
    padding: 7px 8px;
    vertical-align: middle;
    font-size: 12px;
  }
  .race-runners th {
    font-size: 11px;
    white-space: nowrap;
  }
  .race-runners [data-column="contestant"] {
    min-width: 185px;
    width: 185px;
    max-width: 210px;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #0b1017;
    box-shadow: 1px 0 var(--line);
  }
  .race-runners th[data-column="contestant"] {
    background: #101924;
  }
  .runner-identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
  }
  .runner-identity .participant-link {
    font-size: 13px;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 0;
  }
  .runner-identity small {
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }
  .race-runners [data-column="time"],
  .race-runners [data-column="section"] {
    white-space: nowrap;
    min-width: 72px;
  }
  .race-runners [data-column="win"],
  .race-runners [data-column="place-odds"] {
    min-width: 226px;
  }
  .race-heading > div:first-child {
    flex-basis: 100%;
  }
  .race-weather {
    gap: 3px 8px;
    font-size: 10px;
  }
  .odds-grid td {
    padding: 5px;
  }
}
@media (max-width: 540px) {
  .masthead {
    padding: 6px 16px;
    gap: 8px;
  }
  .logo img {
    width: 84px;
    height: 34px;
  }
  .header-venue {
    width: calc(100% - 94px);
  }
  .header-venue select {
    font-size: 16px;
  }
  .page-heading h1 {
    font-size: 18px;
  }
  .page-heading > div {
    gap: 2px 8px;
  }
  #subtitle {
    font-size: 11px;
  }
}

.meeting-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 5px;
}
.meeting-heading .page-heading {
  flex: 1 1 auto;
  padding: 0;
}
.meeting-heading #filters {
  order: 1;
  margin: 0;
}
.race-weather {
  display: block;
}
.race-weather-label,
.race-weather-reading {
  margin-right: 10px;
}
.race-runners th:first-child {
  width: 40px;
}
.race-runners th:nth-child(2) {
  width: 38px;
}
@media (max-width: 700px) {
  .race-runners .combined-quotes small {
    font-size: 11px;
  }
  .race-runners .combined-quotes b {
    font-size: 11px;
  }
  .race-weather {
    line-height: 1.6;
  }
}

/* Keep venue identity in the masthead and the range control inside its graph. */
#venue-heading {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px 9px;
  text-align: right;
}
#venue-heading h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
#header-track {
  font-size: 12px;
  color: var(--muted);
}
.weather-overview {
  position: relative;
}
#weather-context {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
}
#weather-context select {
  padding: 4px 8px;
  font-size: 11px;
  background: #151a1d;
}
@media (max-width: 700px) {
  #venue-heading h1 {
    font-size: 13px;
    line-height: 1.3;
  }
  #header-track {
    font-size: 11px;
  }
  #weather-context select {
    font-size: 16px;
    padding: 2px 8px;
  }
}

.section-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.record-mark {
  display: inline-block;
  width: 0.25rem;
  height: 1rem;
  border-radius: 0.2rem;
  flex-shrink: 0;
}
.record-track_record {
  background: #a855f7;
}
.record-personal_best {
  background: #16883e;
}
.record-slower {
  background: #dc2626;
}
.record-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
  font-size: 0.8rem;
}
.record-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.race-sections:empty {
  display: none;
}

.result-status {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid #7198ae;
  border-radius: 999px;
  color: #c1eaff;
}
.status-protest {
  color: #ffb7b7;
  border-color: #b96464;
}
.status-all_clear,
.status-correct_weight {
  color: #a9ecc8;
  border-color: #509b73;
}

.status-interim {
  color: #dfb7ff;
  border-color: #a66fdb;
  animation: interim-pulse 1.8s ease-in-out infinite;
}
@keyframes interim-pulse {
  50% {
    box-shadow: 0 0 8px #a66fdb80;
    color: #f1ddff;
  }
}
@media (prefers-reduced-motion: reduce) {
  .status-interim {
    animation: none;
  }
}

/* WSS artwork keeps the official rug pattern and square proportions. */
.runner-rug {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  border-radius: 3px;
}
.runner-silk-slot {
  float: left;
  margin-right: 6px;
}
.runner-silk {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.scratched .runner-rug,
.scratched .runner-silk {
  filter: grayscale(1);
  opacity: 0.55;
}
.race-runners [hidden],
.odds-legend[hidden],
.runner-silk-slot[hidden] {
  display: none;
}
.section-orders {
  margin: 8px 0;
  overflow-x: auto;
}
.section-orders:empty {
  display: none;
}
.section-orders h3 {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 5px;
}
.section-order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}
.section-order-name {
  flex: 0 0 32px;
  font-size: 13px;
}
.section-order-positions {
  display: flex;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.section-order-positions li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.section-order-positions small {
  font-size: 10px;
  color: var(--muted);
}
.section-order-missing {
  font-size: 12px;
  color: var(--muted);
}
.record-slower {
  background: #84919c;
}
@media (max-width: 700px) {
  .race-runners:not(.has-odds) table {
    min-width: 560px;
  }
  .section-order-positions {
    gap: 4px;
  }
  .section-order-row {
    gap: 5px;
  }
  .section-order-name {
    flex-basis: 27px;
  }
}

.race-runners .runner-identity.has-silk {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 2px 6px;
}
.race-runners .has-silk .runner-silk-slot {
  grid-row: 1 / span 2;
  margin: 0;
}
.race-runners .has-silk > a,
.race-runners .has-silk > small {
  grid-column: 2;
}
