/* Раздел «Рассылки»: список рассылок и боковая панель сведений. Спецификация — docs/spec/40-mailings.md. */

.cl-mlg { display: flex; height: 100%; min-width: 0; background: var(--white); }
.cl-mlg__main { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.cl-mlg__side {
  flex: none;
  width: 430px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-primary-default);
  background: var(--white);
}
.cl-mlg__side[hidden] { display: none; }

/* --- вкладки видов рассылок: подпись и значок серые, у активной — фирменная линия --- */
.cl-mlg__kinds { flex: none; }
.cl-mlg__kinds .cl-tab,
.cl-mlg__kinds .cl-tab:hover,
.cl-mlg__kinds .cl-tab.is-active { color: var(--grey-400); }

/* --- поиск и кнопки --- */
.cl-mlg__bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.cl-mlg__search { flex: 1 1 auto; min-width: 0; }
.cl-mlg__search .cl-input__control { border-color: var(--border-secondary-default); background: var(--grey-100); }
.cl-mlg__search .cl-input__control:focus { border-color: var(--input-solid-border-focused); }
.cl-mlg__search .cl-input__icon { color: var(--grey-400); }
.cl-mlg__bar .cl-btn.cl-mlg__create { flex: none; width: 178px; padding: 0 18px; }

/* --- плашки статусов --- */
.cl-mlg__chips {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 12px 16px 20px;
  background: var(--white);
  transition: box-shadow var(--duration-row);
}
.cl-mlg__chips.is-raised { box-shadow: var(--mlg-scroll-shadow); }

/* --- список --- */
.cl-mlg__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 20px; }
.cl-mlg__more { display: flex; justify-content: center; padding: 16px 0 0; color: var(--grey-400); }
.cl-mlg__loading { display: grid; place-items: center; padding: 48px 0; color: var(--grey-400); }

.cl-mlg-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 71px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-primary-default);
  background: var(--white);
  cursor: pointer;
  transition: background-color var(--duration-row);
}
.cl-mlg-row:hover { background: var(--grey-50); }
.cl-mlg-row.is-selected { background: var(--brand-100); }
.cl-mlg-row.is-selected::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-500); }
.cl-mlg-row:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; }

.cl-mlg-status { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.cl-mlg-status--draft { background: var(--grey-300); color: var(--text-secondary); }
.cl-mlg-status--scheduled, .cl-mlg-status--sending { background: var(--brand-100); color: var(--brand-500); }
.cl-mlg-status--done { background: var(--green-200); color: var(--green-500); }
.cl-mlg-status--stopped { background: var(--orange-200); color: var(--orange-700); }
.cl-mlg-status--error { background: var(--pink-100); color: var(--red-800); }

.cl-mlg-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cl-mlg-row__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cl-mlg-row__title.is-empty { color: var(--text-caption); }
.cl-mlg-row__meta { display: flex; align-items: center; gap: 6px; overflow: hidden; font-size: 14px; line-height: 18px; color: var(--grey-500); white-space: nowrap; }
.cl-mlg-row__meta > * { flex: none; }
.cl-mlg-row__meta > .cl-mlg-row__author { flex: 0 1 auto; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.cl-mlg-row__sep { color: var(--grey-400); }
.cl-mlg-row__num { display: inline-flex; align-items: center; gap: 4px; }
.cl-mlg-row__num .cl-icon { color: var(--grey-400); }

.cl-mlg-row__state {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 150px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 21px;
  white-space: nowrap;
}
.cl-mlg-row__state--draft { color: var(--text-secondary); }
.cl-mlg-row__state--scheduled { color: var(--brand-500); }
.cl-mlg-row__state--sending, .cl-mlg-row__state--stopped { color: var(--orange-700); }
.cl-mlg-row__state--done { color: var(--green-700); }
.cl-mlg-row__state--error { color: var(--red-700); }
.cl-mlg-row__state .cl-progress { flex: none; }
.cl-mlg-row__state .cl-icon { flex: none; }
.cl-mlg-row__pct { min-width: 34px; text-align: right; }

.cl-mlg-iconbtn {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-4);
  background: none;
  color: var(--text-caption);
  cursor: pointer;
  transition: background-color var(--duration-row), color var(--duration-row);
}
.cl-mlg-iconbtn:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; }
.cl-mlg-star { color: var(--grey-400); }
.cl-mlg-star:hover { background: var(--grey-100); }
.cl-mlg-star.is-on { color: var(--mlg-star); }
.cl-mlg-dots:hover, .cl-mlg-dots[aria-expanded="true"] { color: var(--brand-500); }

