/* This transparent overlay follows the original PNG, including its margins. */
.brain-neural-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translate(-2.7%, -1.8%);
  overflow: visible;
  pointer-events: none;
}

:is(.brain-route,.brain-route-addition) path {
  fill: none;
  stroke-linecap: round;
  filter: url(#brain-neural-glow);
  animation-duration: var(--signal-duration, 7s);
  animation-delay: var(--signal-delay, 0s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-play-state: paused;
}
.brain-trail {
  stroke: none;
  opacity: 0;
  animation: none;
}
.brain-head {
  stroke: #e7fbff;
  stroke-width: 5;
  stroke-dasharray: .0001 .9999;
  opacity: .9;
  animation-name: brain-current;
}
:is(.brain-route,.brain-route-addition)[data-side=left] .brain-head { stroke: #eef9ff; }

.workspace-hub[data-neural-running=true] :is(.brain-route,.brain-route-addition) path {
  animation-play-state: running;
}
.workspace-hub:not([data-neural-running=true]) .hub-icon-motion {
  animation-play-state: paused;
}
@keyframes brain-current {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -1; }
}
/* Only the selected connection carries light packets out from the brain. */
.hub-connections > path.is-active:not(.hub-connection-signal) {
  opacity: .16;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  transition: opacity .18s ease;
}
.hub-connections > .hub-connection-signal {
  stroke: #d9f8ff;
  stroke-width: 2.7;
  stroke-dasharray: .055 .445;
  animation: brain-current 1.9s linear infinite;
  animation-play-state: paused;
  transition: opacity .18s ease;
}
.workspace-hub[data-neural-running=true] .hub-connection-signal.is-active {
  animation-play-state: running;
  opacity: 1;
}

.brain-route-response {
  fill: none;
  stroke: #dffaff;
  stroke-width: 5;
  stroke-linecap: round;
  filter: url(#brain-neural-glow);
}
.brain-contact-ring { display: none; }
.brain-contact-core {
  fill: #edfcff;
  filter: url(#brain-neural-glow);
}

@media (prefers-reduced-motion: reduce) {
  :is(.brain-route,.brain-route-addition) path { animation: none; opacity: 0; }
  .hub-connections > .hub-connection-signal { animation: none; opacity: 0; }
  .hub-connections > path.is-active:not(.hub-connection-signal) { opacity: .5; }
}
