/* === Pipeline section === */

.pipeline {
  padding: 100px 0 120px;
  position: relative;
}
.pipeline .section-head { margin-bottom: 48px; max-width: 760px; }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
  position: relative;
}

.pl-col {
  background: linear-gradient(180deg, rgba(20,18,32,0.55), rgba(12,11,22,0.4));
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 380px;
  position: relative;
  transition: border-color 0.4s;
}
.pl-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}
.pl-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.pl-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pl-dot-new   { background: #93c5fd; box-shadow: 0 0 8px rgba(147,197,253,0.6); }
.pl-dot-qual  { background: var(--lav-400); box-shadow: 0 0 8px rgba(155,124,255,0.6); }
.pl-dot-hot   { background: #f0a3c7; box-shadow: 0 0 8px rgba(240,163,199,0.5); }
.pl-dot-demo  { background: var(--lav-300); box-shadow: 0 0 10px rgba(178,156,255,0.7); }
.pl-dot-won   { background: #6ee7b7; box-shadow: 0 0 10px rgba(110,231,183,0.6); }

.pl-col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 7px;
  min-width: 22px;
  text-align: center;
}
.pl-col-hint {
  font-size: 10.5px;
  color: var(--fg-4);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 0 4px;
  text-transform: uppercase;
}
.pl-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pl-empty {
  font-size: 10px;
  color: var(--fg-4);
  font-family: var(--font-mono);
  text-align: center;
  padding: 16px 0;
  opacity: 0.5;
}

/* Lead card */
.pl-card {
  background: linear-gradient(180deg, rgba(28,24,46,0.7), rgba(18,16,32,0.7));
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1), border-color 0.4s, box-shadow 0.4s;
}
.pl-card:hover {
  transform: translateY(-1px);
  border-color: var(--hairline-strong);
}
.pl-card.just-moved {
  border-color: rgba(155,124,255,0.6);
  box-shadow:
    0 0 0 1px rgba(155,124,255,0.25),
    0 8px 28px -8px rgba(124,92,246,0.5),
    inset 0 0 24px rgba(124,92,246,0.07);
  animation: plCardPop 0.9s cubic-bezier(0.2,0.8,0.2,1);
}

@keyframes plCardPop {
  0%   { transform: translateY(-12px) scale(0.98); }
  50%  { transform: translateY(2px) scale(1.025); }
  100% { transform: translateY(0) scale(1); }
}

.pl-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pl-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: 500;
  background: linear-gradient(135deg, #5a44c0, #a18bff);
}
.pl-avatar.green { background: linear-gradient(135deg, #2a8a5e, #6ee7b7); }
.pl-avatar.blue  { background: linear-gradient(135deg, #2a3d8a, #93c5fd); }
.pl-avatar.pink  { background: linear-gradient(135deg, #8a2a5e, #f0a3c7); }
.pl-avatar.amber { background: linear-gradient(135deg, #8a6a2a, #f5d27e); }

.pl-card-id {
  flex: 1;
  min-width: 0;
}
.pl-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.pl-card-sub {
  font-size: 10px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-card-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  font-family: var(--font-mono);
  line-height: 1;
}
.pl-score-num {
  font-size: 13px;
  color: var(--lav-200);
  font-weight: 500;
}
.pl-score-lbl {
  font-size: 8px;
  color: var(--fg-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.pl-card-bot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pl-tag-src {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline);
  padding: 2px 6px;
  border-radius: 5px;
}
.pl-moved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: var(--lav-200);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(124, 92, 246, 0.14);
  border: 1px solid rgba(155,124,255,0.3);
  padding: 2px 6px;
  border-radius: 5px;
  animation: plMovedPulse 1.6s ease-in-out;
}
@keyframes plMovedPulse {
  0%   { opacity: 0; transform: scale(0.85); }
  20%  { opacity: 1; transform: scale(1.05); }
  60%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0.85; }
}

/* Subtle stage-color tint per column */
.pl-col.pl-won   { background: linear-gradient(180deg, rgba(28, 60, 44, 0.35), rgba(12,11,22,0.4)); }
.pl-col.pl-demo  { background: linear-gradient(180deg, rgba(40, 30, 70, 0.45), rgba(12,11,22,0.4)); }

/* Foot stripe */
.pipeline-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.pl-foot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--fg-2);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
}
.pl-foot-item svg {
  color: var(--lav-300);
  flex-shrink: 0;
}

/* Connecting arrow between columns (decorative) */
.pl-col + .pl-col::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 22px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid rgba(155,124,255,0.35);
  border-right: 1.5px solid rgba(155,124,255,0.35);
  transform: rotate(45deg);
}

/* === Funnel === */
.pl-funnel {
  margin-bottom: 36px;
  padding: 22px 24px 22px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20,18,32,0.4), rgba(12,11,22,0.2));
}
.pl-funnel-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
}
.pl-funnel-svg-wrap {
  position: relative;
}
.pl-funnel-svg {
  width: 100%;
  height: 90px;
  display: block;
}
.pl-funnel-labels {
  display: flex;
  align-items: stretch;
  margin-top: 14px;
  position: relative;
}
.pl-funnel-seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.pl-funnel-meta {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 4px;
}
.pl-funnel-pct {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.pl-funnel-lbl {
  font-size: 11.5px;
  color: var(--fg-2);
  letter-spacing: -0.005em;
  margin-top: 2px;
}
.pl-funnel-count {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1px;
}
.pl-funnel-drop {
  position: absolute;
  right: -16px;
  top: -90px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #f0a3c7;
  background: rgba(12,11,22,0.95);
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(240,163,199,0.35);
  z-index: 2;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.pl-funnel-seg:last-child .pl-funnel-drop { display: none; }

/* === Hero card: the lead the user is following === */
.pl-card.is-hero {
  border-color: rgba(155,124,255,0.55);
  background: linear-gradient(180deg, rgba(60,42,120,0.55), rgba(28,20,52,0.7));
  box-shadow:
    0 0 0 1px rgba(155,124,255,0.18),
    0 12px 36px -12px rgba(124,92,246,0.55);
  position: relative;
}
.pl-card.is-hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 13px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(178,156,255,0.6), rgba(124,92,246,0) 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}
.pl-card.is-hero.is-won {
  border-color: rgba(110,231,183,0.55);
  background: linear-gradient(180deg, rgba(38,80,60,0.6), rgba(18,42,32,0.75));
  box-shadow:
    0 0 0 1px rgba(110,231,183,0.18),
    0 12px 36px -12px rgba(110,231,183,0.55);
}
.pl-card.is-hero.is-won::before {
  background: linear-gradient(135deg, rgba(110,231,183,0.6), rgba(42,157,111,0) 60%);
}

/* Active column receives an extra glow when hero is in it */
.pl-col.is-active {
  border-color: rgba(155,124,255,0.45);
  box-shadow: 0 0 0 1px rgba(155,124,255,0.15), 0 24px 60px -24px rgba(124,92,246,0.45);
}
.pl-col.pl-won.is-active {
  border-color: rgba(110,231,183,0.45);
  box-shadow: 0 0 0 1px rgba(110,231,183,0.15), 0 24px 60px -24px rgba(110,231,183,0.5);
}

/* Caption strip — narrates what the AI just did */
.pl-caption-strip {
  margin-top: 22px;
  padding: 14px 22px;
  background: linear-gradient(90deg, rgba(124,92,246,0.12), rgba(124,92,246,0.04) 60%, transparent);
  border: 1px solid rgba(155,124,255,0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.pl-caption-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(178,156,255,0.08), transparent);
  background-size: 200% 100%;
  animation: plCapShimmer 6s linear infinite;
  pointer-events: none;
}
@keyframes plCapShimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}
.pl-caption-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lav-300);
  box-shadow: 0 0 12px rgba(178,156,255,0.8);
  flex-shrink: 0;
  animation: plCapPulse 1.6s ease-in-out infinite;
}
@keyframes plCapPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.3); }
}
.pl-caption-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-2);
  flex-wrap: wrap;
}
.pl-caption-name {
  font-weight: 500;
  color: var(--fg);
}
.pl-caption-arrow {
  color: var(--lav-300);
  font-family: var(--font-mono);
}
.pl-caption-stage {
  color: var(--lav-200);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(155,124,255,0.12);
  border: 1px solid rgba(155,124,255,0.25);
  padding: 2px 8px;
  border-radius: 5px;
}
.pl-caption-sep {
  color: var(--fg-4);
}
.pl-caption-msg {
  color: var(--fg-3);
  font-style: italic;
}

