:root {
  color-scheme: light;
  --paper: #f1efe8;
  --paper-deep: #e5e1d6;
  --ink: #141412;
  --muted: #68675f;
  --line: #b9b4a7;
  --white: #fffef9;
  --red: #d94735;
  --yellow: #f0c84b;
  --teal: #1b8a80;
  --header-height: 58px;
  font-family: Satoshi, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
}
button, textarea { font: inherit; }
button { letter-spacing: 0; }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--ink);
  background: rgba(241, 239, 232, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--yellow);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.runtime-proof {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}
.runtime-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

.workspace {
  width: min(1480px, 100%);
  min-height: calc(100svh - var(--header-height));
  margin: 0 auto;
  padding: 18px 24px 28px;
}

.intro-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  align-items: end;
  gap: 28px;
  margin-bottom: 16px;
}
.intro-copy > p:last-child { margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.eyebrow, .panel-kicker, .proof-brand {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
h1 {
  width: 100%;
  max-width: 760px;
  margin: 0;
  font-size: 62px;
  line-height: 0.94;
  letter-spacing: 0;
  font-weight: 850;
}
h1 span { display: block; }
h2, h3 { letter-spacing: 0; }

.workbench {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
  align-items: stretch;
}

.artifact-bench, .evidence-field {
  border: 1px solid var(--ink);
  background: var(--white);
}
.artifact-bench {
  grid-column: span 4;
  min-width: 0;
  padding: 15px;
}
.evidence-field {
  position: relative;
  grid-column: span 8;
  min-width: 0;
  min-height: 424px;
  overflow: hidden;
  padding: 15px;
  outline: none;
}
.evidence-field:focus-visible { box-shadow: inset 0 0 0 3px var(--yellow); }

.bench-heading, .evidence-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bench-heading h2, .evidence-heading-row h2 { margin: 0; font-size: 20px; line-height: 1.05; }
.proof-brand { display: block; text-transform: none; }
.catalog-proof {
  border: 1px solid var(--ink);
  padding: 5px 7px;
  background: var(--paper);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

label {
  display: block;
  margin: 8px 0 5px;
  font-size: 12px;
  font-weight: 800;
}
textarea {
  width: 100%;
  height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 9px 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.42;
  outline: none;
}
textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px var(--yellow); }
.bytecode-input { height: 76px; word-break: break-all; }

button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
button:hover { transform: translateY(-1px); }
button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.icon-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
}
.fixture-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 4px;
}
.secondary-button, .primary-button, .export-button, .focus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.secondary-button { background: var(--paper); color: var(--ink); }
.secondary-button:hover { background: var(--yellow); }
.primary-button {
  width: 100%;
  margin-top: 7px;
  background: var(--ink);
  color: var(--white);
}
.primary-button:hover { background: var(--teal); }
.bench-status { min-height: 16px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.bench-status.error { color: var(--red); font-weight: 800; }

.empty-evidence {
  min-height: 330px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}
.empty-evidence[hidden] { display: none !important; }
.empty-evidence h3 { margin: 24px 0 6px; font-size: 23px; }
.empty-evidence p { max-width: 540px; margin: 0; color: var(--muted); line-height: 1.55; }
.empty-tape { width: min(480px, 90%); height: 52px; display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: var(--paper); }
.empty-tape span { border-right: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 12px, rgba(20,20,18,.08) 12px 13px); }
.empty-tape span:last-child { border-right: 0; }

