/* Схемы инструкций (web/templates/guide/diagrams/). На телефоне всё встаёт столбиком. */

.g-diagram {
  margin: 24px 0 0;
}

.g-dg {
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--g-blue-soft) 0%, #fff 70%);
  border: 1px solid var(--g-line);
}

.dg-flow,
.dg-cols {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.dg-node {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 14px;
  border-radius: 20px;
  background: #fff;
  border: 2px solid var(--g-sky);
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dg-node svg {
  width: 32px;
  height: 32px;
  color: var(--g-blue);
}

.dg-node span {
  font-size: 15px;
  color: var(--g-muted);
}

.dg-node--hub {
  background: var(--g-blue);
  border-color: var(--g-blue);
  color: #fff;
}

.dg-node--hub svg,
.dg-node--hub span {
  color: #fff;
}

.dg-node--dst {
  border-color: var(--g-orange-bright);
}

.dg-node--dst svg {
  color: var(--g-orange);
}

.dg-node--ok {
  border-color: var(--g-green);
  color: var(--g-green);
}

.dg-node--no {
  border-color: var(--g-red);
  color: var(--g-red);
}

/* Стрелка: вправо на компьютере, вниз на телефоне. */
.dg-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-style: normal;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--g-orange);
}

.dg-arrow::before {
  content: "→";
}

.dg-arrow--both::before {
  content: "⇄";
}

.dg-arrow--inline {
  margin: 0 6px;
  font-size: 22px;
}

.dg-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px !important;
  font-weight: 600;
  text-align: center;
  color: var(--g-blue-dark);
}

.dg-note svg {
  width: 22px;
  height: 22px;
  color: var(--g-orange);
}

.dg-stack,
.dg-choices {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dg-choices {
  justify-content: center;
}

.dg-or {
  align-self: center;
  font-size: 15px;
  color: var(--g-muted);
}

/* Три тарифа. */
.dg-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  border-radius: 20px;
  background: #fff;
  border: 2px solid var(--g-sky);
  text-align: center;
  line-height: 1.35;
}

.dg-col--top {
  border-color: var(--g-orange-bright);
  background: var(--g-orange-soft);
}

.dg-col > span:last-child {
  font-size: 15px;
  color: var(--g-muted);
}

.dg-tag {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--g-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.dg-col--top .dg-tag {
  background: var(--g-orange);
}

.dg-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--g-blue);
}

.dg-pair svg {
  width: 34px;
  height: 34px;
}

/* Пять действий подряд. */
.dg-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: dg;
}

.dg-steps .dg-node {
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  text-align: left;
  counter-increment: dg;
}

.dg-steps .dg-node::before {
  content: counter(dg);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--g-orange);
  color: #fff;
  font-weight: 800;
}

.dg-steps .dg-node + .dg-node {
  margin-top: 22px;
  position: relative;
}

.dg-steps .dg-node + .dg-node::after {
  content: "↓";
  position: absolute;
  top: -26px;
  left: 28px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--g-orange);
}

@media (max-width: 700px) {
  .g-dg {
    padding: 16px;
    border-radius: 22px;
  }

  .dg-flow,
  .dg-cols {
    flex-direction: column;
  }

  .dg-arrow::before {
    content: "↓";
  }

  .dg-arrow--both::before {
    content: "⇅";
  }

  .dg-arrow--inline::before {
    content: "⇄";
  }
}
