:root {
  --ink: #18312a;
  --muted: #63736d;
  --green: #176b4d;
  --green-dark: #174c3a;
  --green-soft: #eaf4ef;
  --background: #f5f7f6;
  --surface: #ffffff;
  --border: #dfe6e2;
  --course: #7d8d87;
  --track: #176b4d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

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

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 11px;
  color: var(--muted);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.connection__dot {
  width: 8px;
  height: 8px;
  background: #9aa7a2;
  border-radius: 50%;
}

.connection--live {
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: #cfe2d8;
}

.connection--live .connection__dot { background: #1d8a62; }
.connection--delayed .connection__dot { background: #d28a24; }

.overview {
  padding: 48px 0 24px;
}

.overview-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 46px;
  margin: 34px 0 0;
}

.event-meta div {
  min-width: 135px;
}

dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 34px;
  padding: 18px 20px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #cfe2d8;
  border-radius: 10px;
}

.status-card span {
  font-size: 13px;
  font-weight: 600;
}

.status-card strong {
  font-size: 20px;
}

.dashboard {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.stat {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-left: 1px solid var(--border);
}

.stat:first-child { border-left: 0; }

.stat > span,
.stat > small {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -.035em;
}

.stat strong small {
  font-size: 14px;
  letter-spacing: 0;
}

.stat--primary {
  background: #fbfcfb;
}

.progress {
  height: 4px;
  overflow: hidden;
  background: #dce7e1;
  border-radius: 3px;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width .5s ease;
}

.map-section {
  padding: 64px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.last-seen {
  text-align: right;
}

.last-seen span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.last-seen strong {
  font-size: 13px;
}

.map-wrap {
  position: relative;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

#map {
  height: min(65vh, 640px);
  min-height: 430px;
  background: #e4ebe7;
  border-radius: 9px;
}

.map-key {
  position: absolute;
  z-index: 500;
  left: 20px;
  bottom: 20px;
  display: flex;
  gap: 16px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(24, 49, 42, .12);
  border-radius: 7px;
  font-size: 11px;
}

.map-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-key i {
  width: 18px;
  height: 3px;
  display: inline-block;
  border-radius: 2px;
}

.key-course { background: var(--course); }
.key-track { background: var(--track); }

.map-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.map-note--warning {
  color: #9b5e08;
  font-weight: 700;
}

.splits-section,
.landmarks-section {
  padding: 0 0 64px;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.split-table,
.landmark-table {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.split-table__header,
.split-row,
.landmark-table__header,
.landmark-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 160px;
  align-items: center;
  gap: 20px;
  padding: 13px 18px;
}

.split-table__header,
.landmark-table__header {
  color: var(--muted);
  background: #fbfcfb;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.split-row,
.landmark-row {
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.split-table__header,
.split-row {
  grid-template-columns: minmax(0, 1fr) 140px 160px;
}

.split-row:last-child,
.landmark-row:last-child { border-bottom: 0; }
.split-row strong,
.landmark-row strong { font-size: 13px; }
.split-row > span,
.landmark-row > span { color: var(--muted); }
.split-row > span:last-child,
.landmark-row > span:last-child { color: var(--ink); font-weight: 700; }
.split-row--latest { background: var(--green-soft); }
.landmark-row--passed { background: #fafbfa; }
.landmark-row--passed strong,
.landmark-row--passed > span { color: #89958f; }
.landmark-row--next { background: var(--green-soft); }

.table-empty {
  margin: 0;
  padding: 22px 18px;
  color: var(--muted);
  font-size: 13px;
}

.runner-marker {
  width: 26px !important;
  height: 26px !important;
  margin: -13px 0 0 -13px !important;
  background: var(--green);
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(24, 49, 42, .3);
}

.tracker-details {
  margin: -34px 0 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

footer {
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner span {
  font-size: 11px;
  text-align: center;
}

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1120px); }
  .overview { padding-top: 42px; }
  .dashboard { grid-template-columns: 1fr 1fr; }
  .stat { border-top: 1px solid var(--border); }
  .stat:nth-child(2) { border-left: 1px solid var(--border); }
  .stat:first-child,
  .stat:nth-child(2) { border-top: 0; }
  .stat:nth-child(3) { border-left: 0; }
}

@media (max-width: 500px) {
  .header-inner { min-height: 68px; }
  .overview { padding-top: 34px; }
  h1 { font-size: 38px; }
  .event-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .status-card { align-items: flex-start; flex-direction: column; gap: 5px; }
  .stat {
    min-height: 112px;
  }
  .map-section { padding: 48px 0; }
  .section-heading { align-items: flex-start; }
  .last-seen { max-width: 120px; }
  #map { min-height: 460px; }
  .map-key {
    right: 14px;
    bottom: 14px;
    left: 14px;
    justify-content: center;
  }
  .splits-section .section-heading,
  .landmarks-section .section-heading { display: block; }
  .splits-section .section-note,
  .landmarks-section .section-note { margin-top: 7px; }
  .split-table__header,
  .landmark-table__header { display: none; }
  .split-row,
  .landmark-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 16px;
    padding: 13px 15px;
  }
  .split-row strong,
  .landmark-row strong { grid-row: span 2; }
  .split-row > span,
  .landmark-row > span { text-align: right; }
  .split-row > span:nth-child(2)::before { content: "Split "; color: var(--muted); font-weight: 400; }
  .split-row > span:nth-child(3)::before { content: "Total "; color: var(--muted); font-weight: 400; }
  .landmark-row > span:nth-child(2)::before { content: "Mile "; }
  .tracker-details { margin-top: -30px; text-align: left; }
  .footer-inner {
    min-height: 88px;
  }
}
