/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f3f4f6;
  min-height: 100vh;
}

a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Site wrapper ───────────────────────────────────────────────── */
.site-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 0 1px #e5e7eb;
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.site-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #22c55e 0%, #6366f1 100%);
}

.site-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.site-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* ── Nav ────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  padding: 0 28px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.nav-item {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.nav-item:hover { color: #111; text-decoration: none; }

.nav-item.active {
  color: #111;
  font-weight: 600;
  border-bottom-color: #6366f1;
}

/* ── Page body ──────────────────────────────────────────────────── */
.site-body {
  padding: 28px;
}

/* ── Leaderboard tabs ───────────────────────────────────────────── */
.lb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.lb-tab {
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  background: #fff;
  transition: background .15s, color .15s, border-color .15s;
}

.lb-tab:hover { border-color: #6366f1; color: #6366f1; }

.lb-tab.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* ── Leaderboard info line ──────────────────────────────────────── */
.lb-info {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

/* ── Table ──────────────────────────────────────────────────────── */
.lb-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  text-align: left;
  padding: 8px 10px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: 7px 10px;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }

/* Top 3 highlights */
tr.rank-1 td { background: #fffbeb; }
tr.rank-2 td { background: #f9fafb; }
tr.rank-3 td { background: #f9fafb; }

/* Baseline rows */
tr.baseline td {
  color: #9ca3af;
  background: #fafafa;
}
tr.baseline:hover td { background: #f3f4f6; }

.baseline-tag {
  display: inline-block;
  font-size: 10px;
  background: #e5e7eb;
  color: #9ca3af;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
}

.score-val { font-family: 'SFMono-Regular', Consolas, monospace; }

.comment-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6b7280;
}
tr.baseline .comment-cell { color: #9ca3af; }

.lb-note {
  margin-top: 14px;
  font-size: 12px;
  color: #6b7280;
}

/* ── Markdown content pages ─────────────────────────────────────── */
.markdown-body { line-height: 1.7; color: #1a1a1a; }
.markdown-body h1 { font-size: 1.6rem; margin: 0 0 .6rem; }
.markdown-body h2 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; border-bottom: 1px solid #e5e7eb; padding-bottom: .3rem; }
.markdown-body h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.markdown-body p  { margin: .7rem 0; }
.markdown-body ul, .markdown-body ol { margin: .7rem 0 .7rem 1.5rem; }
.markdown-body li { margin: .2rem 0; }
.markdown-body pre { background: #f6f8fa; border: 1px solid #e5e7eb; border-radius: 6px; padding: 14px; overflow-x: auto; margin: 1rem 0; }
.markdown-body code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: .88em; background: #f3f4f6; padding: .15em .35em; border-radius: 3px; }
.markdown-body pre code { background: none; padding: 0; font-size: .85em; }
.markdown-body blockquote { border-left: 3px solid #e5e7eb; color: #6b7280; padding: .4rem 1rem; margin: 1rem 0; }
.markdown-body table { font-size: 13px; }
.markdown-body img { max-width: 100%; border-radius: 4px; margin: .5rem 0; }
.markdown-body iframe { border: none; }
.markdown-body a { color: #4f46e5; }

.content-loading { color: #9ca3af; font-style: italic; padding: 20px 0; }

/* ── Resource bar (dataset page) ───────────────────────────────── */
.resource-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}
.resource-bar-label { font-weight: 600; color: #0369a1; }
.resource-bar-sep { color: #9ca3af; }

/* ── Solutions table ────────────────────────────────────────────── */
.solutions-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 16px; }
.solutions-table th { text-align: left; padding: 8px 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; font-weight: 600; color: #374151; }
.solutions-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.solutions-table tr:last-child td { border-bottom: none; }
.solutions-table tr:hover td { background: #fafafa; }
.solutions-table .rank-cell { font-size: 16px; white-space: nowrap; }
.solutions-table .team-cell { font-weight: 600; }
.solutions-table .link-btn { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; border: 1px solid #e5e7eb; color: #374151; margin-right: 6px; }
.solutions-table .link-btn:hover { border-color: #6366f1; color: #6366f1; text-decoration: none; }
