* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7f9;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #607080;
  --line: #d9e0e7;
  --blue: #185abc;
  --blue-dark: #123f86;
  --green: #0f7a55;
  --red: #a13a3a;
  --amber: #8a6200;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(1500px, 96vw);
  margin: 0 auto;
  padding: 18px 0 42px;
}

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

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 14px;
  margin-top: 14px;
}

p,
span,
small {
  color: var(--muted);
}

.topbar,
.section-title,
.top-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  padding: 10px 0 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 440px) 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.controls {
  position: sticky;
  top: 12px;
}

label {
  display: block;
  color: #33414d;
  font-weight: 700;
  margin: 13px 0 6px;
}

select,
textarea,
input {
  width: 100%;
  border: 1px solid #c7d0d9;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px;
}

textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.55;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.link-button:hover {
  background: var(--blue-dark);
}

button.secondary,
.link-button {
  background: #fff;
  color: var(--blue);
}

button.secondary:hover,
.link-button:hover {
  background: #edf4ff;
}

button:disabled {
  background: #aeb8c2;
  border-color: #aeb8c2;
  cursor: not-allowed;
}

.button-row {
  justify-content: flex-start;
  margin-top: 8px;
}

.model-checks {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.model-checks label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  margin: 0;
  font-weight: 600;
}

.model-checks input {
  width: 18px;
  margin-top: 2px;
}

pre {
  min-height: 48px;
  max-height: 210px;
  overflow: auto;
  white-space: pre-wrap;
  background: #111820;
  color: #dbe8f6;
  border-radius: 6px;
  padding: 10px;
  margin: 14px 0 0;
}

.result-grid,
.ab-grid,
.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.result-card.failed {
  border-color: #e4b6b6;
  background: #fff8f8;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--green);
}

.status-pill.failed {
  background: var(--red);
}

.status-pill.unavailable {
  background: var(--amber);
}

audio {
  width: 100%;
  margin-top: 8px;
}

canvas {
  width: 100%;
  height: 76px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  margin-top: 8px;
}

dl {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0 0;
}

dt {
  color: #526272;
  font-weight: 750;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.path {
  color: #364657;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #e5e9ee;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f3f6;
  color: #344452;
}

.ok {
  color: var(--green);
  font-weight: 800;
}

.bad {
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 920px) {
  .workspace,
  .topbar {
    display: block;
  }

  .controls {
    position: static;
  }

  .top-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }
}
