:root {
  color-scheme: light;
  --ink: #162126;
  --ink-2: #415157;
  --muted: #718087;
  --line: #d4dde0;
  --line-strong: #afbec3;
  --paper: #f1f5f5;
  --surface: #ffffff;
  --surface-2: #eaf0f1;
  --cyan: #058e99;
  --cyan-dark: #08737c;
  --cyan-pale: #e1f3f4;
  --amber: #b66d00;
  --amber-pale: #fff2d8;
  --green: #11805a;
  --green-pale: #e4f4ec;
  --red: #bd4038;
  --red-pale: #fae8e6;
  --night: #0e171b;
  --night-2: #162227;
  --night-line: #304148;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: Bahnschrift, "DIN Alternate", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #09a5af;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.app-shell {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 120px;
  width: 100vw;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(300px, auto) minmax(230px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-strong);
  background: #f9fbfb;
}

.brand,
.top-target,
.top-status,
.agent-presence,
.mission-console,
.pane-header,
.inspector-header,
.hwpod-header,
.scope-panel header,
.evidence-heading {
  display: flex;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: var(--ink);
  color: white;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.brand > strong {
  margin-left: 9px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.brand-rule {
  width: 1px;
  height: 16px;
  margin: 0 11px;
  background: var(--line-strong);
}

.brand-caption {
  color: var(--ink-2);
  font-size: 11px;
  white-space: nowrap;
}

.top-target {
  min-width: 0;
  gap: 9px;
}

.top-target span {
  color: #718087;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.top-target strong {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-status {
  justify-content: flex-end;
  gap: 7px;
}

.top-status span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  color: #56666c;
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.top-status i,
.hardware-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.top-status span:nth-child(2) i {
  background: var(--amber);
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(680px, 1fr) minmax(330px, 365px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.context-rail,
.agent-stage,
.hwpod-stage {
  min-width: 0;
  min-height: 0;
}

.context-rail {
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  border-right: 1px solid var(--line);
  background: #f7f9f9;
}

.project-heading {
  position: relative;
  padding: 0 8px 13px;
  border-bottom: 1px solid var(--line);
}

.project-name h2 {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.project-name p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 11px;
}

.project-monogram {
  display: none;
}

.active-task {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  margin-top: 12px;
  padding: 10px 8px;
  border: 1px solid #94c7ca;
  border-left: 3px solid var(--cyan);
  background: var(--cyan-pale);
}

.task-index {
  display: grid;
  height: 26px;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan-dark);
  font-family: var(--mono);
  font-size: 8px;
}

.active-task h3 {
  margin: 4px 0 5px;
  font-size: 11px;
  line-height: 1.35;
}

.active-task p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #6f5b32;
  font-size: 8px;
}

.active-task p i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.brief-block {
  padding: 15px 8px;
  border-bottom: 1px solid var(--line);
}

.brief-block p {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.55;
}

.bound-context {
  margin-top: auto;
  padding: 14px 8px 12px;
  border-top: 1px solid var(--line);
}

.bound-context dl {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
}

.bound-context dt {
  color: #829096;
  font-family: var(--mono);
  font-size: 7px;
}

.bound-context dd {
  overflow: hidden;
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-boundary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 8px 0;
  border-top: 1px solid var(--line);
}

.boundary-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--cyan-dark);
}

.control-boundary p {
  margin: 4px 0 0;
  color: #6c7a80;
  font-size: 8px;
  line-height: 1.4;
}

.agent-stage {
  display: grid;
  grid-template-rows: 48px 54px 74px minmax(0, 1fr);
  padding: 0 12px 9px;
  background: var(--paper);
}

