:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f3f7;
  --surface-strong: #e8edf3;
  --ink: #111827;
  --text: #1f2937;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #d9e0e8;
  --line-strong: #c8d2dc;
  --green: #17805a;
  --green-bg: #e8f6ef;
  --red: #c33b38;
  --red-bg: #faeaea;
  --amber: #9a650e;
  --amber-bg: #fff4d7;
  --blue: #2764c8;
  --blue-bg: #e9f1ff;
  --violet: #7256c8;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 10px 28px rgb(16 24 40 / 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fbfcfd 0, var(--bg) 280px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08), 0 12px 24px rgb(17 24 39 / 0.12);
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar select {
  min-width: 220px;
  flex: 1 1 auto;
}

.toolbar button {
  flex: 0 0 auto;
}

button,
select {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

button {
  cursor: pointer;
}

button:hover,
select:hover {
  border-color: #aeb9c6;
}

.overview {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  min-height: 108px;
  padding: 14px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04);
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric .value {
  margin-top: 9px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.05;
}

.metric .meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric.good {
  border-color: #bfe5d1;
  background: linear-gradient(180deg, #ffffff 0, #f4fbf7 100%);
}

.metric.warn {
  border-color: #ead596;
  background: linear-gradient(180deg, #ffffff 0, #fffaf0 100%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  min-width: 0;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.leaderboard {
  padding: 6px 10px 10px;
}

.leader-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 13px 0;
}

.leader-row + .leader-row {
  border-top: 1px solid var(--line);
}

.model-name {
  color: var(--ink);
  font-weight: 760;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.leader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 5px;
}

.score {
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.score.small {
  min-width: 58px;
  font-size: 18px;
  text-align: right;
}

.bar {
  height: 7px;
  margin-top: 10px;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #17805a, #2764c8);
}

.matrix-scroll,
.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.matrix-panel table {
  min-width: 920px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.task-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 310px;
  max-width: 380px;
  background: var(--surface);
  white-space: normal;
}

th.task-cell {
  z-index: 3;
  background: #fbfcfd;
}

.task-title {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.matrix-result {
  display: grid;
  gap: 7px;
  width: 154px;
  min-height: 100px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: left;
}

.matrix-result:hover {
  border-color: #aeb9c6;
  background: var(--surface);
}

.matrix-result.is-selected {
  outline: 2px solid color-mix(in srgb, var(--blue) 40%, transparent);
  outline-offset: 1px;
}

.matrix-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.mini-metric {
  min-width: 0;
}

.mini-metric b {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.mini-metric span {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
}

.pass {
  background: var(--green-bg);
  color: var(--green);
}

.fail_verifier {
  background: var(--red-bg);
  color: var(--red);
}

.fail_timeout {
  background: var(--amber-bg);
  color: var(--amber);
}

.infra_error {
  background: var(--red-bg);
  color: var(--red);
}

.unsupported_config {
  background: var(--surface-strong);
  color: var(--muted);
}

.pending {
  background: var(--surface-strong);
  color: var(--muted);
}

.running {
  background: var(--blue-bg);
  color: var(--blue);
}

.stale {
  background: var(--amber-bg);
  color: var(--amber);
}

.schedules {
  display: grid;
  gap: 0;
  padding: 0 12px 10px;
}

.schedule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.schedule-card + .schedule-card {
  border-top: 1px solid var(--line);
}

.schedule-state {
  text-align: right;
}

.trends {
  padding: 12px;
}

.trend-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: start;
}

.trend-svg {
  display: block;
  width: 100%;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.trend-grid line {
  stroke: var(--line);
}

.trend-grid text,
.trend-x text {
  fill: var(--muted);
  font-size: 11px;
}

.trend-series path {
  fill: none;
  stroke: var(--series);
  stroke-width: 2.4;
}

.trend-series circle {
  fill: var(--surface);
  stroke: var(--series);
  stroke-width: 2;
}

.trend-legend {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 300px;
  overflow: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 2px;
}

.run-history-panel {
  margin-bottom: 14px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 2px 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.github-link:hover {
  text-decoration: underline;
}

.github-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.run-history-panel td,
.run-history-panel th {
  padding-top: 10px;
  padding-bottom: 10px;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  width: min(540px, 100vw);
  height: 100vh;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 40px rgb(16 24 40 / 0.16);
  overflow: auto;
}

.detail-drawer.is-hidden {
  display: none;
}

.detail-body {
  padding: 14px 16px 24px;
}

.detail-body dl {
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workspace,
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px;
  }

  .topbar {
    display: block;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }

  .toolbar {
    margin-top: 16px;
    align-items: stretch;
    width: 100%;
  }

  .toolbar select {
    min-width: 0;
  }

  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 98px;
  }

  .trend-chart {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer {
    flex-wrap: wrap;
  }

  .task-cell,
  th.task-cell {
    position: static;
    min-width: 260px;
  }
}
