body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
}

h1 {
  color: #1a1a2e;
  border-bottom: 3px solid #e94560;
  padding-bottom: 10px;
}

h2 {
  color: #1a1a2e;
  margin-top: 30px;
}

/* Scorecard summary cards */
.summary {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.summary-top {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 12px;
}

.summary .big {
  font-size: 2em;
  font-weight: bold;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.summary-card {
  padding: 8px 12px;
  border-radius: 6px;
  background: #f8f9fa;
  text-align: center;
  cursor: pointer;
}

.summary-card .label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
}

.summary-card .value {
  font-size: 1.3em;
  font-weight: bold;
  margin-top: 2px;
}

.mixed {
  color: #f57c00;
}

/* Failure patterns section */
.failure-group {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 15px 0;
  padding: 16px;
}

.failure-group h3 {
  margin: 0 0 8px 0;
  color: #c0392b;
  font-size: 0.95em;
}

.failure-group .affected {
  font-size: 0.85em;
  color: #555;
  margin: 4px 0;
}

.failure-group .affected-item {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: 4px;
  background: #fdecea;
  font-size: 0.8em;
  cursor: pointer;
}

.pass {
  color: #27ae60;
}

.fail {
  color: #e74c3c;
}

.error {
  color: #e67e22;
}

/* Master Index Table */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
}

th {
  background: #2c3e50;
  color: white;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: #eef;
}

/* Card layout details */
.eval-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 15px 0;
  overflow: hidden;
}

.eval-header {
  padding: 12px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eval-header.pass-bg {
  background: #d4edda;
  border-left: 4px solid #27ae60;
}

.eval-header.fail-bg {
  background: #f8d7da;
  border-left: 4px solid #e74c3c;
}

.eval-body {
  padding: 0 16px 16px;
}

/* Modality status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
}

.badge.pass,
.badge.met {
  background: #d4edda;
  color: #155724;
}

.badge.fail,
.badge.not-met {
  background: #f8d7da;
  color: #721c24;
}

.badge.golden {
  background: #fff3e0;
  color: #e65100;
}

.badge.sim {
  background: #e8eaf6;
  color: #283593;
}

.badge.tool {
  background: #e0f2f1;
  color: #004d40;
}

.badge.callback {
  background: #fce4ec;
  color: #880e4f;
}

.meta {
  color: #666;
  font-size: 0.85em;
}

details {
  margin: 4px 0;
}

summary {
  cursor: pointer;
  font-weight: bold;
  padding: 4px 0;
}

/* Run indicator dots */
.run-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 3px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.run-dot:hover {
  border-color: #333;
}

.run-dot.p {
  background: #27ae60;
}

.run-dot.f {
  background: #e74c3c;
}

.run-dot.e {
  background: #e67e22;
}

.session-link {
  font-size: 0.85em;
  color: #3498db;
  margin: 4px 0;
}

.session-link a {
  color: #3498db;
  text-decoration: none;
}

.session-link a:hover {
  text-decoration: underline;
}

/* dialogue turns details */
.turn-row {
  margin: 6px 0;
  padding: 10px;
  background: #fafafa;
  border-radius: 6px;
  border-left: 3px solid #bbb;
  font-size: 0.85em;
}

.turn-row.match {
  border-left-color: #27ae60;
}

.turn-row.mismatch {
  border-left-color: #e74c3c;
  background: #fef5f5;
}

.turn-header {
  font-weight: bold;
  margin-bottom: 4px;
}

.comparison {
  margin: 4px 0;
  padding: 6px 8px;
  border-radius: 4px;
}

.comparison.pass-bg {
  background: #edf7ed;
}

.comparison.fail-bg {
  background: #fdecea;
}

.comp-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
}

.comp-text {
  margin-top: 2px;
}

.sem-score {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: bold;
}

.sem-4 {
  background: #d4edda;
  color: #155724;
}

.sem-3 {
  background: #d4edda;
  color: #155724;
}

.sem-2 {
  background: #fff3cd;
  color: #856404;
}

.sem-1 {
  background: #f8d7da;
  color: #721c24;
}

.sem-0 {
  background: #f8d7da;
  color: #721c24;
}

/* Transcript event bubbles */
.transcript {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  font-size: 0.9em;
}

.transcript .user {
  color: #2980b9;
  margin: 6px 0;
}

.transcript .agent {
  color: #27ae60;
  margin: 6px 0;
}

.transcript .system {
  color: #e67e22;
  margin: 4px 0;
  font-size: 0.85em;
}

.expectation {
  margin: 6px 0;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 4px;
}

.step {
  margin: 6px 0;
  padding: 8px;
  border-left: 3px solid #3498db;
  background: #f0f8ff;
}

/* Audio playback */
.audio-player {
  margin: 8px 0 10px;
  padding: 6px 10px;
  background: #f0f8ff;
  border-radius: 4px;
  border-left: 3px solid #3498db;
}

.audio-label {
  display: block;
  font-size: 0.75em;
  font-weight: bold;
  color: #3498db;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.audio-player audio {
  width: 100%;
  max-width: 480px;
  height: 32px;
  vertical-align: middle;
}

.turn-audio {
  display: block;
  width: 100%;
  max-width: 340px;
  height: 28px;
  margin: 4px 0 2px;
}

