/* Nurturing scenario in an automation builder (includes/visuals/sequence.php) */
.sq { --sq-wire: #7d8a80; border-radius: var(--radius); overflow: hidden; background: var(--white); border: 1px solid var(--line); box-shadow: 0 40px 70px -50px rgba(12, 43, 21, .45); }
.sq ul, .sq ol { list-style: none; margin: 0; padding: 0; }
.sq-bar { display: flex; align-items: center; gap: 16px; padding: 12px 18px; background: var(--forest); color: var(--white); }
.sq-dots { display: flex; gap: 6px; }
.sq-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.sq-crumb { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--sage); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-crumb strong { color: var(--white); font-weight: 600; }
.sq-status { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(150, 248, 120, .14); color: var(--green); font-size: 13px; font-weight: 600; }
.sq-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.sq-body { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .sq-body { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); } }
@media (min-width: 1200px) { .sq-body { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 320px); } }
.sq-side { display: none; }
@media (min-width: 1200px) { .sq-side { display: block; padding: 20px 16px; border-right: 1px solid var(--line); } }
.sq-c-l { margin: 0 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green-text); }
.sq-blocks { display: grid; gap: 6px; }
.sq-blocks li { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
  background: radial-gradient(circle, #b9b3aa 0 1px, transparent 1.4px) right 8px center / 4px 4px repeat-y; background-size: 4px 4px; }
.sq-blocks .sq-ic { width: 16px; height: 16px; }

/* canvas */
.sq-canvas { min-width: 0; padding: 26px 18px 18px; background-color: var(--paper); background-image: radial-gradient(circle, #d2cdc5 1px, transparent 1.3px); background-size: 18px 18px; }
.sq-flow { display: flex; flex-direction: column; align-items: center; }
.sq-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sq-n { position: relative; z-index: 1; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: min(100%, 290px); padding: 9px 12px 9px 10px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--forest); box-shadow: 0 6px 14px -10px rgba(12, 43, 21, .4); }
.sq-n-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--mint); color: var(--forest); }
.sq-n-t { margin: 0; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--forest); }
.sq-n-k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.sq-n-note { display: block; font-weight: 400; font-size: 12.5px; color: var(--sage); }
.sq-badge { padding: 3px 8px; border-radius: 999px; background: var(--forest); color: var(--green); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sq-n--trigger { border-left-color: var(--green-2); }
.sq-n--trigger .sq-n-ic { background: var(--green); }
.sq-n--wait { border-left-color: var(--sage); }
.sq-n--wait .sq-n-ic { background: var(--paper); }
.sq-n--cond { border-left-color: var(--forest-2); }
.sq-n--cond .sq-n-ic { background: var(--forest-2); color: var(--green); }
.sq-n--signal { border-left-color: var(--green-2); }
.sq-n--score { border-left-color: var(--green-text); }
.sq-n--final { background: var(--forest); border-color: var(--forest); }
.sq-n--final .sq-n-ic { background: var(--green); }
.sq-n--final .sq-n-t { color: var(--white); }
.sq-n--final .sq-n-k { color: var(--green); }

/* wires and the travelling lead */
.sq-wire { position: relative; display: block; width: 2px; height: 26px; background: var(--sq-wire); }
.sq-tok { position: absolute; top: 0; left: 1px; width: 0; height: 100%; opacity: 0; }
.sq-tok::before { content: ""; position: absolute; top: -7px; left: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--green); border: 3px solid var(--forest); }

.sq-split { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 620px; padding: 26px 0 26px;
  background: linear-gradient(var(--sq-wire), var(--sq-wire)) 50% 0 / 2px 12px no-repeat, linear-gradient(var(--sq-wire), var(--sq-wire)) 50% 100% / 2px 12px no-repeat; }
.sq-split::before, .sq-split::after { content: ""; position: absolute; left: 25%; right: 25%; height: 14px; border: 2px solid var(--sq-wire); }
.sq-split::before { top: 12px; border-bottom: 0; border-radius: 12px 12px 0 0; }
.sq-split::after { bottom: 12px; border-top: 0; border-radius: 0 0 12px 12px; }
.sq-br { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0 8px; }
.sq-yn { position: relative; z-index: 1; margin-top: -4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.sq-br--yes .sq-yn { background: var(--green); color: var(--forest); }
.sq-br--no .sq-yn { background: var(--white); color: var(--ink-2); border: 1px solid var(--line); }
.sq-br .sq-wire { height: 18px; }
.sq-br .sq-wire--end { flex: 1 0 18px; height: auto; min-height: 18px; }
.sq-br--no .sq-n { opacity: .72; }
.sq-br--no .sq-wire { background: repeating-linear-gradient(var(--sq-wire) 0 4px, transparent 4px 8px); }

.sq-consent { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.sq-consent::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green-2); vertical-align: 1px; }

