/* Plan vs live: the BoogieBoard against Salesforce Live View */

/* ---------- Top bar ---------- */

.bbi-pvl-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 0 18px;
}

.bbi-pvl-top > .bbi-tile { width: 40px; height: 40px; border-radius: 12px; }
.bbi-pvl-top > .bbi-tile svg { width: 21px; height: 21px; }
.bbi-pvl-top__title { min-width: 0; }
.bbi-pvl-top__title b { display: block; font-size: 16px; font-weight: 800; color: var(--bbi-ink); }
.bbi-pvl-top__title small { display: block; font-size: 12px; font-weight: 600; color: var(--bbi-muted); white-space: nowrap; }

.bbi-pvl-seg {
  position: relative;
  display: grid;
  grid-template-columns: 112px 210px;
  gap: 4px;
  height: 46px;
  margin-left: auto;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--bbi-line);
  background: var(--bbi-surface-2);
}

.bbi-pvl-seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 112px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--bbi-shadow-sm), 0 0 0 1.5px rgba(94, 114, 228, 0.35);
  transition: left 0.45s var(--bbi-ease), width 0.45s var(--bbi-ease), box-shadow 0.4s ease;
}

.bbi-pvl-seg.is-live .bbi-pvl-seg__thumb {
  left: 120px;
  width: 210px;
  box-shadow: var(--bbi-shadow-sm), 0 0 0 1.5px rgba(17, 167, 196, 0.5);
}

.bbi-pvl-seg__opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bbi-muted);
  white-space: nowrap;
  transition: color 0.3s ease, transform 0.2s ease;
}

