/* ── Pipeline Bar ─────────────────────────────────────────── */

.pipeline-bar {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 14px 20px 10px;
}

.pl-stages {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.pl-stage {
  align-items: center;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  text-decoration: none;
  transition: background 0.15s;
}

a.pl-stage:hover {
  text-decoration: none;
}

.pl-stage.active {
  background: #e8f2fc;
  outline: 1.5px solid rgba(15, 94, 156, 0.22);
}

.pl-stage.complete  { color: #17663a; }
.pl-stage.active    { color: #0f5e9c; }
.pl-stage.incomplete { color: #b6c4ce; }

.pl-fill   { fill: currentColor; }
.pl-stroke { fill: none; stroke: currentColor; }

.pl-screen-inner {
  fill: white;
  opacity: 0.25;
}

.pl-pipe-interior {
  fill: white;
  opacity: 0.18;
}

.pl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.pl-sublabel {
  font-size: 10px;
  opacity: 0.75;
  text-align: center;
}

/* ── Connectors ─────────────────────────────────────────────── */

.pl-connector {
  align-self: center;
  flex-shrink: 0;
}

.pl-connector.complete  { color: #17663a; }
.pl-connector.active    { color: #0f5e9c; }
.pl-connector.incomplete { color: #d9e0e7; }

/* ── Divider ───────────────────────────────────────────────── */

.pl-divider {
  align-self: stretch;
  background: #d9e0e7;
  flex-shrink: 0;
  margin: 4px 10px;
  width: 1px;
}

/* ── Run section & toggle ──────────────────────────────────── */

.pl-run-section {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px;
}

.pl-run-label {
  color: #687789;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pl-run-section--active .pl-run-label {
  color: #0f5e9c;
}

.pl-toggle-ready {
  background: #a8c8ec;
}

.pl-toggle-ready::after {
  background: #fff;
}

.pl-toggle-form {
  margin: 0;
  padding: 0;
}

.pl-toggle-btn {
  appearance: none;
  background: #c9d3dd;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  height: 28px;
  position: relative;
  transition: background 0.2s;
  width: 52px;
}

.pl-toggle-btn::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  content: '';
  height: 22px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: left 0.2s;
  width: 22px;
}

.pl-toggle-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.pl-toggle-btn.on {
  background: #17663a;
}

.pl-toggle-btn.on::after {
  left: 27px;
}

.pl-toggle-btn.on:not([disabled]) {
  animation: pl-toggle-pulse 2s ease-in-out infinite;
}

/* ── Step dots ─────────────────────────────────────────────── */

.pl-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.pl-dot {
  background: #d9e0e7;
  border-radius: 999px;
  height: 4px;
  transition: all 0.2s;
  width: 8px;
}

.pl-dot.active   { background: #0f5e9c; width: 22px; }
.pl-dot.complete { background: #17663a; }

/* ── Running badge ─────────────────────────────────────────── */

.pl-running-badge {
  animation: pl-status-blink 1.1s ease-in-out infinite;
  background: #dff4e8;
  border: 1px solid #8fd1aa;
  border-radius: 999px;
  color: #17663a;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-left: 10px;
  padding: 2px 9px;
  vertical-align: middle;
}

/* ── Pipe flow animation ───────────────────────────────────── */

.pl-flow-blob {
  display: none;
  fill: currentColor;
  opacity: 0;
}

.pipeline-bar--running .pl-stage[data-stage="queue"] {
  color: #17663a;
}

.pipeline-bar--running .pl-flow-blob {
  display: block;
}

.pipeline-bar--running .pl-flow-1 {
  animation: pl-flow 1.5s linear infinite;
}

.pipeline-bar--running .pl-flow-2 {
  animation: pl-flow 1.5s linear 0.5s infinite;
}

.pipeline-bar--running .pl-flow-3 {
  animation: pl-flow 1.5s linear 1s infinite;
}

/* ── Keyframes ─────────────────────────────────────────────── */

@keyframes pl-flow {
  0%   { transform: translateX(-78px); opacity: 0; }
  8%   { opacity: 0.85; }
  92%  { opacity: 0.85; }
  100% { transform: translateX(78px); opacity: 0; }
}

@keyframes pl-toggle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(23, 102, 58, 0.35); }
  50%       { box-shadow: 0 0 0 7px rgba(23, 102, 58, 0); }
}

@keyframes pl-status-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
