/* ============================================================
   Channel flow diagram — structure only.
   ------------------------------------------------------------
   Layout, geometry and animation live here. Every colour, font
   and radius comes from an --fl-* variable that the three page
   stylesheets set, so the same diagram renders in each system
   without this file knowing which one is active.
   ============================================================ */

.fl-stage {
  position: relative;
  max-width: 940px;
  margin: 44px auto 0;
}

.fl-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.fl-static path { stroke: var(--fl-line, rgba(255,255,255,.18)); stroke-width: 1; }
.fl-route { stroke: var(--fl-route, rgba(215,242,63,.4)); stroke-width: 1.6; }

.fl-pulse {
  stroke: var(--fl-pulse, #D7F23F);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 30 970;
  animation: fl-travel 1400ms cubic-bezier(0.4, 0, 0.5, 1) forwards;
}
@keyframes fl-travel { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

.fl-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 200px;
  gap: 40px;
  align-items: start;
}
.fl-col { display: flex; flex-direction: column; gap: 10px; }
.fl-col-node { align-items: center; }
.fl-col-hub { align-self: center; }

.fl-mlabel {
  font-family: var(--fl-label-font, var(--f-mono, monospace));
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fl-label, rgba(255,255,255,.6));
  margin-bottom: 4px;
}
.fl-col-cust .fl-mlabel, .fl-col-hub .fl-mlabel { display: none; }

/* Customer pills */
.fl-cust {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--fl-cust-border, rgba(255,255,255,.14));
  background: var(--fl-cust-bg, rgba(244,244,241,.06));
  color: var(--fl-cust-fg, #F4F4F1);
  border-radius: 9999px;
  font-family: var(--fl-label-font, var(--f-mono, monospace));
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Channel cards */
.fl-node {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 168px;
  height: 40px;
  background: var(--fl-node-bg, #fff);
  border: 1px solid var(--fl-node-border, #E6E4DD);
  border-radius: var(--fl-node-radius, 12px);
  box-shadow: var(--fl-node-shadow, 0 12px 28px rgba(0,0,0,.32));
  color: var(--fl-node-fg, #181F22);
  font-family: var(--fl-node-font, inherit);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.fl-node-own { justify-content: flex-start; padding: 0 12px; font-size: 13.5px; }
.fl-node-glyph {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--fl-glyph-radius, 7px);
  background: var(--fl-glyph-bg, rgba(215,242,63,.3));
}

.fl-more {
  font-size: 11px;
  line-height: 1.4;
  color: var(--fl-label, rgba(255,255,255,.6));
  margin-top: 2px;
}

.fl-modules {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 190px;
  margin-top: 6px;
  padding: 11px;
  border: 1px dashed var(--fl-cust-border, rgba(255,255,255,.14));
  border-radius: var(--fl-modules-radius, 16px);
}
.fl-modules-label {
  font-family: var(--fl-label-font, var(--f-mono, monospace));
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fl-label, rgba(255,255,255,.6));
  text-align: center;
}
.fl-modules-note {
  font-size: 10px;
  line-height: 1.45;
  color: var(--fl-label, rgba(255,255,255,.6));
  text-align: center;
  max-width: 168px;
}

/* The hub */
.fl-hub {
  background: var(--fl-hub-bg, #fff);
  color: var(--fl-hub-fg, #181F22);
  border: 1.5px solid var(--fl-hub-border, #D7F23F);
  border-radius: var(--fl-hub-radius, 16px);
  padding: 20px 18px;
  box-shadow: var(--fl-hub-shadow, 0 18px 44px rgba(0,0,0,.42));
}
.fl-hub-mark { display: inline-flex; align-items: baseline; gap: 3px; }
.fl-hub-mark b {
  font-family: var(--fl-hub-mark-font, inherit);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.fl-hub-mark i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fl-accent, #D7F23F);
  display: inline-block;
}
.fl-hub-title { font-size: 12px; font-weight: 500; line-height: 1.35; margin-top: 14px; }
.fl-hub-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--fl-node-border, #E6E4DD);
  font-family: var(--fl-label-font, var(--f-mono, monospace));
  font-size: 10.5px;
  line-height: 1.4;
  opacity: .62;
}
.fl-hub-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--fl-label, rgba(255,255,255,.6));
  margin: 14px 0 0;
}
.fl-hub-note strong { color: var(--fl-cust-fg, #F4F4F1); font-weight: 500; }

/* Highlight rings that track the active pair */
.fl-halo {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  border: 1.5px solid var(--fl-accent, #D7F23F);
  box-shadow: 0 0 0 5px var(--fl-halo-glow, rgba(215,242,63,.14));
  transition: left 520ms cubic-bezier(0.2,0.7,0.2,1), top 520ms cubic-bezier(0.2,0.7,0.2,1),
              width 520ms cubic-bezier(0.2,0.7,0.2,1), height 520ms cubic-bezier(0.2,0.7,0.2,1);
}

/* Narration under the diagram */
.fl-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  min-height: 34px;
  text-align: center;
}
.fl-payload {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: var(--fl-node-radius, 9px);
  border: 1px solid var(--fl-hub-border, #D7F23F);
  background: var(--fl-payload-bg, rgba(215,242,63,.1));
  color: var(--fl-cust-fg, #F4F4F1);
  font-family: var(--fl-label-font, var(--f-mono, monospace));
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.fl-narrate { font-size: 14px; line-height: 1.5; color: var(--fl-label, rgba(255,255,255,.6)); }

@media (max-width: 900px) {
  .fl-svg, .fl-halo { display: none; }
  .fl-grid { grid-template-columns: 1fr; gap: 28px; }
  .fl-col-cust { flex-direction: row; flex-wrap: wrap; }
  .fl-col-cust .fl-mlabel, .fl-col-hub .fl-mlabel { display: block; width: 100%; }
  .fl-col-node { align-items: stretch; }
  .fl-node, .fl-modules { width: 100%; }
  .fl-col-hub { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .fl-pulse { animation: none; stroke-dasharray: none; }
  .fl-halo { transition: none; }
}
