:root {
  color-scheme: light;
  --ink: #142f42;
  --muted: #617480;
  --line: #e0e7eb;
  --accent: #087c85;
  --paper: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f4f7f8;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #32a8b6;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1184px;
  margin: auto;
  padding: 22px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: grid;
  gap: 3px;
  font-weight: 800;
  letter-spacing: .11em;
  font-size: 20px;
  text-align: right;
}

.brand small {
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--accent);
}

.logos {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logos img {
  width: 72px;
  height: 47px;
  object-fit: contain;
}

main {
  max-width: 1184px;
  margin: auto;
  padding: 16px;
}

.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
}

h1 {
  font-size: 34px;
  letter-spacing: -.04em;
  margin: 0;
}

h2 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -.025em;
}

.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 24px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.connection:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b07817;
}

.connection[data-state=online]:before {
  background: #168251;
}

.connection[data-state=offline]:before {
  background: #b34840;
}

.view-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.view-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 0;
  background: none;
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
}

.view-tabs button[aria-pressed=true] {
  color: var(--accent);
  border-color: var(--accent);
}

.filters {
  display: flex;
  gap: 16px;
  margin: 22px 0;
}

.filters label {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.filters select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  padding: 12px 44px 12px 14px;
  min-height: 52px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='m5 7.5 5 5 5-5' fill='none' stroke='%23617480' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--ink);
  border: 1px solid #cfdbe1;
  border-radius: 10px;
  text-overflow: ellipsis;
}

.filters select:disabled {
  background-color: #edf1f3;
  color: var(--muted);
  opacity: 1;
  cursor: not-allowed;
}

.filters select:focus-visible {
  border-color: var(--accent);
}

@media (hover: hover) {
  .filters select:not(:disabled):hover {
    border-color: var(--accent);
  }
}

.results {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 22px;
  overflow: hidden;
}

.results-toolbar {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.results-toolbar p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.search {
  position: relative;
  display: block;
  min-width: 250px;
}

.search input {
  border: 1px solid #cfdbe1;
  border-radius: 6px;
  padding: 11px 32px 11px 12px;
  width: 100%;
  font-size: 13px;
  background: #fff;
  min-height: 44px;
}

.search>span:last-child {
  position: absolute;
  right: 12px;
  top: 4px;
  font-size: 26px;
  color: var(--muted);
  pointer-events: none;
}

.connection-note {
  font-size: 12px;
  color: var(--muted);
  background: #f5f9fa;
  margin: 0;
  padding: 9px 24px;
  border-top: 1px solid #ecf0f2;
}

.connection-note[data-warning=true] {
  background: #fff8e9;
  color: #79521e;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.position-col {
  width: 6%;
}

.athlete-col {
  width: 57%;
}

.category-col {
  width: 14%;
}

.time-col {
  width: 23%;
}

th {
  color: var(--muted);
  background: #f8fafb;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf1f3;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  height: 62px;
}

th:first-child,
td:first-child {
  padding-left: 24px;
}

th:last-child,
td:last-child {
  padding-right: 24px;
}

.position-cell {
  color: #758893;
}

td.position-cell {
  font-size: 18px;
  font-weight: 700;
}

.time-cell {
  text-align: right;
}

.primary,
.secondary {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 19px;
}

.primary {
  font-weight: 650;
}

.athlete-heading {
  display: flex;
  align-items: baseline;
  gap: .35em;
  white-space: normal;
  overflow: visible;
}

.athlete-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.athlete-bib {
  flex-shrink: 0;
}

.secondary {
  font-size: 12px;
  color: var(--muted);
}

.category-cell .primary {
  font-size: 12px;
  font-weight: 500;
}

.time-cell .primary {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 16px;
  letter-spacing: -.035em;
}

.penalty {
  color: #985d19;
}

.results-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  gap: 12px;
}

.results-footer:has(#show-more[hidden]):has(#shown-count:empty) {
  display: none;
}

