.help-block-error {
    color: red;
    margin: 10px 0 10px 20px;
}
.modal.to-modal {
  /* оставляем поведение bootstrap, но задаём кастомный стиль контейнера */
  padding-right: 0 !important; /* фикс возможного двоения скролл-бара */
}
.modal.to-modal .modal-dialog.modal-wrapper {
  margin: 1.75rem auto;              /* как в BS, но можно менять */
  max-width: 640px;                   /* ширина модалки по умолчанию */
}
@media (min-width: 992px) {
  .modal.to-modal .modal-dialog.modal-wrapper {
    max-width: 720px;
  }
}
.modal.to-modal .modal-content.modal-container {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .5rem;
  box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.12);
  overflow: hidden;
}

/* ====== ХЕДЕР ====== */
.modal.to-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: center;            /* ты используешь text-center; добавим центрирование флексом */
  position: relative;
  padding: .875rem 3rem;              /* больше места под крестик */
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: #fff;
}
.modal.to-modal .modal-header h4,
.modal.to-modal .modal-header .modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  color: #111827;
}
.modal.to-modal .btn_close {
  position: absolute;
  top: .5rem;
  right: .75rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 1.5rem;
  line-height: 2rem;
  text-align: center;
  cursor: pointer;
  transition: color .2s ease;
}
.modal.to-modal .btn_close:hover { color: #111827; }
.modal.to-modal .btn_close:focus { outline: none; }

/* ====== ТЕЛО ====== */
.modal.to-modal .modal-body {
  padding: 1rem 1.25rem 1.25rem;
  background: #fff;
}

/* ====== ОБЩИЕ ЮТИЛИТЫ (если их нет в Bootstrap) ====== */
.to-modal .display-flex { display: flex; }
.to-modal .flex-column { flex-direction: column; }
.to-modal .flex-grow-1 { flex: 1 1 auto; }
.to-modal .w-100 { width: 100%; }
.to-modal .w-fit { width: -moz-fit-content; width: fit-content; }
.to-modal .mb-4 { margin-bottom: 1.5rem !important; }
.to-modal .mr-2 { margin-right: .5rem !important; }

/* ====== ВЕРХНИЙ БЛОК С ДАННЫМИ (q-body__header) ====== */
.to-modal .q-body__header {
  gap: 1rem;                          /* современный отступ между элементами (перекроет на поддерживаемых браузерах) */
}
.to-modal .q-body__header .title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}
.to-modal .q-body__header .title.confirm {
  color: #0f766e;                     /* аккуратный «подтверждающий» цвет */
}

/* ====== ПАРЫ "give / get" ====== */
.to-modal .header-fields {
  display: block;
}
.to-modal .header-fields > label.title {
  display: inline-block;
  margin-bottom: .5rem;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #6b7280;
}

.to-modal .header-field-coin {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .75rem;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: .5rem;
  background: #fafafa;
}

.to-modal .header-field__currency img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: .375rem;
  object-fit: cover;
}

.to-modal .header-field-coinname span {
  display: inline-block;
  font-weight: 600;
  font-size: .9375rem;
  color: #111827;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.to-modal #expected_amount_to {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum","lnum";
  font-weight: 600;
  color: #0b5ed7;                     /* подчёркиваем итог */
}

/* ====== СТРЕЛКА МЕЖДУ ПОЛЯМИ ====== */
.to-modal .header-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}
.to-modal .header-arrow img {
  display: block;
  width: 28px;
  height: 28px;
  opacity: .75;
}

/* ====== ФОРМА (нижний блок) ====== */
.to-modal ._item_131r1_31 {
  margin-top: 1rem;
}
.to-modal form._DiscountsInfo_uv0nc_8 {
  display: block;
}
.to-modal .form-group {
  margin-bottom: .75rem;
}
.to-modal .help-block.help-block-error {
  margin: .25rem 0 0;
  color: #dc3545;
  font-size: .8125rem;
}
.to-modal .btn.btn-primary.w-fit.w-100 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: .5rem;
  min-height: 2.75rem;
  font-weight: 600;
  letter-spacing: .01em;
}

/* ====== BACKDROP (если нужно слегка отличаться от дефолта Bootstrap) ====== */
.modal.to-modal.show ~ .modal-backdrop,
.modal.to-modal + .modal-backdrop,
#start_unconfirmed_status.show ~ .modal-backdrop,
#start_unconfirmed_status + .modal-backdrop {
  background: #0b1020;
  opacity: .55 !important;
}

/* ====== АНИМАЦИЯ / ВХОД-ВЫХОД (тоньше, чем стандартный fade) ====== */
.modal.to-modal.fade .modal-dialog {
  transition: transform .25s ease-out, opacity .25s ease-out;
  transform: translate3d(0, 10px, 0) scale(.98);
  opacity: 0;
}
.modal.to-modal.show .modal-dialog {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

/* ====== ФОКУСЫ/ДОСТУПНОСТЬ ====== */
.to-modal .modal-content:focus {
  outline: 2px solid rgba(59,130,246,.5);
  outline-offset: 0;
}

/* ====== МЕЛКИЕ ПРАВКИ BOOTSTRAP 4 ПОД ЭТУ МОДАЛКУ ====== */
#start_unconfirmed_status[aria-hidden="true"] .modal-dialog { pointer-events: none; }
#start_unconfirmed_status[aria-hidden="false"] .modal-dialog { pointer-events: auto; }

/* Если у тебя нет своих util-классов, на всякий случай: */
.to-modal .d-flex { display: flex !important; }
.to-modal .align-items-center { align-items: center !important; }
.to-modal .text-center { text-align: center !important; }