:root {
	--bg: #0b1020;
	--card: #121a2a;
	--muted: #97a1b7;
	--text: #e8ecf4;
	--primary: #5b9cff;
	--border: #1e2a43;
	--row-alt: #0e1626;
	/* Fallback; will be updated dynamically to match actual header height */
	--header-height: 96px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
	margin: 0;
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: linear-gradient(180deg, #0b1020 0%, #0a0f1d 100%);
	color: var(--text);
}

.container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px;
}

.page-header {
	border-bottom: 1px solid var(--border);
	background: rgba(10, 15, 29, 0.5);
	backdrop-filter: blur(8px);
	position: sticky;
	top: 0;
	z-index: 10;
}

h1 { margin: 0 0 4px; font-size: 28px; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }

.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid var(--border);
}

.card-header .title { font-weight: 600; }

.explainer {
	padding: 16px 18px;
	border-bottom: 1px solid var(--border);
	color: var(--muted);
}

.explainer p { margin: 0 0 10px; }

.explainer pre {
	background: #0c1322;
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 12px 14px;
	overflow: auto;
	color: var(--text);
}

.explainer code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; }

.search {
	appearance: none;
	border: 1px solid var(--border);
	background: #0c1322;
	color: var(--text);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	width: 260px;
}

.table-wrapper { overflow: auto; border-radius: 0 0 14px 14px; }

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

th, td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

thead th {
	position: sticky;
	top: 0;
	background: #0f1730;
	color: var(--muted);
	font-weight: 600;
	cursor: pointer;
	z-index: 1;
}

tbody tr:hover { background: rgba(91, 156, 255, 0.06); }
tbody tr:nth-child(even) { background: var(--row-alt); }

/* Color the "Rank(out of 2.5M)" column blue */
td[data-label="Rank(out of 2.5M)"], th[data-label="Rank(out of 2.5M)"] {
    font-weight: 700;
    color: #5b9cff !important;
}

/* Color the "Total(200)" column green */
td[data-label="Total(200)"], th[data-label="Total(200)"] {
    font-weight: 700;
    color: #7bc67e !important;
}

/* Keep model names on a single line */
td[data-label="Model"] {
	white-space: nowrap;
}

.footer {
	color: var(--muted);
	font-size: 13px;
	text-align: center;
	opacity: 0.9;
}



/* benchmark-specific additions */
.explainer ul { margin: 0 0 12px; padding-left: 20px; }
.explainer li { margin-bottom: 6px; }
.explainer .caveat {
	background: #0c1322;
	border-left: 3px solid var(--primary);
	border-radius: 8px;
	padding: 12px 14px;
	margin-top: 12px;
}
.table td:first-child, .table th:first-child { text-align: right; }
.table td:nth-child(2), .table th:nth-child(2) { text-align: left; font-weight: 600; color: var(--text); }
#leaderboard td:nth-child(4), #leaderboard th:nth-child(4) { color: var(--primary); font-weight: 700; }

/* disclaimers */
.disclaimer-card { margin-top: 24px; }
.explainer ol { margin: 0 0 12px; padding-left: 22px; }
.explainer ol > li { margin-bottom: 10px; }
.explainer ol ul { margin-top: 6px; }

/* ---- wide-table layout fixes (17 columns) ---- */
/* The leaderboard is much wider than the reference table it was adapted from,
   so give the page more room and tighten the cells until every column fits. */
.container { max-width: 1460px; }
.explainer, .footer { max-width: 1100px; margin-left: auto; margin-right: auto; }

.table { min-width: 0; font-size: 13px; }
.table th, .table td { padding: 10px 9px; white-space: nowrap; }
.table thead th { font-size: 12px; line-height: 1.25; white-space: normal; }
/* numeric columns: aligned right with tabular figures so digits line up */
.table td:not(:nth-child(2)) { text-align: right; font-variant-numeric: tabular-nums; }
.table th:not(:nth-child(2)):not(:first-child) { text-align: right; }

/* horizontal scroll affordance if the viewport is still too narrow */
.table-wrapper { overflow-x: auto; scrollbar-color: var(--primary) var(--card); }

/* footer link was dark-on-dark and collided with the line below */
.footer p { margin: 4px 0; }
.footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
/* keep the search box on the same optical column as the prose */
.card-header .actions { max-width: 1100px; width: 100%; margin: 0 auto; }
/* remove the outer padding so .actions can carry the same 18px inset as .explainer */
.card-header { padding-left: 0; padding-right: 0; }
.card-header .actions { padding: 0 18px; box-sizing: border-box; }

/* ---- tabs ---- */
.tabs-nav { display: flex; gap: 8px; margin: 0 0 18px; }
.tab-btn {
	background: var(--card);
	border: 1px solid var(--border);
	color: var(--muted);
	font: 600 14px 'Inter', system-ui, sans-serif;
	padding: 9px 18px;
	border-radius: 10px;
	cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #06122b; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* professors table: name column left-aligned and readable */
#professors td:nth-child(2), #professors th:nth-child(2) { text-align: left; white-space: nowrap; }
#professors td:nth-child(3), #professors th:nth-child(3),
#professors td:nth-child(4), #professors th:nth-child(4) { text-align: left; }
#professors td a { color: var(--primary); text-decoration: none; }
#professors td a:hover { text-decoration: underline; }
