/* OPSIN site: the live strip on the landing page, and the app pages (/lab, /notebooks, /propose, /agents).
   Tokens come from v3.css (paper, ink, two lights); nothing here introduces a new hue. */

/* ---------- live bar: one slim line under the landing header ---------- */
.live-strip {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line);
}
.ls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding-block: 8px;
}
.ls-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.live-strip[data-state="running"] .ls-dot {
  background: var(--excite);
  box-shadow: 0 0 0 4px var(--ex-soft);
  animation: blink 1.6s steps(2, jump-none) infinite;
}
.live-strip[data-state="halted"] .ls-dot {
  background: var(--inhibit);
  box-shadow: 0 0 0 4px var(--in-soft);
}
.live-strip[data-state="idle"] .ls-dot {
  background: var(--chain);
}
.ls-k {
  font: 600 10.5px / 1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--excite);
  flex: none;
}
.ls-line {
  flex: 1 1 auto;
  min-width: 0;
  font: 500 14px / 1.35 var(--sans);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ls-meta {
  flex: none;
  display: inline-flex;
  gap: 4px;
  font: 400 12px / 1.4 var(--mono);
  color: var(--dim);
  white-space: nowrap;
}
.ls-meta .sep {
  margin: 0 6px;
  color: var(--faint);
}
.ls-go {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13.5px / 1 var(--sans);
  color: var(--ink);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--white);
}
.ls-go svg {
  width: 14px;
  height: 14px;
}
.ls-go:hover {
  border-color: var(--ink);
}
.live-strip.pulse-on {
  animation: lsflash 0.9s var(--ease);
}
@keyframes lsflash {
  0% {
    background: rgba(232, 240, 254, 0.95);
  }
  100% {
    background: rgba(255, 255, 255, 0.78);
  }
}
.lab-live {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 1100px) {
  .ls-meta {
    display: none;
  }
}
@media (max-width: 640px) {
  .ls-row {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-block: 10px;
  }
  .ls-line {
    flex-basis: calc(100% - 140px);
    white-space: normal;
    font-size: 13.5px;
  }
  .ls-go {
    padding: 6px 9px;
    font-size: 13px;
  }
}

/* Notebook #001: the chart shares its column with "Ask the record" (lib/ask-card.ts). In two
   columns the card grows to the findings' height and its answers fill what is left, so neither
   column ends in empty paper; the answers stack in one cell, so switching never moves the page. */
.nb-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nb-ask {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}
.nar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.nar-src {
  font: 400 11.5px / 1.3 var(--mono);
  color: var(--dim);
}
.nb-ask-q {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nb-ask-q button {
  position: relative;
  overflow: hidden;
  font: 500 13px / 1 var(--sans);
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    background-color 0.2s;
}
.nb-ask-q button:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.nb-ask-q button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
/* While the card cycles by itself, the chosen chip fills like a timer. */
.nb-ask-q button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--excite);
  transform: scaleX(0);
  transform-origin: left;
}
.nb-ask[data-cycling] .nb-ask-q button[aria-pressed="true"]::after {
  animation: nar-timer 7s linear forwards;
}
@keyframes nar-timer {
  to {
    transform: scaleX(1);
  }
}
.nar-out {
  display: grid;
  position: relative;
}
.nar-a {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0s linear 0.3s;
}
.nar-a[data-on] {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity 0.3s ease 0.08s,
    transform 0.3s ease 0.08s,
    visibility 0s;
}
.nar-ans {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}
.nar-ans a {
  color: var(--excite);
}
/* One grid per answer, rows on a subgrid: the verdict column is as wide as its widest chip and
   the names line up. */
