/* !RedDataviz — [redflow] Hybrid Vertical Flow + Animated Gradient & Broken Line Styles */
.redflow-instance {
  --rf-primary: #ee1b24;
  --rf-wine: #92181d;
  --rf-dark-ui: #14191c;
  --rf-heading: #212529;
  --rf-body: #4b5563;
  --rf-muted: #777777;
  --rf-border: #dde3e1;
  --rf-white: #ffffff;
  margin: 16px 0 22px;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
}
.redflow-instance *,
.redflow-instance *::before,
.redflow-instance *::after {
  box-sizing: border-box;
}

.redflow-validation-errors {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--rf-primary);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--rf-wine);
  font-size: 13px;
  line-height: 1.45;
}
.redflow-validation-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--rf-primary);
}
.redflow-validation-list {
  margin: 0;
  padding-left: 18px;
}

.redflow-stage-canvas {
  position: relative;
  width: 100%;
  background-color: var(--rf-white);
  background-image: radial-gradient(#dce4e2 1.15px, transparent 1.15px);
  background-size: 18px 18px;
  border: 1.5px solid var(--rf-border);
  border-radius: 10px;
  padding: 22px 20px 24px;
  box-shadow: 0 4px 16px rgba(20, 25, 28, 0.05);
  overflow: hidden;
}
.redflow-stage-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("https://brand.redim.ca/watermark.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: min(450px, 78%) auto;
  filter: brightness(0.965);
}
.redflow-stage-canvas[data-watermark="false"]::before {
  display: none;
}
.redflow-stage-canvas.has-top-arch {
  padding-top: 52px;
}
.redflow-stage-canvas.has-bottom-arch {
  padding-bottom: 62px;
}
.redflow-stage-canvas.has-right-bypass {
  padding-right: 26px;
}

.redflow-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--rf-cols-desktop, 3), minmax(0, 1fr));
  column-gap: clamp(96px, 9vw, 120px);
  row-gap: 88px;
  align-items: stretch;
}
.redflow-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 780px;
  margin: 0 auto;
  column-gap: 116px;
  row-gap: 88px;
}
.redflow-grid.cols-1 {
  grid-template-columns: minmax(0, 1fr);
  max-width: 480px;
  margin: 0 auto;
  column-gap: 0;
  row-gap: 82px;
}

