.zenref-scenario {
  --scenario-bar-col: 123px; /* 101 label + 22 gap */
  --scenario-bar-end: 22px;  /* right padding on the bar/axis area */
  --scenario-total-days: 350;
  margin-top: 72px;
  padding: 0 24px;
  color: #FFF;
}

/* per-phase today day — tweak these to move the today line per phase */
.zenref-scenario__board[data-phase="1"] { --scenario-today-day: 5; }
.zenref-scenario__board[data-phase="2"] { --scenario-today-day: 90; }
.zenref-scenario__board[data-phase="3"] { --scenario-today-day: 100; }

/* per-step bar config — one set of values per (phase, business) */
[data-phase="1"] [data-row-biz="A"] .zenref-scenario__row-fill { --scenario-start-day: 5;   --scenario-end-day: 180; }
[data-phase="2"] [data-row-biz="A"] .zenref-scenario__row-fill { --scenario-start-day: 5;   --scenario-end-day: 240; }
[data-phase="3"] [data-row-biz="A"] .zenref-scenario__row-fill { --scenario-start-day: 5;   --scenario-end-day: 300; }

[data-phase="2"] [data-row-biz="B"] .zenref-scenario__row-fill { --scenario-start-day: 90;  --scenario-end-day: 270; }
[data-phase="3"] [data-row-biz="B"] .zenref-scenario__row-fill { --scenario-start-day: 90;  --scenario-end-day: 330; }

[data-phase="3"] [data-row-biz="C"] .zenref-scenario__row-fill { --scenario-start-day: 100; --scenario-end-day: 270; }

[data-phase="1"] [data-row-biz="A"] .zenref-scenario__row-badge--remaining { --scenario-end-day: 180; }
[data-phase="2"] [data-row-biz="A"] .zenref-scenario__row-badge--remaining { --scenario-end-day: 240; }
[data-phase="3"] [data-row-biz="A"] .zenref-scenario__row-badge--remaining { --scenario-end-day: 300; }
[data-phase="2"] [data-row-biz="B"] .zenref-scenario__row-badge--remaining { --scenario-end-day: 270; }
[data-phase="3"] [data-row-biz="B"] .zenref-scenario__row-badge--remaining { --scenario-end-day: 330; }
[data-phase="3"] [data-row-biz="C"] .zenref-scenario__row-badge--remaining { --scenario-end-day: 270; }

/* bright/elapsed green starts here. defaults to bar start, override per row/phase */

.zenref-scenario__inner {
  max-width: 1312px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 40px;
}

.zenref-scenario__title-wrap {
  display: flex;
  justify-content: center;
}

