:root {
  color-scheme: light;
  --paper: #ece9df;
  --sheet: #f8f5ed;
  --sheet-deep: #e1ddd1;
  --ink: #17201e;
  --muted: #666a64;
  --faint: #979990;
  --rule: #b9b5aa;
  --rule-strong: #777a73;
  --witness: #ad351f;
  --witness-dark: #862b18;
  --agent: #315f58;
  --white: #fffdf7;
  --shadow: rgba(34, 37, 31, .14);
  --tension: 38%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151a18;
  --sheet: #1d2421;
  --sheet-deep: #28302c;
  --ink: #f0ede3;
  --muted: #a8aaa2;
  --faint: #767b75;
  --rule: #434a46;
  --rule-strong: #737b76;
  --witness: #f26b48;
  --witness-dark: #ff9b80;
  --agent: #81b8aa;
  --white: #151a18;
  --shadow: rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent calc(3.5vw - 1px), color-mix(in srgb, var(--rule) 48%, transparent) calc(3.5vw - 1px), color-mix(in srgb, var(--rule) 48%, transparent) 3.5vw, transparent 3.5vw),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: var(--witness); color: var(--white); }
:focus-visible { outline: 3px solid var(--witness-dark); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  transform: translateY(-160%); transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 64px; padding: 0 3.5vw;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-weight: 750; letter-spacing: -.03em; text-decoration: none; }
.brand img { border-radius: 8px; }
.site-header nav { display: flex; align-items: center; gap: 26px; }
.nav-glyph { display: none; }
.site-header nav a, .text-button {
  border: 0; padding: 7px 0; background: transparent; color: var(--muted);
  font-size: .76rem; font-weight: 700; text-decoration: none;
}
.site-header nav a:hover, .text-button:hover { color: var(--ink); }
.protocol-status { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--muted); font: 700 .67rem/1.2 "SFMono-Regular", Consolas, monospace; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.protocol-status[data-active="true"] .status-dot { background: var(--agent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--agent) 15%, transparent); }

main { width: min(1560px, 100%); margin: 0 auto; padding: 0 3.5vw 120px; }
#workspace, #evidence { scroll-margin-top: 78px; }
.eyebrow, .section-number, .live-label, .specimen-number, .state-kicker {
  color: var(--witness); font: 750 .64rem/1.25 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .14em; text-transform: uppercase;
}

.intro {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(470px, .88fr);
  gap: 7vw; align-items: center; min-height: min(760px, calc(100vh - 64px));
  padding: 72px 0 80px;
}
.intro-mast { max-width: 760px; }
.intro h1 {
  margin: 22px 0 24px; max-width: 9ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.8rem, 8vw, 9.5rem); font-weight: 400; line-height: .78; letter-spacing: -.075em;
}
.intro h1 span { color: var(--witness); font-style: italic; }
.intro-deck { max-width: 54ch; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.35vw, 1.22rem); line-height: 1.58; }
.jump-link { display: inline-flex; gap: 44px; align-items: center; margin-top: 32px; padding: 11px 0 8px; border-bottom: 1px solid var(--ink); font-size: .78rem; font-weight: 750; text-decoration: none; }
.jump-link span { color: var(--witness); font-size: 1rem; }

