:root {
  --bg: #0b0d11;
  --panel: #12151b;
  --border: #22262f;
  --text: #e6e8eb;
  --muted: #8b92a1;
  --accent: #5b8def;
  --pos: #3ecf8e;
  --neg: #f0665e;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2.5rem 3rem 4rem;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
}

.header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#meta { margin: 0.25rem 0 0; }

.muted { color: var(--muted); }

.version-wrap { position: relative; flex-shrink: 0; }

.version-badge {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}
.version-badge:hover { color: var(--text); border-color: var(--accent); }

.version-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 280px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 10;
}

.version-entry { padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--border); }
.version-entry:last-child { border-bottom: none; }
.version-entry .v-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.version-entry .v-date { color: var(--muted); font-weight: 400; }
.version-entry ul { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.82rem; }
.version-entry li { margin: 0.15rem 0; }

.toolbar {
  margin: 1.5rem 0 1rem;
}

#search {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
#search:focus { outline: 1px solid var(--accent); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}

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

th.num, td.num { text-align: right; }

thead th {
  background: var(--panel);
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
thead th:hover { color: var(--text); }
thead th.sorted-asc::after { content: " \25B2"; font-size: 0.7em; }
thead th.sorted-desc::after { content: " \25BC"; font-size: 0.7em; }

tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

.rank-1 { color: #f0c14b; font-weight: 600; }
