#venue-directory {
  max-width: 760px;
  margin: 12px auto;
}
#venue-directory h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 18px;
}
#venue-list {
  display: grid;
  gap: 10px;
}
.venue-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid #35414d;
  border-radius: 9px;
  color: #eaf0f6;
  font-size: 16px;
}
.venue-list-item:hover,
.venue-list-item:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 10px #81909e1c;
}
.venue-list-item > span:last-child {
  color: var(--muted);
}
.trial-day-list table {
  min-width: 0;
  width: 100%;
}
.trial-day-list td {
  font-variant-numeric: tabular-nums;
}
.trial-fastest {
  white-space: normal;
  text-align: center;
  display: inline-block;
  border: 1px solid #428d6859;
  background: #2ba56b1a;
  border-radius: 999px;
  padding: 2px 6px;
  color: #8fe0af;
  font-size: 11px;
  font-weight: 500;
}
.trial-difference {
  color: #b5bec9;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .venue-list-item {
    padding: 16px;
    font-size: 15px;
  }
  .trial-day-list th,
  .trial-day-list td {
    padding: 8px 4px;
    font-size: 11px;
  }
  .trial-day-list th {
    white-space: normal;
    letter-spacing: 0;
  }
  .trial-day-list td:first-child,
  .trial-day-list td:nth-child(2) {
    white-space: nowrap;
  }
  .trial-fastest {
    font-size: 10px;
    padding: 2px 4px;
  }
}

.trial-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}
.trial-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.trial-toolbar select,
.trial-toolbar button {
  padding: 7px 10px;
  font-size: 12px;
}
.trial-name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.trial-start-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}
#filters #trial-distance-filter {
  flex: 0 0 auto;
  margin: 0;
}
#trial-distance-filter select {
  width: auto;
  padding: 8px 10px;
  font-size: 13px;
}
button:not(.weather-metric):not(.trial-weather-card),
select,
#meeting-date,
.calendar-days button,
#races a {
  border-radius: 999px;
}
.trial-cup {
  font-size: 13px;
}

.trial-day-list th,
.trial-day-list td {
  padding-block: 8px;
}
.trial-day-list th {
  text-transform: none;
  letter-spacing: 0;
}
.trial-sort {
  border: 0;
  border-radius: 3px;
  box-shadow: none;
  padding: 5px 0;
  font: inherit;
  color: inherit;
  background: transparent;
  white-space: normal;
  text-align: left;
}
.trial-sort:hover {
  color: #fff;
  box-shadow: none;
}
.trial-day-list th[aria-sort="ascending"],
.trial-day-list th[aria-sort="descending"] {
  color: #eaf0f6;
}
.trial-records {
  margin-top: 18px;
}
.trial-records h3 {
  font-size: 13px;
  font-weight: 500;
  margin: 14px 0 6px;
  color: #c8d2dc;
}
.trial-records table {
  font-size: 12px;
}
.trial-record-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trial-record-cell a {
  width: fit-content;
}
.trial-record-cell a:hover {
  text-decoration: underline;
}
.trial-record-cell small {
  font-size: 10px;
  color: var(--muted);
}
.trial-record-cell .trial-record-gap {
  color: #c1cad4;
}
@media (max-width: 700px) {
  .trial-toolbar select {
    font-size: 16px;
  }
  .trial-toolbar button {
    font-size: 11px;
  }
  .trial-records th,
  .trial-records td {
    padding: 7px 5px;
  }
  .trial-record-cell small {
    white-space: normal;
  }
  .trial-records table {
    min-width: 320px;
  }
}