.quantifier-stage {
  position: relative; display: grid; grid-template-columns: .72fr 1.35fr .72fr; grid-template-rows: auto auto auto;
  align-items: center; min-height: 480px; padding: 34px 0 0;
}
.quantifier { position: relative; z-index: 2; font-family: Georgia, "Times New Roman", serif; font-size: clamp(9rem, 16vw, 15rem); line-height: .7; transition: color .55s ease, opacity .55s ease, transform .65s cubic-bezier(.2,.8,.2,1); }
.quantifier.universal { color: var(--ink); transform-origin: right center; }
.quantifier.existential { color: transparent; -webkit-text-stroke: 1px var(--rule-strong); opacity: .48; transform-origin: left center; }
.pressure-line { position: relative; display: grid; grid-template-rows: auto 36px auto; min-width: 0; color: var(--muted); }
.pressure-line i { position: relative; align-self: center; height: 1px; background: var(--rule-strong); transform-origin: left center; }
.pressure-line i::after { content: ""; position: absolute; top: -4px; left: calc(var(--tension) - 4px); width: 9px; height: 9px; background: var(--witness); transform: rotate(45deg); transition: left .4s ease; }
.pressure-label { font: 700 .58rem/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.pressure-label:last-child { justify-self: end; }
.quantifier-caption { grid-column: 1 / -1; max-width: 53ch; margin: 42px 0 0 auto; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.quantifier-caption strong { color: var(--ink); }
.logic-note { grid-column: 1 / -1; justify-self: end; width: min(100%, 430px); margin-top: 18px; border-top: 1px solid var(--rule); color: var(--muted); }
.logic-note summary { padding: 11px 0; color: var(--ink); cursor: pointer; font-size: .72rem; font-weight: 750; }
.logic-note p { margin: 0 0 12px; font-size: .72rem; line-height: 1.55; }

body[data-experience="searching"] .quantifier.universal { transform: translateX(6%) scale(.92); opacity: .6; }
body[data-experience="searching"] .quantifier.existential { transform: translateX(-5%) scale(1.05); opacity: .78; }
body[data-experience="broken"] .quantifier.universal,
body[data-experience="repairing"] .quantifier.universal { color: var(--faint); opacity: .42; transform: rotate(-3deg) translateX(-3%); }
body[data-experience="broken"] .quantifier.existential,
body[data-experience="repairing"] .quantifier.existential { color: var(--witness); -webkit-text-stroke: 0; opacity: 1; transform: translateX(-7%) scale(1.1); }
body[data-experience="bounded"] .quantifier.existential { opacity: .2; }

.proof-rig {
  position: relative; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink);
  background: var(--sheet); box-shadow: 0 32px 80px var(--shadow);
}
.proof-rig::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, transparent 0 31px, color-mix(in srgb, var(--rule) 16%, transparent) 31px 32px);
}
.rig-header {
  position: relative; z-index: 2; display: grid; grid-template-columns: 190px minmax(0, 1fr) 170px; gap: 32px; align-items: start;
  min-height: 150px; padding: 26px 30px; border-bottom: 1px solid var(--ink);
}
.rig-ident { display: grid; gap: 20px; }
.specimen-number { color: var(--ink); }
.specimen-number b { color: var(--witness); }
.rig-state { width: fit-content; padding: 5px 8px; border: 1px solid var(--rule-strong); color: var(--muted); font: 700 .62rem/1.2 "SFMono-Regular", Consolas, monospace; text-transform: uppercase; }
.live-claim-block { padding: 0 28px; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.live-claim-block p { max-width: 68ch; margin: 8px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.25rem, 2vw, 1.8rem); line-height: 1.22; letter-spacing: -.018em; }
.rig-bound { justify-self: end; display: grid; gap: 8px; text-align: right; color: var(--muted); font-size: .67rem; }
.rig-bound strong { color: var(--ink); font: 750 .8rem/1.2 "SFMono-Regular", Consolas, monospace; }
.quick-run { justify-self: end; margin-top: 7px; padding: 6px 0 3px; border: 0; border-bottom: 1px solid var(--witness); border-radius: 0; background: transparent; color: var(--witness); font-size: .62rem; font-weight: 800; }
.quick-run:hover { color: var(--ink); border-color: var(--ink); }
.quick-run:disabled { cursor: wait; opacity: .45; }

