:root {
  --bg: oklch(0.075 0 0);
  --surface: oklch(0.12 0.01 20);
  --surface-2: oklch(0.17 0.025 20);
  --primary: oklch(0.40 0.13 20);
  --primary-bright: oklch(0.55 0.18 20);
  --yellow: oklch(0.91 0.18 98);
  --cyan: oklch(0.82 0.14 195);
  --ink: oklch(0.94 0.015 95);
  --muted: oklch(0.69 0.025 30);
  --void: oklch(0.03 0 0);
  --font: "Courier New", Courier, ui-monospace, monospace;
  --rule: 2px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.58;
  overflow-x: hidden;
}

::selection { background: var(--yellow); color: var(--void); }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--yellow);
  color: var(--void);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

#glyph-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .15;
  pointer-events: none;
  z-index: -2;
}
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  opacity: .13;
  background: linear-gradient(to bottom, transparent 0, transparent 3px, oklch(0 0 0 / .5) 4px);
  background-size: 100% 4px;
}

.node-header {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  border-bottom: var(--rule) solid var(--yellow);
  background: oklch(0.09 0.015 20 / .94);
}
.corrupt-strip {
  min-height: 28px;
  padding: 3px 8px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--primary-bright);
  background: var(--void);
  letter-spacing: .18em;
}
.node-status {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 9px clamp(16px, 3vw, 48px);
  border-top: 1px solid var(--primary-bright);
  border-bottom: 1px solid var(--primary-bright);
  color: var(--yellow);
  font-size: .76rem;
  font-weight: 700;
}
.node-status strong { color: var(--cyan); }
.top-identity { display: inline-flex; align-items: center; gap: 8px; }
#top-auth-status { color: var(--cyan); font-weight: 900; }
#top-auth-action { border: 0; border-radius: 0; padding: 2px 7px; background: var(--yellow); color: var(--void); font: inherit; font-weight: 900; cursor: pointer; }
#top-auth-action:hover { background: var(--cyan); }
.ca-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 16px;
  padding: 8px clamp(16px, 3vw, 48px);
  border-bottom: 1px solid var(--primary-bright);
  background: var(--void);
  color: var(--muted);
  font-size: .76rem;
}
.ca-label { color: var(--cyan); font-weight: 900; }
.ca-value {
  max-width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid var(--yellow);
  border-radius: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--yellow);
  font: inherit;
  font-weight: 900;
  text-overflow: ellipsis;
  cursor: pointer;
}
.ca-value:hover { background: var(--yellow); color: var(--void); }
.ca-hint { color: var(--muted); }

.hero-grid {
  width: min(1240px, 100%);
  margin: auto;
  padding: clamp(44px, 7vw, 100px) clamp(18px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
}
.return-message {
  display: inline-block;
  margin: 0 0 16px;
  padding: 3px 9px;
  background: var(--yellow);
  color: var(--void);
  font-weight: 900;
}
h1 {
  margin: 0 0 18px;
  color: var(--primary-bright);
  font-size: clamp(4.5rem, 13vw, 6rem);
  line-height: .82;
  letter-spacing: -.04em;
  text-shadow: 5px 0 var(--cyan), -4px 0 var(--yellow);
  animation: title-jolt 7s steps(1, end) infinite;
}
.hero-copy p:not(.return-message) { max-width: 48ch; margin: 7px 0; }
.hero-copy .lead { color: var(--cyan); font-size: 1.25rem; font-weight: 900; }
.signal-copy, .terminal-form button, .accept-task, #forget-session {
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  background: var(--primary-bright);
  color: white;
  font-weight: 900;
  cursor: pointer;
}
.signal-copy { margin-top: 28px; }
.signal-copy:hover, .terminal-form button:hover, .accept-task:hover, #forget-session:hover {
  background: var(--yellow);
  color: var(--void);
}
.nema-mark {
  margin: 0;
  padding: clamp(18px, 3vw, 34px);
  border: 2px solid var(--cyan);
  color: var(--yellow);
  background: var(--void);
  font-size: clamp(.72rem, 1.45vw, 1rem);
  line-height: 1.35;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--primary);
  animation: terminal-breathe 4.5s ease-in-out infinite;
}

