/* 05 / How it works, automation 02 (WhatsApp CRM): overrides on top of flow.css.
   Team (green) states, a 6 x 3 diagram grid, the loop edge, and the n8n lanes. */

/* ---------- Trace: step status line ---------- */

#how .crm-flow-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ash);
}

/* ---------- Diagram grid: 6 columns, 3 rows ---------- */

#how .flow-dia {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  min-width: 1040px;
}

#how .flow-dia > .flow-node {
  align-self: center;
}

/* Key sits in the empty top-left cell, above the msg node */
#how .flow-key {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

/* Your team steps in: green instead of red */
#how .crm-tag-team {
  border-color: hsl(152 60% 48% / 0.6);
  color: var(--ok);
}

#how .flow-node--team {
  border-color: hsl(152 60% 48% / 0.45);
}

#how .flow-node--team.is-done {
  border-color: hsl(152 60% 48% / 0.6);
}

#how .flow-node--team.is-on {
  border-color: var(--ok);
  background: hsl(152 60% 48% / 0.07);
  box-shadow: 0 0 0 4px hsl(152 60% 48% / 0.12), 0 18px 40px -24px hsl(152 60% 48% / 0.6);
}

/* Team edges: green when idle-but-reached, brighter once run */
#how .flow-e.crm-e-team {
  stroke: hsl(152 60% 48% / 0.35);
}

#how .flow-e.crm-e-team.is-done {
  stroke: hsl(152 60% 48% / 0.75);
}

#how .flow-run.crm-run-team {
  stroke: var(--ok);
}

/* Follow-up loop: dashed in the diagram, pulses while the quiet lead is selected */
@keyframes crm-loop-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

#how .flow-run.crm-run-pulse {
  animation: crm-loop-pulse 1.4s ease-in-out infinite;
}

/* Legend and key swatches for the team state */
#how .crm-dot-team {
  background: var(--ok);
}

#how .crm-key-sw-team {
  border-color: var(--ok);
  background: hsl(152 60% 48% / 0.14);
}

/* ---------- n8n canvas: triggers, team state ---------- */

/* Tighter card padding so the sheet's labels (e.g. "Summarise pipeline") fit the 176px card */
#how .flow-cn {
  gap: 8px;
  padding: 0 8px 0 6px;
}

#how .flow-cn[data-cn^="wa-trigger"],
#how .flow-cn[data-cn^="schedule"] {
  border-radius: 26px 8px 8px 26px;
  padding-left: 8px;
}

#how .flow-cn--sub {
  gap: 10px;
  padding: 0 14px 0 6px;
}

#how .flow-cn.is-on-team {
  border-color: var(--ok);
  box-shadow: 0 0 0 3px hsl(152 60% 48% / 0.16);
}

#how .flow-cn.is-on-team .flow-cn-ico {
  color: var(--ok);
}

/* Static and reduced motion: the loop shows at full strength, no pulse */
#how.is-static .flow-run.crm-run-pulse {
  animation: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #how .flow-run.crm-run-pulse {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  #how .flow-dia {
    min-width: 1040px;
  }
}

/* ---------- Scroll hint: shown only where the diagram or canvas scrolls sideways ---------- */

#how .crm-swipe {
  display: none;
  margin: 0 0 10px;
  padding: 12px 16px 0;
  color: var(--ash);
}

#how .crm-swipe:has(+ .flow-scrollwrap.is-scrollable) {
  display: block;
}