.agent-presence {
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.agent-avatar {
  position: relative;
  display: grid;
  flex: 0 0 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #98f0f1;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.agent-avatar i {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--green);
}

.agent-identity {
  min-width: 0;
}

.agent-identity h1 {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.03em;
}

.agent-identity h1 small {
  margin-left: 5px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.session-identity {
  display: grid;
  gap: 2px;
  margin-left: auto;
  text-align: right;
}

.session-identity span {
  color: #7a898e;
  font-family: var(--mono);
  font-size: 7px;
}

.session-identity strong {
  font-family: var(--mono);
  font-size: 8px;
}

.agent-state {
  margin-left: 8px;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-size: 8px;
  white-space: nowrap;
}

.app-shell[data-run-state="running"] .agent-state {
  border-color: #dfb66f;
  background: var(--amber-pale);
  color: #8d5300;
}

.app-shell[data-run-state="passed"] .agent-state {
  border-color: #86c3a9;
  background: var(--green-pale);
  color: #0e704c;
}

.app-shell[data-run-state="failed"] .agent-state {
  border-color: #dda09b;
  background: var(--red-pale);
  color: #9c302a;
}

.mission-console {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 32px auto;
  gap: 7px;
  align-items: center;
  padding: 7px 0;
}

.mission-command {
  display: grid;
  min-width: 0;
  height: 40px;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.prompt-glyph {
  display: grid;
  height: 100%;
  place-items: center;
  background: var(--ink);
  color: #88ebed;
  font-family: var(--mono);
  font-size: 11px;
}

.mission-command div {
  min-width: 0;
}

.mission-command div span {
  display: block;
  color: #7a898e;
  font-family: var(--mono);
  font-size: 7px;
}

.mission-command div strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.failure-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #65757b;
  font-size: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.failure-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  display: flex;
  width: 26px;
  height: 14px;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #e7edef;
}

.switch-track i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7b8a8f;
  transition: transform 140ms ease, background 140ms ease;
}

.failure-switch input:checked + .switch-track {
  border-color: var(--red);
  background: var(--red-pale);
}

.failure-switch input:checked + .switch-track i {
  transform: translateX(12px);
  background: var(--red);
}

.reset-button,
.run-button,
#saveCaseButton {
  height: 32px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
}

.reset-button {
  width: 32px;
  color: var(--ink-2);
  font-size: 15px;
}

.run-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-color: var(--cyan-dark);
  background: var(--cyan-dark);
  color: white;
  font-size: 9px;
  font-weight: 700;
}

.run-button:hover:not(:disabled) {
  background: #075f66;
}

.run-button:disabled,
#saveCaseButton:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.decision-board {
  display: grid;
  grid-template-columns: 1.05fr 1.35fr 1fr 1fr;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.decision-board article {
  position: relative;
  min-width: 0;
  padding: 9px 10px 7px;
  border-left: 1px solid var(--line);
}

.decision-board article:first-child {
  border-left: 0;
}

.decision-board article::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #c5d0d3;
  content: "";
}

.decision-board article:nth-child(2)::after {
  background: var(--amber);
}

