:root {
  color-scheme: light;
  --paper: #f3efe5;
  --paper-strong: #fffdf7;
  --ink: #171815;
  --muted: #64645e;
  --line: #b9b5a9;
  --green: #1e7a51;
  --green-soft: #cce8d6;
  --coral: #d45f49;
  --coral-soft: #f2c7bd;
  --blue: #2458d3;
  --yellow: #f0d35d;
  --header-height: 56px;
  font-family: Geist, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0;
}
button, textarea, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: translateY(0); }

.identity-rail {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-strong);
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--ink);
  color: white;
  border-radius: 4px;
  font-size: 11px;
}
.runtime-proof {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.runtime-proof span + span { border-left: 1px solid var(--line); padding-left: 14px; }

main { width: 100%; max-width: 100%; overflow-x: hidden; }
.workbench-band { padding: 16px 24px; border-bottom: 1px solid var(--ink); }
.workbench-grid {
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(0, 1.07fr);
  gap: 24px;
  align-items: start;
}
.input-workbench { min-width: 0; }
.context-line {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
h1, h2, h3, p { letter-spacing: 0; }
h1 {
  max-width: 960px;
  margin: 0;
  font-size: 50px;
  line-height: 0.96;
  font-weight: 760;
}
.inline-receipt {
  width: 76px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  vertical-align: 12%;
  margin: 0 4px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 15px;
  background: var(--yellow);
}
.inline-receipt i { display: block; width: 4px; background: var(--ink); }
.inline-receipt i:nth-child(1) { height: 8px; }
.inline-receipt i:nth-child(2) { height: 17px; }
.inline-receipt i:nth-child(3) { height: 12px; }
.lede { max-width: 740px; margin: 9px 0; color: #373834; font-size: 15px; }
.synthetic-notice {
  margin: 0 0 8px;
  padding: 6px 9px;
  border-left: 4px solid var(--coral);
  background: var(--coral-soft);
  font-size: 12px;
}
.input-actions, .primary-actions, .result-actions, .assessment-options {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.button, .assessment-options button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 740;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.button-primary { background: var(--ink); color: white; }
.button-secondary { background: var(--blue); color: white; border-color: var(--blue); }
.button-light { background: var(--paper-strong); color: var(--ink); }
.button-quiet { background: transparent; color: var(--ink); }
.button:hover:not(:disabled), .assessment-options button:hover { transform: translateY(-1px); }
.button:focus-visible, button:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.field-label { display: block; margin: 8px 0 4px; font-size: 12px; font-weight: 760; }
#evidence-input {
  width: 100%;
  height: 110px;
  resize: vertical;
  display: block;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 10px 12px;
  background: var(--paper-strong);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
}
.input-meta {
  min-height: 21px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
#row-count { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.status-line {
  min-height: 27px;
  margin: 3px 0 6px;
  padding: 5px 8px;
  border-left: 3px solid var(--blue);
  background: #dbe4fb;
  color: #1d315f;
  font-size: 12px;
}
.status-line.error { border-color: var(--coral); background: var(--coral-soft); color: #64291f; }
.status-line.success { border-color: var(--green); background: var(--green-soft); color: #17452f; }
.primary-actions .button { flex: 1 1 180px; }

.result-shell {
  min-width: 0;
  min-height: 555px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--paper-strong);
  padding: 16px;
  box-shadow: 8px 8px 0 var(--ink);
  scroll-margin-top: calc(var(--header-height) + 8px);
}
.result-shell:focus { outline: 3px solid var(--blue); outline-offset: 3px; }
.empty-state { min-height: 520px; display: grid; place-content: center; gap: 18px; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none !important; }
.empty-state p { max-width: 420px; margin: 0; }
.empty-rule { width: 100%; height: 72px; border-block: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 15px, var(--line) 15px 16px); }
.result-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-heading-row h2 { margin: 0; font-size: 24px; line-height: 1.05; }
.scenario-switch { display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; border: 1px solid var(--ink); border-radius: 5px; overflow: hidden; }
.scenario-switch button { min-height: 38px; border: 0; padding: 7px 10px; background: white; color: var(--ink); font-size: 12px; font-weight: 760; white-space: nowrap; }
.scenario-switch button + button { border-left: 1px solid var(--ink); }
.scenario-switch button[aria-pressed="true"] { background: var(--ink); color: white; }
.runtime-visual { margin: 8px 0 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.25; overflow-wrap: anywhere; }
.result-summary { margin: 6px 0 9px; font-size: 14px; font-weight: 700; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.metrics-grid > div { min-width: 0; padding: 8px 9px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.metrics-grid span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.metrics-grid strong { display: block; margin-top: 2px; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.visual-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.65fr); gap: 14px; margin-top: 12px; }
.lorenz-figure { min-width: 0; margin: 0; }
.lorenz-figure figcaption, .bridge-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 11px; text-transform: uppercase; }
.lorenz-figure figcaption strong, .bridge-heading strong { font-size: 11px; color: var(--blue); font-variant-numeric: tabular-nums; }
#lorenz-chart { width: 100%; height: auto; display: block; aspect-ratio: 2 / 1; margin-top: 3px; overflow: visible; }
#lorenz-chart text { font-family: Geist, Arial, sans-serif; font-size: 11px; fill: var(--muted); }
.chart-fallback { margin: 40px 0; color: var(--coral); font-size: 12px; }
.bridge-panel { min-width: 0; border-left: 1px solid var(--line); padding-left: 14px; }
.bridge-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 12px 0; }
.bridge-cells i { display: block; aspect-ratio: 1; min-width: 0; border: 1px solid var(--ink); border-radius: 2px; }
.bridge-cells i.tagged { background: var(--green-soft); box-shadow: inset 0 -5px 0 var(--green); }
.bridge-cells i.gap { background: var(--coral-soft); box-shadow: inset 0 -5px 0 var(--coral); }
.bridge-panel p { margin: 0; font-size: 12px; line-height: 1.35; }
.bridge-legend { display: grid; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.bridge-legend span { display: flex; align-items: center; gap: 6px; }
.bridge-legend i { width: 9px; height: 9px; border: 1px solid var(--ink); }
.bridge-legend .tagged { background: var(--green); }
.bridge-legend .gap { background: var(--coral); }
.insight-carousel { min-height: 56px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 8px; margin-top: 10px; border-block: 1px solid var(--line); }
.insight-carousel button { width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); }
.insight-carousel p { margin: 0; font-size: 12px; }
.result-actions { justify-content: space-between; margin-top: 10px; }
.result-actions span { max-width: 230px; color: var(--muted); font-size: 10px; text-align: right; }

.evidence-tape { overflow: hidden; border-bottom: 1px solid var(--ink); background: var(--yellow); }
.tape-track { width: max-content; display: flex; align-items: center; animation: tape-move 26s linear infinite; }
.tape-track span { padding: 14px 32px; border-right: 1px solid var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
@keyframes tape-move { to { transform: translateX(-50%); } }

.wallet-band { padding: 120px 24px; background: var(--ink); color: white; }
.wallet-band .context-line { color: #84dcae; }
.section-intro { width: min(1260px, 100%); margin: 0 auto 32px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr); gap: 32px; align-items: end; }
.section-intro .context-line { grid-column: 1 / -1; }
.section-intro h2 { max-width: 780px; margin: 0; font-size: 46px; line-height: 1.02; }
.section-intro > p:last-child { margin: 0; color: #c7c8c2; }
.wallet-table-wrap { width: min(1260px, 100%); margin: 0 auto; overflow-x: auto; border: 1px solid #6d6f69; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 14px; border-bottom: 1px solid #484a46; text-align: left; white-space: nowrap; }
th { color: #bfc1bb; font-size: 11px; text-transform: uppercase; }
td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.new-yes { color: #84dcae; }

.method-band { padding: 140px 24px; border-bottom: 1px solid var(--ink); background: #e5ecfa; }
.method-layout { width: min(1260px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr); gap: 90px; align-items: start; }
.method-heading-wrap h2 { max-width: 430px; margin: 0; font-size: 48px; line-height: 1; }
.method-copy { display: grid; gap: 80px; }
.method-copy article { min-height: 190px; padding-top: 16px; border-top: 1px solid var(--ink); }
.method-copy h3 { margin: 0 0 16px; font-size: 24px; }
.method-copy p { max-width: 760px; margin: 0; font-size: 21px; line-height: 1.55; }
.assessment-options { margin: 22px 0 12px; }
.assessment-options button { background: white; color: var(--ink); }
.assessment-feedback { padding: 12px 14px; border-left: 4px solid var(--blue); background: white; font-size: 15px !important; }
.assessment-feedback.correct { border-color: var(--green); background: var(--green-soft); }
.assessment-feedback.incorrect { border-color: var(--coral); background: var(--coral-soft); }

.limits-band { padding: 120px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr); gap: 80px; align-items: end; background: var(--coral-soft); }
.limits-band h2 { max-width: 820px; margin: 0; font-size: 46px; line-height: 1.05; }
.limits-band > p { max-width: 620px; margin: 0; font-size: 18px; }
footer { min-height: 100px; padding: 24px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; background: var(--paper-strong); font-size: 12px; }

@media (max-width: 1020px) {
  .workbench-grid { grid-template-columns: 1fr; }
  .result-shell { min-height: 0; box-shadow: 5px 5px 0 var(--ink); }
  .empty-state { min-height: 320px; }
  .runtime-proof span:nth-child(n+2) { display: none; }
}

@media (max-width: 720px) {
  :root { --header-height: 52px; }
  .identity-rail { min-height: var(--header-height); padding: 7px 12px; gap: 8px; }
  .brand { font-size: 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .runtime-proof { font-size: 10px; }
  .workbench-band { padding: 14px 12px 22px; }
  .workbench-grid { gap: 18px; }
  h1 { font-size: 38px; line-height: 0.98; }
  .inline-receipt { width: 54px; height: 23px; vertical-align: 8%; }
  .lede { margin: 10px 0; font-size: 14px; }
  .synthetic-notice { padding: 7px 8px; font-size: 11px; }
  .input-actions { display: grid; grid-template-columns: 1fr 1fr 0.7fr; }
  .input-actions .button { width: 100%; padding-inline: 8px; font-size: 12px; }
  #evidence-input { height: 146px; font-size: 10px; }
  .input-meta { font-size: 9px; }
  .input-meta span:first-child { max-width: 245px; }
  .result-shell { padding: 12px; }
  .result-heading-row { display: grid; }
  .scenario-switch { width: 100%; }
  .scenario-switch button { min-height: 42px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid strong { font-size: 17px; }
  .visual-grid { grid-template-columns: 1fr; }
  .bridge-panel { border-left: 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
  .bridge-cells { max-width: 260px; }
  .result-actions { align-items: stretch; }
  .result-actions .button { width: 100%; }
  .result-actions span { max-width: none; text-align: left; }
  .wallet-band, .method-band, .limits-band { padding: 80px 14px; }
  .section-intro { grid-template-columns: 1fr; gap: 16px; }
  .section-intro h2, .method-heading-wrap h2, .limits-band h2 { font-size: 36px; }
  .method-layout { grid-template-columns: 1fr; gap: 48px; }
  .method-copy { gap: 60px; }
  .method-copy article { min-height: 0; }
  .method-copy p { font-size: 18px; }
  .limits-band { grid-template-columns: 1fr; gap: 34px; }
  footer { align-items: flex-start; flex-direction: column; }
}

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