#show-more {
  padding: 10px 14px;
  border: 1px solid #bcd4d8;
  background: #eff8f8;
  color: #076a73;
  border-radius: 5px;
  font-weight: 600;
  font-size: 12px;
}

.empty {
  text-align: center;
  padding: 52px 16px 64px;
  color: var(--muted);
}

.empty-mark {
  font-size: 42px;
  color: #82aeb5;
}

.empty p {
  font-size: 15px;
  color: var(--ink);
  margin: 10px 0 6px;
}

.empty small {
  font-size: 12px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0;
  font-size: 11px;
  color: var(--muted);
}

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

.latest .position-col,
.latest .position-cell {
  display: none;
}

.latest .athlete-col {
  width: 63%;
}

.latest .category-col {
  width: 14%;
}

.latest .time-col {
  width: 23%;
}

@media(max-width:600px) {
  .header-inner {
    padding: 8px 12px;
    gap: 10px;
  }

  .brand {
    font-size: 13px;
    letter-spacing: .04em;
  }

  .brand small {
    font-size: 8px;
  }

  .logos {
    gap: 7px;
  }

  .logos img {
    width: 30px;
    height: 28px;
  }

  main {
    padding: 0 8px;
  }

  .heading,
  .results-toolbar > div {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  h1 {
    font-size: 29px;
  }

  .eyebrow {
    font-size: 8px;
  }

  .connection {
    padding: 7px 9px;
    font-size: 11px;
  }

  .view-tabs {
    gap: 0;
  }

  .view-tabs button {
    flex: 1;
    min-height: 44px;
    padding: 10px 4px;
    font-size: 13px;
  }

  #filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    gap: 12px;
    padding: 8px 4px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
  }

  #filter-summary {
    min-width: 0;
    font-size: 14px;
    font-weight: 650;
    overflow-wrap: anywhere;
  }

  #filter-action {
    flex: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 650;
    border: 1px solid #bcd4d8;
    border-radius: 6px;
    padding: 5px 10px;
    background: #eff8f8;
  }

  .filters {
    flex-direction: column;
    gap: 14px;
    margin: 0 0 12px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
  }

  .filters label {
    flex: auto;
  }

  .filters select {
    min-height: 54px;
  }

  .results {
    margin-top: 0;
    border-radius: 7px;
  }

  .results-toolbar {
    padding: 6px;
    display: block;
  }

  h2 {
    font-size: 17px;
  }

  .search {
    min-width: 0;
    margin-top: 0;
  }

  .search input {
    font-size: 16px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .connection-note {
    padding: 9px 12px;
    font-size: 11px;
  }

  .connection-note[data-state=online] {
    display: none;
  }

  .position-col {
    width: 42px;
  }

  .athlete-col {
    width: calc(60% - 42px);
  }

  .category-col {
    width: 12%;
  }

  .time-col {
    width: 28%;
  }

  th {
    padding: 9px 3px;
    font-size: 9px;
  }

  td.position-cell {
    font-size: 16px;
  }

  thead th.position-cell {
    padding-left: 3px;
    padding-right: 0;
  }

  td {
    padding: 9px 3px;
    font-size: 12px;
    height: 56px;
  }

  th:first-child,
  td:first-child {
    padding-left: 6px;
  }

  th:last-child,
  td:last-child {
    padding-right: 6px;
  }

  .primary,
  .secondary {
    line-height: 18px;
  }

  .secondary,
  .category-cell .primary {
    font-size: 10px;
  }

  .time-cell .primary {
    font-size: 12px;
    letter-spacing: -.06em;
  }

  .latest .athlete-col {
    width: 56%;
  }

  .latest .category-col {
    width: 14%;
  }

  .latest .time-col {
    width: 30%;
  }

  .results-footer {
    padding: 14px 10px;
    font-size: 10px;
  }

  .page-footer {
    font-size: 10px;
    flex-wrap: wrap;
  }
}

@media(prefers-reduced-motion:no-preference) {
  button {
    transition: background-color .15s;
  }
}
