/* EgoChemBench result explorer */
.leaderboard {
  background: #fff;
  border-block: 1px solid var(--line);
}
.leaderboard .section-intro {
  margin-bottom: clamp(22px, 3vw, 34px);
}
.board {
  --rank-width: 4rem;
  background: #fff;
  border: 1px solid #d9d9de;
  border-radius: var(--radius);
  overflow: hidden;
}
.board-tabs {
  display: flex;
  align-items: stretch;
  gap: clamp(6px, 2.6vw, 34px);
  padding: 0 clamp(13px, 2.2vw, 27px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.board-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  white-space: nowrap;
  padding: 15px 2px 11px;
  color: var(--muted);
  font-weight: 550;
  font-size: 0.97rem;
}
.board-tabs button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--ink);
}
.board-tabs button:hover {
  color: var(--ink);
}
.board-tools,
.board-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: clamp(13px, 2.2vw, 27px);
}
.board-tools {
  padding-block: 16px 9px;
}
.board-actions,
.board-views {
  display: flex;
  align-items: center;
}
.board-actions {
  gap: 12px;
}
.board-views {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  background: #f4f4f5;
}
.board-views button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 4px;
  padding: 5px 10px;
  min-height: 31px;
  font-size: 0.86rem;
  font-weight: 550;
}
.board-views button[aria-pressed="true"] {
  background: white;
  border-color: #d7d7dc;
  color: var(--ink);
  box-shadow: 0 1px 2px #17171a10;
}
.board-views button:hover {
  color: var(--ink);
}
.compare-trigger,
.close-compare {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.89rem;
  font-weight: 600;
}
.compare-trigger {
  background: var(--dark);
  border: 1px solid var(--dark);
  color: white;
}
.compare-trigger:hover {
  background: #393940;
}
.board-search {
  flex: 0 1 300px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #d6d6db;
  border-radius: 6px;
  color: #63636a;
}
.board-search:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.board-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.91rem;
  color: var(--ink);
  padding: 7px 0;
}
.board-search input::placeholder {
  color: #717179;
}
.search-symbol {
  height: 13px;
  width: 13px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex: none;
  margin-right: 2px;
}
.search-symbol::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 6px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}
.board-caption {
  min-height: 34px;
  padding-block: 3px 10px;
  font-size: 0.83rem;
  color: var(--muted);
}
.board-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.board-scroll:focus-visible {
  outline-offset: -3px;
}
.board-table {
  border-spacing: 0;
  width: 100%;
  color: var(--ink);
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
  --row-bg: #fff;
  --head-bg: #f7f7f8;
  --row-hover: #f7f7f9;
}
.board-table thead th {
  background: var(--head-bg);
  font-weight: 600;
  color: #4f4f57;
  border-block: 1px solid var(--line);
  font-size: 0.83rem;
}
.board-table th,
.board-table td {
  padding: 8px 14px;
  text-align: right;
  white-space: nowrap;
  line-height: 1.33;
}
.board-table tbody td,
.board-table tbody th {
  background: var(--row-bg);
  border-bottom: 1px solid #ececef;
}
.board-table tbody tr:last-child > * {
  border-bottom: none;
}
.board-table tbody tr:hover,
.board-table tbody tr:focus-within {
  --row-bg: var(--row-hover);
}
.board-table .rank-col {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--rank-width);
  min-width: var(--rank-width);
  max-width: var(--rank-width);
  padding-inline: 10px;
  text-align: center;
}
.board-table .name-col {
  position: sticky;
  left: var(--rank-width);
  z-index: 2;
  text-align: left;
}
.board-table .rank-col.first {
  color: var(--ink);
  font-weight: 700;
}
.board-overall .name-col {
  width: 31%;
}
.board-overall .profile-col {
  width: 30%;
  text-align: left;
  padding-left: clamp(20px, 4vw, 56px);
}
.board-group {
  min-width: 640px;
}
.board-all {
  min-width: 1270px;
}
.board-group .name-col,
.board-all .name-col {
  width: 205px;
  border-right: 1px solid #e4e4e8;
}
.board-model {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  line-height: 1.25;
  color: var(--ink);
}
.board-model:hover .model-title,
.board-model:focus-visible .model-title {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.model-logo {
  width: 23px;
  height: 23px;
  object-fit: contain;
  flex: none;
}
.model-identity {
  display: grid;
  gap: 1px;
}
.model-title {
  font-size: 0.95rem;
  font-weight: 600;
}
.model-identity small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}
.board-table .numeric-head {
  padding: 0 14px;
}
.sort-column {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border: 0;
  background: none;
  color: inherit;
  padding: 10px 0;
  font: inherit;
  min-height: 37px;
}
.sort-column:hover,
.numeric-head[aria-sort] .sort-column {
  color: var(--ink);
}
.sort-icon {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 13px;
}
.sort-icon::before,
.sort-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  width: 0;
  height: 0;
  border-inline: 3px solid transparent;
}
.sort-icon::before {
  top: 2px;
  border-bottom: 4px solid #a4a4ab;
}
.sort-icon::after {
  bottom: 2px;
  border-top: 4px solid #a4a4ab;
}
.numeric-head[aria-sort="descending"] .sort-icon::before,
.numeric-head[aria-sort="ascending"] .sort-icon::after {
  opacity: 0.27;
}
.numeric-head[aria-sort="descending"] .sort-icon::after {
  border-top-color: var(--ink);
}
.numeric-head[aria-sort="ascending"] .sort-icon::before {
  border-bottom-color: var(--ink);
}
.board-table .board-number {
  font-family: var(--mono);
  font-size: 0.85rem;
}
.board-number.top-score {
  color: var(--ink);
  font-weight: 700;
}
.inline-score {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.score-value {
  min-width: 5ch;
  text-align: right;
}
.score-track {
  display: block;
  height: 6px;
  width: clamp(60px, 12vw, 158px);
  background: #eeeef1;
  border-radius: 3px;
  overflow: hidden;
}
.score-track > span,
.bar-measure > span {
  display: block;
  height: 100%;
  background: var(--model-color, #737783);
  border-radius: inherit;
}
.profile-key {
  display: flex;
  gap: 9px;
  font-size: 0.67rem;
  font-weight: 450;
  margin-top: 2px;
}
.profile-key span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.profile-key span::before {
  content: "";
  height: 6px;
  width: 6px;
  border-radius: 1px;
  background: var(--series);
}
.profile-key .semantic,
.profile-section.semantic {
  --series: #6264a4;
}
.profile-key .spatial,
.profile-section.spatial {
  --series: #c08143;
}
.profile-key .temporal,
.profile-section.temporal {
  --series: #587f9e;
}
.task-profile {
  display: flex;
  gap: 5px;
}
.profile-section {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: none;
  border: 0;
  padding: 5px 0;
}
.profile-section:hover,
.profile-section:focus-visible {
  background: #f2f2f4;
}
.profile-tick {
  position: relative;
  display: block;
  width: 5px;
  height: 22px;
  background: #eeeef1;
  border-radius: 1px;
  overflow: hidden;
}
.profile-tick > span {
  position: absolute;
  inset: auto 0 0;
  background: var(--series);
}
.board-empty {
  padding: 34px 16px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.text-control {
  background: none;
  border: 0;
  padding: 3px 0;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.board-bars {
  padding: 11px clamp(13px, 2.2vw, 27px) 16px;
  border-top: 1px solid var(--line);
  --label-width: clamp(170px, 26vw, 270px);
}
.board-bar-axis,
.bar-row {
  width: 100%;
  display: grid;
  grid-template-columns: var(--label-width) minmax(15px, 1fr) 48px;
  gap: 14px;
  align-items: center;
}
.board-bar-axis {
  font-size: 0.77rem;
  color: var(--muted);
  padding: 4px 0 8px;
}
.board-bar-axis > span:last-child {
  text-align: right;
}
.board-ticks {
  display: flex;
  justify-content: space-between;
}
.bar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bar-row {
  background: none;
  border: 0;
  border-top: 1px solid #e8e8eb;
  padding: 9px 0;
  text-align: left;
  color: var(--ink);
  font-size: 0.9rem;
}
.bar-row:hover,
.bar-row:focus-visible {
  background: var(--soft);
}
.bar-name {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
  min-width: 0;
}
.bar-rank {
  color: var(--muted);
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}
.bar-measure {
  display: block;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(to right, #e4e4e8 1px, transparent 1px) 0 0/25%
    100%;
  box-shadow: inset -1px 0 #e4e4e8;
}
.bar-value {
  font-family: var(--mono);
  font-size: 0.84rem;
  text-align: right;
}
.bar-row.first {
  color: var(--ink);
  font-weight: 650;
}

/* The comparison uses exactly the same 15 reported scores as the leaderboard. */
#compare-dialog {
  width: min(760px, 95vw);
  max-width: 95vw;
  max-height: 90dvh;
  box-sizing: border-box;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 64px #14141a36;
}
#compare-dialog[open] {
  display: flex;
  flex-direction: column;
}
#compare-dialog::backdrop {
  background: #18181dd1;
}
.compare-top,
.compare-pickers {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 14px clamp(14px, 3vw, 26px);
}
.compare-top {
  justify-content: space-between;
}
.compare-top h2 {
  font-size: 1.5rem;
  letter-spacing: -0.035em;
}
.close-compare {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--body);
  padding: 6px 10px;
}
.compare-pickers {
  padding-top: 0;
  align-items: flex-start;
}
.compare-pickers label {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
  color: var(--muted);
}
.compare-pickers select {
  width: 100%;
  font-size: 0.89rem;
  min-height: 35px;
}
.comparison-body {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
}
.compare-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.compare-table th,
.compare-table td {
  padding: 7px 13px;
  text-align: right;
  border-bottom: 1px solid #ececef;
}
.compare-table th:first-child {
  text-align: left;
  padding-left: clamp(14px, 3vw, 26px);
}
.compare-table th:last-child,
.compare-table td:last-child {
  padding-right: clamp(14px, 3vw, 26px);
}
.compare-table thead th {
  position: sticky;
  top: 0;
  background: #f2f2f4;
  color: var(--body);
  font-size: 0.84rem;
}
.compare-group {
  background: #f7f7f8;
  font-size: 0.81rem;
  color: var(--muted);
}
.compare-metric {
  font-weight: 450;
}
.metric-code {
  font-family: var(--mono);
  font-size: 0.77rem;
  color: var(--muted);
  display: inline-block;
  min-width: 4.25ch;
  margin-right: 8px;
}
.compare-table td {
  font-family: var(--mono);
  font-size: 0.83rem;
}
.compare-table .ahead,
.a-leads {
  color: var(--ink);
  font-weight: 650;
}
.b-leads {
  color: #92532e;
}
.gap-value {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .board {
    --rank-width: 3rem;
  }
  .board-overall .profile-col {
    padding-left: 17px;
  }
  .board-overall .name-col {
    width: auto;
  }
  .board-tools {
    gap: 8px;
  }
  .board-actions {
    gap: 7px;
  }
}
@media (max-width: 600px) {
  .board-tools {
    align-items: stretch;
    flex-direction: column;
    padding-block: 12px 6px;
  }
  .board-search {
    flex: 0 0 auto;
  }
  .board-actions {
    justify-content: space-between;
  }
  .board-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-block: 6px 8px;
    min-height: 0;
    line-height: 1.35;
  }
  .board-tabs {
    gap: 14px;
    padding-inline: 12px;
  }
  .board-tabs button {
    font-size: 0.85rem;
    padding: 11px 0 9px;
  }
  .board-table th,
  .board-table td {
    padding-inline: 8px;
  }
  .board-table .numeric-head {
    padding-inline: 8px;
  }
  .board {
    --rank-width: 2.4rem;
  }
  .board-overall .profile-col {
    display: none;
  }
  .board-group {
    min-width: 570px;
  }
  .board-group .name-col,
  .board-all .name-col {
    width: 137px;
    max-width: 137px;
  }
  .board-group .model-title,
  .board-all .model-title {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .board-group .model-logo,
  .board-all .model-logo {
    display: none;
  }
  .model-title {
    font-size: 0.86rem;
  }
  .model-logo {
    width: 19px;
    height: 19px;
  }
  .board-model {
    gap: 6px;
  }
  .model-identity small {
    font-size: 0.7rem;
  }
  .score-track {
    width: clamp(24px, 11vw, 65px);
  }
  .inline-score {
    gap: 5px;
  }
  .board-bars {
    --label-width: clamp(110px, 36vw, 195px);
  }
  .board-bar-axis,
  .bar-row {
    gap: 7px;
    grid-template-columns: var(--label-width) minmax(15px, 1fr) 40px;
  }
  .bar-row {
    font-size: 0.8rem;
    min-height: 37px;
  }
  .bar-name {
    gap: 4px;
  }
  .bar-name .model-logo {
    display: none;
  }
  .bar-value {
    font-size: 0.78rem;
  }
  .board-bar-axis {
    font-size: 0.66rem;
  }
  #compare-dialog {
    max-height: 92dvh;
  }
  .compare-pickers {
    gap: 7px;
  }
  .compare-pickers select {
    font-size: 0.82rem;
    padding-left: 6px;
    padding-right: 20px;
    background-position: right 4px center;
  }
  .compare-table th,
  .compare-table td {
    padding: 6px;
    line-height: 1.25;
  }
  .compare-table th {
    font-size: 0.81rem;
  }
  .compare-table td {
    font-size: 0.76rem;
  }
  .metric-code {
    display: block;
    margin-right: 0;
  }
}
@media (max-width: 365px) {
  .board-overall .score-track {
    display: none;
  }
  .board-tabs {
    gap: 10px;
  }
}

/* Model colors follow organizations in both leaderboard views. */
.board [data-org="OpenAI"] {
  --model-color: #51535e;
}
.board [data-org="Anthropic"] {
  --model-color: #be765c;
}
.board [data-org="MiniMax"] {
  --model-color: #b24e73;
}
.board [data-org="Z.ai"] {
  --model-color: #737386;
}
.board [data-org="DeepSeek"] {
  --model-color: #5676bb;
}
.board [data-org="Google DeepMind"] {
  --model-color: #8574ad;
}
.metric-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 clamp(13px, 2.2vw, 27px) 11px;
}
.metric-picks[hidden] {
  display: none;
}
.metric-picks button {
  font: 400 0.76rem var(--mono);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  padding: 4px 7px;
}
.metric-picks button:hover {
  background: var(--soft);
}
.metric-picks button[aria-pressed="true"] {
  color: var(--ink);
  border-color: #c5c5cb;
  background: #f4f4f6;
}