/* SaaS Node Cards (Modern Borderless Active Variants + Clean Default Outline) */
.redflow-card {
  min-width: 0;
  background: var(--rf-white);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 6px 16px -4px rgba(20, 25, 28, 0.07), 0 2px 6px rgba(20, 25, 28, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  text-align: left;
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.redflow-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 22px -4px rgba(20, 25, 28, 0.11), 0 3px 8px rgba(20, 25, 28, 0.05);
  transform: translateY(-2px);
}

/* Active Variants: Zero Border (border: none) + Moving Silk Gradient Surface + Ambient Elevation */
.redflow-card.accent {
  background-image: linear-gradient(125deg, #fff5f5 0%, #ffe4e6 34%, #fda4af 68%, #fff1f2 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  box-shadow: 0 10px 24px -6px rgba(238, 27, 36, 0.20), 0 2px 6px rgba(20, 25, 28, 0.06);
}
.redflow-card.accent:hover {
  box-shadow: 0 14px 28px -6px rgba(238, 27, 36, 0.28), 0 4px 10px rgba(20, 25, 28, 0.08);
}

.redflow-card.bridge {
  background-image: linear-gradient(125deg, #fbf7f4 0%, #f3e5dc 36%, #e2c6b6 68%, #f7eee8 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  box-shadow: 0 10px 22px -6px rgba(146, 24, 29, 0.16), 0 2px 6px rgba(20, 25, 28, 0.05);
}
.redflow-card.bridge:hover {
  box-shadow: 0 14px 26px -6px rgba(146, 24, 29, 0.24), 0 4px 10px rgba(20, 25, 28, 0.07);
}

.redflow-card.final {
  background-image: linear-gradient(125deg, #14191c 0%, #28343e 34%, #59161e 68%, #14191c 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  color: var(--rf-white);
  box-shadow: 0 12px 26px -6px rgba(20, 25, 28, 0.34), 0 3px 8px rgba(20, 25, 28, 0.14);
}
.redflow-card.final:hover {
  box-shadow: 0 16px 32px -6px rgba(20, 25, 28, 0.44), 0 4px 10px rgba(20, 25, 28, 0.18);
}

.redflow-card.red {
  background-image: linear-gradient(125deg, #8a1117 0%, #ee1b24 35%, #ff5258 66%, #7a0f15 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  color: var(--rf-white);
  box-shadow: 0 12px 26px -6px rgba(146, 24, 29, 0.40), 0 3px 8px rgba(146, 24, 29, 0.16);
}
.redflow-card.red:hover {
  box-shadow: 0 16px 32px -6px rgba(146, 24, 29, 0.50), 0 4px 10px rgba(146, 24, 29, 0.22);
}

.redflow-card.golden {
  background-image: linear-gradient(125deg, #fef9c3 0%, #fde047 35%, #f59e0b 68%, #fef08a 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  color: #311008;
  box-shadow: 0 10px 24px -6px rgba(180, 83, 9, 0.28), 0 2px 6px rgba(180, 83, 9, 0.10);
}
.redflow-card.golden:hover {
  box-shadow: 0 14px 28px -6px rgba(180, 83, 9, 0.36), 0 4px 10px rgba(180, 83, 9, 0.14);
}

.redflow-card.amber {
  background-image: linear-gradient(125deg, #451a03 0%, #92400e 34%, #d97706 66%, #5c2408 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  color: var(--rf-white);
  box-shadow: 0 12px 26px -6px rgba(120, 53, 15, 0.38), 0 3px 8px rgba(120, 53, 15, 0.16);
}
.redflow-card.amber:hover {
  box-shadow: 0 16px 32px -6px rgba(120, 53, 15, 0.48), 0 4px 10px rgba(120, 53, 15, 0.20);
}

.redflow-card.emerald {
  background-image: linear-gradient(125deg, #04340b 0%, #065f46 34%, #0d9468 66%, #052e16 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  color: var(--rf-white);
  box-shadow: 0 12px 26px -6px rgba(4, 52, 11, 0.34), 0 3px 8px rgba(4, 52, 11, 0.14);
}
.redflow-card.emerald:hover {
  box-shadow: 0 16px 32px -6px rgba(4, 52, 11, 0.44), 0 4px 10px rgba(4, 52, 11, 0.18);
}

.redflow-card.rose {
  background-image: linear-gradient(125deg, #fff1f2 0%, #fecdd3 36%, #fda4af 68%, #ffe4e6 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  box-shadow: 0 10px 24px -6px rgba(225, 29, 72, 0.20), 0 2px 6px rgba(20, 25, 28, 0.06);
}
.redflow-card.rose:hover {
  box-shadow: 0 14px 28px -6px rgba(225, 29, 72, 0.28), 0 4px 10px rgba(20, 25, 28, 0.08);
}

.redflow-card.warm {
  background-image: linear-gradient(125deg, #faf6ee 0%, #ede2cc 36%, #d8c39e 68%, #f3ead8 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  border: none;
  box-shadow: 0 10px 24px -6px rgba(49, 16, 8, 0.14), 0 2px 6px rgba(20, 25, 28, 0.06);
}
.redflow-card.warm:hover {
  box-shadow: 0 14px 28px -6px rgba(49, 16, 8, 0.22), 0 4px 10px rgba(20, 25, 28, 0.08);
}

.redflow-card.anim-card-gradient {
  animation: redflowCardGradient 5.2s ease-in-out infinite;
}
.redflow-card.anim-card-gradient:nth-child(2n) {
  animation-delay: -1.7s;
}
.redflow-card.anim-card-gradient:nth-child(3n) {
  animation-delay: -3.4s;
}

.redflow-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}
.redflow-step-pill {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--rf-primary);
  color: var(--rf-white);
  letter-spacing: 0.01em;
}
.redflow-card.bridge .redflow-step-pill,
.redflow-card.warm .redflow-step-pill {
  background: var(--rf-wine);
}
.redflow-card.accent .redflow-step-pill,
.redflow-card.final .redflow-step-pill,
.redflow-card.rose .redflow-step-pill {
  background: linear-gradient(135deg, #ee1b24 0%, #92181d 100%);
}
.redflow-card.red .redflow-step-pill {
  background: var(--rf-white);
  color: var(--rf-wine);
}
.redflow-card.golden .redflow-step-pill {
  background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
  color: var(--rf-white);
}
.redflow-card.amber .redflow-step-pill {
  background: #fef3c7;
  color: #78350f;
}
.redflow-card.emerald .redflow-step-pill {
  background: #ecfdf5;
  color: #04340b;
}

.redflow-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.25;
  color: var(--rf-heading);
  overflow-wrap: break-word;
}
.redflow-card.final .redflow-title,
.redflow-card.red .redflow-title,
.redflow-card.amber .redflow-title,
.redflow-card.emerald .redflow-title {
  color: var(--rf-white);
}
.redflow-card.golden .redflow-title,
.redflow-card.warm .redflow-title {
  color: #311008;
}

.redflow-issuer {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--rf-wine);
  overflow-wrap: break-word;
}
.redflow-card.final .redflow-issuer {
  color: #fca5a5;
}
.redflow-card.red .redflow-issuer {
  color: #ffe4e6;
}
.redflow-card.golden .redflow-issuer {
  color: #92400e;
}
.redflow-card.amber .redflow-issuer {
  color: #fde68a;
}
.redflow-card.emerald .redflow-issuer {
  color: #a7f3d0;
}

.redflow-meta {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--rf-body);
  border-top: 1px solid #eef2f1;
  padding-top: 5px;
  margin-top: 2px;
  overflow-wrap: break-word;
}
.redflow-card.final .redflow-meta {
  color: #cbd5e1;
  border-top-color: rgba(255, 255, 255, 0.14);
}
.redflow-card.red .redflow-meta {
  color: #fff1f2;
  border-top-color: rgba(255, 255, 255, 0.24);
}
.redflow-card.golden .redflow-meta {
  color: #5c3409;
  border-top-color: rgba(180, 83, 9, 0.22);
}
.redflow-card.amber .redflow-meta {
  color: #fef3c7;
  border-top-color: rgba(255, 255, 255, 0.22);
}
.redflow-card.emerald .redflow-meta {
  color: #ecfdf5;
  border-top-color: rgba(255, 255, 255, 0.22);
}
.redflow-card.accent .redflow-meta,
.redflow-card.rose .redflow-meta {
  border-top-color: rgba(238, 27, 36, 0.16);
}
.redflow-card.bridge .redflow-meta,
.redflow-card.warm .redflow-meta {
  border-top-color: rgba(146, 24, 29, 0.15);
}

/* Smoothstep SVG Connector Layer: Solid Gradient Flow + Clean Moving Broken Lines */
.redflow-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
.redflow-edge-flow {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.redflow-edge-flow.is-broken {
  stroke-dasharray: 8 6;
}
.redflow-edge-flow.is-broken.is-bridge {
  stroke-dasharray: 6 5;
}
.redflow-edge-flow.is-broken.anim-dash {
  animation: redflowMovePrimary 0.9s linear infinite;
}
.redflow-edge-flow.is-broken.is-bridge.anim-dash {
  animation: redflowMoveBridge 0.85s linear infinite;
}

.redflow-stage-canvas[data-motion="paused"] .redflow-edge-flow,
.redflow-stage-canvas[data-motion="paused"] .redflow-card.anim-card-gradient {
  animation-play-state: paused;
}

@keyframes redflowCardGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes redflowMovePrimary {
  from { stroke-dashoffset: 28; }
  to   { stroke-dashoffset: 0; }
}
@keyframes redflowMoveBridge {
  from { stroke-dashoffset: 22; }
  to   { stroke-dashoffset: 0; }
}

/* Edge Label Pills Layer (Accessible to Screen Readers) */
.redflow-pills-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.redflow-edge-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--rf-heading);
  background: var(--rf-white);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 7px;
  box-shadow: 0 2px 6px rgba(20, 25, 28, 0.06);
  text-align: center;
}
.redflow-edge-pill.bridge-pill {
  border-color: rgba(146, 24, 29, 0.42);
  color: var(--rf-wine);
  background: #fffdfd;
}

/* Mobile Lock (<768px): Honors --rf-cols-mobile (1 or 2), Zero Horizontal Overflow */
@media (max-width: 767px) {
  .redflow-stage-canvas {
    padding: 16px 10px 20px;
  }
  .redflow-stage-canvas::before {
    background-size: min(320px, 84%) auto;
  }
  .redflow-stage-canvas.has-top-arch {
    padding-top: 50px;
  }
  .redflow-stage-canvas.has-bottom-arch {
    padding-bottom: 60px;
  }
  .redflow-stage-canvas.has-right-bypass {
    padding-right: 24px;
  }
  .redflow-grid,
  .redflow-grid.cols-2,
  .redflow-grid.cols-1 {
    grid-template-columns: repeat(var(--rf-cols-mobile, 2), minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 92px;
    max-width: none;
  }
  .redflow-grid.mobile-cols-1 {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 76px;
  }
  .redflow-card {
    padding: 9px 9px;
  }
  .redflow-step-pill {
    font-size: 9.5px;
    padding: 2px 5px;
  }
  .redflow-title {
    font-size: 13.5px;
    line-height: 1.22;
  }
  .redflow-issuer {
    font-size: 11px;
    line-height: 1.25;
  }
  .redflow-meta {
    font-size: 10.5px;
    line-height: 1.3;
    padding-top: 4px;
  }
  .redflow-edge-pill {
    font-size: 10px;
    padding: 2px 5px;
  }
}
