:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --ink: #1c2521;
  --muted: #62706a;
  --line: #d8d1c5;
  --panel: #fffdf7;
  --green: #1f7a5a;
  --blue: #2c6fbb;
  --red: #c8523b;
  --gold: #d49b2f;
  --teal: #299285;
  --shadow: 0 18px 45px rgba(42, 37, 25, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

.hero {
  min-height: 62vh;
  display: flex;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(15, 30, 25, 0.2), rgba(15, 30, 25, 0.78)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=2200&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero__inner {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 96px 0 56px;
}

.eyebrow {
  margin: 0 0 10px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.78;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

h3 {
  margin: 0 0 16px;
  font-size: 17px;
}

.hero__copy {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.88);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero__meta span {
  border: 1px solid rgba(255, 255, 255, 0.36);
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

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

.section {
  padding: 54px 0 0;
}

.section__head {
  margin-bottom: 20px;
}

.section__head .eyebrow {
  color: var(--green);
}

.metric-grid,
.chart-grid,
.insight-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel,
.insight,
.highlight,
.notes {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  min-height: 126px;
}

.metric-card__label {
  color: var(--muted);
  font-size: 13px;
}

.metric-card__value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.metric-card__note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 20px;
  min-width: 0;
}

.bar-row,
.stack-row {
  display: grid;
  grid-template-columns: 46px 1fr 84px;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  margin: 11px 0;
  font-size: 13px;
}

.bar-track,
.stack-track {
  height: 14px;
  background: #e8e1d5;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.stack-track {
  display: flex;
}

.seg-run { background: var(--green); }
.seg-trail { background: var(--gold); }
.seg-bike { background: var(--blue); }
.seg-other { background: var(--red); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: -1px;
}

.legend .run::before { background: var(--green); }
.legend .trail::before { background: var(--gold); }
.legend .bike::before { background: var(--blue); }
.legend .other::before { background: var(--red); }

.data-table,
.workout-table,
.line-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid #e7dfd1;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.highlight-list {
  display: grid;
  gap: 14px;
}

.highlight {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
}

.highlight__date {
  color: var(--green);
  font-weight: 800;
}

.highlight__title {
  font-weight: 800;
}

.highlight__meta,
.highlight__note {
  color: var(--muted);
  font-size: 13px;
}

.highlight__badge {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight {
  padding: 20px;
}

.insight ul {
  padding-left: 18px;
  margin: 12px 0 0;
}

.insight li {
  margin: 8px 0;
}

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

.table-tools label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.record-count {
  color: var(--muted);
  font-size: 13px;
}

.notes {
  padding: 20px;
  color: var(--muted);
}

.notes ul {
  margin: 0;
  padding-left: 18px;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 54px auto 0;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 880px) {
  .hero {
    min-height: 58vh;
  }

  .metric-grid,
  .chart-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .highlight {
    grid-template-columns: 1fr;
  }

  .highlight__badge {
    justify-self: start;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  main,
  .hero__inner,
  footer {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 25px;
  }

  .bar-row,
  .stack-row {
    grid-template-columns: 40px 1fr 66px;
    gap: 8px;
  }
}