/* --- меню строки: слева от «трёх точек» --- */
.cl-mlg-menu {
  position: fixed;
  z-index: var(--z-popover);
  min-width: 164px;
  overflow: hidden;
  border: 1px solid var(--mlg-menu-border);
  border-radius: var(--radius-6);
  background: var(--white);
  box-shadow: var(--shadow-dropdown);
}
.cl-mlg-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 6px 8px;
  background: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-row), color var(--duration-row);
}
.cl-mlg-menu__item:first-child { height: 52px; border-bottom: 1px solid var(--border-primary-default); }
.cl-mlg-menu__item .cl-icon { flex: none; color: var(--grey-500); transition: color var(--duration-row); }
.cl-mlg-menu__item:focus { outline: none; }
.cl-mlg-menu__item:hover, .cl-mlg-menu__item:focus-visible { background: var(--brand-100); color: var(--brand-500); }
.cl-mlg-menu__item:hover .cl-icon, .cl-mlg-menu__item:focus-visible .cl-icon { color: var(--brand-500); }

/* --- пустое состояние и карточка «Создать рассылку» --- */
.cl-mlg-none {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-12);
  background: var(--white);
  font-size: 14px;
  line-height: 21px;
  color: var(--text-secondary);
}
.cl-mlg-none__tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-8); background: var(--grey-100); color: var(--grey-500); }
.cl-mlg-none .cl-btn { width: 104px; }

.cl-mlg-new {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-top: 20px;
  padding: 43px 20px;
  border: 1px dashed var(--border-primary-default);
  border-radius: var(--radius-12);
  background: none;
  text-align: left;
  cursor: pointer;
}
.cl-mlg-new__plus {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-8);
  background: var(--brand-100);
  color: var(--brand-500);
  transition: background-color var(--duration-row);
}
.cl-mlg-new__plus:hover { background: var(--brand-300); }
.cl-mlg-new--alone { margin-top: 0; }
.cl-mlg-new__body { display: block; min-width: 0; }
.cl-mlg-new__title { display: block; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 24px; color: var(--text-secondary); transition: color var(--duration-row); }
.cl-mlg-new:hover .cl-mlg-new__title { color: var(--brand-500); }
.cl-mlg-new__text { display: block; font-size: 14px; line-height: 22px; color: var(--text-secondary); }
.cl-mlg-new:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 2px; }

/* --- окно «Фильтры рассылок» --- */
.cl-mlg-filters .cl-modal__body { gap: 8px; padding: 16px 20px; }
.cl-mlg-filters__group { display: flex; flex-direction: column; gap: 6px; }
.cl-mlg-filters__label { font-size: 14px; line-height: 18px; color: var(--text-primary); }
.cl-mlg-filters__range { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-primary); }
.cl-mlg-filters__range > .cl-field { flex: 1 1 0; min-width: 0; }
.cl-mlg-filters .cl-modal__footer { gap: 8px; padding: 14px 20px; background: var(--grey-50); }

/* --- окно «Просмотр шаблона» --- */
.cl-mlg-preview .cl-modal__body { padding: 12px 16px 16px; background: var(--grey-50); }
.cl-mlg-preview__text { font-size: 14px; line-height: 21px; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-mlg-preview__note { font-size: 14px; line-height: 20px; color: var(--grey-500); }

/* --- подтверждение удаления --- */
.cl-mlg-del b { font-weight: var(--font-weight-semibold); color: var(--text-primary); }

/* ============ боковая панель сведений ============ */
.cl-mlg-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--grey-300); }
.cl-mlg-empty__text { font-size: 18px; font-weight: var(--font-weight-semibold); line-height: 24px; color: var(--text-primary); }

