/**
 * Shared compact pipeline / step board — Pose Lab + Character Lab
 */
.pipe-board {
  margin: 0;
  padding: 8px 10px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  min-width: 0;
}

.pipe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin: 0 0 6px;
  min-width: 0;
}

.pipe-now {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text);
  min-width: 0;
  flex: 1 1 auto;
}

.pipe-kicker {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  flex-shrink: 0;
}

.pipe-now-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pipe-reset {
  flex: 0 0 auto;
  min-height: 28px !important;
  padding: 2px 10px !important;
  font-size: 0.72rem !important;
  border-radius: 7px !important;
  border: 1px solid rgba(125, 211, 199, 0.45) !important;
  color: var(--accent-2) !important;
  background: transparent !important;
  line-height: 1.2 !important;
}

.pipe-reset:hover:not(:disabled) {
  background: rgba(125, 211, 199, 0.12) !important;
  border-color: var(--accent-2) !important;
  color: #fff !important;
}

.pipe-steps {
  list-style: none;
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.pipe-steps--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pipe-steps--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.pipe-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  position: relative;
  padding: 0 2px 2px;
  color: var(--text-muted);
  text-align: center;
  min-width: 0;
  border: 0;
  background: transparent;
}

/* Connector behind the circles */
.pipe-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(50% + 12px);
  right: calc(-50% + 12px);
  top: 10px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 0;
  pointer-events: none;
}

.pipe-steps li.is-done:not(:last-child)::before {
  background: rgba(125, 211, 199, 0.5);
}

.pipe-steps li.is-active:not(:last-child)::before {
  background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.12));
}

.pipe-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  border: 1px solid var(--border-strong, var(--border));
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-muted);
  z-index: 1;
  position: relative;
  flex-shrink: 0;
}

.pipe-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Where tags: active only — keeps Pose + Character boards the same height */
.pipe-where {
  display: none;
  max-width: 100%;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 720px) {
  .pipe-steps li.is-active .pipe-where {
    display: inline-block;
  }
}

.pipe-steps li.is-active {
  color: var(--text);
}

.pipe-steps li.is-active .pipe-num {
  color: #041016;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.pipe-steps li.is-active .pipe-label {
  color: var(--accent-2);
}

.pipe-steps li.is-active .pipe-where {
  color: #041016;
  background: var(--accent-2);
  border-color: transparent;
}

.pipe-steps li.is-done {
  color: var(--text);
}

.pipe-steps li.is-done .pipe-num {
  color: var(--accent-2);
  border-color: rgba(125, 211, 199, 0.4);
  background: rgba(125, 211, 199, 0.12);
  font-size: 0;
}

.pipe-steps li.is-done .pipe-num::after {
  content: "✓";
  font-size: 0.62rem;
}

.pipe-steps li.is-busy-step .pipe-num,
.pipe-steps li.is-active.is-busy .pipe-num {
  animation: pipe-pulse 1.2s ease-in-out infinite;
}

.pipe-steps li.is-error .pipe-num {
  color: #ffd7c8;
  background: rgba(255, 107, 53, 0.22);
  border-color: rgba(255, 107, 53, 0.55);
}

@keyframes pipe-pulse {
  50% { opacity: 0.55; }
}

@media (max-width: 639px) {
  .pipe-board {
    padding: 6px 8px 4px;
  }

  .pipe-label {
    font-size: 0.55rem;
  }

  .pipe-num {
    width: 18px;
    height: 18px;
  }

  .pipe-steps li:not(:last-child)::before {
    left: calc(50% + 10px);
    right: calc(-50% + 10px);
    top: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pipe-steps li.is-busy-step .pipe-num,
  .pipe-steps li.is-active.is-busy .pipe-num {
    animation: none;
  }
}