.completed-evidence { min-width: 0; }
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.metric-strip div { min-width: 0; padding: 8px 10px; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip strong { display: block; font-size: 25px; line-height: 1; }
.metric-strip span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.result-summary-line { margin: 9px 0 7px; font-size: 13px; font-weight: 850; line-height: 1.25; }

.opcode-figure { margin: 0; }
#opcode-canvas {
  display: block;
  width: 100%;
  height: 92px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.opcode-figure figcaption { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.opcode-figure figcaption span { display: inline-flex; align-items: center; gap: 5px; }
.legend-mark { display: inline-block; width: 10px; height: 10px; }
.hidden-mark { background: var(--red); }
.corroborated-mark { background: var(--teal); }
.proxy-mark { background: var(--yellow); border: 1px solid var(--ink); }

.result-tabs { display: flex; gap: 0; margin-top: 10px; border-bottom: 1px solid var(--ink); }
.tab-button {
  min-height: 34px;
  padding: 0 14px;
  border-width: 1px 1px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.tab-button:first-child { border-left-width: 1px; }
.tab-button.active { background: var(--ink); color: var(--white); }
.tab-pane { padding-top: 8px; }

.evidence-list { max-height: 154px; overflow: auto; border-bottom: 1px solid var(--line); }
.evidence-row { border-top: 1px solid var(--line); background: transparent; }
.evidence-row:first-child { border-top: 0; }
.evidence-row summary {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(90px, .7fr) minmax(88px, .65fr);
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
}
.evidence-row summary::-webkit-details-marker { display: none; }
.evidence-row summary:hover { background: var(--paper); }
.evidence-row.runtime-only { border-left: 5px solid var(--red); }
.evidence-row.corroborated { border-left: 5px solid var(--teal); }
.control-name { min-width: 0; font-size: 12px; font-weight: 850; }
.evidence-row code { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.evidence-badge { justify-self: end; font-size: 10px; font-weight: 850; white-space: nowrap; }
.evidence-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 0 8px 9px; color: var(--muted); font-size: 11px; }
.evidence-detail strong { color: var(--ink); }
.signature-line { grid-column: 1 / -1; font-family: "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }

.signal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.signal-item { padding: 10px; border-left: 5px solid var(--yellow); background: var(--paper); }
.signal-item strong { display: block; margin-bottom: 3px; font-size: 12px; }
.signal-item span { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.interpretation { margin: 9px 0 0; padding: 9px 10px; border: 1px solid var(--ink); font-size: 11px; line-height: 1.45; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.method-grid div { padding: 7px 9px; border-right: 1px solid var(--line); }
.method-grid div:last-child { border-right: 0; }
.method-grid span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.method-grid strong { display: block; margin-top: 2px; font-size: 12px; }
.method-copy { margin: 8px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.runtime-hash { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }

.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.export-button { background: var(--yellow); color: var(--ink); }
.focus-button { background: var(--ink); color: var(--white); }
.export-button:hover { background: #ffd95e; }
.focus-button:hover { background: var(--teal); }

.error-evidence {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--red);
}
.error-evidence svg { width: 28px; height: 28px; }
.error-evidence strong { display: block; color: var(--ink); }
.error-evidence p { margin: 4px 0 0; max-width: 520px; }

.reasoning-band {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.7fr);
  gap: 42px;
  margin-top: 76px;
  padding: 72px max(24px, calc((100vw - 1432px) / 2));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}
.reasoning-band h2 { max-width: 520px; margin: 0; font-size: 38px; line-height: 1.05; }
.reasoning-band .eyebrow { color: var(--yellow); }
.reasoning-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.reasoning-columns p { margin: 0; color: #ccc9bf; line-height: 1.55; }
.reasoning-columns strong { display: block; margin-bottom: 8px; color: var(--white); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: var(--paper);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

@media (max-width: 980px) {
  h1 { font-size: 52px; }
  .intro-copy { grid-template-columns: 1fr; gap: 10px; }
  .intro-copy > p:last-child { max-width: 720px; }
  .artifact-bench { grid-column: span 5; }
  .evidence-field { grid-column: span 7; }
  .fixture-actions { grid-template-columns: 1fr; }
  .reasoning-band { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --header-height: 64px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
  .runtime-proof { font-size: 10px; }
  #runtime-label { max-width: 82px; overflow: hidden; text-overflow: ellipsis; }
  .workspace { padding: 12px 10px 20px; }
  .intro-copy { margin-bottom: 12px; }
  .eyebrow { margin-bottom: 5px; }
  h1 { font-size: 40px; line-height: .98; }
  .intro-copy > p:last-child { font-size: 13px; line-height: 1.42; }
  .workbench { grid-template-columns: 1fr; gap: 10px; }
  .artifact-bench, .evidence-field { grid-column: 1; }
  .artifact-bench { padding: 12px; }
  .evidence-field { min-height: 420px; padding: 12px; }
  .bench-heading { margin-bottom: 7px; }
  .bench-heading h2, .evidence-heading-row h2 { font-size: 18px; }
  textarea { height: 82px; }
  .bytecode-input { height: 64px; }
  .fixture-actions { grid-template-columns: 1fr 1fr; gap: 6px; }
  .secondary-button, .primary-button, .export-button, .focus-button { padding: 0 8px; font-size: 10px; }
  .metric-strip div { padding: 7px 6px; }
  .metric-strip strong { font-size: 22px; }
  .metric-strip span { font-size: 8px; }
  #opcode-canvas { height: 88px; }
  .evidence-list { max-height: none; }
  .evidence-row summary { grid-template-columns: minmax(0, 1.2fr) 86px; gap: 6px; }
  .evidence-badge { grid-column: 1 / -1; justify-self: start; }
  .evidence-detail { grid-template-columns: 1fr; }
  .signature-line { grid-column: 1; }
  .signal-list { grid-template-columns: 1fr; }
  .result-actions { position: static; }
  .reasoning-band { margin-top: 44px; padding: 52px 18px; gap: 26px; }
  .reasoning-band h2 { font-size: 30px; }
  .reasoning-columns { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 5px; }
}

@media (max-width: 390px) {
  .brand span:last-child { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
  .runtime-proof { display: none; }
  .fixture-actions { grid-template-columns: 1fr; }
  .secondary-button { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