.nar-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
}
.nar-rows li {
  display: contents;
}
.nar-rows li[hidden] {
  display: none;
}
.nar-rows a {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-areas: "v n e" "v m e";
  align-items: center;
  column-gap: 12px;
  row-gap: 3px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.nar-rows .vchip {
  grid-area: v;
  justify-self: start;
}
.nar-rows b {
  grid-area: n;
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nar-rows small {
  grid-area: m;
  font: 400 11.5px / 1.3 var(--mono);
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nar-rows a:hover b {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nar-fx {
  grid-area: e;
  justify-self: end;
  font: 400 22px / 1 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.nar-fx[data-v="excites"] {
  color: var(--excite);
}
.nar-fx[data-v="inhibits"] {
  color: var(--inhibit);
}
.nar-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 10px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--dim);
  font: 400 15px / 1 var(--sans);
  text-align: left;
  cursor: text;
  transition: border-color 0.2s;
}
.nar-bar:hover {
  border-color: var(--ink);
}
.nar-bar svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.nar-bar span {
  flex: 1;
}
.nar-bar kbd {
  font: 500 12px / 1 var(--mono);
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--white);
  color: var(--dim);
}
@media (min-width: 1001px) {
  .nb-split {
    align-items: stretch;
  }
  .nb-side .nb-ask {
    flex: 1 1 auto;
  }
  /* The answers take whatever height is left and never push the column past the findings.
     /js/ask.js then shows whole rows only (data-fit); without it, the last row fades out. */
  .nar-out {
    flex: 1 1 0;
    min-height: 0;
    contain: size;
    overflow: hidden;
  }
  .nb-ask:not([data-fit]) .nar-out {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  }
  .nar-bar {
    margin-top: auto;
  }
}
@media (hover: none), (max-width: 640px) {
  .nar-bar kbd {
    display: none;
  }
}
@media (max-width: 480px) {
  .nar-rows {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .nar-rows a {
    grid-template-areas: "v e" "n e" "m e";
  }
  .nar-rows b,
  .nar-rows small {
    white-space: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nar-a,
  .nar-a[data-on] {
    transition: none;
    transform: none;
  }
}

/* ---------- app shell ---------- */
.app {
  min-height: 100svh;
  position: relative;
  z-index: 1;
}
.app-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 246, 242, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-nav .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}
.app-nav .logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.app-nav .logo svg {
  width: 26px;
  height: 26px;
}
.app-nav .logo span {
  font: 600 19px / 1 var(--sans);
  letter-spacing: 0.02em;
}
.app-links {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}
.app-links a {
  font: 500 14.5px / 1 var(--sans);
  color: var(--ink-2);
  text-decoration: none;
  padding: 9px 11px;
  border-radius: 8px;
}
.app-links a[aria-current="page"],
.app-links a:hover {
  color: var(--ink);
  background: rgba(14, 19, 22, 0.06);
}
.app-nav .btn {
  margin-left: auto;
  padding: 10px 14px;
  font-size: 14px;
}
.app-head {
  padding: 40px 0 22px;
}
.app-head .eyebrow {
  margin-bottom: 14px;
}
.app-head h1 {
  font-size: clamp(34px, 25.3px + 2.2vw, 56px);
}
.app-head .sub {
  margin-top: 10px;
  max-width: 70ch;
}
@media (max-width: 760px) {
  .app-links {
    display: none;
  }
}

/* ---------- /lab HUD ---------- */
.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding-bottom: 60px;
  align-items: start;
}
.side {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.panel > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font: 500 10.5px / 1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.panel > header b {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.panel > header .cd {
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
  color: var(--eyespot);
}
.panel > header .st[data-s="awaiting_beacon"] {
  color: var(--eyespot);
}
.panel > header .st {
  white-space: nowrap;
}
.panel > header .st[data-s="running"] {
  color: var(--excite);
}
.panel > header .st[data-s="published"] {
  color: var(--chain);
}
.panel > header .r {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
}
.panel-body {
  padding: 14px 16px;
}
.cyc-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cyc-meta div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.cyc-meta dt {
  font: 500 10px / 1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.cyc-meta dd {
  margin: 0;
  font: 500 13px / 1.3 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.cyc-meta a {
  color: inherit;
}
.look {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.look-bar {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.look-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e3e3db;
}
.look-bar i.on {
  background: var(--excite);
}
.look-bar i.mark {
  box-shadow: 0 0 0 1.5px var(--ink-2);
}
.look-l {
  margin-top: 8px;
  font: 400 12px / 1.4 var(--mono);
  color: var(--dim);
}
.hud-arm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px 184px;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.hud-arm:last-child {
  border-bottom: 0;
}
.arm-l {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.arm-l b {
  font: 500 14.5px / 1.25 var(--sans);
}
.arm-l span {
  font: 400 11.5px / 1.35 var(--mono);
  color: var(--dim);
}
.hud-arm.ctrl {
  background: linear-gradient(90deg, rgba(14, 19, 22, 0.025), transparent 70%);
}
.arm-prog {
  display: grid;
  gap: 6px;
}
.arm-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.arm-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e3e3db;
}
.arm-dots i.d {
  background: var(--ink-2);
}
.arm-dots i.x {
  background: var(--excite);
}
.arm-r {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.pred {
  font: 400 11px / 1.2 var(--mono);
  color: var(--alga);
  white-space: nowrap;
}
.callbtns {
  display: inline-flex;
  gap: 3px;
  margin: 0;
  min-width: 0;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.callbtns button {
  font: 500 11.5px / 1 var(--sans);
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.callbtns button:hover:not(:disabled) {
  background: var(--white);
  border-color: var(--line);
}
.callbtns button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.callbtns button:disabled {
  cursor: default;
  opacity: 0.55;
}
.qlist li,
.vlist li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.qlist li:last-child,
.vlist li:last-child {
  border-bottom: 0;
}
.qlist .n {
  font: 500 12px / 1 var(--mono);
  color: var(--dim);
}
.qlist .lbl,
.vlist .lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qlist .s {
  font: 400 11px / 1 var(--mono);
  color: var(--dim);
}
.vlist a {
  color: inherit;
  text-decoration: none;
  display: contents;
}
.empty {
  padding: 16px;
  font-size: 14px;
  color: var(--dim);
}
.gauge {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin: 6px 0 8px;
}
.gauge i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e3e3db;
}
.gauge i.on {
  background: var(--eyespot);
}
.gauge-l {
  font: 400 12.5px / 1.4 var(--mono);
  color: var(--ink-2);
}
.halt {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--in-soft);
  color: var(--inhibit);
  font: 500 13px / 1.4 var(--sans);
}
.log {
  max-height: 400px;
  overflow: auto;
  overscroll-behavior: contain;
}
.log li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}
.log li.fresh {
  animation: logfresh 1.2s var(--ease);
}
@keyframes logfresh {
  from {
    background: var(--ex-soft);
  }
  to {
    background: transparent;
  }
}
.log time {
  font: 400 11.5px / 1.6 var(--mono);
  color: var(--faint);
}
.log b {
  color: var(--ink);
  font-weight: 600;
}
.log .k {
  font: 600 10px / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 6px;
}
.lab-foot {
  margin-top: 10px;
  font: 400 12px / 1.5 var(--mono);
  color: var(--dim);
  overflow-wrap: anywhere;
}
.lab-foot a {
  color: inherit;
  white-space: nowrap;
}
.rs-p .safety {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.call-note {
  margin: 0;
  padding: 0 16px 14px;
}
.pause {
  margin-left: 8px;
  font: 500 11px / 1 var(--mono);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--white);
  cursor: pointer;
}
@media (max-width: 1100px) {
  .hud {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .side {
    grid-template-columns: minmax(0, 1fr);
  }
  .cyc-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hud-arm {
    grid-template-columns: minmax(0, 1fr);
  }
  .arm-r {
    justify-content: flex-start;
  }
}

/* ---------- forms (/propose) ---------- */
.form {
  display: grid;
  gap: 18px;
  max-width: 760px;
  padding-bottom: 72px;
}
.fld {
  display: grid;
  gap: 8px;
}
.fld > label,
.choices > legend {
  font: 500 10.5px / 1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.fld textarea,
.fld input[type="text"],
.fld select {
  width: 100%;
  font: 400 15px / 1.45 var(--mono);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 11px 12px;
}
.fld textarea {
  min-height: 120px;
  resize: vertical;
}
.fld textarea:focus,
.fld input:focus,
.fld select:focus {
  outline: none;
  border-color: var(--excite);
  box-shadow: 0 0 0 3px rgba(31, 111, 229, 0.15);
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.choices > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 4px;
}
.choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 14px / 1 var(--sans);
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--white);
  cursor: pointer;
}
.choices input {
  accent-color: var(--ink);
}
.choices label:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.hint {
  font-size: 13.5px;
  color: var(--dim);
  line-height: 1.5;
}
.result {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 15px;
  line-height: 1.5;
}
.result.ok {
  border-color: rgba(19, 138, 125, 0.5);
  background: var(--chain-soft);
}
.result.err {
  border-color: rgba(217, 130, 0, 0.5);
  background: var(--in-soft);
}

/* ---------- notebook pages ---------- */
.nb-page {
  padding-bottom: 80px;
}
.nb-summary {
  margin-top: 14px;
  max-width: 70ch;
  font: 400 clamp(19px, 16.6px + 0.6vw, 23px) / 1.45 var(--serif);
  color: var(--ink);
}
.rs-json {
  font: 400 11px / 1.3 var(--mono);
  color: var(--dim);
}
.rs-e small {
  display: block;
  margin-top: 3px;
  font: 400 10.5px / 1 var(--mono);
  color: var(--dim);
  white-space: nowrap;
}
.nb-foot {
  margin-top: 16px;
  max-width: 80ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--dim);
}
.nb-page .results {
  margin-top: 18px;
}
.nb-page .rs-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) 100px 72px 80px;
}
.receipts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.receipt {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  display: grid;
  gap: 6px;
  min-width: 0;
}
.receipt dt {
  font: 500 10px / 1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.receipt dd {
  margin: 0;
  font: 400 12.5px / 1.45 var(--mono);
  overflow-wrap: anywhere;
  color: var(--ink);
}
.callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--white);
}
.callout.warn {
  background: var(--in-soft);
  border-color: rgba(217, 130, 0, 0.45);
}
.safety {
  font: 400 11.5px / 1.3 var(--mono);
  color: var(--dim);
}
@media (max-width: 1000px) {
  .receipts {
    grid-template-columns: minmax(0, 1fr);
  }
  .nb-page .rs-row {
    grid-template-columns: minmax(0, 1fr) 96px 64px;
  }
  .nb-page .rs-row .dots {
    grid-column: 1 / -1;
  }
}

/* ---------- docs (/agents) ---------- */
.docs {
  display: grid;
  gap: 18px;
  padding-bottom: 80px;
  max-width: 900px;
}
.docs h2 {
  font-size: clamp(26px, 21px + 1vw, 34px);
  margin-top: 14px;
}
.docs p {
  color: var(--ink-2);
  line-height: 1.6;
}
.docs pre {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0f1518;
  color: #dbe3e4;
  font: 400 12.5px / 1.65 var(--mono);
  overflow-x: auto;
}
.docs code {
  font-family: var(--mono);
}

/* ---------- landing header pulse: the lab's state, live (replaces the artifact's simulated count) ---------- */
a.pulse {
  text-decoration: none;
}
a.pulse:hover b {
  text-decoration: underline;
}
.pulse[data-state="running"] i {
  background: var(--excite);
  box-shadow: 0 0 0 3px var(--ex-soft);
}
.pulse[data-state="halted"] i {
  background: var(--inhibit);
  box-shadow: 0 0 0 3px var(--in-soft);
  animation: none;
}
.pulse[data-state="offline"] i {
  background: var(--faint);
  box-shadow: none;
  animation: none;
}

/* ---------- /agents: on-chain requests ---------- */
.vlog {
  display: grid;
  gap: 6px;
  font: 400 13px / 1.5 var(--mono);
  color: var(--ink-2);
}

/* ---------- landing header: live chip, Ask OPSIN, a CTA that follows the lab ---------- */
.nav .pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
}
.nav .pulse:hover {
  border-color: var(--ink);
}
.pulse .ring {
  width: 18px;
  height: 18px;
  flex: none;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 2.2;
}
.ring-fg {
  fill: none;
  stroke: var(--excite);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease);
}
.ring-dot {
  fill: var(--chain);
}
.pulse[data-state="running"] .ring-dot {
  fill: var(--excite);
}
.pulse[data-state="halted"] .ring-dot {
  fill: var(--inhibit);
}
.pulse[data-state="offline"] .ring-dot {
  fill: var(--faint);
}
.pulse[data-deadline] .ring-dot {
  fill: var(--eyespot);
  animation: blink 1.6s steps(2, jump-none) infinite;
}
.pulse [data-live="pulse-v"] {
  font-variant-numeric: tabular-nums;
}
.ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--white);
  color: var(--ink-2);
  font: 500 13.5px / 1 var(--sans);
  cursor: pointer;
  flex: none;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.ask-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.ask-btn kbd {
  font: 500 11px / 1 var(--mono);
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--dim);
}
.ask-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.nav .nav-cta[data-tone="call"] {
  background: var(--eyespot);
  border-color: var(--eyespot);
}
.nav .nav-cta [data-live="cta-label"] {
  font-variant-numeric: tabular-nums;
}
.app-nav .ask-btn {
  margin-left: auto;
}
.app-nav .ask-btn + .btn {
  margin-left: 0;
}
@media (max-width: 900px) {
  .nav .pulse {
    max-width: 150px;
  }
  .nav .pulse span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 900px) {
  .ask-btn span,
  .ask-btn kbd {
    display: none;
  }
  .ask-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .nav .ask-btn {
    margin-left: auto;
  }
  .nav .nav-cta {
    margin-left: 0;
  }
}
@media (max-width: 420px) {
  .nav .pulse b {
    font-size: 11px;
  }
  .nav-row {
    gap: 10px;
  }
  .nav .nav-cta {
    padding: 10px 12px;
    font-size: 13.5px;
  }
}