.rig-pressure { position: relative; z-index: 3; display: grid; grid-template-columns: 58px 1fr 58px; align-items: center; height: 58px; padding: 0 22px; border-bottom: 1px solid var(--rule); background: var(--sheet-deep); }
.pressure-origin, .pressure-destination { font-family: Georgia, serif; font-size: 2.5rem; line-height: 1; }
.pressure-destination { color: var(--witness); text-align: right; }
.stress-track { position: relative; height: 14px; background: repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 5%); }
.stress-track::before { content: ""; position: absolute; top: 6px; right: 0; left: 0; height: 1px; background: var(--rule-strong); }
.stress-track i { position: absolute; top: 4px; left: 0; z-index: 1; width: var(--tension); height: 5px; background: var(--ink); transition: width .4s ease; }
.stress-track b { position: absolute; top: 1px; left: var(--tension); z-index: 2; width: 12px; height: 12px; border: 2px solid var(--witness); background: var(--sheet-deep); transform: translateX(-50%) rotate(45deg); transition: left .4s ease; }
body[data-experience="searching"] .stress-track::after { content: ""; position: absolute; inset: -3px 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--witness) 60%, transparent), transparent); animation: pressure-scan 1.1s ease-in-out infinite; }
body[data-experience="broken"] .stress-track::before,
body[data-experience="repairing"] .stress-track::before { background: linear-gradient(90deg, var(--rule-strong) 0 49%, transparent 49% 52%, var(--witness) 52% 100%); transform: skewY(-1deg); }
body[data-experience="broken"] .stress-track b,
body[data-experience="repairing"] .stress-track b { left: 51%; border-color: var(--witness); background: var(--witness); }
@keyframes pressure-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.rig-body { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(340px, .72fr) minmax(620px, 1.55fr); min-height: 760px; }
.builder-panel { padding: 30px; border-right: 1px solid var(--ink); background: color-mix(in srgb, var(--sheet) 93%, transparent); }
.panel-heading, .result-toolbar, .repair-heading, .evidence-heading { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; }
h2, h3, h4 { letter-spacing: -.04em; }
.panel-heading h2, .result-toolbar h2 { max-width: 12ch; margin: 8px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 400; line-height: 1.05; }
.scenario-picker { display: grid; gap: 6px; min-width: 140px; color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .09em; }
select, .text-input { border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; background: transparent; color: var(--ink); }
select { cursor: pointer; }
.scenario-picker select { width: 100%; padding: 7px 20px 7px 0; font-size: .7rem; text-transform: none; }
.field-label, fieldset legend { display: block; margin: 27px 0 9px; color: var(--muted); font-size: .69rem; font-weight: 750; }
.text-input, .full-select { width: 100%; padding: 11px 2px; }
.text-input { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
fieldset { margin: 0; padding: 0; border: 0; }
.check-row, .select-row { display: flex; align-items: center; justify-content: space-between; min-height: 42px; border-top: 1px solid var(--rule); font-size: .77rem; }
.check-row:last-child, .select-row:last-child { border-bottom: 1px solid var(--rule); }
.check-row { justify-content: flex-start; gap: 12px; }
.check-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--witness); }
.select-row select { width: 142px; padding: 7px 20px 7px 3px; font-size: .7rem; }
.advanced-premises { border-bottom: 1px solid var(--rule); }
.advanced-premises summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px;
  color: var(--ink); cursor: pointer; font-size: .72rem; font-weight: 750; list-style: none;
}
.advanced-premises summary::-webkit-details-marker { display: none; }
.advanced-premises summary::after { content: "+"; color: var(--witness); font: 800 .9rem/1 "SFMono-Regular", Consolas, monospace; }
.advanced-premises[open] summary { border-bottom: 1px solid var(--rule); }
.advanced-premises[open] summary::after { content: "−"; }
.advanced-premises summary small { margin-left: auto; color: var(--muted); font-size: .58rem; font-weight: 650; }
.advanced-premise-list .check-row:last-child,
.advanced-premise-list .select-row:last-child { border-bottom: 0; }
.conclusion-label { margin-top: 24px; }
.full-select { font-weight: 750; }
.range-row { display: grid; grid-template-columns: 1fr; margin: 24px 0 18px; color: var(--muted); font-size: .69rem; }
.range-row strong { color: var(--ink); }
.range-row input { width: 100%; margin: 15px 0 5px; accent-color: var(--witness); }
.range-scale { display: flex; justify-content: space-between; color: var(--faint); font: 600 .56rem/1 "SFMono-Regular", Consolas, monospace; }
.range-scale i { font-style: normal; }
.primary-button, .secondary-button {
  min-height: 46px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 0;
  font-size: .73rem; font-weight: 800; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.primary-button { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--ink); color: var(--paper); }
