body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border-radius: 0.5rem;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: #2563eb; color: #2563eb; }

/* Titles */
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  color: #111827;
}
.section-subtitle {
  margin-top: 0.5rem;
  text-align: center;
  color: #6b7280;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* Stat cards */
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
}
.stat-label {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Controls */
.control-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.control-input {
  width: 100%;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 0.65rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
}
.control-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Toggle */
.toggle-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
}

/* Tables */
.data-table {
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead th {
  padding: 0.65rem 0.75rem;
  font-weight: 600;
  font-size: 0.78rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e5e7eb;
  text-align: center;
  white-space: nowrap;
}
.data-table thead th.text-left { text-align: left; }

.data-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  text-align: center;
  white-space: nowrap;
}
.data-table tbody td:nth-child(2) {
  text-align: left;
  font-weight: 500;
}
.data-table tbody tr:hover { background: #f9fafb; }

.rank-gold { color: #d97706; font-weight: 700; }
.rank-silver { color: #6b7280; font-weight: 700; }
.rank-bronze { color: #b45309; font-weight: 700; }

/* Charts */
.chart-container-wide {
  position: relative;
  max-width: 100%;
  height: 380px;
}

/* Cards */
.finding-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: relative;
}
.finding-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
  margin-bottom: 0.5rem;
}

/* Group cards */
.group-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
}
.group-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}
.group-card p {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.7;
}
.mini-rank {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.mini-rank:last-child { border-bottom: none; }
.mini-rank-score {
  font-weight: 700;
  color: #111827;
}

/* Model picker */
.model-picker {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  max-height: 360px;
  overflow: auto;
  padding: 0.5rem;
  background: #fafafa;
}
.model-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.55rem;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: background 0.15s;
}
.model-option:hover { background: #fff; }
.model-option input { accent-color: #2563eb; }
.model-option .meta {
  color: #9ca3af;
  font-size: 0.75rem;
}

/* Balanced list */
.balanced-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
}
.balanced-item-title {
  font-weight: 600;
  color: #111827;
  font-size: 0.9rem;
}
.balanced-metrics {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.balanced-metrics div {
  background: #f9fafb;
  border-radius: 0.55rem;
  padding: 0.45rem 0.5rem;
}
.balanced-metrics span {
  display: block;
  font-size: 0.68rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.balanced-metrics strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.82rem;
  color: #111827;
}

/* Accordion */
.accordion {
  border: 1px solid #e5e7eb;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #fff;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border: none;
  transition: background 0.15s;
}
.accordion-header:hover { background: #f9fafb; }
.accordion-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: #9ca3af;
}
.accordion.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.1rem;
}
.accordion.open .accordion-body {
  max-height: 500px;
  padding: 0 1.1rem 1.1rem;
}
.bench-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  background: transparent;
  text-decoration: none;
}
.bench-tab:hover { color: #111827; }
.bench-tab.active {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.dataset-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}
.dataset-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
}
.dataset-badge.gray {
  background: #f3f4f6;
  color: #6b7280;
}
.dataset-body {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* BibTeX */
.bibtex-block {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

code {
  background: #f3f4f6;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
}

html { scroll-behavior: smooth; }
