.graph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-32);
  padding: var(--sp-64) var(--container-pad);
  background: var(--surface-dark-blue);
  border-radius: var(--radius-40) var(--radius-40) 0 0;
}

.graph__diagram {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: var(--container-width);
}

.graph__block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-16);
  padding: var(--sp-24) var(--sp-24) var(--sp-16);
  border-radius: var(--radius-12);
  background: var(--surface-blue-opacity);
  border: 2px dashed var(--surface-blue);
}

.graph__block--reverse {
  padding: var(--sp-16) var(--sp-24) var(--sp-24);
}

.graph__block-title {
  font-size: var(--fs-body-20);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-inverse);
  text-align: center;
}

.graph__block-title strong {
  font-weight: 600;
}

.graph__row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: var(--sp-8);
  width: 100%;
}

.graph__item {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-24);
  border: 1px dashed var(--surface-blue);
  border-radius: var(--radius-12);
  font-size: var(--fs-body-14);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-inverse);
  text-align: center;
}

.graph__core {
  padding: var(--sp-16) var(--sp-24);
  border-radius: var(--radius-12);
  background: var(--surface-neon-opacity);
  border: 2px solid var(--surface-neon);
}

.graph__core-title {
  font-size: var(--fs-body-20);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--surface-neon);
  text-align: center;
}

.graph__connectors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-8) 1.625rem; /* 8px vertical gap to blocks; horizontal aligns arrows to columns */
}

.graph__connector {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.graph__connector-line {
  width: 0.25rem; /* 4px */
  height: 2rem; /* 32px, split above/below badge */
  background: var(--surface-blue);
  position: relative;
}

/* Arrowheads: the down arrow renders on every connector; the up arrow only on
   bidirectional connectors (columns 1/4/6/7 — see .graph__connector--bidir). */
.graph__connector-line--bottom::after,
.graph__connector--bidir .graph__connector-line--top::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 0.8125rem solid transparent; /* 13px */
  border-right: 0.8125rem solid transparent; /* 13px */
  transform: translateX(-50%);
}

.graph__connector--bidir .graph__connector-line--top::before {
  top: -0.2rem; /* -0.3px, чтобы стрелка не прилипала к границе блока */
  border-bottom: 1.25rem solid var(--surface-blue); /* 20px */
}

.graph__connector-line--bottom::after {
  bottom: -0.2rem; /* -1px */
  border-top: 1.25rem solid var(--surface-blue); /* 20px */
}

.graph__badge {
  padding: var(--sp-8);
  width: 3.75rem; /* 60px */
  text-align: center;
  border-radius: var(--radius-12);
  background: var(--surface-blue);
  color: var(--text-inverse);
  font-size: var(--fs-body-14);
  font-weight: 500;
  margin: 0.25rem 0;
}

.graph__badge--strong {
  font-weight: 600;
}