/* contact record */
.sq-contact { padding: 22px 20px; border-top: 1px solid var(--line); }
@media (min-width: 860px) { .sq-contact { border-top: 0; border-left: 1px solid var(--line); } }
.sq-who { margin: 0 0 22px; display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.sq-who strong { display: block; font-size: 16px; color: var(--forest); }
.sq-av { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sage); color: var(--forest); font-weight: 700; flex: none; }
.sq-score { margin-bottom: 22px; padding: 14px; border-radius: 10px; background: var(--paper); }
.sq-score-h { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sq-score-v { display: grid; font-family: var(--font-serif); font-size: 34px; line-height: 1; color: var(--forest); font-variant-numeric: tabular-nums; }
.sq-sv { grid-area: 1 / 1; text-align: right; }
.sq-sv--a, .sq-sv--b { opacity: 0; }
/* bar: scale 0–80, final 55 = 68.75 %, threshold 50 = 62.5 % */
.sq-meter { position: relative; height: 12px; border-radius: 999px; background: var(--line); }
.sq-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 68.75%; border-radius: 999px; background: var(--green-2); transform-origin: left; }
.sq-meter-th { position: absolute; left: 62.5%; top: -6px; bottom: -6px; width: 2px; background: var(--forest); }
.sq-th-l { margin: 8px 0 0 calc(62.5% - 2px); font-size: 12px; line-height: 1.3; color: var(--ink-2); border-left: 2px solid var(--forest); padding-left: 6px; }
.sq .sq-hist { position: relative; display: grid; gap: 10px; padding-left: 20px; font-size: 13.5px; line-height: 1.35; color: var(--ink); }
.sq-hist::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.sq-h { position: relative; }
.sq-h::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--white); border: 2px solid var(--forest); }
.sq-h--5 { font-weight: 600; color: var(--forest); }
.sq-h--5::before { background: var(--green); }

@media (max-width: 600px) {
  .sq-canvas { padding: 20px 10px 14px; }
  .sq-br { padding: 0 4px; }
  .sq-br .sq-n { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 8px 8px 8px 8px; }
  .sq-br .sq-n-ic { display: none; }
  .sq-br .sq-n-t { font-size: 12.5px; }
  .sq-crumb span { display: none; }
}

