:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --yellow: #ffd21e;
  --yellow-hover: #f5c400;
  --yellow-soft: #fff8d6;
  --orange: #d97706;
  --green: #16803b;
  --green-soft: #eaf7ee;
  --red: #c93434;
  --red-soft: #fff0f0;
  --amber: #9a6700;
  --amber-soft: #fff7df;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: relative;
  z-index: 10;
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -0.015em; }
.brand-mark { font-size: 24px; line-height: 1; }
nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 13px; }
nav a:hover { color: var(--text); }
.nav-source { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 64px;
  align-items: center;
  padding: 76px 0 64px;
}
.eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin: 15px 0 20px;
  font-size: clamp(42px, 5.2vw, 64px);
  line-height: 1.03;
  letter-spacing: -0.047em;
  font-weight: 680;
}
.hero-lede { max-width: 680px; margin-bottom: 28px; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 620;
  font-size: 13px;
  transition: background 130ms ease, border-color 130ms ease;
}
.button-primary { background: var(--yellow); color: #1f2937; border-color: #e3bc13; }
.button-primary:hover { background: var(--yellow-hover); }
.button-primary:disabled { opacity: 0.58; cursor: wait; }
.button-secondary { border-color: var(--border-strong); background: var(--surface); }
.button-secondary:hover { background: var(--surface-soft); }

.signal-card { padding: 4px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); }
.signal-row { display: flex; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.signal-row:last-child { border-bottom: 0; }
.signal-icon { color: var(--orange); font-family: monospace; font-size: 17px; }
.signal-row div { display: flex; flex-direction: column; }
.signal-row strong { font-size: 13px; font-weight: 620; }
.signal-row small { color: var(--muted); font-size: 11px; }

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1120px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.metrics-strip div { padding: 20px 28px; text-align: center; border-right: 1px solid var(--border); }
.metrics-strip div:last-child { border-right: 0; }
.metrics-strip strong { display: block; font: 650 24px/1 monospace; }
.metrics-strip span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

.section { padding: 84px 0; scroll-margin-top: 20px; }
.section-muted { background: var(--surface-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-heading { max-width: 720px; margin-bottom: 32px; }
.section-heading h2 { margin: 10px 0 9px; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 650; }
.section-heading p { color: var(--muted); margin-bottom: 0; font-size: 14px; }
.split-heading { max-width: none; display: flex; justify-content: space-between; gap: 48px; align-items: end; }
.split-heading > p { max-width: 440px; }

.inspector-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.inspect-form { padding: 24px; }
.inspect-form > label { display: block; margin-bottom: 8px; color: #4b5563; font-size: 12px; font-weight: 620; }
.input-row { display: flex; gap: 10px; }
.model-input-wrap { flex: 1; display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); }
.model-input-wrap:focus-within { border-color: #d3a900; box-shadow: 0 0 0 3px rgba(255,210,30,0.22); }
.model-input-wrap span { padding-left: 13px; color: var(--faint); font-family: monospace; font-size: 12px; }
.model-input-wrap input { width: 100%; padding: 12px 13px 12px 5px; border: 0; outline: 0; background: transparent; color: var(--text); font-family: monospace; font-size: 13px; }
.example-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; color: var(--faint); font-size: 11px; }
.example-chip { padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); color: var(--muted); cursor: pointer; }
.example-chip:hover { color: var(--text); border-color: var(--border-strong); }

.run-state { padding: 18px 24px 21px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.run-state-top { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 12px; }
.run-state-top span:last-child { color: var(--orange); font-family: monospace; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #e5e7eb; }
.progress-bar { width: 2%; height: 100%; border-radius: inherit; background: var(--yellow-hover); transition: width 200ms ease; }
.run-state p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.error-panel { margin: 0 24px 24px; padding: 14px 16px; border: 1px solid #f0b6b6; border-radius: 9px; background: var(--red-soft); color: #9e2929; white-space: pre-wrap; font-size: 12px; }

.live-results { padding: 24px; border-top: 1px solid var(--border); }
.result-hero { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 20px; }
.coverage-block { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.coverage-block strong { font: 650 34px/1 monospace; letter-spacing: -0.06em; }
.coverage-block span { color: var(--faint); font-family: monospace; font-size: 12px; }
.coverage-block .coverage-detail { font-size: 11px; max-width: 34ch; text-align: right; }
.result-title h3 { margin: 8px 0 4px; font-size: 19px; font-weight: 630; }
.result-title p { margin: 0; color: var(--muted); font-size: 11px; }
.result-actions { display: flex; gap: 7px; }
.small-button { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 11px; }
.small-button:hover { background: var(--surface-soft); }

.engine-comparison { margin-bottom: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; }
.engine-diverged { border-color: #edcc87; background: var(--amber-soft); }
.engine-agreed { border-color: #b9ddc5; background: var(--green-soft); }
.engine-comparison-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.engine-comparison-heading > div > span { color: var(--amber); font: 9px monospace; text-transform: uppercase; letter-spacing: 0.07em; }
.engine-agreed .engine-comparison-heading > div > span { color: var(--green); }
.engine-comparison h3 { margin: 4px 0; font-size: 15px; }
.engine-comparison p { margin: 0; color: var(--muted); font-size: 11px; }
.engine-diff-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 13px; }
.engine-diff-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid rgba(154,103,0,0.12); border-radius: 7px; background: rgba(255,255,255,0.55); }
.engine-diff-list strong { font-size: 10px; }
.engine-states { display: flex; align-items: center; gap: 6px; color: var(--faint); font: 9px monospace; white-space: nowrap; }

.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.check-card { padding: 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.check-top { display: flex; justify-content: space-between; gap: 11px; }
.check-top h4 { margin: 0; font-size: 13px; font-weight: 620; }
.check-card > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.check-card details { margin-top: 10px; }
.check-card summary { color: var(--muted); cursor: pointer; font-size: 10px; }
.check-card pre, .evidence-pre { overflow: auto; max-height: 260px; padding: 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); color: #374151; font: 10px/1.45 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; width: max-content; padding: 4px 7px; border-radius: 99px; font: 650 9px/1.2 monospace; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-pass, .badge-contract_pass { color: var(--green); background: var(--green-soft); }
.badge-fail, .badge-error, .badge-contract_fail { color: var(--red); background: var(--red-soft); }
.badge-warn, .badge-proposed_fail { color: var(--amber); background: var(--amber-soft); }
.badge-skip, .badge-load_error { color: var(--muted); background: var(--surface-muted); }

.baseline-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 18px; }
.summary-card { padding: 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.summary-card strong { display: block; font: 650 22px/1 monospace; }
.summary-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.table-controls { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.search-control, .filter-control { display: flex; align-items: center; min-height: 39px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.search-control { width: min(420px, 100%); }
.search-control > span { padding-left: 12px; color: var(--faint); }
.search-control input, .filter-control select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-control input { padding: 9px; }
.filter-control select { padding: 8px 31px 8px 11px; }
.table-shell { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--border); text-align: left; font-size: 11px; }
th { color: var(--muted); background: var(--surface-soft); font: 620 9px/1.2 monospace; text-transform: uppercase; letter-spacing: 0.045em; }
tbody tr { cursor: pointer; transition: background 100ms ease; }
tbody tr:hover { background: #fffdf3; }
tbody tr:last-child td { border-bottom: 0; }
.model-cell { min-width: 180px; }
.model-cell strong { display: block; font-size: 12px; font-weight: 620; }
.model-cell span { display: block; max-width: 230px; overflow: hidden; color: var(--faint); font: 9px monospace; text-overflow: ellipsis; }
.status-cell { white-space: nowrap; }
.coverage-cell { font: 650 13px monospace; }
.check-symbol { font-size: 10px; white-space: nowrap; }
.check-symbol.pass { color: var(--green); }
.check-symbol.fail, .check-symbol.error { color: var(--red); }
.check-symbol.warn { color: var(--amber); }
.check-symbol.skip { color: var(--faint); }
.empty-state { padding: 22px; text-align: center; color: var(--muted); }

.method-section .section-heading { max-width: 680px; }
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.method-grid article { min-height: 190px; padding: 21px; border-right: 1px solid var(--border); background: var(--surface); }
.method-grid article:last-child { border-right: 0; }
.method-grid article > span { color: var(--orange); font: 11px monospace; }
.method-grid h3 { margin: 35px 0 8px; font-size: 15px; }
.method-grid p { color: var(--muted); font-size: 11px; }

.detail-dialog { width: min(800px, calc(100% - 32px)); max-height: 88vh; padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,0.2); }
.detail-dialog::backdrop { background: rgba(17,24,39,0.48); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.96); }
.dialog-head h2 { margin: 4px 0 0; font-size: 22px; }
.dialog-kicker { color: var(--orange); font: 9px monospace; text-transform: uppercase; letter-spacing: 0.07em; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 20px; }
#dialog-content { padding: 20px 22px 26px; }
.dialog-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 17px; }
.meta-item { padding: 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.meta-item span { display: block; color: var(--muted); font: 8px monospace; text-transform: uppercase; }
.meta-item strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font: 10px monospace; }
.dialog-check { padding: 14px 0; border-top: 1px solid var(--border); }
.dialog-check-head { display: flex; justify-content: space-between; gap: 14px; }
.dialog-check h3 { margin: 0; font-size: 13px; }
.dialog-check p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }

footer { border-top: 1px solid var(--border); background: var(--surface-soft); }
.footer-inner { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 26px; }
.footer-inner > div { display: flex; flex-direction: column; }
.footer-inner span, .footer-inner p { color: var(--muted); font-size: 10px; }
.footer-inner p { margin: 0; }
.sr-only, .sr-only-focusable:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 920px) {
  nav a:not(.nav-source) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 58px; }
  .signal-card { max-width: 620px; }
  .split-heading { display: block; }
  .split-heading > p { max-width: 650px; }
  .method-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid article:nth-child(2) { border-right: 0; }
  .method-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 680px) {
  .page-shell, .site-header { width: min(100% - 26px, 1120px); }
  .site-header { min-height: 58px; }
  .nav-source { font-size: 0; }
  .nav-source::after { content: "Source ↗"; font-size: 11px; }
  h1 { font-size: 40px; }
  .hero { padding: 48px 0 52px; }
  .metrics-strip { width: calc(100% - 26px); grid-template-columns: repeat(2, 1fr); }
  .metrics-strip div:nth-child(2) { border-right: 0; }
  .metrics-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .section { padding: 62px 0; }
  .input-row { flex-direction: column; }
  .inspect-form, .live-results { padding: 18px; }
  .check-grid, .baseline-summary, .engine-diff-list { grid-template-columns: 1fr; }
  .result-hero, .table-controls, .footer-inner { align-items: stretch; flex-direction: column; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article { min-height: 150px; border-right: 0; border-bottom: 1px solid var(--border); }
  .method-grid article:last-child { border-bottom: 0; }
  .dialog-meta { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; padding: 25px 0; }
}
