.how-it-works {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(249, 246, 239, 0.9));
}

.flow-visual {
  --flow-bg: #fff;
  --flow-ink: var(--ink);
  --flow-muted: rgba(17, 20, 23, 0.6);
  --flow-border: rgba(231, 223, 208, 0.92);
  --flow-shadow: 0 18px 45px rgba(15, 15, 15, 0.1);
  --flow-primary: rgba(var(--brand-rgb), 0.95);
  --flow-primary-soft: rgba(var(--brand-rgb), 0.22);
  --flow-primary-faint: rgba(var(--brand-rgb), 0.12);
  --flow-secondary: rgba(78, 163, 136, 0.95);
  --flow-secondary-soft: rgba(78, 163, 136, 0.18);
  --flow-secondary-faint: rgba(78, 163, 136, 0.08);
  position: relative;
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: clamp(1.8rem, 3vw, 2.6rem);
  border-radius: var(--radius-xl);
  background: linear-gradient(140deg, rgba(var(--brand-rgb), 0.08), rgba(255, 255, 255, 0.97));
  border: 1px solid var(--flow-border);
  box-shadow: var(--flow-shadow);
}

.flow-visual *,
.flow-visual *::before,
.flow-visual *::after {
  box-sizing: border-box;
}

.flow-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.8fr 1fr;
  gap: clamp(1rem, 2.2vw, 1.5rem);
  align-items: stretch;
}

.flow-panel {
  position: relative;
  background: transparent;
  border: 0;
  min-height: 360px;
  z-index: 2;
}

.flow-step-top {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  padding: 0 2px;
  align-items: center;
  text-align: center;
}

.flow-step-title {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--flow-muted);
}

.flow-mini {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--flow-primary);
  box-shadow: 0 0 0 6px rgba(var(--brand-rgb), 0.16);
}

.flow-panel--center .flow-mini {
  background: var(--flow-secondary);
  box-shadow: 0 0 0 6px rgba(78, 163, 136, 0.14);
}

