:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5f6b7a;
  --line: #d9dee7;
  --green: #067a46;
  --red: #b42318;
  --blue: #2457d6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.status {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.panel,
.raceCard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

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

.metricValue {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.panel {
  margin-top: 16px;
  overflow: hidden;
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.tableWrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

.raceCard {
  margin: 12px 16px;
  padding: 16px;
}

.raceHeader {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.bets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bet {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.betTitle {
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 6px;
}

.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 780px) {
  .topbar {
    display: block;
    padding: 22px 16px;
  }

  .status {
    margin-top: 12px;
    text-align: left;
  }

  .metrics,
  .bets {
    grid-template-columns: 1fr;
  }
}