.cl-mlg-side__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cl-mlg-head { padding: 20px 9px 20px 20px; border-bottom: 1px solid var(--border-primary-default); }
.cl-mlg-head__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cl-mlg-head__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--grey-500);
  text-transform: uppercase;
  cursor: pointer;
}
.cl-mlg-head__back:hover { color: var(--text-primary); }
.cl-mlg-head__tools { display: flex; align-items: center; gap: 12px; padding-right: 11px; }
.cl-mlg-head__tool { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-4); background: none; color: var(--grey-500); cursor: pointer; }
.cl-mlg-head__tool:hover { color: var(--brand-500); background: var(--grey-100); }
.cl-mlg-head__title { margin-bottom: 12px; padding-right: 11px; font-size: 18px; font-weight: var(--font-weight-medium); line-height: 24px; color: var(--text-primary); overflow-wrap: anywhere; }
.cl-mlg-head__title.is-empty { color: var(--text-caption); }
.cl-mlg-head__line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding-right: 11px; }
.cl-mlg-pill { display: inline-block; height: 22px; padding: 0 8px; border-radius: var(--radius-4); font-size: 14px; line-height: 22px; white-space: nowrap; }
.cl-mlg-pill--draft { background: var(--grey-300); color: var(--text-secondary); }
.cl-mlg-pill--scheduled, .cl-mlg-pill--sending { background: var(--brand-90); color: var(--brand-500); }
.cl-mlg-pill--done { background: var(--green-300); color: var(--green-700); }
.cl-mlg-pill--stopped { background: var(--orange-200); color: var(--orange-700); }
.cl-mlg-pill--error { background: var(--pink-100); color: var(--red-800); }
.cl-mlg-head__id { background: none; font-size: 14px; line-height: 20px; color: var(--grey-500); cursor: pointer; }
.cl-mlg-head__id:hover { color: var(--brand-500); }
.cl-mlg-author { margin-bottom: 12px; }
.cl-mlg-author__label { font-size: 14px; line-height: 16px; color: var(--grey-500); }
.cl-mlg-author__name { font-size: 14px; font-weight: var(--font-weight-medium); line-height: 20px; color: var(--text-primary); }
.cl-mlg-tiles { display: flex; gap: 8px; padding-right: 11px; }
.cl-mlg-tile { flex: 1 1 0; min-width: 0; padding: 8px 12px; border-radius: var(--radius-10); background: var(--grey-50); }
.cl-mlg-tile__label { font-size: 14px; line-height: 16px; color: var(--grey-500); }
.cl-mlg-tile__value { margin-top: 2px; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 18px; color: var(--text-primary); }
.cl-mlg-tile__value.is-planned { color: var(--brand-500); }

/* «Доставка и вовлечение» */
.cl-mlg-stats { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-right: 11px; }
.cl-mlg-stats__title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 20px; color: var(--text-primary); }
.cl-mlg-stats__title .cl-icon { color: var(--grey-500); }
.cl-mlg-stats__tiles { display: flex; gap: 8px; }
.cl-mlg-metric { flex: 1 1 0; min-width: 0; padding: 10px 12px; border-radius: var(--radius-10); background: var(--grey-50); }
.cl-mlg-metric__value { font-size: 20px; font-weight: var(--font-weight-medium); line-height: 24px; color: var(--text-primary); }
.cl-mlg-metric__value--brand { color: var(--brand-500); }
.cl-mlg-metric__label { margin-top: 2px; font-size: 14px; line-height: 16px; color: var(--grey-500); }
.cl-mlg-bar { --line: var(--grey-500); --fill: var(--grey-500); }
.cl-mlg-bar--green { --line: var(--green-700); --fill: var(--green-500); }
.cl-mlg-bar--red { --line: var(--red-700); --fill: var(--red-700); }
.cl-mlg-bar--brand { --line: var(--brand-500); --fill: var(--brand-500); }
.cl-mlg-bar__row { display: flex; align-items: baseline; gap: 8px; font-size: 14px; line-height: 20px; color: var(--text-primary); }
.cl-mlg-bar__name { flex: 1 1 auto; min-width: 0; }
.cl-mlg-bar__num { font-weight: var(--font-weight-medium); }
.cl-mlg-bar__pct { min-width: 38px; font-weight: var(--font-weight-medium); color: var(--line); text-align: right; }
.cl-mlg-bar__track { height: 4px; margin-top: 4px; overflow: hidden; border-radius: var(--radius-pill); background: var(--grey-100); }
.cl-mlg-bar__fill { height: 100%; border-radius: var(--radius-pill); background: var(--fill); transition: width var(--duration-panel); }
.cl-mlg-kinds { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--grey-500); }
.cl-mlg-kinds__row { display: flex; justify-content: space-between; gap: 8px; }
.cl-mlg-note { padding: 8px 12px; border-radius: var(--radius-6); font-size: 14px; line-height: 20px; }
.cl-mlg-note--wait { background: var(--orange-200); color: var(--orange-800); }
.cl-mlg-note--error { background: var(--red-200); color: var(--red-700); overflow-wrap: anywhere; }

