/* ---- Order-flow diagram ---- */
#nx2 .nx-flow {
  width: 100%;
  max-width: 640px;
  container-type: inline-size;
}
#nx2 .nx-flow__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 320;
  direction: ltr;
}
#nx2 .nx-flow__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
#nx2 .nx-flow__glow {
  filter: drop-shadow(0 0 6px rgba(255, 138, 31, 0.9));
}
#nx2 .nx-flow__run {
  stroke-dasharray: 6 18;
  animation: nx-dash 1.4s linear infinite;
}
@keyframes nx-dash {
  to {
    stroke-dashoffset: -48;
  }
}
#nx2 .nx-flow__node {
  position: absolute;
  width: 25%;
  height: 20%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--nx-r-sm);
  background: var(--nx-glass-tile);
  border: var(--nx-glass-tile-border);
  -webkit-backdrop-filter: var(--nx-glass-tile-backdrop);
  backdrop-filter: var(--nx-glass-tile-backdrop);
  box-shadow: var(--nx-glass-tile-edge);
}
#nx2 .nx-flow__node--in {
  left: 0;
}
#nx2 .nx-flow__node--out {
  left: 75%;
}
#nx2[dir="rtl"] .nx-flow__node {
  direction: rtl;
}
#nx2 .nx-flow__icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--nx-ink);
  display: grid;
  place-items: center;
}
/* A store: its icon alone, on a square tile where the path ends */
#nx2 .nx-flow__node--icon {
  width: auto;
  aspect-ratio: 1;
  padding: 0;
  justify-content: center;
}
#nx2 .nx-flow__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#nx2 .nx-flow__label {
  font-size: 13px;
  font-weight: var(--nx-w-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nx2 .nx-flow__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: var(--nx-w-body);
  white-space: nowrap;
}
#nx2 .nx-flow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--nx-ok);
  box-shadow: 0 0 6px var(--nx-ok);
}
#nx2 .nx-flow__hub {
  position: absolute;
  left: 39.17%;
  top: 32.8%;
  width: 21.67%;
  height: 34.4%;
  border-radius: 26px;
  background: var(--nx-hub-fill);
  border: 1px solid rgba(255, 230, 190, 0.9);
  -webkit-backdrop-filter: var(--nx-glass-tile-backdrop);
  backdrop-filter: var(--nx-glass-tile-backdrop);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: nx-hub 3.2s ease-in-out infinite;
}
#nx2 .nx-flow__hub-word {
  font-family: var(--nx-font-mark);
  font-size: 13px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
}
@keyframes nx-hub {
  0%,
  100% {
    box-shadow: 0 0 30px rgba(255, 138, 31, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
  50% {
    box-shadow: 0 0 60px rgba(255, 138, 31, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}
@media (prefers-reduced-motion: reduce) {
  #nx2 .nx-flow__run,
  #nx2 .nx-flow__hub {
    animation: none !important;
  }
  #nx2 .nx-flow__hub {
    box-shadow: 0 0 40px rgba(255, 138, 31, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}
/* Narrow diagrams: taller stage, no icon tiles, labels may wrap */
@container (max-width: 520px) {
  #nx2 .nx-flow__stage {
    aspect-ratio: 600 / 430;
  }
  #nx2 .nx-flow__icon,
  #nx2 .nx-flow__status {
    display: none;
  }
  #nx2 .nx-flow__node--icon .nx-flow__icon {
    display: grid;
    width: 26px;
    height: 26px;
    border-radius: 9px;
  }
  #nx2 .nx-flow__node {
    padding: 0 8px;
    border-radius: 14px;
    justify-content: center;
    text-align: center;
  }
  #nx2 .nx-flow__label {
    font-size: 11px;
    white-space: normal;
    line-height: 1.35;
  }
  #nx2 .nx-flow__hub {
    border-radius: 18px;
    gap: 4px;
  }
  #nx2 .nx-flow__hub svg {
    width: 24px;
    height: 24px;
  }
  #nx2 .nx-flow__hub-word {
    font-size: 9px;
  }
}

/* ---- Placeholders, loading, centred messages ---- */