/* ---------- Ask OPSIN: a palette over the signed record ---------- */
dialog.ask {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(720px, calc(100vw - 24px));
  max-width: none;
  max-height: min(80vh, 720px);
  margin: 10vh auto auto;
  overflow: visible;
}
dialog.ask::backdrop {
  background: rgba(14, 19, 22, 0.32);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.ask-box {
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 720px);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(14, 19, 22, 0.25);
  overflow: hidden;
}
.ask-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.ask-row svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
  flex: none;
}
.ask-in {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 19px / 1.3 var(--sans);
  color: var(--ink);
}
.ask-row kbd {
  font: 500 11px / 1 var(--mono);
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--dim);
}
.ask-ans {
  padding: 14px 18px 4px;
  font: 400 17.5px / 1.45 var(--serif);
  color: var(--ink);
}
.ask-list {
  overflow: auto;
  padding: 6px 8px 8px;
  overscroll-behavior: contain;
}
.ask-item a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.ask-item b {
  font: 500 15px / 1.3 var(--sans);
}
.ask-meta {
  grid-column: 2 / -1;
  font: 400 12px / 1.45 var(--mono);
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-eff {
  font: 500 14px / 1 var(--mono);
  font-variant-numeric: tabular-nums;
}
.ask-item[aria-selected="true"] a,
.ask-item a:hover {
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.ask-act a {
  grid-template-columns: 1fr;
  color: var(--excite);
  font: 500 14.5px / 1.3 var(--sans);
}
.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px 12px;
}
.ask-chip {
  font: 500 13px / 1 var(--sans);
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--white);
  color: var(--ink-2);
  cursor: pointer;
}
.ask-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.ask-foot {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--line);
  font: 400 12px / 1.4 var(--mono);
  color: var(--dim);
}
.ask-foot a {
  color: inherit;
}
html.ask-open {
  overflow: hidden;
}