/* вкладки панели */
.cl-mlg-tabs { display: flex; gap: 24px; padding: 12px 12px 0 20px; border-bottom: 1px solid var(--border-primary-default); }
.cl-mlg-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-tab), border-color var(--duration-tab);
}
.cl-mlg-tabs__tab.is-active { color: var(--brand-500); border-bottom-color: var(--brand-500); cursor: default; }
.cl-mlg-tabs__tab:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; border-radius: var(--radius-4); }
.cl-mlg-pane { padding: 12px 20px 20px; }

/* «Содержание рассылки» */
.cl-mlg-text__label { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; color: var(--text-primary); }
.cl-mlg-text__copy { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--radius-4); background: none; color: var(--grey-500); cursor: pointer; }
.cl-mlg-text__copy:hover { color: var(--brand-500); }
.cl-mlg-text__body { margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-mlg-text__body.is-empty { color: var(--grey-500); }
.cl-mlg-plate { display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: var(--radius-5); background: var(--grey-100); font-size: 14px; line-height: 19px; color: var(--grey-500); }
.cl-mlg-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.cl-mlg-buttons__row { display: flex; gap: 6px; }
.cl-mlg-buttons__btn {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  font-size: 14px;
  line-height: 20px;
  color: var(--brand-500);
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cl-mlg-files__title { margin-top: 16px; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 24px; color: var(--text-secondary); }
.cl-mlg-files { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.cl-mlg-file { display: flex; flex-direction: column; gap: 4px; width: 100px; }
.cl-mlg-file__box { display: grid; place-items: center; width: 100px; height: 100px; overflow: hidden; border-radius: var(--radius-6); background: var(--brand-100); color: var(--brand-500); }
.cl-mlg-file__box img { width: 100%; height: 100%; object-fit: cover; }
.cl-mlg-file__name { overflow: hidden; font-size: 14px; line-height: 20px; color: var(--brand-500); white-space: nowrap; text-overflow: ellipsis; }
a.cl-mlg-file__name:hover { color: var(--brand-600); }

/* «Параметры» */
.cl-mlg-param { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-primary-default); font-size: 14px; font-weight: var(--font-weight-medium); line-height: 20px; color: var(--text-primary); }
.cl-mlg-param__name { flex: 0 1 auto; min-width: 120px; }
.cl-mlg-param__value { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; overflow-wrap: anywhere; }
.cl-mlg-param__chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.cl-mlg-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 3px 8px; border-radius: var(--radius-6); background: var(--grey-100); font-weight: var(--font-weight-regular); }
.cl-mlg-chip .cl-icon { flex: none; color: var(--grey-500); }
.cl-mlg-chip__text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cl-mlg-chip__dot { flex: none; width: 10px; height: 10px; border-radius: var(--radius-2); }
.cl-mlg-blockid { padding: 2px 6px; border-radius: var(--radius-6); background: var(--grey-200); font-size: 14px; line-height: 20px; color: var(--text-primary); cursor: pointer; }
.cl-mlg-blockid:hover { background: var(--grey-300); }

/* подвал панели */
.cl-mlg-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border-primary-default); background: var(--white); }
.cl-mlg-foot .cl-btn { height: 44px; padding: 0 20px; border-radius: var(--radius-8); gap: 8px; }
.cl-mlg-foot .cl-btn--outline { padding: 0 19px; }
.cl-mlg-foot .cl-btn--brand:hover:not(:disabled) { background: var(--brand-600); }
.cl-mlg-side__loading { flex: 1 1 auto; display: grid; place-items: center; color: var(--grey-400); }

