:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1b1f27;
  --panel-2: #232936;
  --text: #f2f5f8;
  --muted: #a8b0bd;
  --line: #343b49;
  --resolved: #42c47f;
  --unresolved: #f26b63;
  --evaluator: #f3c14b;
  --not-graded: #8f9aac;
  --active: #4ca7ff;
  --pending: #2c3240;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

header, section { margin-bottom: 18px; }

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { margin-bottom: 10px; font-size: 16px; font-weight: 650; }
p, .label, td, th { color: var(--muted); }

.status-pill {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.metrics > div, .grid > div, section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

header {
  border: 0;
  background: transparent;
  padding: 0;
}

.metrics strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 24px;
  color: var(--text);
}

#dataset,
#model-label,
#planner-model,
#coder-model,
#reviewer-model {
  font-size: 16px;
  line-height: 1.3;
}

.metric-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
}

.bar {
  display: flex;
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: var(--panel-2);
}

.progress-segment {
  height: 100%;
  width: 0%;
  transition: width 200ms ease;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
}

.resolved { background: var(--resolved); }
.unresolved { background: var(--unresolved); }
.evaluator { background: var(--evaluator); }
.not-graded { background: var(--not-graded); }
.active { background: var(--active); }
.pending { background: var(--pending); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

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

th, td {
  padding: 8px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

td:first-child { color: var(--text); }
.empty { color: var(--muted); }

.log-heading,
.log-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.log-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  user-select: none;
}

.log-button::before {
  content: "›";
  color: var(--active);
  font-size: 16px;
  line-height: 1;
  transform: translateY(-1px);
}

.log-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--active) 45%, var(--line));
}

.log-button[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.log-row > td {
  padding-top: 0;
  border-top: 0;
}

.verbose-output {
  max-height: 14em;
  overflow: auto;
  margin: 2px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1016;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 850px) {
  header { display: block; }
  .status-pill { display: inline-block; margin-top: 12px; }
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  main { width: min(100vw - 20px, 1180px); padding-top: 18px; }
  .grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
}