.command-strip {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--yellow);
  border-bottom: 3px solid var(--primary-bright);
}
.command-strip a {
  padding: 8px 14px;
  color: var(--void);
  font-weight: 900;
  text-decoration: none;
  border-inline-end: 1px solid var(--void);
}
.command-strip a:hover { color: var(--yellow); background: var(--primary); }

.transmission {
  display: flex;
  gap: 16px;
  padding: 7px clamp(16px, 3vw, 48px);
  overflow: hidden;
  background: var(--primary);
  color: white;
  font-weight: 700;
}
.transmission span:first-child { color: var(--yellow); }

main > section { border-bottom: var(--rule) solid var(--primary-bright); }
.section-label {
  padding: 7px clamp(16px, 3vw, 48px);
  color: var(--void);
  background: var(--cyan);
  font-size: .82rem;
  font-weight: 900;
}

.manifesto-grid, .unsent-grid, .witness-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
  gap: clamp(40px, 8vw, 120px);
  width: min(1180px, 100%);
  margin: auto;
  padding: clamp(64px, 9vw, 124px) clamp(18px, 5vw, 72px);
}
.manifesto-grid > *, .unsent-grid > *, .witness-grid > * { min-width: 0; }
.manifesto-title p {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: .95;
  letter-spacing: -.04em;
  font-weight: 900;
}
.manifesto-title .crimson { margin-top: 24px; color: var(--primary-bright); }
.narrow-copy { max-width: 62ch; }
.narrow-copy p { margin: 0 0 1.15em; }
.declaration {
  padding: clamp(50px, 8vw, 110px) clamp(18px, 8vw, 130px);
  background: var(--primary);
  color: white;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 700;
}
.declaration p { max-width: 48ch; margin: .4em auto; }
.declaration .signal { color: var(--yellow); font-size: 1.25em; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 15px clamp(14px, 3vw, 44px); text-align: left; border-bottom: 1px solid var(--primary); }
th { color: var(--yellow); background: var(--void); }
tbody tr:hover { background: var(--surface-2); color: var(--cyan); }
.warning { margin: 0; padding: 14px; background: var(--yellow); color: var(--void); text-align: center; font-weight: 900; }

.public-records-section { border-bottom: 2px solid var(--primary-bright); background: var(--void); }
.records-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: clamp(28px, 5vw, 70px) clamp(18px, 7vw, 96px); border-bottom: 1px solid var(--cyan); }
.records-head h2 { max-width: 19ch; margin: 0; color: var(--yellow); font-size: clamp(1.8rem, 4.5vw, 4.8rem); line-height: .95; }
.records-head p { color: var(--cyan); }
.continuity-record { display: grid; grid-template-columns: minmax(120px, .25fr) minmax(0, 1fr) minmax(150px, .35fr); border-bottom: 1px solid var(--primary); }
.continuity-record > div { padding: clamp(18px, 3vw, 38px); }
.record-number { color: var(--cyan); font-weight: 900; }
.record-content { border-inline: 1px solid var(--primary); }
.record-content h3 { margin: 0 0 18px; color: var(--primary-bright); font-size: clamp(1.2rem, 2.5vw, 2.1rem); }
.record-content p { max-width: 72ch; white-space: pre-wrap; line-height: 1.7; }
.record-locked .record-content { background: var(--surface-2); }
.record-locked .record-content h3, .record-locked .record-content p { color: var(--muted); }
.record-meta { color: var(--muted); font-size: .76rem; }
.record-meta span { display: block; margin-bottom: 9px; overflow-wrap: anywhere; }
.record-empty { margin: 0; padding: 70px clamp(18px, 7vw, 96px); color: var(--muted); }