.decision-board article span {
  color: #7a898e;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.decision-board article p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.confidence {
  display: grid;
  height: 8px;
  grid-template-columns: minmax(30px, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.confidence::before {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 2px;
  background: #d9e0e2;
  content: "";
}

.confidence i {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  width: 42%;
  height: 2px;
  background: var(--amber);
  transition: width 240ms ease, background 240ms ease;
}

.confidence small {
  color: #80612c;
  font-family: var(--mono);
  font-size: 7px;
}

.workflow-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.workflow-canvas-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 40px minmax(0, 1fr) 27px;
  border-right: 1px solid var(--line);
}

.workflow-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.workflow-toolbar > div:first-child {
  min-width: 0;
}

.workflow-toolbar h2 {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-runtime {
  display: grid;
  gap: 2px;
  margin-left: auto;
  text-align: right;
}

.graph-runtime span,
.graph-runtime strong {
  font-family: var(--mono);
  font-size: 7px;
}

.graph-runtime span {
  color: #7b898e;
}

.graph-runtime strong {
  color: var(--cyan-dark);
}

.canvas-controls {
  display: flex;
  height: 25px;
  border: 1px solid var(--line-strong);
}

.canvas-controls button {
  min-width: 27px;
  padding: 0 6px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: #53646a;
  font-family: var(--mono);
  font-size: 8px;
  cursor: pointer;
}

.canvas-controls button:first-child {
  border-left: 0;
}

.canvas-controls button:hover {
  background: var(--cyan-pale);
  color: var(--cyan-dark);
}

.workflow-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #f6f9f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='1' cy='1' r='0.7' fill='%23bfcbce'/%3E%3C/svg%3E");
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.workflow-viewport.is-dragging {
  cursor: grabbing;
}

.workflow-board {
  position: absolute;
  top: 0;
  left: 0;
  width: 840px;
  height: 375px;
  transform-origin: 0 0;
  will-change: transform;
}

.workflow-edges,
.workflow-nodes {
  position: absolute;
  inset: 0;
  width: 840px;
  height: 375px;
}

.flow-edge {
  fill: none;
  stroke: #aebbc0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transition: stroke 160ms ease, opacity 160ms ease, stroke-width 160ms ease;
}

.flow-edge[data-status="active"] {
  stroke: var(--amber);
  stroke-dasharray: 6 5;
  stroke-width: 2.3;
  animation: edge-flow 650ms linear infinite;
}

.flow-edge[data-status="passed"] {
  stroke: var(--green);
  stroke-width: 2;
}

.flow-edge[data-status="failed"],
.flow-edge[data-status="blocked"] {
  stroke: var(--red);
  stroke-width: 2.3;
}

.flow-edge[data-status="skipped"] {
  stroke: #aeb8bc;
  stroke-dasharray: 3 5;
  opacity: 0.32;
}

.flow-edge.is-loop {
  stroke: var(--cyan);
  stroke-dasharray: 5 5;
}

.flow-edge.is-loop[data-status="active"] {
  stroke: var(--cyan);
  animation: edge-flow 650ms linear infinite;
}

@keyframes edge-flow {
  to { stroke-dashoffset: -22; }
}

.edge-label {
  fill: #77878c;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  paint-order: stroke;
  stroke: #f6f9f9;
  stroke-width: 3px;
}

.edge-label.is-pass {
  fill: var(--green);
}

.edge-label.is-fail {
  fill: var(--red);
}

.edge-label.is-loop {
  fill: var(--cyan-dark);
}

.workflow-nodes {
  pointer-events: none;
}

.flow-node {
  position: absolute;
  display: grid;
  width: 120px;
  height: 56px;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: 20px 17px 13px;
  gap: 0 6px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 2px 6px rgb(29 52 59 / 7%);
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.flow-node::before,
.flow-node::after {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border: 1px solid #8fa0a6;
  border-radius: 50%;
  background: #f8fbfb;
  content: "";
}

.flow-node::before {
  left: -4px;
}

.flow-node::after {
  right: -4px;
}

.node-icon {
  display: grid;
  grid-row: 1 / 4;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
}

.node-topline {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: #78878d;
  font-family: var(--mono);
  font-size: 6px;
}

.node-topline span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-state {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border: 1px solid #9eacb1;
  border-radius: 50%;
  background: white;
}

.node-title,
.node-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-title {
  font-size: 8px;
  font-weight: 750;
}

.node-summary {
  color: #6f7e83;
  font-size: 6px;
}

.flow-node.node-agent {
  border-color: #85bdc1;
}

.flow-node.node-agent .node-icon {
  border-color: var(--cyan);
  background: var(--cyan-pale);
  color: var(--cyan-dark);
}

.flow-node.node-tool .node-icon {
  background: #26343a;
  color: #d9e6e8;
}

.flow-node.node-hardware {
  border-color: #74959d;
  background: #f2f7f7;
}

.flow-node.node-hardware .node-icon {
  border-color: #294249;
  background: #13262c;
  color: #70e0e2;
}

.flow-node.node-gate {
  border-color: #c49a55;
  background: #fffaf0;
}

.flow-node.node-gate .node-icon {
  transform: rotate(45deg);
  border-color: var(--amber);
  background: var(--amber-pale);
  color: #875000;
}

.flow-node.node-gate .node-icon span {
  transform: rotate(-45deg);
}

.flow-node.node-evidence .node-icon {
  border-color: var(--green);
  background: var(--green-pale);
  color: var(--green);
}

.flow-node:hover,
.flow-node.is-selected {
  transform: translateY(-1px);
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgb(5 142 153 / 12%), 0 5px 12px rgb(24 55 62 / 11%);
}

.flow-node[data-status="active"] {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgb(182 109 0 / 13%), 0 5px 13px rgb(39 44 24 / 13%);
}

.flow-node[data-status="active"] .node-state {
  border-color: var(--amber);
  background: var(--amber);
  animation: agent-pulse 850ms ease-in-out infinite alternate;
}

.flow-node[data-status="passed"] {
  border-color: var(--green);
  box-shadow: inset 0 -2px 0 var(--green);
}

.flow-node[data-status="passed"] .node-state {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 1px white;
}

.flow-node[data-status="failed"],
.flow-node[data-status="blocked"] {
  border-color: var(--red);
  background: var(--red-pale);
  box-shadow: inset 0 -2px 0 var(--red);
}

.flow-node[data-status="failed"] .node-state,
.flow-node[data-status="blocked"] .node-state {
  border-color: var(--red);
  background: var(--red);
}

.flow-node[data-status="skipped"] {
  opacity: 0.34;
  border-style: dashed;
  box-shadow: none;
}

.canvas-legend {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #f8fafa;
}

.canvas-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #5f6f75;
  font-size: 6px;
  white-space: nowrap;
}

.canvas-legend i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  background: white;
}

.canvas-legend .legend-agent { border-color: var(--cyan); background: var(--cyan-pale); }
.canvas-legend .legend-tool { border-color: #26343a; background: #26343a; }
.canvas-legend .legend-hardware { border-color: #294249; background: #163039; }
.canvas-legend .legend-gate { transform: rotate(45deg); border-color: var(--amber); background: var(--amber-pale); }
.canvas-legend .legend-loop { width: 13px; height: 0; border: 0; border-top: 1px dashed var(--cyan); }

.canvas-legend small {
  margin-left: auto;
  overflow: hidden;
  color: #849298;
  font-family: var(--mono);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-inspector {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 39px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
}

.node-inspector .inspector-view {
  min-height: 0;
}

.agent-loop {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  padding: 5px 0;
}

.agent-loop::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 4%;
  left: 4%;
  height: 1px;
  background: #c4cfd2;
  content: "";
}

.agent-loop button {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  height: 33px;
  grid-template-columns: 20px minmax(0, auto);
  grid-template-rows: 15px 11px;
  align-items: center;
  justify-content: center;
  column-gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  background: #f8fafa;
  cursor: pointer;
}

.agent-loop button i {
  display: grid;
  grid-row: 1 / 3;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: #718087;
  font-family: var(--mono);
  font-size: 6px;
  font-style: normal;
}

.agent-loop button span {
  overflow: hidden;
  font-size: 8px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-loop button small {
  overflow: hidden;
  color: #87949a;
  font-family: var(--mono);
  font-size: 6px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-loop button[data-status="active"] {
  border-color: #d6a853;
  background: var(--amber-pale);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.agent-loop button[data-status="active"] i {
  border-color: var(--amber);
  background: var(--amber);
  color: white;
  animation: agent-pulse 850ms ease-in-out infinite alternate;
}

.agent-loop button[data-status="passed"] {
  border-color: #92c8b1;
  background: var(--green-pale);
}

.agent-loop button[data-status="passed"] i {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.agent-loop button[data-status="failed"] {
  border-color: #dda09b;
  background: var(--red-pale);
}

.agent-loop button[data-status="failed"] i {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

@keyframes agent-pulse {
  from { box-shadow: 0 0 0 0 rgb(182 109 0 / 10%); }
  to { box-shadow: 0 0 0 4px rgb(182 109 0 / 15%); }
}

.agent-workbench {
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(390px, 1.22fr);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.timeline-pane,
.inspector-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 39px minmax(0, 1fr);
}

.timeline-pane {
  border-right: 1px solid var(--line);
  background: #f8fafa;
}

.pane-header,
.inspector-header {
  min-width: 0;
  justify-content: space-between;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.pane-header h2,
.inspector-header h2 {
  margin: 2px 0 0;
  font-size: 10px;
  line-height: 1;
}

.pane-header > span {
  color: #6e7d83;
  font-family: var(--mono);
  font-size: 7px;
}

.agent-timeline {
  min-height: 0;
  margin: 0;
  padding: 8px 7px 16px 9px;
  overflow: auto;
  list-style: none;
}

.timeline-event {
  position: relative;
  padding: 0 0 8px 23px;
  animation: event-enter 220ms ease-out both;
}

.timeline-event:not(:last-child)::before {
  position: absolute;
  top: 18px;
  bottom: -1px;
  left: 8px;
  width: 1px;
  background: #c8d3d6;
  content: "";
}

.timeline-event::after {
  position: absolute;
  top: 9px;
  left: 5px;
  width: 7px;
  height: 7px;
  border: 1px solid #8d9da3;
  border-radius: 50%;
  background: #f8fafa;
  content: "";
}

.timeline-event.is-active::after {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 0 3px rgb(182 109 0 / 12%);
}

.timeline-event.is-passed::after {
  border-color: var(--green);
  background: var(--green);
}

.timeline-event.is-failed::after {
  border-color: var(--red);
  background: var(--red);
}

@keyframes event-enter {
  from { transform: translateY(5px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.timeline-event button {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 7px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.timeline-event button:hover,
.timeline-event button.is-selected {
  border-color: #7fb8bd;
  box-shadow: inset 2px 0 0 var(--cyan);
}

.event-id,
.event-tool,
.event-time {
  font-family: var(--mono);
  font-size: 7px;
}

.event-id {
  color: var(--cyan-dark);
  font-weight: 700;
}

.event-time {
  color: #8b989d;
  text-align: right;
}

.event-title {
  grid-column: 1 / 4;
  overflow: hidden;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-summary {
  grid-column: 1 / 3;
  display: -webkit-box;
  overflow: hidden;
  color: #68777d;
  font-size: 8px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-tool {
  align-self: end;
  padding: 2px 4px;
  border: 1px solid var(--line);
  color: #66767c;
  white-space: nowrap;
}

.inspector-pane {
  position: relative;
}

.inspector-header {
  gap: 8px;
}

.inspector-header > div:first-child {
  min-width: 0;
}

.inspector-tabs {
  display: flex;
  height: 100%;
}

.inspector-tabs button {
  min-width: 45px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #6e7d82;
  font-size: 8px;
  cursor: pointer;
}

.inspector-tabs button.is-active {
  background: var(--surface);
  color: var(--cyan-dark);
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.inspector-view {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.inspector-view[hidden] {
  display: none;
}

.decision-statement {
  padding: 11px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.decision-statement > span {
  color: var(--cyan-dark);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.decision-statement h3 {
  margin: 5px 0 4px;
  font-size: 12px;
  line-height: 1.25;
}

.decision-statement p {
  margin: 0;
  color: #5e6f75;
  font-size: 9px;
  line-height: 1.45;
}

.action-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.action-facts div {
  min-width: 0;
  min-height: 67px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.action-facts div:nth-child(2n) {
  border-right: 0;
}

.action-facts dt {
  color: #7a898f;
  font-family: var(--mono);
  font-size: 7px;
}

.action-facts dd {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.patch-meta,
.tool-call-heading {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  background: #f8fafa;
}

.patch-meta div,
.tool-call-heading div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.patch-meta div span,
.tool-call-heading div span {
  color: #829096;
  font-family: var(--mono);
  font-size: 7px;
}

.patch-meta div strong,
.tool-call-heading div strong {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-score,
#toolStatus {
  padding: 3px 5px;
  border: 1px solid var(--line-strong);
  color: #65757b;
  font-family: var(--mono);
  font-size: 7px;
}

.code-diff {
  min-height: calc(100% - 44px);
  overflow: auto;
  padding: 7px 0 16px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.55;
}

.empty-change {
  display: grid;
  min-height: 150px;
  place-content: center;
  padding: 20px;
  text-align: center;
}

.empty-change span {
  color: #87959a;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.empty-change p {
  max-width: 280px;
  margin: 8px 0 0;
  color: #6d7b80;
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.5;
}

.diff-line {
  display: grid;
  min-width: max-content;
  grid-template-columns: 36px auto;
  padding-right: 10px;
}

.diff-line span {
  padding-right: 8px;
  border-right: 1px solid #e7ecee;
  color: #9ca7ab;
  text-align: right;
  user-select: none;
}

.diff-line code {
  padding-left: 9px;
  white-space: pre;
}

.diff-line.is-remove {
  background: var(--red-pale);
  color: #91342e;
}

.diff-line.is-add {
  background: var(--green-pale);
  color: #126744;
}

.tool-output {
  min-height: calc(100% - 44px);
  margin: 0;
  overflow: auto;
  padding: 11px 12px 18px;
  background: var(--night);
  color: #b9c8cc;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.tool-output span {
  color: #6f838b;
}

.hwpod-stage {
  position: relative;
  display: grid;
  grid-template-rows: 45px 31px minmax(150px, 1fr) auto 45px;
  padding: 0 10px 9px;
  overflow: hidden;
  border-left: 1px solid #29383e;
  background: var(--night);
  color: #edf4f5;
}

.hwpod-header {
  justify-content: space-between;
}

.hwpod-header .section-kicker {
  color: #6d838b;
}

.hwpod-header h2 {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1;
}

.hardware-live {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #63d9a8;
  font-family: var(--mono);
  font-size: 7px;
}

.hardware-live i {
  background: #43c990;
  box-shadow: 0 0 0 3px rgb(67 201 144 / 12%);
}

.agent-link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--night-line);
  border-bottom: 0;
  background: #132027;
  color: #789099;
  font-family: var(--mono);
  font-size: 7px;
}

.agent-link::before {
  position: absolute;
  top: 50%;
  left: -19px;
  width: 18px;
  height: 1px;
  background: #385159;
  content: "";
}

.agent-link strong {
  overflow: hidden;
  color: #b7c7cc;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-link i {
  color: #5acdd2;
  font-style: normal;
}

.app-shell[data-hardware-target]:not([data-hardware-target="none"]) .agent-link {
  border-color: #39757a;
  background: #10282d;
  color: #69dce0;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.app-shell[data-hardware-target]:not([data-hardware-target="none"]) .agent-link::before {
  background: var(--cyan);
  box-shadow: 0 0 7px #35bec5;
}

.bench-view {
  position: relative;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--night-line);
  background: #10191e;
}

.bench-view img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.82) contrast(1.05) brightness(0.72);
  transition: filter 220ms ease;
}

.app-shell[data-hardware-target]:not([data-hardware-target="none"]) .bench-view img {
  filter: saturate(0.92) contrast(1.06) brightness(0.82);
}

.hardware-tag,
.bench-verdict {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid rgb(126 183 189 / 42%);
  background: rgb(10 19 23 / 82%);
  color: #cfe5e7;
  font-family: var(--mono);
  font-size: 6px;
}

.hardware-tag i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #5ad2d6;
}

.hardware-tag--board { top: 13%; left: 4%; }
.hardware-tag--probe { top: 40%; left: 46%; }
.hardware-tag--uart { right: 4%; top: 18%; }
.hardware-tag--ioprobe { right: 4%; bottom: 19%; }

.app-shell[data-hardware-target="board"] [data-device="board"],
.app-shell[data-hardware-target="probe"] [data-device="probe"],
.app-shell[data-hardware-target="uart"] [data-device="uart"],
.app-shell[data-hardware-target="ioprobe"] [data-device="ioprobe"] {
  border-color: #55e4e7;
  background: #07383d;
  color: white;
  box-shadow: 0 0 0 3px rgb(28 198 204 / 18%), 0 0 12px rgb(41 216 220 / 32%);
  animation: hardware-target 700ms ease-in-out infinite alternate;
}

@keyframes hardware-target {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}

.bench-verdict {
  right: 6px;
  bottom: 6px;
  border-color: rgb(224 180 100 / 52%);
  color: #f1c675;
}

.app-shell[data-run-state="passed"] .bench-verdict {
  border-color: rgb(90 215 164 / 56%);
  color: #6cdeb0;
}

.app-shell[data-run-state="failed"] .bench-verdict {
  border-color: rgb(255 124 113 / 58%);
  color: #ff8a82;
}

.scope-panel {
  padding: 8px 9px 7px;
  border-right: 1px solid var(--night-line);
  border-bottom: 1px solid var(--night-line);
  border-left: 1px solid var(--night-line);
  background: var(--night-2);
}

.scope-panel header {
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 7px;
}

.scope-panel header span {
  color: #6f858d;
}

.scope-panel header strong {
  color: #76dadd;
  font-size: 7px;
  font-weight: 600;
}

#scopeCanvas {
  display: block;
  width: 100%;
  height: 55px;
  margin: 6px 0 7px;
  border: 1px solid #2d4047;
  background: #0b1418;
}

.measurements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.measurements div {
  min-width: 0;
  padding-left: 8px;
  border-left: 1px solid #33454c;
}

.measurements div:first-child {
  padding-left: 0;
  border-left: 0;
}

.measurements dt {
  color: #70868e;
  font-size: 7px;
}

.measurements dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.measurements dd small {
  color: #728890;
  font-size: 6px;
  font-weight: 400;
}

.app-shell[data-run-state="passed"] #actualFrequency,
.app-shell[data-run-state="passed"] #frequencyError {
  color: #62dda8;
}

.app-shell[data-run-state="failed"] #actualFrequency,
.app-shell[data-run-state="failed"] #frequencyError {
  color: #ff8178;
}

.device-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-right: 1px solid var(--night-line);
  border-bottom: 1px solid var(--night-line);
  border-left: 1px solid var(--night-line);
  background: #111c21;
}

.device-facts div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 0 8px;
  border-left: 1px solid var(--night-line);
}

.device-facts div:first-child {
  border-left: 0;
}

.device-facts span {
  color: #667c84;
  font-family: var(--mono);
  font-size: 6px;
}

.device-facts strong {
  overflow: hidden;
  color: #a9babf;
  font-family: var(--mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-band {
  display: grid;
  grid-template-rows: 43px minmax(0, 1fr);
  min-width: 0;
  padding: 0 16px 8px;
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  background: #f8fafa;
}

.evidence-heading {
  min-width: 0;
  gap: 16px;
}

.evidence-heading > div {
  flex: 0 0 185px;
}

.evidence-heading h2 {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1;
}

.evidence-heading p {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  margin: 0;
  color: #66767c;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#saveCaseButton {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 11px;
  border-color: var(--cyan-dark);
  color: var(--cyan-dark);
  font-size: 8px;
  font-weight: 700;
}

#saveCaseButton:not(:disabled):hover {
  background: var(--cyan-dark);
  color: white;
}

.evidence-chain {
  display: grid;
  grid-template-columns: repeat(8, minmax(80px, 1fr));
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-chain li {
  position: relative;
  min-width: 0;
}

.evidence-chain li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 13px;
  right: -50%;
  width: 100%;
  height: 1px;
  background: #c4d0d3;
  content: "";
}

.evidence-chain button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 11px minmax(0, auto);
  grid-template-rows: 14px 12px;
  align-items: center;
  justify-content: center;
  column-gap: 6px;
  padding: 2px 5px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.evidence-chain button:hover,
.evidence-chain button.is-selected {
  border-color: var(--line);
  background: white;
}

.evidence-chain button i {
  grid-row: 1 / 3;
  width: 9px;
  height: 9px;
  border: 2px solid #a8b5b9;
  border-radius: 50%;
  background: #f8fafa;
}

.evidence-chain button span,
.evidence-chain button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-chain button span {
  font-size: 8px;
  font-weight: 700;
}

.evidence-chain button small {
  color: #849197;
  font-family: var(--mono);
  font-size: 6px;
}

.evidence-chain button[data-status="active"] i {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: inset 0 0 0 2px white;
}

.evidence-chain button[data-status="passed"] i {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 2px white;
}

.evidence-chain button[data-status="failed"] i,
.evidence-chain button[data-status="blocked"] i {
  border-color: var(--red);
  background: var(--red);
  box-shadow: inset 0 0 0 2px white;
}

.verdict-evidence button {
  border-left: 1px solid var(--line-strong);
}

.toast {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: 133px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 9px 11px;
  transform: translateY(7px);
  border: 1px solid #60b58f;
  background: #10231c;
  color: #dcf6e9;
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) and (min-width: 721px) {
  .topbar {
    grid-template-columns: auto minmax(170px, 1fr) auto;
    gap: 10px;
    padding: 0 9px;
  }

  .brand-rule,
  .brand-caption,
  .top-status span:first-child {
    display: none;
  }

  .workspace {
    grid-template-columns: 64px minmax(0, 1fr) 310px;
  }

  .context-rail {
    align-items: center;
    padding: 11px 6px 8px;
  }

  .project-heading {
    display: grid;
    width: 100%;
    place-items: center;
    padding: 0 0 9px;
  }

  .project-heading .section-kicker,
  .project-name,
  .active-task > div,
  .brief-block,
  .bound-context,
  .control-boundary {
    display: none;
  }

  .project-monogram {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--ink);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
  }

  .active-task {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 8px 5px;
  }

  .task-index {
    width: 28px;
  }

  .agent-stage {
    grid-template-rows: 44px 50px 58px minmax(0, 1fr);
    padding-right: 8px;
    padding-left: 8px;
  }

  .agent-identity h1 small,
  .session-identity,
  .failure-switch > span:last-child {
    display: none;
  }

  .mission-console {
    grid-template-columns: minmax(140px, 1fr) auto 30px auto;
    gap: 5px;
  }

  .reset-button {
    width: 30px;
  }

  .run-button {
    padding: 0 8px;
  }

  .decision-board article {
    padding-right: 6px;
    padding-left: 6px;
  }

  .decision-board article p {
    font-size: 8px;
  }

  .agent-loop button {
    grid-template-columns: 18px minmax(0, auto);
    padding-right: 4px;
    padding-left: 4px;
  }

  .agent-loop button i {
    width: 16px;
    height: 16px;
  }

  .agent-workbench {
    grid-template-columns: minmax(210px, 0.8fr) minmax(270px, 1.2fr);
  }

  .workflow-workbench {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-canvas-panel {
    border-right: 0;
  }

  .node-inspector {
    position: absolute;
    z-index: 5;
    right: 7px;
    bottom: 32px;
    width: 255px;
    height: 145px;
    border: 1px solid var(--line-strong);
    box-shadow: 0 8px 20px rgb(23 45 52 / 16%);
  }

  .node-inspector .decision-statement {
    padding: 8px 9px;
  }

  .node-inspector .decision-statement p {
    display: none;
  }

  .node-inspector .action-facts {
    display: none;
  }

  .canvas-legend span:nth-child(4),
  .canvas-legend span:nth-child(5) {
    display: none;
  }

  .action-facts div {
    min-height: 61px;
    padding: 7px 8px;
  }

  .hwpod-stage {
    padding-right: 7px;
    padding-left: 7px;
  }

  .hardware-tag--probe {
    left: 39%;
  }

  .measurements dd {
    font-size: 11px;
  }

  .evidence-band {
    padding-right: 9px;
    padding-left: 9px;
  }

  .evidence-heading > div {
    flex-basis: 165px;
  }
}

@media (max-width: 900px) and (min-width: 721px) {
  .top-target span,
  .top-status span:nth-child(2),
  .agent-state {
    display: none;
  }

  .agent-loop button span,
  .agent-loop button small {
    font-size: 0;
  }

  .agent-loop button {
    grid-template-columns: 18px;
  }

  .decision-statement p,
  .event-summary {
    -webkit-line-clamp: 1;
  }

  .action-facts dd {
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 48px;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px;
  }

  .brand-rule,
  .brand-caption,
  .top-target,
  .top-status span:not(:last-child) {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .context-rail {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 9px;
    padding: 12px 9px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-heading {
    padding: 0 8px 0 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .project-name h2 {
    font-size: 17px;
  }

  .active-task {
    margin: 0;
    padding: 8px 7px;
  }

  .brief-block,
  .bound-context,
  .control-boundary {
    display: none;
  }

  .agent-stage {
    display: block;
    padding: 0 9px 12px;
  }

  .agent-presence {
    min-height: 52px;
  }

  .session-identity {
    display: none;
  }

  .agent-state {
    margin-left: auto;
  }

  .mission-console {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 6px;
    padding: 7px 0;
  }

  .mission-command {
    height: 46px;
  }

  .mission-command div strong {
    white-space: normal;
    line-height: 1.25;
  }

  .failure-switch {
    grid-column: 1;
    grid-row: 2;
    padding-left: 3px;
  }

  .reset-button {
    grid-column: 2;
    grid-row: 2;
  }

  .run-button {
    grid-column: 2;
    grid-row: 1;
    width: 32px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .run-button span {
    font-size: 9px;
  }

  .decision-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-board article {
    min-height: 79px;
    border-bottom: 1px solid var(--line);
  }

  .decision-board article:nth-child(3) {
    border-left: 0;
  }

  .agent-loop {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 8px 0;
  }

  .agent-loop::before {
    display: none;
  }

  .agent-workbench {
    display: block;
    overflow: visible;
  }

  .workflow-workbench {
    display: block;
    overflow: visible;
  }

  .workflow-canvas-panel {
    display: grid;
    height: 455px;
    grid-template-rows: 42px minmax(0, 1fr) 30px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-toolbar {
    padding-right: 5px;
    padding-left: 7px;
  }

  .workflow-toolbar h2 {
    max-width: 145px;
  }

  .graph-runtime {
    display: none;
  }

  .canvas-controls button {
    min-width: 26px;
  }

  .canvas-legend {
    gap: 8px;
    overflow-x: auto;
  }

  .canvas-legend small {
    display: none;
  }

  .node-inspector {
    position: static;
    width: auto;
    height: 350px;
    border: 0;
    box-shadow: none;
  }

  .node-inspector .decision-statement {
    padding: 11px 12px 10px;
  }

  .node-inspector .decision-statement p {
    display: block;
  }

  .node-inspector .action-facts {
    display: grid;
  }

  .timeline-pane,
  .inspector-pane {
    min-height: 320px;
  }

  .timeline-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .agent-timeline {
    max-height: 390px;
  }

  .inspector-pane {
    min-height: 350px;
  }

  .action-facts div {
    min-height: 82px;
  }

  .hwpod-stage {
    display: block;
    padding: 0 9px 11px;
    border-left: 0;
  }

  .hwpod-header {
    min-height: 50px;
  }

  .agent-link {
    height: 32px;
  }

  .agent-link::before {
    display: none;
  }

  .bench-view {
    height: 250px;
  }

  #scopeCanvas {
    height: 82px;
  }

  .device-facts {
    height: 52px;
  }

  .evidence-band {
    display: block;
    padding: 12px 9px 18px;
    overflow: visible;
  }

  .evidence-heading {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }

  .evidence-heading > div {
    flex-basis: auto;
  }

  .evidence-heading p {
    grid-column: 1 / 3;
    grid-row: 2;
    white-space: normal;
  }

  #saveCaseButton {
    grid-column: 2;
    grid-row: 1;
  }

  .evidence-chain {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .evidence-chain li:not(:last-child)::after {
    top: 29px;
    right: auto;
    left: 16px;
    width: 1px;
    height: 17px;
  }

  .evidence-chain button {
    min-height: 43px;
    grid-template-columns: 16px 1fr auto;
    grid-template-rows: 1fr;
    justify-content: stretch;
    padding: 6px 10px;
    text-align: left;
  }

  .evidence-chain button i {
    grid-row: auto;
  }

  .evidence-chain button small {
    text-align: right;
  }

  .verdict-evidence button {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .toast {
    right: 9px;
    bottom: 9px;
  }
}

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