.zenref-scenario__title {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 40px 56px;
  border-radius: 64px;
  background: linear-gradient(143deg, #222 0.72%, #000 100%);
  color: #FFF;
  text-align: center;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: Nunito, sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 32px;
}

.zenref-scenario__title-accent {
  color: #22E243;
  font-family: Nunito, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.zenref-scenario__board {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px 32px 0 32px;
  margin-bottom: 56px;
  border-radius: 16px;
}

/* ---------- phase-text helper ---------- */

.zenref-scenario__phase-text { display: none; }
.zenref-scenario__board[data-phase="1"] [data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] [data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] [data-show-in-phase="3"] {
  display: revert;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__row-badge[data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-badge[data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-badge[data-show-in-phase="3"] {
  display: inline-flex;
}

/* remaining badge always visible per row */
.zenref-scenario__row-badge--remaining { display: inline-flex; }

/* inner phase-text shows icon + text inline-flex with gap */
.zenref-scenario__board[data-phase="1"] .zenref-scenario__row-badge--remaining > [data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-badge--remaining > [data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-badge--remaining > [data-show-in-phase="3"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__row-tag--pct > [data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-tag--pct > [data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-tag--pct > [data-show-in-phase="3"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__row-tag--days > [data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-tag--days > [data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-tag--days > [data-show-in-phase="3"],
.zenref-scenario__board[data-phase="1"] .zenref-scenario__row-tag--remaining > [data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-tag--remaining > [data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-tag--remaining > [data-show-in-phase="3"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ext badges cumulative: visible from their from_phase onward */
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-badge--ext[data-from-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-badge--ext[data-from-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-badge--ext[data-from-phase="3"] {
  display: inline-flex;
}

.zenref-scenario__row-fill { display: block; }

/* the row that activates in the current phase has flat left side, rounded right */
.zenref-scenario__board[data-phase="1"] .zenref-scenario__row[data-active-in="1"] .zenref-scenario__row-fill,
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row[data-active-in="2"] .zenref-scenario__row-fill,
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-active-in="3"] .zenref-scenario__row-fill {
  border-radius: 0 8px 8px 0;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__btn[data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__btn[data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__btn[data-show-in-phase="3"] {
  display: inline-flex;
}

/* today-pos elements are data carriers only */
.zenref-scenario__today-pos,
.zenref-scenario__row-today-pos {
  display: none !important;
}

/* ---------- intros ---------- */

.zenref-scenario__intros {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 33px;
}

.zenref-scenario__intro {
  margin: 0;
  margin-bottom: 0 !important;
  font-family: Nunito, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  color: #B3AA9D;
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
}

.zenref-scenario__intro .zenref-scenario__biz-name {
  color: #B3AA9D;
  font-family: Nunito, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

.zenref-scenario__intro strong {
  color: inherit;
  font-family: Nunito, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-from="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-from="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-from="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="1"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="3"] {
  opacity: 1;
  visibility: visible;
}

.zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-from="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="3"] {
  animation: zenref-scenario-intro-rise 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes zenref-scenario-intro-rise {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-active-in="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-active-in="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-active-in="3"] {
  color: #FFF;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-active-in="1"] .zenref-scenario__biz-name,
.zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-active-in="2"] .zenref-scenario__biz-name,
.zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-active-in="3"] .zenref-scenario__biz-name {
  color: #22E243;
}

/* ---------- head ---------- */

.zenref-scenario__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.zenref-scenario__pills {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.zenref-scenario__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(111, 104, 94, 0.40);
  background: transparent;
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  transition: border-color 300ms ease;
}

.zenref-scenario__pill--active {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 64px;
  border: 1px solid #888;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: #FFF;
}

.zenref-scenario__pill--active .zenref-scenario__pill-value,
.zenref-scenario__pill--active .zenref-scenario__phase-text {
  color: #22E243;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
}

.zenref-scenario__pill-arrow { display: none; }
.zenref-scenario__board[data-phase="2"] .zenref-scenario__pill--commission .zenref-scenario__pill-arrow,
.zenref-scenario__board[data-phase="3"] .zenref-scenario__pill--commission .zenref-scenario__pill-arrow {
  display: inline-flex;
}

.zenref-scenario__pill--commission {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 64px;
  border: 1px solid #888;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: #FFF;
  transition: border-color 300ms ease;
}

.zenref-scenario__pill-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
}

.zenref-scenario__pill-info svg { display: block; }

.zenref-scenario__tooltip {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: none;
  width: 320px;
  padding: 19px 22px 18px 24px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  border-radius: 16px;
  border: 1px solid rgba(114, 114, 114, 0.50);
  background: #222;
  color: #FFF;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
}

/* Flip: kiedy tooltip nie mieści się pod pillem, JS dokleja .is-above i wyrzuca go nad pill. */
.zenref-scenario__tooltip.is-above {
  top: auto;
  bottom: calc(100% + 12px);
}

.zenref-scenario__pill--commission:hover .zenref-scenario__tooltip,
.zenref-scenario__pill--commission .zenref-scenario__tooltip.is-open {
  display: flex;
  pointer-events: auto;
}

.zenref-scenario__tooltip-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: none;
}

.zenref-scenario__tooltip-head {
  display: flex;
  align-self: stretch;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(179, 170, 157, 0.15);
  color: #B3AA9D;
  text-align: center;
  font-family: Nunito, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 21px;
  text-transform: uppercase;
}

.zenref-scenario__tooltip-rows {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  align-items: stretch;
  gap: 4px;
  margin-top: 4px;
}

.zenref-scenario__tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 8px 56px;
  min-height: 42px;
  border-bottom: 1px solid rgba(179, 170, 157, 0.15);
}

.zenref-scenario__tooltip-row:last-child { border-bottom: 0; }

.zenref-scenario__tooltip-count {
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.zenref-scenario__tooltip-count.is-max { color: #22E243; }

.zenref-scenario__tooltip-vals {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.zenref-scenario__tooltip-pct {
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.zenref-scenario__tooltip-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 48px;
  border: 1px solid rgba(114, 114, 114, 0.50);
  background: linear-gradient(143deg, #222 0.72%, #222 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.zenref-scenario__tooltip-delta {
  color: #22E243;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
}

.zenref-scenario__tooltip-box--max {
  color: #22E243;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  background: #000;
  border-color: transparent;
}

.zenref-scenario__pill--commission .zenref-scenario__pill-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.zenref-scenario__board[data-phase="2"] .zenref-scenario__pill--commission,
.zenref-scenario__board[data-phase="3"] .zenref-scenario__pill--commission {
  border-color: #22E243;
}

.zenref-scenario__pill--commission .zenref-scenario__pill-value,
.zenref-scenario__pill--commission .zenref-scenario__phase-text {
  color: #22E243;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
}

.zenref-scenario__pill-label--short { display: none; }
.zenref-scenario__pill-value { color: #22E243; font-weight: 700; }

.zenref-scenario__legend {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #B3AA9D;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 18px;
}

.zenref-scenario__legend-item { display: inline-flex; align-items: center; gap: 5px; }
.zenref-scenario__legend-swatch { display: block; width: 24px; height: 11.895px; flex-shrink: 0; }
.zenref-scenario__legend-mark { display: inline-block; width: 2px; height: 11.895px; background: #FC5555; border-radius: 3px; }

/* ---------- timeline ---------- */

.zenref-scenario__timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zenref-scenario__axis {
  position: relative;
}

.zenref-scenario__axis::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.116px;
  background: rgba(136, 136, 136, 0.30);
}

.zenref-scenario__axis-track {
  position: relative;
  height: 22px;
  margin-left: var(--scenario-bar-col);
  margin-right: var(--scenario-bar-end);
}

.zenref-scenario__axis-day {
  position: absolute;
  top: 0;
  left: calc(var(--scenario-day, 0) * 100% / var(--scenario-total-days));
  transform: translateX(-50%);
  color: #B3AA9D;
  font-family: Nunito, sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  white-space: nowrap;
  text-box: trim-both cap alphabetic;
}

.zenref-scenario__axis-day--start { transform: translateX(0); }
.zenref-scenario__axis-day--end   { transform: translateX(-100%); }

.zenref-scenario__axis-day--highlight {
  color: #FFF;
}

.zenref-scenario__rows {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 16px;
}

.zenref-scenario__row {
  display: none;
  grid-template-columns: 101px 1fr;
  align-items: center;
  gap: 22px;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__row[data-from="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row[data-from="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row[data-from="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-from="1"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-from="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-from="3"] {
  display: grid;
}

.zenref-scenario__board[data-phase="2"] .zenref-scenario__row[data-from="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-from="3"] {
  animation: zenref-scenario-row-in 600ms ease both;
}

@keyframes zenref-scenario-row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.zenref-scenario__row-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
}

.zenref-scenario__row-name {
  color: #FFF;
  text-align: center;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: Nunito, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 24px;
  transition: color 300ms ease;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__row[data-active-in="1"] .zenref-scenario__row-name,
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row[data-active-in="2"] .zenref-scenario__row-name,
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-active-in="3"] .zenref-scenario__row-name {
  color: #22E243;
}

.zenref-scenario__row-tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.zenref-scenario__row-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 48px;
  border: 1px solid transparent;
  background:
    linear-gradient(143deg, #222 0.72%, #222 100%) padding-box,
    linear-gradient(0deg, #000 0%, rgba(114, 114, 114, 0.5) 50%) border-box;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: 18px;
}

.zenref-scenario__row-tag--days,
.zenref-scenario__row-tag--remaining { display: none; }

.zenref-scenario__row-delta {
  color: #22E243;
  font-family: Nunito, sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 18px;
}

.zenref-scenario__row-bar { position: relative; padding-right: var(--scenario-bar-end); }

.zenref-scenario__row-axis {
  display: none;
  position: relative;
  height: 16px;
  margin-bottom: 8px;
  border-top: 1px solid #2F312F;
}

.zenref-scenario__row-track {
  position: relative;
  height: 48px;
  background: #2D2C2C;
  border-radius: 8px;
  overflow: visible;
}

.zenref-scenario__row-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--scenario-start-day, 0) * 100% / var(--scenario-total-days));
  width: calc((var(--scenario-end-day, 0) - var(--scenario-start-day, 0)) * 100% / var(--scenario-total-days));
  border-radius: 8px;
  background: #228233;
  overflow: hidden;
  transition: left 700ms cubic-bezier(0.16, 1, 0.3, 1), width 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.zenref-scenario__row-fill::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((var(--scenario-bright-start-day, var(--scenario-start-day, 0)) - var(--scenario-start-day, 0)) * 100% / (var(--scenario-end-day, 1) - var(--scenario-start-day, 0)));
  width: calc((var(--scenario-today-day, 0) - var(--scenario-bright-start-day, var(--scenario-start-day, 0))) * 100% / (var(--scenario-end-day, 1) - var(--scenario-start-day, 0)));
  border-radius: 8px 0 0 8px;
  background: #22E243;
  transition: left 700ms cubic-bezier(0.16, 1, 0.3, 1), width 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* shimmer overlay triggered by JS during phase change */
.zenref-scenario__row-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.22) 50%, transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.zenref-scenario__board.is-loading .zenref-scenario__row-fill::after {
  animation: zenref-scenario-shimmer 1100ms ease both;
}

@keyframes zenref-scenario-shimmer {
  0%   { transform: translateX(-100%); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

.zenref-scenario__row-badge {
  position: absolute;
  top: 50%;
  left: calc(var(--scenario-day, 0) * 100% / var(--scenario-total-days));
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0E0E0E;
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(34, 226, 67, 0.25);
  animation: zenref-scenario-badge-in 600ms ease both;
}

.zenref-scenario__row-badge--ext {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 26px;
  padding: 7px 11px 7px 9px;
  border-radius: 64px;
  border: 1px solid rgba(255, 255, 255, 0.50);
  background: transparent;
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  box-shadow: none;
  transform: translate(calc(-100% - 12px), -50%);
  animation: zenref-scenario-ext-badge-in 600ms ease both;
}

.zenref-scenario__board[data-phase="1"] .zenref-scenario__row-badge--ext[data-show-in-phase="1"],
.zenref-scenario__board[data-phase="2"] .zenref-scenario__row-badge--ext[data-show-in-phase="2"],
.zenref-scenario__board[data-phase="3"] .zenref-scenario__row-badge--ext[data-show-in-phase="3"] {
  display: inline-flex;
}

@keyframes zenref-scenario-ext-badge-in {
  from { opacity: 0; transform: translate(calc(-100% - 12px), -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(calc(-100% - 12px), -50%) scale(1); }
}

.zenref-scenario__row-badge--ext::before {
  content: '';
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 48px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0.3) 4px, transparent 4px, transparent 8px);
  pointer-events: none;
  z-index: -1;
}

@keyframes zenref-scenario-badge-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.zenref-scenario__row-badge--remaining {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 26px;
  left: calc(var(--scenario-end-day, 0) * 100% / var(--scenario-total-days));
  padding: 7px 11px 7px 9px;
  border-radius: 64px;
  border: 1px solid rgba(136, 136, 136, 0.30);
  background: #222;
  box-shadow: none;
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  transform: translate(calc(-100% - 10px), -50%);
  animation: zenref-scenario-remaining-badge-in 600ms ease both;
}

@keyframes zenref-scenario-remaining-badge-in {
  from { opacity: 0; transform: translate(calc(-100% - 10px), -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(calc(-100% - 10px), -50%) scale(1); }
}

/* ---------- today line: global rail (desktop) ---------- */

.zenref-scenario__today-rail {
  position: absolute;
  top: 22px;
  bottom: 0;
  left: var(--scenario-bar-col);
  right: var(--scenario-bar-end);
  pointer-events: none;
  z-index: 2;
}

.zenref-scenario__today-line {
  position: absolute;
  top: -3px;
  bottom: 4px;
  width: 3px;
  background: #FC5555;
  border-radius: 3px 3px 0 0;
  left: calc(var(--scenario-today-day, 0) * 100% / var(--scenario-total-days));
  transition: left 700ms cubic-bezier(0.16, 1, 0.3, 1), bottom 700ms ease;
}

.zenref-scenario__board[data-phase="3"] .zenref-scenario__today-line {
  bottom: 5px;
}

/* ---------- per-row today line (mobile) ---------- */

.zenref-scenario__row-today {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: #FC5555;
  border-radius: 3px 3px 0 0;
  left: calc(var(--scenario-today-day, 0) * 100% / var(--scenario-total-days));
  transition: left 700ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  display: none;
}

/* ---------- action button ---------- */

.zenref-scenario__action {
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 48px;
}

.zenref-scenario__btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
  animation: zenref-scenario-btn-in 600ms ease both;
}

@keyframes zenref-scenario-btn-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.zenref-scenario__btn--outline {
  background: transparent;
  border: 1px solid #22E243;
  border-radius: 64px;
  color: #FFF;
  font-family: Nunito, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0.07px;
  text-transform: uppercase;
  padding: 14px 32px;
}

.zenref-scenario__btn--outline .zenref-scenario__btn-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zenref-scenario__btn--outline .zenref-scenario__btn-white { color: #FFF; }
.zenref-scenario__btn--outline .zenref-scenario__btn-green { color: #22E243; }

.zenref-scenario__btn--outline:hover {
  background: #22E243;
  color: #000;
}

.zenref-scenario__btn--outline:hover .zenref-scenario__btn-white,
.zenref-scenario__btn--outline:hover .zenref-scenario__btn-green {
  color: #000;
}

.zenref-scenario__btn--solid {
  margin-top: 16px;
  background: #22E243;
  border: 1px solid #22E243;
  border-radius: 64px;
  color: #000;
  height: 64px;
  padding: 24px 32px;
  font-family: Nunito, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.zenref-scenario__btn--solid {
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.zenref-scenario__btn--solid svg path {
  transition: stroke 0.2s;
}
.zenref-scenario__btn--solid:hover {
  background: #20BB3B;
  color: #000;
  border-color: #20BB3B;
}
.zenref-scenario__btn--solid:hover svg path { stroke: #000; }

.zenref-scenario__btn svg { flex-shrink: 0; }

/* ---------- mobile ---------- */

@media (max-width: 768px) {
  .zenref-scenario {
    margin-top: 64px;
    padding: 0 16px;
  }

  /* Tytuł na mobile: jeden płynący tekst (zamiast inline-flex z kolumnami). */
  .zenref-scenario__title {
    display: block;
    padding: 32px 40px;
    font-size: 18px;
    line-height: 24px;
  }
  .zenref-scenario__title-accent {
    display: inline;
    font-size: 18px;
    line-height: 24px;
  }

  .zenref-scenario__pill-arrow svg {
    width: 16px;
    height: 16px;
  }

  .zenref-scenario__pill--commission:hover .zenref-scenario__tooltip { display: none; }
  .zenref-scenario__pill--commission .zenref-scenario__tooltip.is-open { display: flex; pointer-events: auto; }

  /* X close: nad tooltipem jako osobny rząd, przyklejony do prawej. */
  .zenref-scenario__tooltip-close {
    position: static;
    display: inline-flex;
    align-self: flex-end;
    padding: 10px;
    margin: -6px -6px 4px;
  }
  .zenref-scenario__tooltip-close svg {
    width: 20px;
    height: 20px;
  }

  /* Tooltip: pill commission siedzi po prawej — kotwiczymy do prawej krawędzi pilla,
     rozciągamy w lewo, max szerokość = viewport - padding sekcji (16px * 2). */
  .zenref-scenario__tooltip {
    width: min(320px, calc(100vw - 32px));
    right: 0;
    left: auto;
    padding: 16px 16px 14px 20px;
    box-sizing: border-box;
  }

  .zenref-scenario__tooltip-row {
    padding: 8px 0 8px 8px;
    gap: 8px;
  }

  .zenref-scenario__tooltip-vals {
    flex-shrink: 0;
    gap: 6px;
  }

  .zenref-scenario__tooltip-box {
    padding: 6px 8px;
  }

  .zenref-scenario__board {
    padding: 0;
    gap: 0;
  }
  .zenref-scenario__board > * + * { margin-top: 32px; }
  .zenref-scenario__head + * { margin-top: 0; }

  .zenref-scenario__head {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }

  .zenref-scenario__legend { margin-top: 32px; }

  .zenref-scenario__pills { width: 100%; gap: 12px; }

  .zenref-scenario__pill {
    flex: 1 1 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 6px;
    padding: 12px 16px;
    white-space: normal;
  }

  .zenref-scenario__pill-label--full  { display: none; }
  .zenref-scenario__pill-label--short {
    display: inline;
    color: #FFF;
    width: 100%;
    text-align: center;
    order: -1;
  }

  /* expose pill-text children as direct flex items of the pill */
  .zenref-scenario__pill--commission .zenref-scenario__pill-text {
    display: contents;
  }

  /* active pill: label on top, icon + number below */
  .zenref-scenario__pill--active {
    flex: 1 0 0;
    flex-direction: row;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 10px 20px 10px 20px;
    gap: 6px 3px;
  }

  .zenref-scenario__pill--active > svg {
    width: 16px;
    height: 16px;
  }

  .zenref-scenario__pill--active .zenref-scenario__pill-label--short,
  .zenref-scenario__pill--active .zenref-scenario__pill-value,
  .zenref-scenario__pill--active .zenref-scenario__phase-text {
    text-box: trim-both cap alphabetic;
  }

  .zenref-scenario__pill--active .zenref-scenario__pill-value,
  .zenref-scenario__pill--active .zenref-scenario__phase-text {
    font-size: 20px;
  }

  /* commission pill: same layout as active */
  .zenref-scenario__pill--commission {
    flex: 1 0 0;
    flex-direction: row;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 10px 20px 10px 20px;
    gap: 6px 3px;
  }

  .zenref-scenario__pill--commission .zenref-scenario__pill-label--short,
  .zenref-scenario__pill--commission .zenref-scenario__pill-value,
  .zenref-scenario__pill--commission .zenref-scenario__phase-text {
    text-box: trim-both cap alphabetic;
  }

  .zenref-scenario__pill--commission .zenref-scenario__pill-value,
  .zenref-scenario__pill--commission .zenref-scenario__phase-text {
    font-size: 20px;
  }

  /* intros: stack vertical, hide non-current */
  .zenref-scenario__intros {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    margin: 0;
  }

  .zenref-scenario__intro {
    display: none;
    white-space: normal;
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    color: #B3AA9D;
    transition: color 400ms ease, font-size 400ms ease, margin-top 400ms ease;
  }

  .zenref-scenario__intro .zenref-scenario__biz-name,
  .zenref-scenario__intro strong {
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    transition: color 400ms ease, font-size 400ms ease;
  }

  .zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-from="1"],
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-from="1"],
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-from="2"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="1"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="2"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-from="3"] {
    display: block;
  }

  /* active intro: bigger fonts, green biz-name, white text */
  .zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-active-in="1"],
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-active-in="2"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-active-in="3"] {
    font-size: 22px;
    font-weight: 500;
    line-height: 20px;
    color: #FFF;
  }

  .zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-active-in="1"] .zenref-scenario__biz-name,
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-active-in="2"] .zenref-scenario__biz-name,
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-active-in="3"] .zenref-scenario__biz-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 20px;
    color: #22E243;
  }

  .zenref-scenario__board[data-phase="1"] .zenref-scenario__intro[data-active-in="1"] strong,
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__intro[data-active-in="2"] strong,
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro[data-active-in="3"] strong {
    font-size: 22px;
    font-weight: 700;
    line-height: 20px;
  }

  /* spacing: 20px between inactives, 32px before active */
  .zenref-scenario__intro + .zenref-scenario__intro { margin-top: 20px; }

  .zenref-scenario__board[data-phase="2"] .zenref-scenario__intro + .zenref-scenario__intro[data-active-in="2"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__intro + .zenref-scenario__intro[data-active-in="3"] {
    margin-top: 32px;
  }

  .zenref-scenario__axis { display: none; } /* per-row axis on mobile */
  .zenref-scenario__row-axis {
    display: block;
    height: 21.116px;
    border: 0;
  }
  .zenref-scenario__row-axis::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.116px;
    background: rgba(136, 136, 136, 0.30);
  }

  .zenref-scenario__row-axis .zenref-scenario__axis-day--highlight { text-align: center; }

  .zenref-scenario__rows { gap: 0; padding-top: 0; }

  .zenref-scenario__row {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 28px;
    border-bottom: 1px solid #2F312F;
    margin-bottom: 28px;
  }

  /* active row is always the last visible one — no separator after it */
  .zenref-scenario__board[data-phase="1"] .zenref-scenario__row[data-active-in="1"],
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__row[data-active-in="2"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__row[data-active-in="3"] {
    padding-bottom: 0;
    border-bottom: 0;
    margin-bottom: 0;
  }

  .zenref-scenario__row-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .zenref-scenario__row-tags {
    width: 100%;
    justify-content: space-between;
  }

  .zenref-scenario__row-tag {
    min-height: 28px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .zenref-scenario__row-tag--remaining { display: inline-flex; }

  .zenref-scenario__board[data-phase="1"] .zenref-scenario__row-tag--days[data-phases*="1"],
  .zenref-scenario__board[data-phase="2"] .zenref-scenario__row-tag--days[data-phases*="2"],
  .zenref-scenario__board[data-phase="3"] .zenref-scenario__row-tag--days[data-phases*="3"] {
    display: inline-flex;
  }

  .zenref-scenario__row-tag--days {
    height: 28px;
    padding: 7px 11px 7px 9px;
    border-radius: 64px;
    border: 1px solid rgba(255, 255, 255, 0.50);
    background: transparent;
    justify-content: center;
    gap: 6px;
  }

  .zenref-scenario__row-tag--remaining { font-weight: 500; }

  .zenref-scenario__row-badge--remaining { display: none !important; }

  .zenref-scenario__row-badge--ext {
    width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    font-size: 0;
    gap: 0;
    overflow: visible;
    transform: translate(-50%, -50%);
    animation: none;
  }
  .zenref-scenario__row-badge--ext > * { display: none; }
  .zenref-scenario__row-badge--ext::before {
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 32px;
    z-index: 2;
    opacity: 1;
    background: linear-gradient(to bottom,
      rgba(255,255,255,0.3) 0, rgba(255,255,255,0.3) 4px,
      transparent 4px, transparent 7px,
      rgba(255,255,255,0.3) 7px, rgba(255,255,255,0.3) 11px,
      transparent 11px, transparent 14px,
      rgba(255,255,255,0.3) 14px, rgba(255,255,255,0.3) 18px,
      transparent 18px, transparent 21px,
      rgba(255,255,255,0.3) 21px, rgba(255,255,255,0.3) 25px,
      transparent 25px, transparent 28px,
      rgba(255,255,255,0.3) 28px, rgba(255,255,255,0.3) 32px
    );
  }

  .zenref-scenario__row-bar { padding-right: 0; }

  .zenref-scenario__row-track {
    height: 32px;
    border-radius: 8px;
  }

  /* hide global today rail, show per-row */
  .zenref-scenario__today-rail { display: none; }
  .zenref-scenario__row-today {
    display: block;
    width: 2px;
    height: 40px;
    border-radius: 2px;
    background: #FC5555;
    top: -4px;
    bottom: auto;
  }

  .zenref-scenario__btn { width: 100%; }
  .zenref-scenario__btn--outline {
    padding: 14px 24px;
  }
  .zenref-scenario__btn--outline svg {
    width: 16px;
    height: 16px;
  }
  .zenref-scenario__btn--solid {
    margin-top: 0;
    height: auto;
    padding: 19px 32px;
  }
  .zenref-scenario__btn--solid svg {
    width: 16px;
    height: 16px;
  }
}
