:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #030711;
  --surface: rgba(9, 20, 35, 0.84);
  --surface-strong: rgba(14, 29, 49, 0.96);
  --surface-soft: rgba(18, 37, 62, 0.74);
  --text: #edf4ff;
  --muted: #93a7c4;
  --line: rgba(155, 192, 255, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --tab: rgba(128, 164, 225, 0.1);
  --tab-active: #edf4ff;
  --tab-active-text: #091321;
  --score: #40c9a2;
  --tokens: #d0b24d;
  --cost: #f59e68;
  --duration: #68a6ff;
  --matrix: #bf8cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(70, 138, 255, 0.24), transparent 26%),
    radial-gradient(circle at 85% 18%, rgba(138, 89, 255, 0.18), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(34, 205, 164, 0.14), transparent 30%),
    linear-gradient(180deg, #091424 0%, var(--bg) 46%, var(--bg-deep) 100%);
}

button,
select {
  font: inherit;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.hero h1,
.card h2,
.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
  max-width: 11ch;
}

.hero-copy,
.section-copy,
.empty-state p {
  margin: 16px 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.5;
}

.hero-panel,
.card,
.summary-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(15, 31, 52, 0.96), rgba(8, 18, 33, 0.92));
}

.run-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.run-picker select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-strong);
}

.hero-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.84rem;
  color: var(--muted);
}

.dashboard {
  display: grid;
  gap: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(13, 27, 45, 0.94), rgba(8, 18, 33, 0.92));
}

.summary-card p {
  margin: 0;
}

.summary-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.summary-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1;
}

.summary-detail {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.card,
.empty-state {
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(11, 24, 41, 0.95), rgba(7, 16, 30, 0.92));
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--tab);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.tab:hover {
  transform: translateY(-1px);
}

.tab.active {
  color: var(--tab-active-text);
  background: var(--tab-active);
}

.bar-chart {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 260px) minmax(0, 1fr) 108px;
  gap: 14px;
  align-items: center;
}

.bar-label,
.legend-name,
.matrix-metrics,
.hero-meta span {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.bar-label {
  font-size: 0.84rem;
  word-break: break-word;
}

.bar-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(150, 180, 230, 0.12);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.02)),
    var(--bar-color, var(--score));
}

.bar-value {
  text-align: right;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.88rem;
}

.matrix-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.matrix-frame {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(16, 33, 54, 0.96), rgba(8, 20, 35, 0.92));
  overflow: hidden;
}

.matrix-svg {
  display: block;
  width: 100%;
  height: auto;
}

.matrix-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(12, 26, 44, 0.86);
}

.matrix-panel h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.matrix-legend {
  display: grid;
  gap: 10px;
}

.legend-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.legend-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
}

.legend-name {
  font-size: 0.82rem;
}

.matrix-metrics {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.benchmark-layout {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.benchmark-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.benchmark-fact,
.benchmark-callout,
.benchmark-section,
.test-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(12, 26, 44, 0.86);
}

.benchmark-fact {
  padding: 16px;
}

.benchmark-fact-label,
.test-label,
.test-id,
.test-expected {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.benchmark-fact-value {
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.benchmark-callout,
.benchmark-section {
  padding: 18px;
}

.benchmark-callout p:last-child,
.test-description,
.test-empty {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.benchmark-section-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
}

.benchmark-markdown {
  margin-top: 16px;
  color: #d7e4fb;
  line-height: 1.65;
}

.benchmark-markdown h2,
.benchmark-markdown h3,
.benchmark-markdown h4 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
}

.benchmark-markdown p,
.benchmark-markdown ul {
  margin: 0 0 14px;
}

.benchmark-markdown ul {
  padding-left: 20px;
}

.benchmark-markdown strong {
  color: var(--text);
}

.benchmark-markdown code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6df9d;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.benchmark-code {
  margin: 0 0 14px;
  padding: 16px;
  overflow: auto;
  border-radius: 18px;
  background: rgba(4, 10, 19, 0.84);
  color: #d7e4fb;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.benchmark-code.compact {
  font-size: 0.76rem;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.test-card {
  padding: 16px;
}

.test-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.test-empty {
  margin: 0;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .matrix-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .benchmark-facts,
  .test-grid {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-direction: column;
  }

  .tabs {
    justify-content: flex-start;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bar-value {
    text-align: left;
  }
}
