:root {
  --bg: #f6f6f1;
  --surface: #ffffff;
  --surface-soft: #efefe8;
  --ink: #111111;
  --muted: #6c6c69;
  --line: rgba(17, 17, 17, 0.1);
  --line-strong: rgba(17, 17, 17, 0.16);
  --green: #1b7447;
  --amber: #9f651a;
  --blue: #2259bb;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: "General Sans", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
}

a {
  color: inherit;
}

code {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.topbar-mark,
.topbar-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-mark {
  align-items: baseline;
}

.topbar-links {
  align-items: center;
}

.topbar-links {
  margin-right: 10px;
}

.topbar-label {
  font-size: 1.72rem;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.topbar-meta,
.topbar-links a {
  color: var(--muted);
  font-size: 1rem;
  text-decoration: none;
}

.topbar-links a:hover {
  color: var(--ink);
}

.topbar-links a {
  border-bottom: 1px solid rgba(17, 17, 17, 0.24);
  line-height: 1.2;
}

.topbar-links a:hover {
  border-bottom-color: var(--ink);
}

.eyebrow,
.section-kicker,
.label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-header h2,
.controls-title {
  margin: 0;
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.summary-strip {
  margin-top: 22px;
  padding: 14px 0 14px;
}

.disclaimer,
.meta,
.muted {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-line {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-align: center;
}

.summary-line strong {
  display: inline-block;
  margin: 0 0.58em 0 0.12em;
  color: var(--ink);
  font-size: 2.08rem;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.05em;
  vertical-align: -0.08em;
}

.controls {
  padding: 16px 0 14px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-shell {
  display: block;
  flex: 1 1 auto;
  max-width: none;
}

.toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}

.inline-toggle input {
  accent-color: var(--ink);
}

.search-shell input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.03);
}

.search-shell input:focus {
  outline: none;
  border-color: var(--ink);
}

.table-section {
  padding-top: 10px;
}

.table-wrap {
  overflow: auto;
  margin-top: 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 14px;
}

.table-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 18px;
}

.footer-page-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-page-size label {
  white-space: nowrap;
}

.footer-page-size select {
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
}

.pagination {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  justify-self: center;
}

.pagination[hidden] {
  display: none;
}

.pagination-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(17, 17, 17, 0.72);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 500;
  cursor: pointer;
}

.pagination-button:hover,
.pagination-button.active {
  color: var(--ink);
}

.pagination-button.active {
  font-weight: 700;
}

.table-footer-spacer {
  min-height: 1px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: center;
}

thead th:nth-child(1),
tbody td:nth-child(1) {
  width: 56px;
}

thead th:nth-child(2),
tbody td:nth-child(2) {
  width: 35%;
}

thead th:nth-child(3),
tbody td:nth-child(3) {
  width: 92px;
}

thead th:nth-child(4),
tbody td:nth-child(4) {
  width: 92px;
}

thead th:nth-child(5),
tbody td:nth-child(5) {
  width: 15%;
}

thead th:nth-child(6),
tbody td:nth-child(6) {
  width: 128px;
}

thead th:nth-child(7),
tbody td:nth-child(7) {
  width: 90px;
}

thead th:nth-child(8),
tbody td:nth-child(8) {
  width: 92px;
}

thead th {
  padding-top: 10px;
  padding-bottom: 10px;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.sort-button.active {
  color: var(--ink);
}

.sort-button::after {
  content: "";
}

.sort-button.active[data-direction="asc"]::after {
  content: "↑";
}

.sort-button.active[data-direction="desc"]::after {
  content: "↓";
}

tbody tr:hover {
  background: rgba(17, 17, 17, 0.02);
}

.status-badge,
.track-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-official {
  background: rgba(27, 116, 71, 0.1);
  color: var(--green);
}

.status-open {
  background: rgba(159, 101, 26, 0.1);
  color: var(--amber);
}

.status-merged {
  background: rgba(34, 89, 187, 0.1);
  color: var(--blue);
}

.status-closed {
  background: rgba(108, 108, 105, 0.11);
  color: var(--muted);
}

.track-badge {
  background: var(--surface-soft);
}

.run-name {
  display: block;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.title-cell {
  max-width: 0;
}

.metric-cell,
.score-value,
.metric-value {
  white-space: nowrap;
}

.rank-value {
  color: var(--muted);
  font-weight: 500;
}

.author-cell,
.date-cell,
.status-cell,
.track-cell {
  max-width: 0;
}

.author-link {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 17, 17, 0.22);
}

.loss-value {
  font-weight: 500;
}

.author-link:hover {
  border-bottom-color: var(--ink);
}

.date-cell {
  white-space: nowrap;
  font-size: 0.92rem;
}

.status-cell,
.track-cell {
  white-space: nowrap;
}

.title-link {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 17, 17, 0.22);
}

.title-link:hover {
  color: var(--muted);
  border-bottom-color: rgba(108, 108, 105, 0.5);
}

.loading-row,
.empty-row {
  color: var(--muted);
  text-align: center;
}

.site-footer {
  padding-top: 40px;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.footer-name {
  border-bottom: 1px solid rgba(17, 17, 17, 0.18);
}

.site-footer a:hover .footer-name {
  border-bottom-color: rgba(17, 17, 17, 0.4);
}

@media (max-width: 900px) {
  .summary-line {
    white-space: normal;
  }

  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-shell,
  .toggle-group,
  .inline-toggle {
    max-width: none;
    width: 100%;
  }

  .toggle-group {
    display: grid;
    gap: 10px;
    justify-content: stretch;
  }

  .table-footer {
    grid-template-columns: 1fr;
    gap: 12px;
    justify-items: center;
  }

  .footer-page-size,
  .pagination {
    justify-self: center;
  }
}
