/* Modal action rows (Figma «Кнопки», table 04 and section 06).
   Home modals: one row on the right, the main action last; a destructive Plain action
   stands alone on the left. On a phone the secondary actions share one row and the main
   Filled action takes the full width below. Connect modals keep their 50 / 50 pair. */

.home-modal:not(.home-connect-modal) .home-modal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.home-modal:not(.home-connect-modal) .home-modal__actions > .btn {
  flex: 0 0 auto;
  margin: 0;
}

.home-modal:not(.home-connect-modal) .home-modal__actions > :is(.btn-danger-plain, .btn-plain.btn-danger):first-child {
  margin-right: auto;
}

/* Rows with a status and Button S line up on one centre line. */
:is(.home-modal-row__actions, .home-yandex-manage-service-actions) {
  align-items: center;
}

:is(.home-modal-row__actions, .home-yandex-manage-service-actions) > .btn {
  margin-top: 0;
}

/* Confirmation: «Отмена» Gray L and the verb action L, equal halves. */
.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.confirm-actions > .btn {
  flex: 1 1 0;
  margin: 0;
}

@media (max-width: 640px) {
  .home-modal:not(.home-connect-modal) .home-modal__actions > .btn {
    flex: 1 1 0;
  }

  .home-modal:not(.home-connect-modal) .home-modal__actions > :is(.btn-filled, .btn-primary, .btn-connect, .btn-forest):last-child {
    order: 1;
    flex: 1 0 100%;
  }

  .home-modal:not(.home-connect-modal) .home-modal__actions > :is(.btn-danger-plain, .btn-plain.btn-danger):first-child {
    margin-right: 0;
  }
}