.primary-button:hover { border-color: var(--witness); background: var(--witness); color: var(--white); }
.primary-button:disabled { cursor: wait; opacity: .52; }
.primary-button.compact { display: inline-flex; width: auto; }
.secondary-button { background: transparent; color: var(--ink); }
.secondary-button:hover { background: var(--ink); color: var(--paper); }
button:active { transform: translateY(1px); }
.builder-utility-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 12px; }
.utility-button { color: var(--ink); font-size: .65rem; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.utility-button:hover { text-decoration-color: var(--witness); }
.builder-note { margin: 12px 0 0; color: var(--muted); font: .61rem/1.5 "SFMono-Regular", Consolas, monospace; }

.result-panel { position: relative; min-width: 0; padding: 30px; overflow: hidden; }
.result-panel::after { content: "∃"; position: absolute; right: -32px; bottom: -74px; z-index: -1; color: color-mix(in srgb, var(--rule) 18%, transparent); font-family: Georgia, serif; font-size: 24rem; line-height: 1; }
.result-toolbar { position: relative; z-index: 2; padding-bottom: 21px; border-bottom: 1px solid var(--rule-strong); }
.result-toolbar h2 { max-width: none; }
.search-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font: 650 .63rem/1.2 "SFMono-Regular", Consolas, monospace; }
#search-state { padding: 6px 8px; border: 1px solid var(--rule); color: var(--ink); text-transform: uppercase; }
#search-state[data-state="searching"] { border-color: var(--witness); color: var(--witness); }
#search-state[data-state="found"] { border-color: var(--witness); background: var(--witness); color: var(--white); }
#search-state[data-state="survived"] { border-color: var(--agent); color: var(--agent); }

.empty-state, .searching-state, .no-witness-state { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(260px, .75fr); gap: 4vw; align-items: center; min-height: 650px; }
.empty-state h3, .searching-state h3, .no-witness-state h3 { margin: 10px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 4vw, 4.4rem); font-weight: 400; line-height: .92; }
.empty-state p:not(.state-kicker), .searching-state p:not(.state-kicker), .no-witness-state p { max-width: 44ch; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.58; }
.rest-diagram { display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-width: 0; }
.rest-forall, .rest-exists { font-family: Georgia, serif; font-size: clamp(5rem, 9vw, 9rem); line-height: .8; }
.rest-exists { color: transparent; -webkit-text-stroke: 1px var(--rule-strong); opacity: .48; }
.rest-line { position: relative; height: 1px; background: var(--rule-strong); }
.rest-line i { position: absolute; top: -4px; left: var(--tension); width: 9px; height: 9px; background: var(--witness); transform: rotate(45deg); }