.bbi-pvl-seg__opt svg { width: 16px; height: 16px; }
.bbi-pvl-seg__opt.is-on { color: var(--bbi-indigo); font-weight: 800; }
.bbi-pvl-seg__live.is-on { color: #0b8aa3; }
.bbi-pvl-seg__opt.is-pressed { transform: scale(0.95); }

/* ---------- Table ---------- */

.bbi-pvl-grid {
  display: grid;
  grid-template-columns: 172px 108px 108px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 0 18px;
}

.bbi-pvl-head {
  height: 46px;
  border-bottom: 1px solid var(--bbi-line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-pvl-head__gl { opacity: 0.5; transition: opacity 0.3s ease, color 0.3s ease; }
.bbi-pvl-main.is-gl .bbi-pvl-head__gl { opacity: 1; color: var(--bbi-indigo); }

.bbi-pvl-rows { padding-top: 4px; }

.bbi-pvl-row {
  height: 74px;
  transition: height 0.45s var(--bbi-ease), background-color 0.3s ease;
}

.bbi-pvl-main.is-open .bbi-pvl-row { height: 60px; }

.bbi-pvl-row.is-open { background: rgba(94, 114, 228, 0.05); }

.bbi-pvl-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.bbi-pvl-who .bbi-avatar { width: 36px; height: 36px; }
.bbi-pvl-who b { display: block; font-size: 14px; font-weight: 800; color: var(--bbi-ink); line-height: 1.25; white-space: nowrap; }
.bbi-pvl-who small { display: block; font-size: 12px; font-weight: 600; color: var(--bbi-muted); white-space: nowrap; }

.bbi-pvl-cell {
  height: 42px;
  padding: 0 10px 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.bbi-pvl-cell .bbi-cell__delta { padding-left: 4px; }

/* Gained / lost */

.bbi-pvl-gl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.bbi-pvl-main.is-gl .bbi-pvl-gl { opacity: 1; }

.bbi-pvl-gl__chips { display: flex; align-items: center; justify-content: center; gap: 6px; }

.bbi-pvl-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.bbi-pvl-chip--in { background: var(--bbi-good-bg); color: var(--bbi-good); }
.bbi-pvl-chip--out { background: var(--bbi-bad-bg); color: var(--bbi-bad); }
.bbi-pvl-chip--kept { background: var(--bbi-surface-2); color: var(--bbi-muted); }
.bbi-pvl-chip.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(240, 56, 107, 0.55); }
.bbi-pvl-chip.is-pressed { transform: scale(0.94); }

.bbi-pvl-arrows {
  position: relative;
  height: 8px;
}

.bbi-pvl-arrows i {
  position: absolute;
  left: calc(50% - 1px);
  top: -3px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: var(--bbi-faint);
}

.bbi-pvl-arrow {
  position: absolute;
  top: 1px;
  height: 6px;
  width: 0;
}

.bbi-pvl-arrow--in {
  left: calc(50% + 3px);
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, #7fe2b5, #1aae6f);
}

.bbi-pvl-arrow--out {
  right: calc(50% + 3px);
  border-radius: 0 3px 3px 0;
  background: linear-gradient(270deg, #ff9db7, #f0386b);
}

.bbi-pvl-arrow::after {
  content: '';
  position: absolute;
  top: -3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.bbi-pvl-arrow--in::after { right: -7px; border-left: 8px solid #1aae6f; }
.bbi-pvl-arrow--out::after { left: -7px; border-right: 8px solid #f0386b; }

.bbi-pvl-ghost {
  position: absolute;
  top: 58px;
  left: 448px;
  width: 254px;
  height: 284px;
  display: grid;
  place-items: center;
  border: 2px dashed #d7dcf0;
  border-radius: 14px;
  background: rgba(246, 248, 253, 0.6);
  transition: opacity 0.35s ease;
}

.bbi-pvl-main.is-gl .bbi-pvl-ghost { opacity: 0; }

.bbi-pvl-ghost__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(94, 114, 228, 0.35);
  background: #fff;
  box-shadow: var(--bbi-shadow-sm);
  font-size: 13px;
  font-weight: 800;
  color: var(--bbi-indigo);
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.bbi-pvl-ghost__btn svg { width: 15px; height: 15px; }
.bbi-pvl-ghost__btn.is-pressed { transform: scale(0.95); }

/* Accounts behind a value */

.bbi-pvl-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 0;
  margin: 0 8px;
  padding: 0 10px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bbi-surface-2);
  transition: height 0.45s var(--bbi-ease), margin 0.45s var(--bbi-ease);
}

.bbi-pvl-detail.is-open { height: 50px; margin-top: 2px; margin-bottom: 6px; }

.bbi-pvl-detail__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--bbi-bad);
  white-space: nowrap;
}

.bbi-pvl-detail__label svg { width: 14px; height: 14px; }

.bbi-pvl-leave { gap: 6px; padding-right: 6px; }
.bbi-pvl-leave > svg { width: 12px; height: 12px; color: var(--bbi-muted); }
.bbi-pvl-leave .bbi-avatar { width: 20px; height: 20px; box-shadow: none; }

.bbi-pvl-detail__more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--bbi-muted);
  white-space: nowrap;
}

/* ---------- Score strip ---------- */

.bbi-pvl-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 0 12px;
}

.bbi-pvl-ring {
  --pvl-score: 100;
  --pvl-color: var(--bbi-good);
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--pvl-color) calc(var(--pvl-score) * 1%), var(--bbi-line) 0);
}

.bbi-pvl-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}

.bbi-pvl-ring b {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 800;
  color: var(--bbi-ink);
  font-variant-numeric: tabular-nums;
}

.bbi-pvl-ring.is-bad { --pvl-color: var(--bbi-bad); }

.bbi-pvl-stat b { display: block; font-size: 14px; font-weight: 800; color: var(--bbi-ink); white-space: nowrap; }
.bbi-pvl-stat small { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--bbi-muted); white-space: nowrap; }

.bbi-pvl-legend i { width: 10px; height: 10px; border-radius: 3px; }
.bbi-pvl-legend i.is-good { background: var(--bbi-good-bg); box-shadow: inset 0 0 0 1.5px var(--bbi-good); }
.bbi-pvl-legend i.is-bad { margin-left: 6px; background: var(--bbi-bad-bg); box-shadow: inset 0 0 0 1.5px var(--bbi-bad); }

.bbi-pvl-sep { width: 1px; height: 32px; background: var(--bbi-line); }

.bbi-pvl-summary { margin-left: auto; height: 30px; padding: 0 12px; font-size: 13px; }