.flow-step-sub {
  margin: 0;
  color: var(--flow-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  max-width: 52ch;
  text-align: center;
}

.flow-globe {
  position: relative;
  height: 340px;
  border: 0;
  background: transparent;
  overflow: visible;
  z-index: 3;
}

.flow-globe-outline,
.flow-globe-ring {
  fill: none;
  stroke: rgba(17, 20, 23, 0.18);
  stroke-width: 1;
}

.flow-node {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 24px rgba(15, 15, 15, 0.08);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.flow-node svg {
  width: 22px;
  height: 22px;
  display: block;
}

.flow-node-label {
  position: absolute;
  left: 50%;
  top: 46px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: rgba(17, 20, 23, 0.62);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--flow-border);
  border-radius: 999px;
  padding: 4px 8px;
  box-shadow: 0 8px 16px rgba(15, 15, 15, 0.08);
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

.flow-icon-outline {
  fill: none;
  stroke: var(--flow-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-icon-muted {
  fill: none;
  stroke: rgba(17, 20, 23, 0.5);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-icon-accent {
  fill: none;
  stroke: var(--flow-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-ai-stage {
  position: relative;
  height: calc(100% - 92px);
  display: grid;
  place-items: center;
  padding: 10px 0;
}

.flow-ai-core {
  position: relative;
  width: 176px;
  height: 176px;
  border-radius: 999px;
  border: 1px solid var(--flow-border);
  background: #fff;
  box-shadow: var(--flow-shadow);
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
}

.flow-ai-core::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1px solid var(--flow-primary-faint);
  background: transparent;
  z-index: 0;
}

.flow-ai-core::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  border: 2px solid var(--flow-secondary-faint);
  border-left-color: var(--flow-secondary);
  border-top-color: var(--flow-primary);
  opacity: 0.85;
  animation: flow-sweep 6.5s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes flow-sweep {
  to {
    transform: rotate(360deg);
  }
}

.flow-ai-label {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  border: 1px solid var(--flow-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 20px rgba(15, 15, 15, 0.08);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.9rem;
  color: var(--flow-ink);
}

.flow-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--flow-primary-soft);
  transform: scale(1);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.flow-ai-core.is-pulsing .flow-pulse-ring {
  animation: flow-ring 760ms cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.flow-ai-core.is-pulsing {
  animation: flow-core-glow 760ms cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

@keyframes flow-ring {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  16% {
    opacity: 0.55;
  }
  100% {
    transform: scale(1.24);
    opacity: 0;
  }
}

@keyframes flow-core-glow {
  0% {
    filter: brightness(1);
  }
  22% {
    filter: brightness(1.05);
  }
  100% {
    filter: brightness(1);
  }
}

.flow-right {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.flow-card {
  border-radius: 22px;
  border: 1px solid var(--flow-border);
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 15, 15, 0.08);
  padding: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.flow-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.flow-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.7rem;
}

.flow-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.flow-card-meta {
  font-size: 0.75rem;
  color: var(--flow-muted);
  margin: 0;
  white-space: nowrap;
}

.flow-chart {
  border-radius: 16px;
  border: 1px solid rgba(231, 223, 208, 0.85);
  background: #fff;
  padding: 10px;
  overflow: hidden;
  position: relative;
}

.flow-chart.is-flashing {
  border-color: var(--flow-secondary-soft);
  box-shadow: 0 18px 36px rgba(15, 15, 15, 0.12);
}

.flow-chart-sweep {
  position: absolute;
  inset: -40px -60px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: linear-gradient(
    115deg,
    rgba(78, 163, 136, 0) 0%,
    rgba(78, 163, 136, 0.08) 34%,
    rgba(var(--brand-rgb), 0.1) 52%,
    rgba(78, 163, 136, 0) 72%
  );
  transform: translateX(-36%) rotate(-8deg);
}

.flow-chart.is-flashing .flow-chart-sweep {
  animation: flow-chart-sweep 520ms ease-out 1;
}

@keyframes flow-chart-sweep {
  0% {
    opacity: 0;
    transform: translateX(-42%) rotate(-8deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(28%) rotate(-8deg);
  }
}

.flow-chart-svg {
  width: 100%;
  height: 126px;
  display: block;
  position: relative;
  z-index: 1;
}

.flow-axis {
  stroke: rgba(17, 20, 23, 0.28);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.flow-separator {
  stroke: var(--flow-primary-faint);
  stroke-width: 1;
  stroke-dasharray: 3 6;
  shape-rendering: crispEdges;
}

.flow-now {
  stroke: var(--flow-primary-soft);
  stroke-width: 1;
  shape-rendering: crispEdges;
  animation: flow-now-pulse 3s ease-in-out infinite;
}

@keyframes flow-now-pulse {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.55;
  }
}

.flow-bar {
  fill: rgba(var(--brand-rgb), 0.18);
  stroke: rgba(var(--brand-rgb), 0.35);
  stroke-width: 1;
  rx: 3;
}

.flow-bars .flow-bar {
  transform-origin: center bottom;
  transform: scaleY(0.12);
  transition: transform 820ms ease;
}

.flow-card.is-revealed .flow-bars .flow-bar {
  transform: scaleY(1);
}

.flow-forecast-line {
  fill: none;
  stroke: var(--flow-secondary);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: miter;
}

.flow-forecast-path {
  opacity: 0;
}

.flow-forecast-dot {
  fill: var(--flow-secondary);
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.6;
  opacity: 0;
  transition: opacity 600ms ease;
}

.flow-marker {
  fill: var(--flow-secondary);
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.9;
  opacity: 0;
  transition: opacity 450ms ease;
}

.flow-card.is-revealed .flow-marker {
  opacity: 1;
}

.flow-pill-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.flow-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(231, 223, 208, 0.9);
  background: rgba(255, 255, 255, 0.98);
  transition: transform 280ms ease, border-color 280ms ease, box-shadow 280ms ease;
}

.flow-pill.is-emph {
  border-color: var(--flow-primary-soft);
  box-shadow: 0 14px 28px rgba(15, 15, 15, 0.12);
  transform: scale(1.012);
}

.flow-pill-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--flow-ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-pill-value {
  font-size: 0.75rem;
  color: var(--flow-muted);
  margin: 0;
  white-space: nowrap;
}

.flow-tag {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.flow-tag--primary {
  background: var(--flow-primary);
  box-shadow: 0 0 0 6px rgba(var(--brand-rgb), 0.12);
}

.flow-tag--secondary {
  background: var(--flow-secondary);
  box-shadow: 0 0 0 6px rgba(78, 163, 136, 0.12);
}

.flow-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.flow-rail {
  fill: none;
  stroke: rgba(var(--brand-rgb), 0.18);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.flow-rail-strong {
  fill: none;
  stroke: rgba(78, 163, 136, 0.22);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 2 8;
}

.flow-packet {
  opacity: 0.92;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .flow-stage {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    counter-reset: flow-step;
  }

  .flow-panel {
    min-height: 300px;
    counter-increment: flow-step;
  }

  .flow-step-top {
    position: relative;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--flow-border);
    box-shadow: 0 12px 24px rgba(15, 15, 15, 0.08);
    margin: 0 auto 1.4rem;
    width: min(520px, 100%);
    z-index: 3;
  }

  .flow-mini {
    display: none;
  }

  .flow-step-title {
    gap: 0.55rem;
    letter-spacing: 0.14em;
  }

  .flow-step-title::before {
    content: counter(flow-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.18);
    color: var(--flow-ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: normal;
  }

  .flow-panel--center .flow-step-title::before {
    background: rgba(78, 163, 136, 0.2);
  }

  .flow-globe {
    height: 300px;
  }

  .flow-ai-stage {
    height: 230px;
  }
}

@media (max-width: 720px) {
  .flow-visual {
    padding: 1.4rem;
  }

  .flow-card {
    padding: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-card,
  .flow-bars .flow-bar,
  .flow-chart-sweep,
  .flow-ai-core::after {
    transition: none !important;
    animation: none !important;
  }
}
