* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 68px);
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid rgba(203, 213, 225, 0.7);
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

main {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 56px) 64px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 34px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
  line-height: 1.2;
}

.intro p {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.proof {
  min-height: 112px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.proof strong {
  display: block;
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1;
}

.proof span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.workbench {
  display: grid;
  grid-template-columns: 230px minmax(430px, 1.2fr) minmax(390px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.scenario-rail,
.viewer,
.inspector,
.evidence-grid article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.scenario-rail,
.viewer,
.inspector {
  min-width: 0;
}

.scenario-rail,
.inspector,
.evidence-grid article {
  padding: 18px;
}

.scenario-buttons {
  display: grid;
  gap: 8px;
}

.scenario-buttons button {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.scenario-buttons button[aria-pressed="true"] {
  border-color: #5eead4;
  background: #ecfeff;
  color: var(--teal);
}

.viewer {
  overflow: hidden;
}

.viewer-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.viewer-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.status-stack {
  display: grid;
  gap: 8px;
  min-width: 210px;
}

.status-stack span {
  display: block;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

#scenarioImage {
  display: block;
  width: 100%;
  min-height: 360px;
  object-fit: contain;
  background: #ffffff;
}

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

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

td code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.score-good {
  color: var(--teal);
  font-weight: 800;
}

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

.preference {
  margin-top: 18px;
  padding: 16px;
  border-left: 4px solid var(--teal);
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.evidence-grid article {
  min-width: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

pre {
  max-height: 340px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .intro {
    grid-template-columns: 1fr;
  }

  .workbench,
  .evidence-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-stack {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .topbar,
  .viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  h1 {
    font-size: 42px;
  }
}
