.pnj-stage.is-on {
  background: rgba(2, 132, 199, 0.3);
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
}

.pnj-chip.is-on {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
  color: #d1fae5;
}

.pnj-view {
  position: relative;
  height: min(38vh, 320px);
  min-height: 220px;
}

.pnj-view canvas,
.pnj-stack canvas,
.pnj-iv canvas,
.pnj-fermi canvas,
.pnj-balance canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.pnj-stack {
  height: min(58vh, 520px);
  min-height: 360px;
}

.pnj-iv,
.pnj-fermi {
  height: 260px;
}

.pnj-balance {
  height: 92px;
}

.pnj-read {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: #94a3b8;
}

.pnj-why {
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
}

.pnj-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  align-items: center;
}

.pnj-chain span {
  border-radius: 0.5rem;
  border: 1px solid rgba(125, 211, 252, 0.22);
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.pnj-chain i { color: #64748b; font-size: 0.62rem; }

.pnj-tip {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 0.5rem 0.65rem;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(125, 211, 252, 0.28);
  color: #e2e8f0;
  font-size: 0.72rem;
  line-height: 1.45;
  pointer-events: none;
}

.eq-inline { min-height: 1.4rem; }

.story-rail {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.is-story .lab-only { display: none !important; }
.is-story #story-rail { display: flex; }
.is-story #controls { opacity: 0.72; }

.story-rail li {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.2rem 0.55rem;
}

.story-rail li.is-on {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.08);
}

@media (max-width: 768px) {
  .pnj-view { height: 240px; }
  .pnj-stack { height: 420px; min-height: 340px; }
}
