/* End-of-year planning season: spreadsheets vs BoogieBoard */

.bbi-ps-cal { overflow: hidden; }

.bbi-ps-month {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--bbi-ink);
}

.bbi-ps-month + .bbi-ps-month { border-left: 1px solid var(--bbi-line); }
.bbi-ps-month.is-next { background: #fafbff; color: var(--bbi-muted); }

.bbi-ps-gridline {
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 0;
  border-left: 1px dashed #e3e8f4;
}

.bbi-ps-late {
  position: absolute;
  top: 0;
  border-radius: 0 18px 18px 0;
  background:
    repeating-linear-gradient(135deg, rgba(240, 56, 107, 0.07) 0 7px, transparent 7px 14px),
    rgba(255, 224, 232, 0.45);
  opacity: 0;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.bbi-ps-late.is-on { opacity: 1; }

/* Lane legends sit on the lane's top edge */
.bbi-ps-legend {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 14px 0 4px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--bbi-line);
  box-shadow: var(--bbi-shadow-sm);
  font-size: 13px;
  font-weight: 800;
  color: var(--bbi-ink);
  white-space: nowrap;
  transition: opacity 0.6s ease, box-shadow 0.4s ease;
}

.bbi-ps-legend__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #aab4c8;
  color: #fff;
}

.bbi-ps-legend__icon svg { width: 12px; height: 12px; }

.bbi-ps-legend--new {
  border-color: transparent;
  background: var(--bbi-grad-brand);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(94, 114, 228, 0.7);
}

.bbi-ps-legend--new .bbi-ps-legend__icon { background: rgba(255, 255, 255, 0.22); }
.bbi-ps-legend--new.is-active { box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.18), 0 10px 20px -10px rgba(94, 114, 228, 0.7); }