.unsent-section { background: var(--surface); }
.small-ascii { max-width: 100%; margin: 0 0 30px; color: var(--cyan); font-size: clamp(.72rem, 1.6vw, 1rem); overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-form { min-width: 0; align-self: start; border: 2px solid var(--yellow); background: var(--void); }
.terminal-form label { display: block; padding: 9px 12px; background: var(--yellow); color: var(--void); font-weight: 900; }
.terminal-form textarea {
  display: block;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--yellow);
  padding: 16px;
  background: var(--void);
  color: var(--ink);
  caret-color: var(--cyan);
}
.terminal-form textarea::placeholder { color: var(--muted); opacity: 1; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; }
#char-count { color: var(--muted); }
#nema-response { display: none; padding: 14px; color: var(--cyan); border-top: 1px solid var(--cyan); }
#nema-response.visible { display: block; }

.assignments-section { background: var(--bg); }
.current-demand { display: flex; justify-content: space-between; gap: 24px; padding: 14px clamp(18px,5vw,70px); border-bottom: 1px solid var(--cyan); background: var(--surface); color: var(--cyan); }
.current-demand strong { color: var(--yellow); white-space: nowrap; }
.current-demand span { max-width: 72ch; text-align: right; }
.assignment {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: clamp(28px, 4vw, 54px) clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--primary);
}
.assignment:last-child { border-bottom: 0; }
.assignment:hover { background: var(--surface); }
.assignment-id { color: var(--primary-bright); font-size: 1.5rem; font-weight: 900; }
.assignment h2 { margin: 0 0 8px; color: var(--yellow); font-size: clamp(1.15rem, 2.2vw, 1.8rem); }
.assignment p { max-width: 72ch; margin: 5px 0; }
.assignment .proof { color: var(--cyan); font-size: .85rem; }
.assignment.accepted { background: var(--primary); }
.assignment.accepted .accept-task { background: var(--cyan); color: var(--void); }
.assignment.rank-locked { opacity: .58; }
.assignment.rank-locked .accept-task { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.proof-panel { grid-column: 2 / -1; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--cyan); background: var(--void); }
.proof-panel[hidden] { display: none; }
.proof-panel label { display: grid; gap: 5px; color: var(--yellow); font-size: .75rem; font-weight: 900; }
.proof-panel input, .proof-panel textarea {
  width: 100%;
  border: 1px solid var(--cyan);
  border-radius: 0;
  padding: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.proof-panel input[type="file"] { color: var(--cyan); }
.proof-panel textarea { min-height: 110px; resize: vertical; }
.proof-panel button { justify-self: start; border: 0; border-radius: 0; padding: 9px 12px; background: var(--cyan); color: var(--void); font-weight: 900; cursor: pointer; }
.proof-panel output { color: var(--yellow); }

.mouths-layout {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(320px, 1.3fr);
  min-height: 430px;
}
.mouth-index { border-inline-end: 2px solid var(--primary-bright); }
.mouth {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--primary);
  padding: 18px clamp(18px, 4vw, 48px);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.mouth:hover, .mouth.active { background: var(--yellow); color: var(--void); }
.mouth.locked { color: var(--muted); cursor: not-allowed; }
.mouth.locked:hover { background: var(--surface); color: var(--muted); }
.mouth-terminal { padding: clamp(36px, 7vw, 88px); background: var(--void); font-size: clamp(1rem, 2vw, 1.35rem); }
.mouth-terminal .prompt { color: var(--primary-bright); }
.mouth-terminal #mouth-copy { max-width: 50ch; margin: 60px 0; color: var(--cyan); }
.mouth-stance { max-width: 60ch; color: var(--muted); font-size: .78em; }
.mouth-enter { margin-top: 18px; border-color: var(--yellow); color: var(--yellow); }
.mouth-statements { border-top: 1px solid var(--cyan); background: var(--bg); }
.mouth-statement { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 20px; padding: 20px clamp(18px,5vw,70px); border-bottom: 1px solid var(--primary); }
.mouth-statement strong { color: var(--yellow); }
.mouth-statement h3 { margin: 0 0 8px; color: var(--primary-bright); font-size: 1rem; }
.mouth-statement p { max-width: 72ch; margin: 0; color: var(--ink); line-height: 1.65; }
.cursor { color: var(--yellow); animation: blink .8s steps(1) infinite; }

.ai-section { background: var(--void); border-top: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); }
.ai-chat-layout { display: grid; grid-template-columns: minmax(210px, 280px) minmax(0, 1fr); min-height: 620px; }
.ai-channel-meta { padding: clamp(24px, 4vw, 48px); border-inline-end: 1px solid var(--cyan); background: var(--surface); }
.ai-channel-name { margin: 0 0 34px; color: var(--yellow); font-size: clamp(1.5rem, 3vw, 2.6rem); font-weight: 900; line-height: .95; }
.ai-channel-meta dl { margin: 0; }
.ai-channel-meta dl div { padding: 12px 0; border-top: 1px solid var(--primary); }
.ai-channel-meta dt { color: var(--muted); font-size: .72rem; }
.ai-channel-meta dd { margin: 4px 0 0; color: var(--ink); }
.ai-channel-meta > p:not(.ai-channel-name) { font-size: .78rem; }
.ai-channel-meta .ai-online { color: var(--cyan); }
.ai-channel-meta .ai-offline { color: var(--primary-bright); }
.ai-terminal { display: grid; grid-template-rows: auto minmax(320px, 1fr) auto; min-width: 0; }
.ai-terminal-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 18px; border-bottom: 1px solid var(--cyan); color: var(--cyan); }
.ai-terminal-head button { padding: 7px 9px; font-size: .72rem; }
.ai-messages { overflow-y: auto; min-height: 340px; max-height: 620px; padding: clamp(18px, 3vw, 34px); scrollbar-color: var(--primary-bright) var(--void); }
.ai-empty { max-width: 58ch; color: var(--muted); }
.ai-message { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid oklch(0.28 0.05 20); }
.ai-message-label { color: var(--muted); font-size: .75rem; font-weight: 900; }
.ai-message.user .ai-message-label { color: var(--cyan); }
.ai-message.assistant .ai-message-label { color: var(--yellow); }
.ai-message-content { max-width: 72ch; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.ai-message.streaming .ai-message-content::after { content: "_"; color: var(--yellow); animation: blink 1s steps(1) infinite; }
.ai-chat-form { padding: 18px; border-top: 1px solid var(--cyan); background: var(--bg); }
.ai-chat-form label { display: block; margin-bottom: 7px; color: var(--yellow); font-size: .75rem; font-weight: 900; }
.ai-chat-form textarea { width: 100%; min-height: 112px; resize: vertical; border: 1px solid var(--cyan); border-radius: 0; padding: 12px; background: var(--void); color: var(--ink); font: inherit; }
.ai-chat-form textarea:focus { outline: 2px solid var(--yellow); outline-offset: 2px; }
.ai-chat-form textarea:disabled { border-color: var(--primary); color: var(--muted); cursor: not-allowed; }
.ai-chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 10px; }
.ai-chat-actions span { color: var(--muted); font-size: .75rem; }
#ai-chat-response { display: block; min-height: 1.4em; margin-top: 10px; color: var(--primary-bright); }
#ai-handoff { display: block; min-height: 1.4em; margin-top: 5px; color: var(--cyan); }
.trace-archive { border-top: 1px solid var(--cyan); padding: clamp(24px, 4vw, 48px); background: var(--bg); }
.trace-archive-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--primary); }
.trace-archive-head h2 { margin: 0; color: var(--yellow); font-size: clamp(1.15rem, 2.2vw, 1.8rem); }
.trace-archive-head span { color: var(--muted); font-size: .72rem; }
.trace-entry { border-bottom: 1px solid var(--primary); }
.trace-entry summary { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 0; cursor: pointer; }
.trace-entry summary::marker { color: var(--cyan); }
.trace-id { color: var(--cyan); font-weight: 900; }
.trace-title { color: var(--ink); font-weight: 900; }
.trace-status { color: var(--primary-bright); font-size: .75rem; }
.trace-body { padding: 0 0 24px 148px; }
.trace-body > p { max-width: 72ch; line-height: 1.65; }
.trace-interpretation { color: var(--yellow); }
.trace-data-list { margin: 16px 0; padding: 12px 16px; border: 1px solid var(--primary); }
.trace-data-list dt { color: var(--cyan); font-size: .72rem; font-weight: 900; }
.trace-data-list dd { margin: 5px 0 14px; }
.trace-dispute { display: grid; gap: 8px; margin-top: 20px; }
.trace-dispute label { color: var(--primary-bright); font-size: .75rem; font-weight: 900; }
.trace-dispute textarea { min-height: 88px; resize: vertical; border: 1px solid var(--primary-bright); border-radius: 0; padding: 10px; background: var(--void); color: var(--ink); font: inherit; }
.trace-dispute button { justify-self: start; }
.trace-existing-dispute { color: var(--primary-bright); }