/* ============ мастер рассылки (разделы 2.3, 3.10–3.17 спецификации) ============ */

/* --- шапка приложения: стрелка «назад» с заголовком и полоса кнопок поверх шапки --- */
body.cl-mlgw-open .cl-header__right { visibility: hidden; }
.cl-mlgw-head { display: inline-flex; align-items: center; gap: 16px; height: var(--header-height); vertical-align: top; }
.cl-mlgw-head__back { display: flex; flex: none; width: 24px; height: 24px; border-radius: var(--radius-4); color: var(--text-caption); transition: color var(--duration-button); }
.cl-mlgw-head__back:hover { color: var(--text-primary); }
.cl-mlgw-head__back:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 2px; }
.cl-mlgw-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 130px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  height: var(--header-height);
  padding: 6px 20px;
  pointer-events: none;
}
.cl-mlgw-bar > * { pointer-events: auto; }
.cl-mlgw-bar__group { display: flex; gap: 8px; }
.cl-mlgw-bar__group:not(:has(> :not([hidden]))) { display: none; }

/* --- раскладка: форма прокручивается вместе со страницей, правая колонка 500 px стоит на месте --- */
.cl-mlgw-host { width: 100%; height: 100%; }
.cl-mlgw.cl-page-scroll { overflow-y: scroll; background: var(--white); }
.cl-mlgw__layout { display: flex; align-items: flex-start; min-height: 100%; }
.cl-mlgw__main { flex: 1 1 auto; min-width: 0; padding: 18px 20px 0; }
.cl-mlgw__side {
  position: sticky;
  top: 0;
  flex: none;
  width: 500px;
  height: calc(100vh - var(--header-height));
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--border-primary-default);
  background: var(--white);
}

/* --- полоса шагов --- */
.cl-mlgw-steps {
  display: inline-flex;
  align-items: stretch;
  height: 36px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
}
.cl-mlgw-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-tab);
}
.cl-mlgw-step:first-child { border-radius: var(--radius-5) 0 0 var(--radius-5); }
.cl-mlgw-step:last-child { border-radius: 0 var(--radius-5) var(--radius-5) 0; }
.cl-mlgw-step__icon { display: flex; flex: none; width: 20px; height: 20px; color: var(--grey-500); }
.cl-mlgw-step.is-done, .cl-mlgw-step.is-done .cl-mlgw-step__icon { color: var(--success-text); }
.cl-mlgw-step.is-current, .cl-mlgw-step.is-current .cl-mlgw-step__icon { color: var(--brand-500); }
.cl-mlgw-step.is-current { cursor: default; }
.cl-mlgw-step.is-blocked { cursor: not-allowed; }
.cl-mlgw-step:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; }
.cl-mlgw-steps__sep { flex: none; width: 11px; height: 34px; color: var(--border-primary-default); }

/* --- карточка шага --- */
.cl-mlgw-card {
  margin-top: 24px;
  padding: 16px 20px 20px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-12);
  background: var(--white);
}
.cl-mlgw-card--message { padding: 16px; }
.cl-mlgw-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cl-mlgw-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cl-mlgw-sec__title {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  line-height: 22px;
  color: var(--text-primary);
}
.cl-mlgw-line { height: 1px; margin: 20px 0; border: 0; background: var(--border-primary-default); }
.cl-mlgw-group { display: flex; flex-direction: column; gap: 6px; }
.cl-mlgw-label { font-size: 14px; line-height: 20px; color: var(--text-primary); }
.cl-mlgw-card .cl-field__label { line-height: 20px; }
.cl-mlgw-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.cl-mlgw-row2__wide { grid-column: 1 / -1; }