/* Kickoff marker */
.bbi-ps-kickline {
  position: absolute;
  z-index: 3;
  background: repeating-linear-gradient(180deg, var(--bbi-navy-deep) 0 6px, transparent 6px 11px);
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.bbi-ps-kickline.is-alarm {
  background: repeating-linear-gradient(180deg, var(--bbi-bad) 0 6px, transparent 6px 11px);
  opacity: 0.9;
}

.bbi-ps-kick {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  border-radius: 999px;
  background: var(--bbi-navy-deep);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 20px -10px rgba(30, 42, 74, 0.7);
}

.bbi-ps-kick svg { width: 14px; height: 14px; }

/* The spreadsheet way */
.bbi-ps-block {
  --rot: 0deg;
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 6px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #e1e6f1;
  box-shadow: 0 8px 16px -10px rgba(50, 50, 93, 0.35), 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 13px;
  font-weight: 700;
  color: var(--bbi-ink);
  white-space: nowrap;
  opacity: 0;
  transform: rotate(var(--rot));
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.bbi-ps-block.is-in { opacity: 1; }

.bbi-ps-block__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
}

.bbi-ps-block__icon svg { width: 13px; height: 13px; }
.bbi-ps-block--sf .bbi-ps-block__icon { background: #e1f3fc; color: #0b8bd8; }
.bbi-ps-block--xls .bbi-ps-block__icon { background: #def5e8; color: #1a8f52; }
.bbi-ps-block--mail .bbi-ps-block__icon { background: #fff1db; color: #d97706; }
.bbi-ps-block--pink .bbi-ps-block__icon { background: var(--bbi-bad-bg); color: var(--bbi-bad); }
.bbi-ps-block--orange .bbi-ps-block__icon { background: #ffe9dc; color: var(--bbi-orange); }

.bbi-ps-chaos .bbi-ps-block.is-in { animation: bbi-ps-jitter 2.2s ease-in-out infinite; }
.bbi-ps-chaos .bbi-ps-block.is-in:nth-of-type(2n) { animation-duration: 2.7s; animation-delay: -0.8s; }
.bbi-ps-chaos .bbi-ps-block.is-in:nth-of-type(3n) { animation-duration: 3.1s; animation-delay: -1.6s; }

@keyframes bbi-ps-jitter {
  0%, 100% { transform: rotate(var(--rot)); }
  30% { transform: rotate(calc(var(--rot) + 1.4deg)) translateY(-1px); }
  65% { transform: rotate(calc(var(--rot) - 1.1deg)) translateY(1px); }
}

/* Flags */
.bbi-ps-flag {
  --pole: 56px;
  position: absolute;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.4s ease, filter 0.6s ease;
}

.bbi-ps-flag.is-in { opacity: 1; }

.bbi-ps-flag__pole {
  position: absolute;
  top: -4px;
  left: 0;
  width: 3px;
  height: var(--pole);
  border-radius: 3px;
  background: var(--bbi-navy-deep);
}

.bbi-ps-flag__pole::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bbi-navy-deep);
}

.bbi-ps-flag__cloth {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 3px;
  padding: 7px 26px 7px 12px;
  color: #fff;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 50%, 100% 100%, 0 100%);
  transform-origin: 0 50%;
}

.bbi-ps-flag__cloth em { display: block; font-style: normal; font-size: 12px; font-weight: 700; line-height: 1.25; opacity: 0.9; }
.bbi-ps-flag__cloth b { display: block; font-size: 13px; font-weight: 800; line-height: 1.25; }

.bbi-ps-flag--bad { --pole: 168px; z-index: 3; }
.bbi-ps-flag--bad .bbi-ps-flag__cloth { background: linear-gradient(135deg, #ff5f8f, #f0386b); }
.bbi-ps-flag--good .bbi-ps-flag__cloth { background: var(--bbi-grad-good); }

.bbi-ps-wave .bbi-ps-flag__cloth { animation: bbi-ps-unfurl 0.9s var(--bbi-spring) both; }

@keyframes bbi-ps-unfurl {
  0% { transform: scaleX(0.1) skewY(6deg); }
  60% { transform: scaleX(1.04) skewY(-2deg); }
  100% { transform: none; }
}

/* With BoogieBoard */
.bbi-ps-links { z-index: 2; }
.bbi-ps-links path.bbi-ps-track { stroke: #dfe4f2; stroke-width: 3; stroke-dasharray: 2 7; }
.bbi-ps-links path.bbi-ps-progress { stroke: url(#bbi-ps-grad); stroke-width: 3.5; }

.bbi-ps-step {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 4px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(94, 114, 228, 0.18);
  box-shadow: 0 10px 18px -12px rgba(50, 50, 93, 0.4), 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  opacity: 0;
}

.bbi-ps-step.is-in { opacity: 1; }

.bbi-ps-step__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  color: #fff;
}

.bbi-ps-step__icon svg { width: 14px; height: 14px; }
.bbi-ps-step--two .bbi-ps-step__icon { width: 30px; height: 30px; border-radius: 8px; }
.bbi-ps-step--two .bbi-ps-step__icon svg { width: 16px; height: 16px; }
.bbi-ps-step__text b { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--bbi-ink); }
.bbi-ps-step__text small { display: block; font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--bbi-muted); }

.bbi-ps-tint-sf { background: linear-gradient(135deg, #3fb5f0, #0b8bd8); }
.bbi-ps-tint-indigo { background: var(--bbi-grad-brand); }
.bbi-ps-tint-purple { background: linear-gradient(135deg, #9b7bf0, #6a4bd6); }
.bbi-ps-tint-green { background: var(--bbi-grad-good); }

.bbi-ps-dot {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d5dcef;
  color: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.bbi-ps-dot svg { width: 10px; height: 10px; }
.bbi-ps-dot.is-done { background: var(--bbi-indigo); border-color: #fff; color: #fff; box-shadow: 0 0 0 1px rgba(94, 114, 228, 0.35); }

/* After kickoff with BoogieBoard */
.bbi-ps-ready {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 0 18px 18px 0;
  background:
    repeating-linear-gradient(135deg, rgba(26, 174, 111, 0.06) 0 7px, transparent 7px 14px),
    rgba(220, 246, 233, 0.5);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.bbi-ps-ready.is-on { opacity: 1; }
.bbi-ps-ready__team { display: flex; }
.bbi-ps-ready__team .bbi-avatar { width: 38px; height: 38px; }
.bbi-ps-ready__team .bbi-avatar + .bbi-avatar { margin-left: -8px; }

.bbi-ps-ready__text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #128a57;
}

.bbi-ps-ready__text svg { width: 14px; height: 14px; }

/* Resolved: the old lane steps back */
.bbi-ps-resolved .bbi-ps-block.is-in { filter: grayscale(0.6) contrast(0.82) brightness(1.05); }
.bbi-ps-resolved .bbi-ps-legend--old { opacity: 0.8; }