/* intro: nodes and wires appear in order */
.js .vz-figure .sq-n, .js .vz-figure .sq-yn { opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.js .vz-figure .sq-wire, .js .vz-figure .sq-split::before, .js .vz-figure .sq-split::after { transform: scaleY(0); transform-origin: top; transition: transform .3s ease; }
.js .vz-figure .sq-a1, .js .vz-figure .sq-w--1 { transition-delay: .2s; }
.js .vz-figure .sq-a2, .js .vz-figure .sq-w--2 { transition-delay: .4s; }
.js .vz-figure .sq-a3, .js .vz-figure .sq-w--3 { transition-delay: .6s; }
.js .vz-figure .sq-split::before, .js .vz-figure .sq-yn, .js .vz-figure .sq-br .sq-wire { transition-delay: .8s; }
.js .vz-figure .sq-br .sq-n { transition-delay: 1s; }
.js .vz-figure .sq-a5, .js .vz-figure .sq-br--no .sq-n + .sq-wire + .sq-n { transition-delay: 1.2s; }
.js .vz-figure .sq-split::after { transition-delay: 1.4s; }
.js .vz-figure .sq-a6, .js .vz-figure .sq-w--7 { transition-delay: 1.5s; }
.js .vz-figure .sq-a7 { transition-delay: 1.7s; }
.js .vz-figure .sq-h { opacity: 0; transition: opacity .4s ease; }
.js .vz-figure .sq-h--2 { transition-delay: .3s; } .js .vz-figure .sq-h--3 { transition-delay: .6s; } .js .vz-figure .sq-h--4 { transition-delay: .9s; } .js .vz-figure .sq-h--5 { transition-delay: 1.2s; }
.js .vz-figure.is-visible .sq-n, .js .vz-figure.is-visible .sq-yn, .js .vz-figure.is-visible .sq-h { opacity: 1; }
.js .vz-figure.is-visible .sq-br--no .sq-n { opacity: .72; }
.js .vz-figure.is-visible .sq-n, .js .vz-figure.is-visible .sq-yn, .js .vz-figure.is-visible .sq-wire,
.js .vz-figure.is-visible .sq-split::before, .js .vz-figure.is-visible .sq-split::after { transform: none; }

/* loop (period 9 s, starts at 2.2 s): the lead travels one wire per second along the "yes" path, each node
   lights up as it arrives, the score rises at the scoring steps and crosses the threshold */
.vz-figure.is-visible .sq-tok { animation: sq-tok 9s linear infinite; }
.vz-figure.is-visible .sq-w--1 .sq-tok { animation-delay: 2.2s; }
.vz-figure.is-visible .sq-w--2 .sq-tok { animation-delay: 3.2s; }
.vz-figure.is-visible .sq-w--3 .sq-tok { animation-delay: 4.2s; }
.vz-figure.is-visible .sq-w--4 .sq-tok { animation-delay: 5.2s; }
.vz-figure.is-visible .sq-w--5 .sq-tok { animation-delay: 6.2s; }
.vz-figure.is-visible .sq-w--6 .sq-tok { animation-delay: 7.2s; }
.vz-figure.is-visible .sq-w--7 .sq-tok { animation-delay: 8.2s; }
.sq-wire:not([class*="sq-w--"]) .sq-tok { display: none; }
@keyframes sq-tok { 0% { opacity: 1; transform: translateY(0); } 10% { opacity: 1; transform: translateY(100%); } 10.5%, 100% { opacity: 0; transform: translateY(100%); } }
.vz-figure.is-visible :is(.sq-a0, .sq-a1, .sq-a2, .sq-a3, .sq-a4, .sq-a5, .sq-a6) { animation: sq-glow 9s ease-out infinite; }
.vz-figure.is-visible .sq-a0 { animation-delay: 2.2s; }
.vz-figure.is-visible .sq-a1 { animation-delay: 3.1s; }
.vz-figure.is-visible .sq-a2 { animation-delay: 4.1s; }
.vz-figure.is-visible .sq-a3 { animation-delay: 5.1s; }
.vz-figure.is-visible .sq-a4 { animation-delay: 6.1s; }
.vz-figure.is-visible .sq-a5 { animation-delay: 7.1s; }
.vz-figure.is-visible .sq-a6 { animation-delay: 8.1s; }
.vz-figure.is-visible .sq-a7 { animation: sq-final 9s ease-out 9.1s infinite; }
@keyframes sq-glow { 0% { box-shadow: 0 0 0 0 rgba(150, 248, 120, .9); } 4% { box-shadow: 0 0 0 5px rgba(150, 248, 120, .55); } 11%, 100% { box-shadow: 0 6px 14px -10px rgba(12, 43, 21, .4); } }
@keyframes sq-final { 0% { box-shadow: 0 0 0 0 rgba(150, 248, 120, .9); } 5%, 16% { box-shadow: 0 0 0 6px rgba(150, 248, 120, .5); } 24%, 100% { box-shadow: 0 6px 14px -10px rgba(12, 43, 21, .4); } }
/* score: +10 at the trigger, +20 at the condition (t = 3 s), +25 at the signal (t = 5 s) */
.vz-figure.is-visible .sq-meter-fill { animation: sq-score 9s ease-out 2.2s infinite backwards; }
.vz-figure.is-visible .sq-sv--a { animation: sq-sv-a 9s steps(1, end) 2.2s infinite backwards; }
.vz-figure.is-visible .sq-sv--b { animation: sq-sv-b 9s steps(1, end) 2.2s infinite backwards; }
.vz-figure.is-visible .sq-sv--c { animation: sq-sv-c 9s steps(1, end) 2.2s infinite backwards; }
@keyframes sq-score {
  0% { transform: scaleX(0); background: var(--forest); }
  2%, 33.3% { transform: scaleX(.1818); background: var(--forest); }
  36%, 55.5% { transform: scaleX(.5454); background: var(--forest); }
  58%, 100% { transform: none; background: var(--green-2); }
}
@keyframes sq-sv-a { 0%, 33.3% { opacity: 1; } 33.4%, 100% { opacity: 0; } }
@keyframes sq-sv-b { 0%, 33.3% { opacity: 0; } 33.4%, 55.5% { opacity: 1; } 55.6%, 100% { opacity: 0; } }
@keyframes sq-sv-c { 0%, 55.5% { opacity: 0; } 55.6%, 100% { opacity: 1; } }
