/* Workbench geometry uses the same signs and travel direction as the lecture. */
.wb {
  --wb-rule: #303a47;
  --wb-panel: #12171e;
  --wb-muted: #b0bccb;
  color: var(--paper, #f4f6fa);
  font: 18px/1.3 var(--sans, Arial, sans-serif);
  font-variant-numeric: tabular-nums;
  padding: 8px 0 18px;
}
.wb *,
.wb *::before,
.wb *::after {
  box-sizing: border-box;
}
.wb button,
.wb input,
.wb select,
.wb textarea {
  font-family: inherit;
}
.wb button,
.wb summary,
.wb select {
  cursor: pointer;
}
.wb button {
  border: 1px solid transparent;
  color: inherit;
  background: transparent;
  font-size: 16px;
  line-height: 1.25;
}
.wb button:disabled {
  opacity: 0.37;
  cursor: default;
}
.wb button:hover:not(:disabled),
.wb summary:hover {
  color: var(--forward);
}
.wb input,
.wb textarea,
.wb select {
  background: #171e27;
  color: var(--paper);
  border: 1px solid #3c4859;
  border-radius: 3px;
  padding: 6px 9px;
  font-size: 16px;
  min-width: 0;
}
.wb input,
.wb textarea {
  user-select: text;
}
.wb select {
  padding-right: 8px;
}
.wb-heading,
.wb-examples,
.wb-examples label,
.wb-canvas-tools,
.wb-canvas-tools > div,
.wb-transport,
.wb-transport-buttons,
.wb-play-options,
.wb-play-options label,
.wb-signal,
.wb-advanced-line,
.wb-verification {
  display: flex;
  align-items: center;
}
.wb-heading {
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 15px;
}
.wb-heading h2 {
  font: 550 40px/1.12 var(--sans);
  letter-spacing: -0.035em;
  margin: 0;
}
.wb-examples {
  gap: 4px;
}
.wb-examples label,
.wb-play-options label {
  gap: 9px;
  font-size: 16px;
  color: var(--wb-muted);
}
.wb-examples button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
}
.wb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 273px;
  align-items: stretch;
  border-block: 1px solid var(--wb-rule);
}
.wb-canvas-side {
  min-width: 0;
  background: #12171e;
  position: relative;
}
.wb-canvas-tools {
  padding: 11px 16px;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.wb-canvas-tools > div {
  gap: 6px;
}
.wb-canvas-tools select {
  font-size: 15px;
  background: #1d2632;
}
.wb-canvas-tools button {
  font-weight: 500;
  color: #c7d1df;
  padding: 6px 9px;
}
.wb-canvas-tools button[data-wb-add] {
  background: transparent;
  border: 1px solid #4a5b72;
  border-radius: 3px;
}
.wb-view-tools > span {
  width: 1px;
  height: 15px;
  background: var(--wb-rule);
  margin-inline: 4px;
}
.wb-view-tools button:not(:first-child) {
  padding-inline: 6px;
}
.wb-graph-field {
  position: relative;
  background-image: radial-gradient(circle, #8b9aac2f 0.9px, transparent 1px);
  background-size: 18px 18px;
  isolation: isolate;
}
.wb svg[data-wb-canvas] {
  display: block;
  width: 100%;
  height: 302px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  outline: 0;
}
.wb svg[data-wb-canvas]:active {
  cursor: grabbing;
}
.wb svg.picking,
.wb svg.picking [data-wb-node] {
  cursor: crosshair;
}
.wb [data-wb-node] {
  cursor: grab;
  outline: none;
}
.wb [data-wb-node]:active {
  cursor: grabbing;
}
.wb svg text {
  pointer-events: none;
  font-family: var(--sans);
  fill: #dce3ef;
}
.wb-wire {
  fill: none;
  stroke: #8595a9;
  stroke-width: 1.65;
}
.wb-wire.active {
  stroke: var(--forward);
  stroke-width: 3.2;
}
.wb[data-phase="reverse"] .wb-wire.active,
.wb[data-phase="naive"] .wb-wire.active {
  stroke: var(--backward);
}
.wb-output-mark {
  stroke: var(--forward);
  stroke-width: 3.2;
  stroke-linecap: round;
}
.wb-hit {
  fill: transparent;
  stroke: none;
}
.wb-disc {
  stroke: #8595a9;
  fill: #1d2632;
  stroke-width: 1.65;
  transition: stroke 0.15s;
}
.wb-orbit {
  stroke: #a8bddd;
  fill: none;
  stroke-width: 1.15;
  opacity: 0;
}
.wb [data-wb-node].selected .wb-orbit {
  opacity: 0.85;
  stroke-dasharray: 3 3;
}
.wb [data-wb-node]:focus-visible .wb-orbit,
.wb [data-wb-node]:hover .wb-orbit {
  opacity: 1;
  stroke: var(--paper);
  stroke-width: 2;
}
.wb-node-id {
  font-weight: 600;
  letter-spacing: -0.03em;
}
.wb .wb-node-reading {
  font-weight: 550;
  font-size: 18px;
  fill: #c7d1df;
  paint-order: stroke;
  stroke: #171e27;
  stroke-width: 4px;
  stroke-linejoin: round;
}
.wb [data-wb-node].reached .wb-disc {
  stroke: #a8bddd;
}
.wb [data-wb-node].active .wb-disc {
  fill: var(--forward);
  stroke: #bad0ff;
  stroke-width: 2.5;
}
.wb [data-wb-node].active .wb-node-id {
  fill: #12171e;
}
.wb[data-phase="reverse"] [data-wb-node].active .wb-disc,
.wb[data-phase="naive"] [data-wb-node].active .wb-disc {
  fill: var(--backward);
  stroke: #ffddbc;
}
.wb[data-phase="reverse"] .reached .wb-node-reading,
.wb[data-phase="naive"] .reached .wb-node-reading,
.wb[data-phase="complete"] .wb-node-reading {
  fill: var(--backward);
}
.wb-packet {
  fill: none;
  stroke: #eaf0ff;
  stroke-width: 4.7;
  stroke-linecap: round;
  stroke-dasharray: 0.12 1.5;
  animation: wb-travel var(--travel, 0.45s) cubic-bezier(0.22, 0.69, 0.35, 1) both;
  pointer-events: none;
}
@keyframes wb-travel {
  0% {
    stroke-dashoffset: 0.12;
    opacity: 0.2;
  }
  15%,
  82% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -1;
    opacity: 0;
  }
}
.wb-build[data-frame="-1"] .wb-disc {
  animation: wb-reveal 0.38s ease-out both;
}
@keyframes wb-reveal {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}
.wb-canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 95%;
  padding: 5px 11px;
  font-size: 15px;
  color: var(--forward);
  background: #142138;
  border: 1px solid #4a5b72;
  border-radius: 3px;
  pointer-events: none;
}
.wb-canvas-hint:empty {
  display: none;
}
.wb-signal {
  justify-content: space-between;
  min-height: 79px;
  padding: 11px 20px 8px;
  gap: 14px;
  background: #171e27;
  border-top: 1px solid #202d41;
}
.wb-label {
  display: block;
  font-size: 14px;
  letter-spacing: 0.065em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--wb-muted);
}
.wb .wb-event {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--paper);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wb[data-phase="forward"] .wb-event {
  color: var(--forward);
}
.wb[data-phase="reverse"] .wb-event,
.wb[data-phase="naive"] .wb-event,
.wb[data-phase="complete"] .wb-event {
  color: var(--backward);
}
.wb-signal-right {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}
.wb-signal-right output {
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.wb-signal-right span {
  font-size: 14px;
  color: var(--wb-muted);
}
.wb-progress {
  height: 14px;
  line-height: 0;
  background: #171e27;
  padding: 0 20px 8px;
}
.wb-progress input {
  appearance: none;
  display: block;
  width: 100%;
  height: 12px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(#4a5b72, #4a5b72) center / 100% 2px no-repeat;
  cursor: ew-resize;
  accent-color: var(--forward);
}
.wb-progress input::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--forward);
}
.wb-progress input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--forward);
}
.wb-inspect {
  min-width: 0;
  border-left: 1px solid var(--wb-rule);
  padding: 19px 0 8px 24px;
}
.wb-name {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 66px;
  flex-wrap: wrap;
}
.wb-name strong {
  font: 530 54px/1.18 var(--sans);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.wb-name span {
  font-size: 19px;
  color: var(--wb-muted);
}
.wb-node-readings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 5px 0 17px;
  padding: 10px 0 12px;
  border-block: 1px solid var(--wb-rule);
  gap: 10px;
}
.wb-node-readings span {
  display: block;
  font-size: 15px;
  color: var(--wb-muted);
}
.wb-node-readings b {
  display: block;
  font: 500 27px/1.2 var(--sans);
  color: var(--forward);
  overflow-wrap: anywhere;
  letter-spacing: -0.035em;
}
.wb-node-readings b[data-wb-inspect-gradient] {
  color: var(--backward);
}
.wb-parent,
.wb-number,
.wb-output-label {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 7px 0;
  font-size: 16px;
  color: #c7d1df;
}
.wb-parent {
  grid-template-columns: 85px minmax(0, 1fr) 36px;
}
.wb-parent button {
  padding: 2px;
  font: 15px/1 var(--sans);
  color: var(--forward);
}
.wb .wb-output-label {
  border-top: 1px solid var(--wb-rule);
  margin-top: 14px;
  padding-top: 13px;
}
.wb .wb-remove {
  color: #b0bccb;
  font-size: 14px;
  padding: 5px 0;
}
.wb .wb-remove:hover:not(:disabled) {
  color: var(--backward);
}
.wb-transport {
  justify-content: space-between;
  padding: 12px 0;
  gap: 12px;
}
.wb-transport-buttons {
  gap: 6px;
}
.wb-transport-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 32px;
  min-height: 34px;
  padding: 7px 8px;
}
.wb .wb-run {
  background: var(--forward);
  border: 1px solid var(--forward);
  border-radius: 3px;
  color: #142138;
  font-weight: 650;
  padding: 8px 15px;
}
.wb .wb-run:hover:not(:disabled) {
  color: #142138;
  background: #bad0ff;
}
.wb-play-options {
  gap: 14px;
}
.wb-advanced-line {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--wb-rule);
  padding-top: 11px;
}
.wb-advanced-line details {
  flex: 1;
  min-width: 0;
}
.wb-advanced-line summary {
  width: max-content;
  color: var(--wb-muted);
  font-size: 16px;
}
.wb-declarations {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 165px;
  gap: 16px;
  margin-top: 12px;
  max-width: 850px;
}
.wb-declarations label {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--wb-muted);
}
.wb-declarations textarea {
  font: 16px/1.45 var(--mono);
  width: 100%;
  resize: vertical;
}
.wb-declarations button {
  border: 1px solid #4a5b72;
  border-radius: 3px;
  margin: 8px 0;
  padding: 6px 11px;
}
.wb-declarations small {
  display: block;
  color: var(--wb-muted);
  line-height: 1.4;
}
.wb-verification {
  flex-direction: column;
  align-items: flex-end;
  max-width: 42%;
  gap: 6px;
}
.wb-verification button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  color: #c7d1df;
}
.wb-verification span {
  color: var(--forward);
  font-size: 15px;
  text-align: right;
}
.wb .wb-error {
  margin: 0 0 9px;
  padding: 6px 9px;
  border-left: 2px solid var(--backward);
  color: #f7caa6;
  font-size: 17px;
}
@media (prefers-reduced-motion: reduce) {
  .wb-packet,
  .wb-build .wb-disc {
    animation: none;
  }
  .wb-disc {
    transition: none;
  }
}
.reduce-motion .wb-packet,
.reduce-motion .wb-build .wb-disc {
  animation: none;
}

.wb .wb-packet-label {
  font: 600 17px var(--sans);
  fill: var(--forward);
  paint-order: stroke;
  stroke: #12171e;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.wb[data-phase="reverse"] .wb-packet-label,
.wb[data-phase="naive"] .wb-packet-label {
  fill: var(--backward);
}