/* === Funnel head update === */
.pl-funnel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.pl-funnel-sub {
  font-size: 11.5px;
  color: var(--fg-3);
  margin-top: 4px;
}
.pl-funnel-result {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pl-funnel-result-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: #6ee7b7;
  letter-spacing: -0.02em;
}
.pl-funnel-result-lbl {
  font-size: 11.5px;
  color: var(--fg-3);
  text-align: right;
  max-width: 130px;
  line-height: 1.4;
}

/* Active funnel segment glows */
.pl-funnel-poly {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  opacity: 0.55;
  transition: opacity 0.6s, filter 0.6s;
}
.pl-funnel-poly.is-active {
  opacity: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4)) drop-shadow(0 0 12px rgba(178,156,255,0.4));
}

.pl-funnel-seg {
  transition: opacity 0.4s;
  opacity: 0.7;
}
.pl-funnel-seg.is-active { opacity: 1; }
.pl-funnel-seg.is-active .pl-funnel-pct { color: var(--lav-100, #fff); }
.pl-funnel-won.is-active .pl-funnel-pct { color: #6ee7b7; }
.pl-card.is-won {
  background: linear-gradient(180deg, rgba(38,72,56,0.55), rgba(18,32,26,0.65));
  border-color: rgba(110,231,183,0.35);
}
.pl-card.is-won .pl-score-num { color: #6ee7b7; }
.pl-tag-won {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: #6ee7b7;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(110, 231, 183, 0.12);
  border: 1px solid rgba(110,231,183,0.3);
  padding: 2px 6px;
  border-radius: 5px;
}

/* won-column body gets a subtle "celebration" sheen */
.pl-col-body-won {
  position: relative;
}

/* === Make col-hint a flex row with icon === */
.pl-col-hint {
  display: flex;
  align-items: center;
  gap: 5px;
}
.pl-col-hint svg { color: var(--lav-300); flex-shrink: 0; opacity: 0.8; }

/* === Make connecting arrows brighter and animated === */
.pl-col + .pl-col::before {
  border-top-color: rgba(155,124,255,0.5);
  border-right-color: rgba(155,124,255,0.5);
  animation: plArrowPulse 2.4s ease-in-out infinite;
}
@keyframes plArrowPulse {
  0%, 100% { opacity: 0.4; transform: rotate(45deg) translate(0,0); }
  50%      { opacity: 1; transform: rotate(45deg) translate(2px,-2px); }
}

@media (max-width: 1100px) {
  .pl-funnel-track { flex-wrap: wrap; }
  .pl-funnel-seg { min-width: 33%; margin-bottom: 16px; }
  .pl-funnel-drop { display: none !important; }
  .pipeline-board { grid-template-columns: repeat(2, 1fr); }
  .pipeline-foot { grid-template-columns: 1fr; }
  .pl-col + .pl-col::before { display: none; }
}
@media (max-width: 700px) {
  .pipeline-board { grid-template-columns: 1fr; }
}