/* Tool interactions */
.tool-details {
  margin: 4px 0;
  padding: 4px 8px;
  background: #f3e8ff;
  border-radius: 4px;
  border-left: 3px solid #8e44ad;
}

.tool-summary {
  font-weight: normal;
  font-size: 0.9em;
  color: #6c3483;
  padding: 2px 0;
}

.tool-data {
  margin: 4px 0;
  padding: 8px;
  background: #faf5ff;
  border-radius: 4px;
  font-size: 0.8em;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.tool-section {
  font-size: 0.85em;
  color: #555;
  margin-top: 6px;
}

/* Interactive controls panel */
.controls {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.controls button {
  padding: 6px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.15s;
}

.controls button:hover {
  background: #eee;
}

.controls button.active {
  background: #2c3e50;
  color: white;
  border-color: #2c3e50;
}

tr.hidden-row {
  display: none;
}

.eval-card.hidden-card {
  display: none;
}

.user-bubble {
  color: #2980b9;
  margin: 4px 0;
  padding: 4px 8px;
  background: #eef5ff;
  border-radius: 4px;
}

.tool-call-args-details {
  margin-top: 4px;
}

.tool-call-args-summary {
  cursor: pointer;
  font-size: 0.85em;
  color: #666;
}

.tool-call-args-body {
  font-size: 0.82em;
  background: #f8f9fa;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 4px;
}

.tool-call-args-pre {
  margin: 2px 0;
  white-space: pre-wrap;
}

/* Media Query Dark Theme target */
@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #e0e0e0;
  }

  h1,
  h2 {
    color: #e0e0e0;
  }

  h1 {
    border-bottom-color: #e94560;
  }

  .summary {
    background: #1e1e1e;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
  }

  .summary-card {
    background: #2d2d2d;
  }

  .summary-card .label {
    color: #aaa;
  }

  .failure-group {
    background: #1e1e1e;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
  }

  .failure-group h3 {
    color: #cf6679;
  }

  .failure-group .affected {
    color: #bbb;
  }

  .failure-group .affected-item {
    background: #331e1e;
    color: #e57373;
  }

  table {
    color: #e0e0e0;
  }

  th {
    background: #332940;
  }

  td {
    border-bottom-color: #333;
  }

  tr.clickable:hover {
    background: #252538;
  }

  .eval-card {
    background: #1e1e1e;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
  }

  .eval-header.pass-bg {
    background: #1b382b;
    border-left-color: #27ae60;
    color: #e0e0e0;
  }

  .eval-header.fail-bg {
    background: #3d1e22;
    border-left-color: #e74c3c;
    color: #e0e0e0;
  }

  .badge.pass,
  .badge.met {
    background: #1b382b;
    color: #81c784;
  }

  .badge.fail,
  .badge.not-met {
    background: #3d1e22;
    color: #e57373;
  }

  .badge.golden {
    background: #332211;
    color: #ffb74d;
  }

  .badge.sim {
    background: #1a237e;
    color: #9fa8da;
  }

  .badge.tool {
    background: #004d40;
    color: #80cbc4;
  }

  .badge.callback {
    background: #880e4f;
    color: #f48fb1;
  }

  .meta {
    color: #aaa;
  }

  .run-dot:hover {
    border-color: #e0e0e0;
  }

  .turn-row {
    background: #252525;
    border-left-color: #555;
  }

  .turn-row.match {
    border-left-color: #27ae60;
  }

  .turn-row.mismatch {
    background: #2d1f21;
    border-left-color: #e74c3c;
  }

  .comparison.pass-bg {
    background: #1b382b;
  }

  .comparison.fail-bg {
    background: #3d1e22;
  }

  .comp-label {
    color: #aaa;
  }

  .sem-4,
  .sem-3 {
    background: #1b382b;
    color: #81c784;
  }

  .sem-2 {
    background: #332c00;
    color: #ffd54f;
  }

  .sem-1,
  .sem-0 {
    background: #3d1e22;
    color: #e57373;
  }

  .transcript {
    background: #252525;
  }

  .transcript .user {
    color: #64b5f6;
  }

  .transcript .agent {
    color: #81c784;
  }

  .transcript .system {
    color: #ffb74d;
  }

  .expectation {
    background: #2d2d2d;
  }

  .step {
    background: #1a2a3a;
    border-left-color: #3498db;
  }

  .tool-details {
    background: #2c1d3a;
    border-left-color: #8e44ad;
  }

  .tool-summary {
    color: #d1c4e9;
  }

  .tool-data {
    background: #1f1425;
    color: #e0e0e0;
  }

  .tool-section {
    color: #bbb;
  }

  .controls button {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
  }

  .controls button:hover {
    background: #3d3d3d;
  }

  .controls button.active {
    background: #e94560;
    color: white;
    border-color: #e94560;
  }

  .user-bubble {
    background: #1a2a3a;
    color: #64b5f6;
  }

  .tool-call-args-summary {
    color: #aaa;
  }

  .tool-call-args-body {
    background: #2d2d2d;
  }

  .audio-player {
    background: #1a2a3a;
    border-left-color: #3498db;
  }

  .audio-label {
    color: #64b5f6;
  }
}