.trial-cup {
  padding: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  color: #f2c76b;
}
.trial-trophy-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(300px, calc(100vw - 16px));
  padding: 8px 10px;
  color: #f1dfad;
  background: #20262d;
  border: 1px solid #62605a;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 4px 12px #0006;
  pointer-events: none;
}
.trial-weather {
  margin: 0 0 12px;
}
.trial-weather-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
#trial-weather-context .trial-weather-heading {
  margin: 0;
}
.trial-session-active {
  margin-bottom: 8px;
}
.trial-session-active .page-heading > div {
  gap: 4px 8px;
}
@media (min-width: 1000px) {
  #trial-weather-context::before {
    content: "·";
    margin-right: 8px;
    color: var(--muted);
  }
  #trial-weather-context:not([hidden]) {
    display: flex;
    align-items: center;
  }
}
.trial-weather-toggle {
  padding: 4px 7px;
  font-size: 11px;
  white-space: nowrap;
}
.trial-weather-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.trial-weather-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 7px 9px;
  text-align: left;
}
.trial-weather-card span {
  font-size: 12px;
  color: #d7dfe7;
}
.trial-weather-card small {
  font-size: 11px;
  color: var(--muted);
}
.trial-weather-graph {
  margin-top: 8px;
}
.trial-weather-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.trial-weather-legend button {
  padding: 4px 7px;
  font-size: 11px;
}
.trial-weather-legend button[aria-pressed="false"] {
  opacity: 0.45;
}
.trial-weather-plots {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}
.trial-weather-chart,
.trial-weather-rose {
  height: 300px;
  min-width: 0;
  background: #151a1d;
  border: 1px solid #41494d;
  border-radius: 6px;
  overflow: hidden;
}
.trial-weather-status {
  margin: 4px 0;
  font-size: 10px;
  color: var(--muted);
}
.trial-result-row td {
  padding-block: 7px;
}
.trial-results-grid td[data-column="wind"] {
  max-width: 185px;
  white-space: normal;
}
.trial-weather-row {
  width: 100%;
  text-align: left;
  padding: 2px 0;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
  font-size: 11px;
  color: var(--muted);
  white-space: normal;
}
.trial-weather-row:hover {
  color: #eaf0f6;
  box-shadow: none;
}
@media (max-width: 700px) {
  .trial-weather-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trial-weather-card:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .trial-weather-card {
    padding: 6px 8px;
  }
  .trial-weather-heading {
    align-items: flex-start;
  }
  .trial-weather-plots {
    grid-template-columns: 1fr;
  }
  .trial-weather-chart {
    height: 260px;
  }
  .trial-weather-rose {
    height: 230px;
  }
  .trial-weather-band td {
    white-space: normal !important;
  }
  .trial-weather-row {
    font-size: 10px;
    line-height: 1.65;
  }
  .trial-name {
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 2px;
  }
  .trial-result-row td:first-child {
    min-width: 0;
  }
  .trial-start-time {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 10px;
  }
}

/* Keep every trial on one table row; only this region scrolls on phones. */
.trial-results-grid {
  max-width: 100%;
  overscroll-behavior-x: contain;
}
.trial-results-grid table {
  min-width: 790px;
}
.trial-results-grid .trial-fastest,
.trial-results-grid .trial-sort,
.trial-results-grid .trial-weather-row,
.trial-results-grid .trial-name {
  white-space: nowrap;
  flex-wrap: nowrap;
}
.trial-results-grid th:first-child,
.trial-results-grid td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #0b1017;
  box-shadow: 1px 0 var(--line);
}
.trial-results-grid th:first-child {
  background: #101924;
}
@media (max-width: 700px) {
  .trial-results-grid th,
  .trial-results-grid td {
    padding: 9px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .trial-results-grid th {
    font-size: 11px;
  }
  .trial-results-grid .trial-name {
    display: inline-flex;
    gap: 4px;
  }
  .trial-results-grid .trial-start-time,
  .trial-results-grid .trial-weather-row {
    font-size: 12px;
    line-height: 1.4;
  }
  .trial-session-active {
    gap: 6px;
  }
  .trial-session-active #filters {
    order: 0;
    width: 100%;
  }
  .trial-session-active .page-heading {
    flex-basis: 100%;
  }
  .trial-session-active #subtitle {
    display: none;
  }
  #trial-weather-context {
    width: 100%;
  }
  #trial-weather-context .trial-weather-heading {
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
  }
  .trial-weather-toggle {
    flex-shrink: 0;
    min-height: 34px;
    padding: 6px 12px;
    line-height: 1.2;
  }
}
