:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #152033;
  background: #f4f7fb;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: white;
  background: #1267d8;
  cursor: pointer;
}

button.secondary {
  color: #152033;
  background: #e3eaf5;
}

input {
  min-height: 40px;
  border: 1px solid #c8d3e2;
  border-radius: 6px;
  padding: 0 12px;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view h1 {
  margin: 0 0 12px;
  font-size: 36px;
}

.view p {
  margin: 0 0 24px;
  color: #55657a;
}

.fallback-title {
  margin: 28px 0 12px;
  font-size: 20px;
}

.hidden {
  display: none;
}

.panel,
.item {
  max-width: 520px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
  background: white;
}

.panel {
  display: grid;
  gap: 10px;
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  max-width: none;
}

.item h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  border-color: #9db8da;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  color: #55657a;
}

.status {
  min-height: 24px;
  color: #1267d8;
}

.detail {
  border: 1px solid #c8d3e2;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 24px;
  background: white;
}

.detail-header,
.modal-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail h2,
.modal-panel h2 {
  margin: 0 0 8px;
}

.detail p,
.modal-panel p {
  margin: 0 0 16px;
  color: #55657a;
}

.detail-metrics {
  margin-bottom: 16px;
}

.splits {
  width: 100%;
  border-collapse: collapse;
}

.splits th,
.splits td {
  padding: 10px 8px;
  border-top: 1px solid #e5ebf3;
  text-align: left;
}

.splits th {
  color: #55657a;
  font-weight: 600;
}

.log-csv {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #e5ebf3;
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
  color: #152033;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 32, 51, 0.36);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(420px, 100%);
  border-radius: 8px;
  padding: 22px;
  background: white;
  box-shadow: 0 18px 48px rgba(21, 32, 51, 0.18);
}

@media (max-width: 640px) {
  .detail-header,
  .modal-actions {
    display: grid;
  }

  .splits {
    font-size: 14px;
  }
}
