.financing-waterfall {
  --waterfall-accent: #a52e0e;
  --waterfall-connector: #b97966;
  margin: 40px 0;
  scroll-margin-top: 92px;
}

.financing-waterfall .waterfall-flow {
  margin: 24px 0 30px;
  padding: clamp(12px, 3vw, 23px);
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.financing-waterfall .waterfall-node {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.financing-waterfall .waterfall-start {
  border-left: 4px solid var(--waterfall-accent);
}

.financing-waterfall .waterfall-node :is(h3, h4) {
  margin: 0 0 6px;
  font-size: 1.075rem;
  line-height: 1.26;
  letter-spacing: -.01em;
  text-transform: none;
}

.financing-waterfall .waterfall-node p {
  margin: 0;
  color: #393430;
  font-size: .9375rem;
  line-height: 1.55;
}

.waterfall-arrow::before {
  content: "↓";
  display: block;
  padding: 3px;
  color: var(--waterfall-accent);
  font-size: 1.4rem;
  line-height: 1.2;
  text-align: center;
}

.financing-waterfall .waterfall-decision {
  border-color: #eedbd3;
  background: #f9eae3;
  text-align: center;
}

.financing-waterfall .waterfall-decision h3 {
  margin: 0;
}

.waterfall-branches,
.waterfall-scenarios {
  display: grid;
  gap: 12px;
}

.waterfall-branches {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
  padding-top: 22px;
}

.waterfall-branches::before {
  position: absolute;
  top: 0;
  left: 50%;
  height: 12px;
  border-left: 1px solid var(--waterfall-connector);
  content: '';
}

.waterfall-branches::after {
  position: absolute;
  top: 11px;
  left: 16.67%;
  right: 16.67%;
  border-top: 1px solid var(--waterfall-connector);
  content: '';
}

.waterfall-branches > .waterfall-node {
  position: relative;
}

.waterfall-branches > .waterfall-node::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  height: 12px;
  border-left: 1px solid var(--waterfall-connector);
  content: '';
}

.waterfall-scenarios {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.financing-waterfall .waterfall-scenarios .waterfall-node {
  background: var(--warm);
}

.financing-waterfall .waterfall-note,
.financing-waterfall .waterfall-sources {
  margin: 12px 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .waterfall-branches,
  .waterfall-scenarios {
    grid-template-columns: minmax(0, 1fr);
  }

  .waterfall-branches {
    padding: 12px 0 0 14px;
  }

  .waterfall-branches::before {
    left: 4px;
    bottom: 30px;
    height: auto;
  }

  .waterfall-branches::after {
    display: none;
  }

  .waterfall-branches > .waterfall-node::before {
    left: -11px;
    top: 25px;
    width: 10px;
    height: auto;
    border: 0;
    border-top: 1px solid var(--waterfall-connector);
  }
}