.enumeration-field { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; min-height: 260px; overflow: hidden; border: 1px solid var(--rule); background: var(--rule); }
.enumeration-field span { display: grid; place-items: center; background: var(--sheet); color: var(--muted); font: 650 .66rem/1 "SFMono-Regular", Consolas, monospace; }
.enumeration-field i { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0, color-mix(in srgb, var(--witness) 27%, transparent) 46%, var(--witness) 50%, transparent 54%); animation: enumerate 1.2s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes enumerate { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.witness-state { display: grid; grid-template-columns: minmax(330px, 1.05fr) minmax(300px, .78fr); gap: 34px; min-height: 650px; align-items: center; padding-top: 20px; }
.witness-visual { position: relative; min-width: 0; min-height: 500px; display: grid; place-items: center; border-right: 1px solid var(--rule-strong); }
.existence-stamp { position: absolute; top: 9%; left: 3%; color: color-mix(in srgb, var(--witness) 17%, transparent); font-family: Georgia, serif; font-size: clamp(8rem, 14vw, 14rem); line-height: .7; }
#graph-canvas { position: relative; z-index: 2; display: block; width: 100%; min-height: 420px; }
.graph-edge { stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; opacity: .76; stroke-dasharray: 520; animation: draw-edge .72s cubic-bezier(.2,.8,.2,1) both; }
.graph-node { animation: place-node .38s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--node-index) * 70ms); transform-origin: center; }
.graph-node circle { fill: var(--sheet); stroke: var(--ink); stroke-width: 2.3; }
.graph-node:first-child circle { fill: var(--witness); stroke: var(--witness); }
.graph-node text { fill: var(--ink); text-anchor: middle; font: 750 15px "SFMono-Regular", Consolas, monospace; }
.graph-node:first-child text { fill: var(--white); }
@keyframes draw-edge { from { stroke-dashoffset: 520; } to { stroke-dashoffset: 0; } }
@keyframes place-node { from { opacity: 0; transform: scale(.45); } }
.minimal-tag { position: absolute; left: 4px; bottom: 20px; z-index: 3; padding: 7px 9px; border-left: 3px solid var(--witness); background: var(--sheet); font: 700 .59rem/1.2 "SFMono-Regular", Consolas, monospace; }
.witness-report { position: relative; z-index: 2; padding-right: 4px; }
.result-verdict { color: var(--witness); font: 800 .62rem/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
.witness-report h3 { margin: 12px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 4.4vw, 4.8rem); font-weight: 400; line-height: .86; }
.witness-report > p:not(.result-verdict) { color: var(--muted); font-size: .77rem; line-height: 1.55; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0; border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
.metric-grid > div { padding: 10px; border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.metric-grid dt { color: var(--muted); font-size: .58rem; }
.metric-grid dd { margin: 4px 0 0; font: 750 .8rem/1.2 "SFMono-Regular", Consolas, monospace; }
.result-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.result-actions .secondary-button { min-height: 42px; }
.certificate-summary { display: flex; justify-content: space-between; gap: 14px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .62rem; }
.certificate-summary code { color: var(--agent); font: 750 .63rem/1.2 "SFMono-Regular", Consolas, monospace; }

.no-witness-state { grid-template-columns: .7fr 1fr; }
.bounded-mark { color: var(--agent); font-family: Georgia, serif; font-size: clamp(7rem, 15vw, 15rem); line-height: .8; }
.bounded-mark sup { font: 700 .12em/1 "SFMono-Regular", Consolas, monospace; vertical-align: top; }

.repair-panel { position: absolute; inset: auto 20px 20px 20px; z-index: 8; padding: 24px; border: 2px solid var(--witness); background: var(--sheet); box-shadow: 12px 12px 0 color-mix(in srgb, var(--witness) 22%, transparent); }
.repair-heading h3 { margin: 7px 0 0; font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.repair-panel > p { max-width: 76ch; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.repair-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
.repair-list article { display: flex; flex-direction: column; padding: 15px; border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.repair-list h4 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 1rem; font-weight: 400; }
.repair-list p { margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.48; }
.repair-list small { display: block; min-height: 54px; margin-top: 10px; color: var(--muted); font-size: .58rem; line-height: 1.45; }
.repair-apply { width: 100%; min-height: 40px; margin-top: auto; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--paper); font-size: .66rem; font-weight: 800; }
.repair-apply:hover { border-color: var(--witness); background: var(--witness); color: var(--white); }

.agent-relay { display: grid; grid-template-columns: .72fr 1.65fr; gap: 6vw; margin: 100px 0 120px; padding: 44px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.agent-relay header h2 { max-width: 11ch; margin: 10px 0 0; font-family: Georgia, serif; font-size: clamp(2.2rem, 4vw, 4.3rem); font-weight: 400; line-height: .92; }
.relay-line { display: grid; grid-template-columns: 1fr 38px 1fr 38px 1fr; align-items: center; }
.relay-line > div { display: grid; gap: 7px; }
.relay-line b { color: var(--witness); font: 750 .61rem/1 "SFMono-Regular", Consolas, monospace; }
.relay-line strong { font-family: Georgia, serif; font-size: 1.05rem; font-weight: 400; }
.relay-line span { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.relay-line i { height: 1px; margin: 0 10px; background: var(--rule-strong); }
.relay-action { grid-column: 2; justify-self: end; margin-top: 28px; }

.evidence-section { padding-top: 10px; }
.evidence-heading { align-items: end; padding-bottom: 27px; border-bottom: 3px solid var(--ink); }
.evidence-heading h2, .activity-section h2 { margin: 9px 0 0; font-family: Georgia, serif; font-size: clamp(2.5rem, 4vw, 4.5rem); font-weight: 400; line-height: .9; }
.evidence-heading-copy { display: grid; justify-items: end; gap: 12px; }
.evidence-heading p { max-width: 48ch; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.saved-list { min-height: 190px; }
.saved-empty { display: grid; grid-template-columns: 100px 1fr; gap: 28px; align-items: center; min-height: 190px; border-bottom: 1px solid var(--rule); }
.empty-file { color: var(--faint); font-family: Georgia, serif; font-size: 4.5rem; }
.saved-empty p { margin: 0 0 5px; font-family: Georgia, serif; font-size: 1.25rem; }
.saved-empty div > span { color: var(--muted); font-size: .72rem; }
.saved-card { display: grid; grid-template-columns: 94px 1fr; gap: 24px; padding: 25px 0; border-bottom: 1px solid var(--rule-strong); }
.saved-count { color: var(--witness); font: 750 2rem/1 "SFMono-Regular", Consolas, monospace; }
.saved-card h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 400; }
.saved-card p { max-width: 82ch; margin: 0 0 9px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.saved-card div > span { font: .62rem/1.3 "SFMono-Regular", Consolas, monospace; }
.saved-card code { display: block; width: fit-content; margin-top: 9px; color: var(--agent); font: 750 .61rem/1.3 "SFMono-Regular", Consolas, monospace; }

.activity-section { display: grid; grid-template-columns: .55fr 1.45fr; gap: 7vw; margin-top: 110px; padding-top: 28px; border-top: 1px solid var(--ink); }
.activity-section > div > p { max-width: 31ch; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.activity-log { margin: 0; padding: 0; list-style: none; }
.activity-log li { display: grid; grid-template-columns: 76px 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: .72rem; }
.activity-log time { color: var(--witness); font: 750 .61rem/1.5 "SFMono-Regular", Consolas, monospace; }
.activity-log span { color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 30px; width: min(1560px, 100%); margin: 0 auto; padding: 30px 3.5vw 48px; border-top: 1px solid var(--ink); color: var(--muted); font-size: .68rem; }
footer p { max-width: 70ch; margin: 0; }
footer strong, footer a { color: var(--ink); }
footer a { font-weight: 750; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: 340px; padding: 13px 16px; border-left: 4px solid var(--witness); background: var(--ink); color: var(--paper); box-shadow: 8px 8px 0 color-mix(in srgb, var(--witness) 25%, transparent); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-size: .72rem; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .intro { grid-template-columns: 1fr minmax(390px, .8fr); gap: 3vw; }
  .rig-header { grid-template-columns: 150px 1fr 145px; gap: 20px; }
  .rig-body { grid-template-columns: 360px minmax(0, 1fr); }
  .witness-state { grid-template-columns: 1fr; gap: 0; }
  .witness-visual { min-height: 360px; border-right: 0; border-bottom: 1px solid var(--rule); }
  #graph-canvas { min-height: 330px; }
  .witness-report { padding: 26px 0 14px; }
  .repair-panel { position: static; margin-top: 24px; box-shadow: none; }
}

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto auto; gap: 7px; }
  .site-header nav { display: flex; gap: 3px; }
  .site-header nav a, .site-header nav button { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; }
  .site-header nav .nav-label { display: none; }
  .site-header nav .nav-glyph { display: inline; font: 700 1rem/1 Georgia, serif; }
  .intro { grid-template-columns: 1fr; min-height: 0; padding: 70px 0; }
  .intro h1 { max-width: 8ch; }
  .quantifier-stage { max-width: 650px; min-height: 390px; }
  .rig-header { grid-template-columns: 1fr auto; min-height: 0; }
  .live-claim-block { grid-column: 1 / -1; grid-row: 2; padding: 20px 0 0; border: 0; border-top: 1px solid var(--rule); }
  .rig-bound { grid-column: 2; grid-row: 1; }
  .rig-pressure { grid-template-columns: 46px 1fr 46px; }
  .rig-body { grid-template-columns: 1fr; }
  .builder-panel { border-right: 0; border-bottom: 1px solid var(--ink); }
  .empty-state, .searching-state, .no-witness-state { min-height: 520px; }
  .agent-relay { grid-template-columns: 1fr; }
  .agent-relay header h2 { max-width: 14ch; }
  .relay-action { grid-column: 1; }
}

@media (max-width: 620px) {
  body { background: var(--paper); }
  .site-header { min-height: 58px; padding: 0 17px; }
  .brand span { font-size: .86rem; }
  .protocol-status span:last-child { display: none; }
  main { padding: 0 15px 80px; }
  .intro { gap: 44px; padding: 54px 0 62px; }
  .intro h1 { margin: 17px 0 20px; font-size: clamp(4rem, 22vw, 6.7rem); line-height: .8; }
  .intro-deck { font-size: .92rem; }
  .quantifier-stage { grid-template-columns: .65fr 1.2fr .65fr; min-height: 320px; padding-top: 0; }
  .quantifier { font-size: clamp(6rem, 30vw, 9rem); }
  .pressure-label { display: none; }
  .quantifier-caption { margin-top: 25px; font-size: .69rem; }
  .logic-note { margin-top: 10px; }
  .proof-rig { margin: 0 -15px; box-shadow: none; }
  .rig-header { padding: 20px 17px; }
  .specimen-number { font-size: .58rem; }
  .live-claim-block p { font-size: 1.18rem; }
  .rig-bound { font-size: .57rem; }
  .rig-bound strong { font-size: .66rem; }
  .quick-run { font-size: .58rem; }
  .rig-pressure { height: 52px; padding: 0 15px; }
  .rig-body { display: block; }
  .builder-panel, .result-panel { padding: 24px 17px; }
  .panel-heading, .result-toolbar, .evidence-heading { align-items: flex-start; flex-direction: column; }
  .scenario-picker { width: 100%; margin-top: 10px; }
  .panel-heading h2, .result-toolbar h2 { max-width: 14ch; font-size: 1.75rem; }
  .select-row { align-items: flex-start; flex-direction: column; gap: 6px; padding: 10px 0; }
  .select-row select { width: 100%; }
  .search-meta { width: 100%; justify-content: space-between; }
  .empty-state, .searching-state, .no-witness-state { grid-template-columns: 1fr; gap: 32px; min-height: 500px; padding: 28px 0; }
  .rest-diagram { order: 1; }
  .empty-state > div:last-child { order: 0; }
  .enumeration-field { order: 1; min-height: 210px; }
  .searching-state > div:last-child { order: 0; }
  .witness-state { display: block; min-height: 0; }
  .witness-visual { min-height: 330px; }
  #graph-canvas { min-height: 300px; }
  .existence-stamp { font-size: 9rem; }
  .witness-report h3 { font-size: 3.4rem; }
  .result-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .result-actions .primary-button { grid-column: 1 / -1; justify-content: center; }
  .result-actions .secondary-button { width: 100%; }
  .certificate-summary { align-items: flex-start; flex-direction: column; }
  .repair-panel { margin: 22px -2px 0; padding: 19px 16px; }
  .repair-list { grid-template-columns: 1fr; }
  .repair-list p, .repair-list small { min-height: 0; font-size: .75rem; line-height: 1.55; }
  .agent-relay { margin: 74px 0 90px; padding: 32px 0; }
  .agent-relay header h2 { font-size: 3rem; }
  .relay-line { grid-template-columns: 1fr; gap: 0; margin-top: 15px; }
  .relay-line > div { padding: 18px 0; border-bottom: 1px solid var(--rule); }
  .relay-line i { width: 1px; height: 22px; margin: 0 0 0 5px; background: var(--witness); }
  .relay-action { width: 100%; margin-top: 24px; }
  .evidence-heading { align-items: stretch; }
  .evidence-heading-copy { justify-items: start; }
  .evidence-heading h2, .activity-section h2 { font-size: 3.4rem; }
  .saved-empty { grid-template-columns: 70px 1fr; }
  .saved-card { grid-template-columns: 56px 1fr; gap: 13px; }
  .activity-section { grid-template-columns: 1fr; gap: 24px; margin-top: 76px; }
  .toast { right: 15px; bottom: 15px; left: 15px; max-width: none; }
  footer { flex-direction: column; padding: 25px 17px 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .enumeration-field i { display: none; }
}