/* ---------- OPSIN narrates: one toast per lab event ---------- */
.narrator {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  gap: 4px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 21, 24, 0.94);
  color: #e8eef0;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
}
.narrator.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.nr-k {
  font: 600 10.5px / 1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fe3d8;
}
.nr-t {
  font: 400 14px / 1.4 var(--sans);
}
@media (prefers-reduced-motion: reduce) {
  .narrator {
    transition: none;
    transform: none;
  }
}

/* ---------- What OPSIN found ---------- */
.findings {
  padding: 72px 0 32px;
}
.fd-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: end;
}
.fd-head h2 {
  font-size: clamp(34px, 24px + 2.4vw, 56px);
  line-height: 1.02;
}
.fd-head .sub {
  max-width: 52ch;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--excite);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.fd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.fd {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s;
}
.fd:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}
.fd-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.fd-nb {
  font: 400 11.5px / 1.2 var(--mono);
  color: var(--dim);
  text-align: right;
}
.fd-name {
  font: 500 17px / 1.25 var(--sans);
}
.fd-q {
  font: italic 400 15px / 1.45 var(--serif);
  color: var(--ink-2);
}
.fd-eff b {
  display: block;
  font: 400 44px / 1 var(--serif);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.fd[data-v="excites"] .fd-eff b {
  color: var(--excite);
}
.fd[data-v="inhibits"] .fd-eff b {
  color: var(--inhibit);
}
.fd[data-v="inhibits"] .dots i.on {
  --c: var(--inhibit);
}
.fd-eff small {
  display: block;
  margin-top: 6px;
  font: 400 11.5px / 1.35 var(--mono);
  color: var(--dim);
}
@media (max-width: 1000px) {
  .fd-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .fd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .findings {
    padding: 52px 0 20px;
  }
  .fd-grid {
    display: flex;
    gap: 12px;
    margin: 22px calc(-1 * var(--gut)) 0;
    padding: 0 var(--gut) 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .fd-grid > li {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }
}

/* header refinements: the CTA has a short form; the chip keeps its words on phones */
.nav .nav-cta .cta-s {
  display: none;
}
.fd-d {
  font: 400 12.5px / 1.45 var(--mono);
  color: var(--dim);
}
.ask-in::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
@media (max-width: 640px) {
  .nav .nav-cta .cta-l {
    display: none;
  }
  .nav .nav-cta .cta-s {
    display: inline;
  }
}

/* ---------- phones: long card stacks become swipeable rows (the page was ~30 screens tall) ---------- */
@media (max-width: 640px) {
  .unlocks {
    display: flex;
    gap: 12px;
    margin: 28px calc(-1 * var(--gut)) 0;
    padding: 0 var(--gut) 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .unlocks > li {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
  .loop {
    display: flex;
    gap: 16px;
    margin-left: calc(-1 * var(--gut));
    margin-right: calc(-1 * var(--gut));
    padding: 0 var(--gut) 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .loop > li {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }
  .unlocks::-webkit-scrollbar,
  .loop::-webkit-scrollbar,
  .fd-grid::-webkit-scrollbar {
    display: none;
  }
}

/* ---------- chapters: a rail on wide screens, a button and a sheet on phones ---------- */
.ch-rail {
  position: fixed;
  right: 14px;
  top: 50%;
  z-index: 40;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
html[data-past-top] .ch-rail {
  opacity: 1;
  pointer-events: auto;
}
.ch-dot {
  position: relative;
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
  transition:
    background-color 0.25s,
    transform 0.25s var(--ease);
}
.ch-dot span {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font: 500 12px / 1 var(--sans);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.ch-dot:hover span,
.ch-dot:focus-visible span {
  opacity: 1;
}
.ch-dot[aria-current] {
  background: var(--excite);
  transform: scale(1.35);
}
.ch-rail.flash .ch-dot[aria-current] span {
  opacity: 1;
}
.ch-rail:hover .ch-dot[aria-current]:not(:hover) span {
  opacity: 0;
}
.ch-btn {
  display: none;
}
.ch-sheet {
  border: 0;
  padding: 8px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(78vh, 640px);
  margin: auto auto 16px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(14, 19, 22, 0.3);
}
.ch-sheet::backdrop {
  background: rgba(14, 19, 22, 0.3);
}
.ch-sheet ol {
  display: grid;
}
.ch-sheet button {
  display: flex;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 12px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  font: 500 16px / 1.2 var(--sans);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.ch-sheet li[data-on] button {
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.ch-n {
  font: 500 11.5px / 1 var(--mono);
  color: var(--dim);
}
@media (max-width: 1100px) {
  .ch-rail {
    display: none;
  }
  .ch-btn {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font: 500 12.5px / 1 var(--mono);
    color: var(--ink);
    box-shadow: 0 10px 24px -12px rgba(14, 19, 22, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }
  html[data-past-top] .ch-btn {
    opacity: 1;
    pointer-events: auto;
  }
  .narrator {
    bottom: 64px;
  }
}

/* "How it works" cards: `.step` is a grid with no explicit column, so its implicit column took the
   width of its widest child (1,020 px at tablet widths) and the first card ran off the screen. */
.step {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.step .fig {
  min-width: 0;
  overflow: hidden;
}

/* Header at laptop and tablet widths: labels never wrap onto two lines. Ask collapses to its icon
   below 1240 px; below 1180 px the section links give way (the chapters button navigates there). */
.nav .links a,
.nav .nav-cta {
  white-space: nowrap;
}
@media (max-width: 1240px) {
  .nav .ask-btn span,
  .nav .ask-btn kbd {
    display: none;
  }
  .nav .ask-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
}
@media (max-width: 1180px) {
  .nav .links {
    display: none;
  }
  .nav .ask-btn {
    margin-left: auto;
  }
}

/* Phones: carousels snap to the gutter, not the screen edge; the CTA drops its arrow so the live
   chip keeps its words. */
@media (max-width: 640px) {
  .fd-grid,
  .unlocks,
  .loop {
    scroll-padding-inline: var(--gut);
  }
}
@media (max-width: 420px) {
  .nav .nav-cta svg {
    display: none;
  }
  .nav .pulse {
    max-width: 140px;
    padding-right: 8px;
  }
}

/* /agents: long code lines scroll inside their block; they never widen the page. */
.docs {
  grid-template-columns: minmax(0, 1fr);
}
.docs pre {
  max-width: 100%;
}
.docs p {
  overflow-wrap: anywhere;
}

/* Hero at laptop widths: a narrower replay card, so it no longer covers the visual's labels. */
@media (max-width: 1240px) and (min-width: 1001px) {
  .hero-vis .trial {
    width: 280px;
    padding: 14px 14px 12px;
  }
}