/* переключатель способа отбора: в CLcode способ один, сегмент всегда выбран */
.cl-mlgw-mode.cl-tabs--segment { gap: 0; padding: 4px; border-radius: var(--radius-6); }
.cl-mlgw-mode.cl-tabs--segment .cl-tab {
  height: auto;
  padding: 8px 16px;
  font-weight: var(--font-weight-regular);
  line-height: 19px;
  cursor: default;
}
.cl-mlgw-mode.cl-tabs--segment .cl-tab.is-active,
.cl-mlgw-mode.cl-tabs--segment .cl-tab.is-active:hover { box-shadow: var(--mlgw-segment-shadow); }

/* карточки-переключатели */
.cl-mlgw-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cl-mlgw-choice__card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border-primary-default);
  border-radius: 14px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--duration-input), background-color var(--duration-input);
}
.cl-mlgw-choice--l .cl-mlgw-choice__card { padding: 9px 12px; }
.cl-mlgw-choice__card:hover { border-color: var(--brand-500); }
.cl-mlgw-choice__card.is-selected { border-color: var(--brand-500); background: var(--brand-90); cursor: default; }
.cl-mlgw-choice__card:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; }
.cl-mlgw-choice__mark {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-primary-default);
  border-radius: 50%;
  background: var(--white);
  transition: border-color var(--duration-input);
}
.cl-mlgw-choice__card.is-selected .cl-mlgw-choice__mark { border-color: var(--brand-500); }
.cl-mlgw-choice__card.is-selected .cl-mlgw-choice__mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--brand-500);
}
.cl-mlgw-choice__body { display: flex; flex-direction: column; min-width: 0; }
.cl-mlgw-choice__title { font-size: 14px; font-weight: var(--font-weight-medium); line-height: 19px; color: var(--text-primary); }
.cl-mlgw-choice__text { font-size: 14px; line-height: 19px; color: var(--text-caption); }

/* шаг «Сообщение»: рассылка из блока воронки */
.cl-mlgw-blocktext {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 12px 16px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-10);
  background: var(--white);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  resize: vertical;
}
.cl-mlgw-blocktext:focus { outline: none; border-color: var(--border-secondary-default); }
.cl-mlg-plate.cl-mlgw-plate { margin-top: 0; }
.cl-mlg-buttons.cl-mlgw-blockbuttons, .cl-mlg-files.cl-mlgw-blockfiles { margin-top: 0; }

/* шаг «Отправка»: «Дополнительно» */
.cl-mlgw-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--radius-10); background: var(--grey-50); }
.cl-mlgw-panel .cl-toggle { align-self: flex-start; gap: 8px; font-weight: var(--font-weight-medium); color: var(--text-primary); }
.cl-mlgw-addto { width: 382px; max-width: 100%; }

/* полоса навигации под карточкой */
.cl-mlgw-nav { display: flex; align-items: center; gap: 12px; padding: 16px 0 24px; }

/* --- правая колонка --- */
.cl-mlgw-info { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 20px; border-bottom: 1px solid var(--border-primary-default); }
.cl-mlgw-info__title { margin: 0; font-size: 16px; font-weight: var(--font-weight-medium); line-height: 22px; color: var(--text-primary); }
.cl-mlgw-info__count { font-size: 14px; font-weight: var(--font-weight-medium); line-height: 19px; color: var(--grey-500); overflow-wrap: anywhere; }
.cl-mlgw-info__num { color: var(--text-primary); }
.cl-mlgw-info__count.is-error { color: var(--text-danger); }
.cl-mlgw-info__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-mlgw-info__recount { min-width: 162px; }
.cl-mlgw-preview { padding: 16px 20px 20px; }

/* --- окно «Протестировать рассылку» и перечень клиентов --- */
.cl-mlgw-test__actions { display: flex; }
.cl-btn.cl-mlgw-test__submit { padding: 0 12px; }
.cl-mlgw-clients { max-height: 300px; }

/* --- окно подтверждения запуска --- */
.cl-modal.cl-mlgw-confirm { border: 1px solid var(--border-primary-default); border-radius: var(--radius-6); }
.cl-mlgw-confirm .cl-confirm__title { margin-bottom: 0; font-size: 16px; line-height: 22px; }
.cl-mlgw-confirm .cl-confirm__text { margin: 8px 0 0; }
.cl-mlgw-confirm .cl-confirm__actions { margin-top: 20px; }
