/* Leaderboards: lead counts on top, then every board on one page with its ranking beside its history chart. */
.lb-filters { margin-top: 18px; }
.lb-filters form { gap: 10px; }
.lb-select { display: inline-flex; align-items: center; gap: 8px; }
.lb-select > span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.lb-select select.input { height: 30px; width: auto; min-width: 120px; font-size: 13.5px; }

.lb-leads { margin-top: 22px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.lb-leads .kpi > span a:hover { text-decoration: underline; text-underline-offset: 3px; }

.lb-group > .sh { margin-top: 48px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lb-group > .sh h2 { font-size: 16px; }
.lb-group h3 { font-size: 15px; font-weight: 600; margin: 0; }
.lb-group .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.lb-group a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Ranking: the leader in a tinted block, everyone else ranked under it. */
.lb-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.lb-lead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 10px; padding: 8px 10px; margin-bottom: 4px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--g, var(--ink2)) 14%, transparent); box-shadow: inset 3px 0 0 var(--g, var(--ink2)); }
.lb-lead .nm { display: flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-lead b { font-size: 20px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.lb-lead small { grid-column: 2; text-align: right; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.lb-lead .tie { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; margin-left: 4px; }
.lb-rest { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 46px; gap: 8px; align-items: center; height: 28px; padding: 0 10px; font-size: 13px; color: var(--ink2); }
.lb-rest .n { color: var(--faint); font-size: 12px; }
.lb-rest .nm { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-rest .v { font-weight: 500; color: var(--ink); text-align: right; white-space: nowrap; }
.lb-rest .v small { color: var(--faint); font-weight: 400; font-size: 11.5px; margin-right: 8px; }
.lb-rest .gap { color: var(--faint); font-size: 12px; text-align: right; }

/* Boards without a chart lead their group as cards that share the full width (half of it when there is only one). */
.lb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; align-items: start; }
.lb-cards:has(> .lb-card:only-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lb-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 10px; min-width: 0; }
.lb-card h3 { font-size: 14px; }
.lb-card .none { color: var(--faint); margin-top: 10px; }
.lb-card.blank { border-style: dashed; }

/* Boards with a chart: ranking on the left, chart on the right. */
.lb-board { display: grid; grid-template-columns: minmax(290px, 340px) minmax(0, 1fr); gap: 16px 36px; padding: 18px 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; }
.lb-side, .lb-chart { min-width: 0; }
.lb-chart h4 { font-size: 12.5px; font-weight: 600; margin: 0; color: var(--ink2); }
.lb-chart > p { color: var(--faint); font-size: 12px; margin: 1px 0 8px; }
.lb-chart .chart { height: 260px; }

/* Course records each holder has, under a records board. */
.lb-held { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 24px; align-items: start; margin-top: 12px; }
.lb-held h5 { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; font-size: 13.5px; font-weight: 500; border-bottom: 1px solid var(--line2); }
.lb-held h5 > span:last-child { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.lb-held ul { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 6px; }
.lb-held li { display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ink2); }
.lb-held li b { font-weight: 600; color: var(--ink); text-align: right; }
.lb-held li time { color: var(--faint); font-size: 12px; text-align: right; }

@media (max-width: 860px) {
  .lb-filters > .grow { display: none; }
  .lb-cards:has(> .lb-card:only-child) { grid-template-columns: minmax(0, 1fr); }
  .lb-board { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .lb-chart .chart { height: 240px; }
}
