:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --panel: #ffffff;
  --ink: #242424;
  --muted: #6f6f6a;
  --line: #dfdfda;
  --accent: #536c66;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

.shell {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  width: min(960px, calc(100vw - 24px));
  height: 100dvh;
  margin: 0 auto;
  padding: 10px 0;
}

.topbar,
.totals article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 12px;
}

h1,
h2 {
  margin: 0;
  font-weight: 400;
}

h1 {
  font-size: 18px;
}

h2 {
  font-size: 14px;
}

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.totals article {
  padding: 12px;
}

.totals span,
.panel-head span,
.leaderboard li span:first-child,
.graph-row > span:last-child,
.muted {
  color: var(--muted);
}

.totals strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.content {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
  min-height: 0;
}

.panel {
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.leaderboard {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 86px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.leaderboard li span:nth-child(3),
.leaderboard li span:nth-child(4) {
  text-align: right;
}

.graph {
  display: grid;
  gap: 18px;
  align-content: center;
  height: calc(100% - 28px);
}

.graph-row {
  display: grid;
  grid-template-columns: 84px 1fr 170px;
  gap: 12px;
  align-items: center;
}

.graph-row div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeeea;
}

.graph-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.graph-row > span:last-child {
  font-size: 13px;
  text-align: right;
}

@media (max-width: 700px) {
  .shell {
    width: min(100vw - 16px, 960px);
  }

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

  .leaderboard li {
    grid-template-columns: 36px 1fr;
    gap: 6px 10px;
    padding: 8px 10px;
  }

  .leaderboard li span:nth-child(3),
  .leaderboard li span:nth-child(4) {
    text-align: left;
  }

  .graph-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .graph-row > span:last-child {
    text-align: left;
  }
}
