/* Market placement diagram: one submission out, the whole board worked in parallel.
   Self-contained editorial treatment; geometry is calibrated to a 1280 x 620 canvas
   (SVG viewBox and node percentages share the same coordinate system). */

.market-flow {
  color: var(--ink);
  background: var(--paper);
}

.market-flow__heading {
  width: min(930px, 100%);
}

.market-flow__heading .eyebrow {
  color: var(--teal);
}

.market-flow__heading h2 {
  max-width: 900px;
  color: var(--ink);
}

.market-flow__heading > p:last-child {
  color: var(--slate);
}

/* Canvas */

.market-flow__visual {
  position: relative;
  height: 620px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.market-flow__connectors {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.market-flow__line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.market-flow__line--outbound {
  stroke: #c9942e;
  opacity: 0.85;
}

.market-flow__line--return {
  stroke: var(--teal);
  stroke-width: 1.9;
  stroke-dasharray: 0.1 5.5;
  opacity: 0.85;
  animation: market-flow-return 2.4s linear infinite;
}

@keyframes market-flow-return {
  to {
    stroke-dashoffset: -5.6;
  }
}

.market-flow__junction {
  fill: #c9942e;
}

/* Legend */

.market-flow__legend {
  position: absolute;
  z-index: 2;
  top: 38px;
  left: 2.1875%;
  display: grid;
  gap: 9px;
}

.market-flow__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--slate);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.market-flow__legend-item::before {
  width: 24px;
  content: "";
}

.market-flow__legend-item--out::before {
  border-top: 2px solid #c9942e;
}

.market-flow__legend-item--back::before {
  border-top: 2px dotted var(--teal);
}

/* Nodes */

.market-flow__market-list,
.market-flow__compare-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.market-flow__node,
.market-flow__markets,
.market-flow__return-stack {
  position: absolute;
  z-index: 2;
}

.market-flow__node {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(7, 29, 48, 0.07);
}

.market-flow__node h3 {
  margin-bottom: 10px;
  font-size: clamp(19px, 1.65vw, 24px);
  line-height: 1.22;
}

.market-flow__node p {
  margin-bottom: 0;
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.55;
}

.market-flow__step {
  display: block;
  margin-bottom: 13px;
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  line-height: 1.25;
  text-transform: uppercase;
}

.market-flow__icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--navy-800);
}

.market-flow__icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

/* 01: the operation */

.market-flow__node--submission {
  top: 348px;
  left: 2.1875%;
  width: 15.625%;
  transform: translateY(-50%);
}

/* 02: the hub */

.market-flow__node--hub {
  top: 348px;
  left: 23.4375%;
  width: 18.75%;
  padding: 26px 24px;
  transform: translateY(-50%);
  border-color: var(--navy-800);
  border-left: 4px solid var(--gold);
  background: var(--navy-800);
  box-shadow: 0 22px 48px rgba(7, 29, 48, 0.24);
}

.market-flow__node--hub img {
  width: 58px;
  height: 54px;
  margin-bottom: 16px;
  object-fit: contain;
}

.market-flow__node--hub .market-flow__step {
  color: var(--gold-light);
}

.market-flow__node--hub h3 {
  color: var(--white);
  font-size: 21px;
}

.market-flow__node--hub p {
  color: rgba(255, 255, 255, 0.74);
}

/* 03: the market board */

.market-flow__markets {
  top: 24px;
  left: 48.75%;
  width: 17.8125%;
}

.market-flow__markets-heading {
  height: 104px;
}

.market-flow__markets-heading .market-flow__step {
  margin-bottom: 8px;
  color: var(--navy-700);
}

.market-flow__markets h3 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 21px;
}

.market-flow__markets-heading p {
  margin-bottom: 0;
  color: var(--slate);
  font-size: 12px;
  line-height: 1.45;
}

.market-flow__market-list {
  border-top: 1px solid var(--line);
}

.market-flow__market-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  height: 88px;
  column-gap: 12px;
  row-gap: 3px;
  border-bottom: 1px solid var(--line);
}

.market-flow__market-list li > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.market-flow__market-list strong {
  grid-column: 2;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.25;
}

.market-flow__market-list small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

/* 04 + 05: review, then the walkthrough */

.market-flow__return-stack {
  top: 96px;
  left: 74.0625%;
  width: 23.75%;
}

.market-flow__return-stack .market-flow__node {
  position: relative;
  width: 100%;
}

.market-flow__compare-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 16px;
}

.market-flow__compare-list li {
  position: relative;
  padding-left: 12px;
  color: var(--slate);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.6;
}

.market-flow__compare-list li::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 1.5px;
  background: var(--gold);
  content: "";
}

.market-flow__stack-connector {
  display: block;
  width: 2px;
  height: 40px;
  margin: 0 auto;
  background: var(--gold);
  opacity: 0.75;
}

.market-flow__node--options {
  border-color: #ddd3ba;
  background: var(--paper-warm);
}

.market-flow__node--options::before {
  position: absolute;
  top: -1px;
  right: -1px;
  left: -1px;
  height: 3px;
  background: var(--gold);
  content: "";
}

/* Compliance note tucked into the quiet corner */

.market-flow__disclosure {
  position: absolute;
  z-index: 2;
  bottom: 26px;
  left: 2.1875%;
  width: 30%;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Stacked layout below the diagram breakpoint */

@media (max-width: 1100px) {
  .market-flow__visual {
    height: auto;
    padding: 26px 0;
  }

  .market-flow__connectors,
  .market-flow__legend {
    display: none;
  }

  .market-flow__diagram {
    display: grid;
    gap: 16px;
  }

  .market-flow__node,
  .market-flow__markets,
  .market-flow__return-stack {
    position: relative;
    inset: auto;
    width: auto;
    transform: none;
  }

  .market-flow__markets {
    padding: 6px 4px;
  }

  .market-flow__markets-heading {
    height: auto;
    margin-bottom: 14px;
  }

  .market-flow__market-list li {
    height: auto;
    min-height: 66px;
    padding: 11px 0;
  }

  .market-flow__stack-connector {
    height: 28px;
  }

  .market-flow__disclosure {
    position: static;
    width: auto;
    margin-top: 22px;
  }
}

@media (max-width: 720px) {
  .market-flow__node {
    padding: 22px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .market-flow__line--return {
    animation: none;
  }
}
