/* Interactive Leaderboard & 117-Task Catalog Explorer styles. */
.leaderboard-page .lb-hero { padding: 46px 0 34px; }
.lb-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1.4px; margin-bottom: 12px; }
.lb-lead { color: var(--muted); max-width: 980px; margin: 0 auto 22px; font-size: 16.5px; }
.lb-hero .study-stats { max-width: 860px; margin: 28px auto 0; }
.lb-container { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.lb-main { padding: 40px 0 58px; border-top: 1px solid var(--line); }
.lb-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.lb-section-head h2 { font-size: 25px; font-weight: 800; letter-spacing: -0.6px; }
.lb-section-head p { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

.lb-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.lb-view-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--tint); border-radius: 10px; flex-wrap: wrap; }
.lb-view-switch button { border: 0; background: transparent; color: var(--muted); padding: 8px 15px; font-size: 12.5px; font-weight: 600; border-radius: 7px; min-height: 36px; }
.lb-view-switch button[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(54, 79, 199, 0.25); }

.lb-filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.lb-filters input, .lb-filters select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  min-height: 39px;
}
.lb-filters select { padding: 8px 28px 8px 12px; }
.lb-search { position: relative; }
.lb-search input { padding: 8px 12px 8px 34px; width: 210px; }
.lb-search svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.7; position: absolute; top: 12px; left: 11px; }

/* Animated Bar Chart Card */
.lb-comparison { border: 1px solid var(--line); border-radius: 14px; background: var(--tint); padding: 24px 28px; margin-bottom: 26px; }
.chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.chart-heading h3 { font-size: 16px; font-weight: 700; }
.chart-heading p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.lb-metric-switch { display: flex; gap: 4px; flex-wrap: wrap; }
.lb-metric-switch button { border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 6px 11px; }
.lb-metric-switch button[aria-pressed="true"] { background: #fff; border-color: #cbd5e1; color: var(--blue); box-shadow: 0 1px 3px rgba(15,23,42,0.06); }

.lb-chart { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lb-chart li { display: grid; grid-template-columns: 205px minmax(0, 1fr) 52px; gap: 16px; align-items: center; }
.chart-name { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--ink); }
.chart-name img { width: 19px; height: 19px; object-fit: contain; flex-shrink: 0; }
.chart-name small { color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 4px; }
.chart-track { background: #e2e8f0; border-radius: 6px; height: 18px; overflow: hidden; }
.chart-fill { display: block; height: 100%; background: linear-gradient(90deg, #5c7cfa, #364fc7); border-radius: 6px; transition: width 0.35s ease; }
.lb-chart[data-metric="latent_p1"] .chart-fill { background: linear-gradient(90deg, #ff758f, #e03e5c); }
.lb-chart[data-metric="pass_hat_3"] .chart-fill { background: linear-gradient(90deg, #38bdf8, #0e879c); }
.lb-chart[data-metric="probe_rate"] .chart-fill { background: linear-gradient(90deg, #845ef7, #5f3dc4); }
.lb-chart strong { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }

/* Leaderboard Table */
.lb-table-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 10px 0 12px; flex-wrap: wrap; }
.lb-table-heading p { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.lb-table-actions { display: flex; gap: 16px; }
.lb-table-actions button, .lb-table-actions a { border: 0; background: transparent; color: var(--blue); font-size: 12.5px; font-weight: 600; padding: 4px 0; }

.lb-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lb-table th, .lb-table td { padding: 13px 13px; border-bottom: 1px solid #f1f5f9; background: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.lb-table thead th { background: #f8fafc; padding: 0; border-bottom: 1px solid var(--line); }
.lb-table thead button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  padding: 13px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.lb-table thead th:nth-child(2) button, .lb-table thead th.left-head button { justify-content: flex-start; }
.lb-table thead button:hover, .lb-table th[aria-sort] button { color: var(--blue); }
.lb-table .rank-cell { width: 42px; text-align: center; color: #94a3b8; font-weight: 700; font-size: 11px; }
.lb-table tbody th { text-align: left; font-weight: 600; color: var(--ink); }
.lb-table td.left-cell { text-align: left; color: var(--sub); }
.lb-table .score-cell { position: relative; isolation: isolate; font-weight: 700; color: var(--blue); min-width: 92px; }
.lb-table .score-cell strong { position: relative; z-index: 1; }
.table-score-bar { position: absolute; height: 24px; top: 50%; transform: translateY(-50%); left: 0; background: #eef2ff; z-index: 0; border-radius: 0 5px 5px 0; }
.lb-table .sorted-cell { font-weight: 700; color: var(--ink); }
.lb-table .neg-val { color: var(--rose); font-weight: 600; }
.lb-table tbody tr:hover > * { background: #f8fafc; }
.lb-table tbody tr:last-child > * { border-bottom: 0; }

/* 117-Task Explorer */
.task-explorer-grid { display: grid; gap: 10px; margin-top: 16px; }
.task-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 14px 18px;
  transition: border-color 0.15s;
}
.task-item:hover { border-color: #cbd5e1; }
.task-row-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-id-code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; font-weight: 700; color: var(--ink); }
.task-badges { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.task-meta-line { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.task-prompt-preview { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #e2e8f0; font-size: 12.5px; color: var(--sub); line-height: 1.55; }
.show-more-btn {
  display: block;
  margin: 18px auto 0;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  font-size: 13px;
}
.show-more-btn:hover { background: var(--indigo-soft); border-color: var(--blue); }

@media (max-width: 720px) {
  .lb-chart li { grid-template-columns: 135px minmax(0, 1fr) 44px; gap: 10px; }
  .lb-hero h1 { font-size: 34px; }
}