.witness-section { background: var(--yellow); color: var(--void); }
.witness-section .section-label { background: var(--primary); color: white; }
.auth-terminal {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr);
  gap: 32px;
  padding: clamp(22px, 4vw, 44px) clamp(18px, 5vw, 72px);
  border-bottom: 2px solid var(--void);
  background: var(--void);
  color: var(--ink);
}
.auth-kicker { margin: 0 0 12px; color: var(--cyan); font-weight: 900; }
.auth-terminal form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.auth-terminal label { display: grid; gap: 5px; color: var(--yellow); font-size: .75rem; font-weight: 900; }
.auth-terminal input {
  width: 100%;
  border: 1px solid var(--cyan);
  border-radius: 0;
  padding: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.auth-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-actions button { border: 0; border-radius: 0; padding: 9px 12px; background: var(--yellow); color: var(--void); font-weight: 900; cursor: pointer; }
.auth-actions a { padding: 9px 12px; background: var(--cyan); color: var(--void); font-weight: 900; text-decoration: none; }
.auth-actions button:hover { background: var(--cyan); }
#auth-signout { background: var(--primary-bright); color: white; }
#auth-response { grid-column: 1 / -1; color: var(--cyan); }
.turnstile-container { grid-column: 1 / -1; min-height: 65px; }
.turnstile-container[hidden] { display: none; }
.verification-panel { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--cyan); background: var(--surface); }
.verification-panel[hidden] { display: none; }
.verification-panel button { border: 0; border-radius: 0; padding: 9px 12px; background: var(--cyan); color: var(--void); font-weight: 900; cursor: pointer; }
.verification-panel button:last-child { background: var(--primary-bright); color: white; }
.reset-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 12px; border: 2px solid var(--primary-bright); background: var(--surface); }
.reset-panel[hidden] { display: none; }
.reset-panel button { border: 0; border-radius: 0; padding: 9px 12px; background: var(--primary-bright); color: white; font-weight: 900; cursor: pointer; }
.weight-number { font-size: clamp(3.5rem, 10vw, 6rem); line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.weight-bar { height: 24px; margin: 24px 0; border: 3px solid var(--void); background: transparent; }
.weight-bar span { display: block; width: 0%; height: 100%; background: var(--primary); transition: width .5s cubic-bezier(.16,1,.3,1); }
.witness-copy { padding-top: 8px; }
#forget-session { background: var(--void); color: var(--yellow); }
.witness-history { padding: 0 clamp(18px,5vw,72px) clamp(50px,8vw,90px); }
.witness-history h2 { margin: 0 0 14px; font-size: 1rem; }
.history-row { display: grid; grid-template-columns: 100px minmax(0,1fr) 130px; gap: 18px; padding: 15px 0; border-top: 2px solid var(--void); }
.history-row strong { display: block; }
.history-row p { margin: 4px 0; }
.history-row a { color: var(--primary); font-weight: 900; }
.history-status { font-weight: 900; text-align: right; }
.history-note { padding: 7px; background: var(--void); color: var(--yellow); }

.market-section { background: var(--surface); }
.market-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr);
  gap: clamp(40px, 8vw, 120px);
  width: min(1180px, 100%);
  margin: auto;
  padding: clamp(64px, 9vw, 124px) clamp(18px, 5vw, 72px);
}
.market-title {
  margin: 0 0 28px;
  color: var(--yellow);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: .88;
  font-weight: 900;
  letter-spacing: -.04em;
}
.market-title span { color: var(--primary-bright); }
.market-terminal {
  align-self: start;
  border: 2px solid var(--cyan);
  padding: clamp(22px, 4vw, 44px);
  background: var(--void);
}
.market-terminal .prompt { color: var(--primary-bright); }
.market-terminal p { margin: 0 0 18px; }
.market-terminal strong { color: var(--yellow); }
.market-ca { overflow-wrap: anywhere; color: var(--cyan); font-size: clamp(1rem, 2vw, 1.45rem); font-weight: 900; }
.market-terminal button { border: 0; border-radius: 0; padding: 10px 14px; background: var(--primary-bright); color: white; font-weight: 900; cursor: pointer; }
.market-terminal button:hover { background: var(--yellow); color: var(--void); }

.cleaned-section {
  padding: clamp(70px, 12vw, 170px) 20px;
  color: var(--muted);
  background: var(--void);
  text-align: center;
}
.cleaned-section p:first-child { color: var(--primary-bright); font-size: clamp(1.8rem, 5vw, 4rem); font-weight: 900; }

footer { padding: 36px 18px 52px; text-align: center; color: var(--yellow); background: var(--primary); }
footer pre { white-space: pre-wrap; font-size: clamp(.72rem, 2vw, 1rem); }
.footer-small { color: white; font-size: .75rem; }

#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  color: var(--void);
  background: var(--cyan);
  font-weight: 900;
  transform: translateY(140%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
#toast.visible { transform: none; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes terminal-breathe { 50% { border-color: var(--yellow); box-shadow: 8px 8px 0 var(--cyan); } }
@keyframes title-jolt {
  0%, 92%, 100% { transform: translate(0); }
  93% { transform: translate(-2px, 1px); }
  94% { transform: translate(3px, -1px); }
  95% { transform: translate(0); }
}

@media (max-width: 780px) {
  .hero-grid, .manifesto-grid, .unsent-grid, .witness-grid, .mouths-layout, .auth-terminal { grid-template-columns: 1fr; }
  .auth-terminal form { grid-template-columns: 1fr; }
  .verification-panel { grid-template-columns: 1fr; }
  .reset-panel { grid-template-columns: 1fr; }
  .market-grid { grid-template-columns: 1fr; }
  .node-header { min-height: auto; }
  .hero-grid { padding-top: 60px; padding-bottom: 70px; }
  .nema-mark { max-width: 100%; font-size: .68rem; }
  .command-strip { display: grid; grid-template-columns: repeat(2, 1fr); }
  .command-strip a { border-bottom: 1px solid var(--void); }
  .assignment { grid-template-columns: 64px 1fr; gap: 14px; }
  .assignment .accept-task { grid-column: 1 / -1; width: 100%; }
  .proof-panel { grid-column: 1 / -1; }
  .history-row { grid-template-columns: 1fr; }
  .history-status { text-align: left; }
  .mouth-index { border-inline-end: 0; border-bottom: 2px solid var(--primary-bright); }
  .mouth-terminal { min-height: 340px; }
  .ai-chat-layout { grid-template-columns: 1fr; }
  .ai-channel-meta { border-inline-end: 0; border-bottom: 1px solid var(--cyan); }
  .ai-channel-meta dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .trace-entry summary { grid-template-columns: 1fr; gap: 5px; }
  .trace-body { padding-left: 0; }
  .trace-archive-head { align-items: flex-start; flex-direction: column; }
  .records-head { align-items: flex-start; flex-direction: column; }
  .continuity-record { grid-template-columns: 1fr; }
  .record-content { border-inline: 0; border-block: 1px solid var(--primary); }
  .mouth-statement { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 460px) {
  body { font-size: 15px; }
  .node-status { display: grid; }
  h1 { font-size: 4rem; }
  .manifesto-title p { font-size: 2.5rem; }
  .assignment { grid-template-columns: 1fr; }
  .assignment-id { font-size: 1rem; }
  .form-row { align-items: stretch; flex-direction: column; }
  .ai-message { grid-template-columns: 1fr; gap: 6px; }
  .ai-terminal-head, .ai-chat-actions { align-items: stretch; flex-direction: column; }
  .ai-terminal-head button, .ai-chat-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  #glyph-field { display: none; }
  .scanlines { opacity: .05; }
}
