/* Конструктор — правая панель: редактор блока, редактор стрелки «Соединение», «Конструктор условий».
   Размеры — docs/spec/11-constructor-block-editor.md и 12-constructor-arrows-tools.md (§3.3–3.5).
   Каркас панели (ширина, рамка, ручка) — в builder.css; токены --bp-* — в конце tokens.css. */

/* ============ Каркас формы ============ */
.cl-bp { position: relative; font-size: 14px; color: var(--text-primary); }
.cl-bp__scroll { flex: 1 1 auto; min-height: 0; padding: 0 12px 4px; overflow-x: hidden; overflow-y: auto; }
.cl-bp__head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 45px;
  margin-bottom: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-primary-default);
  background: var(--white);
}
.cl-bp__foot {
  position: relative;
  z-index: 4;
  display: flex;
  flex: none;
  height: 60px;
  padding: 10px 12px;
  background: var(--white);
  box-shadow: var(--bld-panel-foot-shadow);
}
.cl-bp__save { --btn-pad: 10px; }
.cl-bp__save-close { --btn-pad: 20px; margin-left: 10px; }
.cl-bp[data-form="edge"] .cl-bp__save-close { --btn-pad: 15px; }
/* На время запроса надпись сменяется кольцом; «Сохранить и закрыть» сереет */
.cl-bp__foot .cl-btn.is-loading .cl-btn__label { visibility: hidden; }
.cl-bp__foot .cl-btn.is-loading .cl-spinner { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.cl-bp__save-close.is-loading { border-color: var(--bp-saving); background: var(--bp-saving); color: var(--text-white); }

/* ============ Шапка ============ */
.cl-bp-head__kind { display: inline-flex; flex: none; align-items: center; width: 42px; height: 24px; margin-right: 6px; color: var(--grey-500); cursor: pointer; }
.cl-bp-head__kindicon { display: inline-flex; flex: none; width: 24px; height: 24px; }
.cl-bp-head__kindicon[data-kind="start"] { color: var(--bp-kind-start); }
.cl-bp-head__kindicon[data-kind="condition"] { color: var(--bp-kind-condition); }
.cl-bp-head__kindicon[data-kind="state"] { color: var(--bp-kind-state); }
.cl-bp-head__kindicon[data-kind="side"], .cl-bp-head__kindicon[data-kind="nostate"], .cl-bp-head__kindicon[data-kind="comment"] { color: var(--bp-kind-muted); }
.cl-bp-head__title, .cl-bp-head__name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-inherit);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-bp-head__title { flex: 0 1 auto; cursor: pointer; }
.cl-bp-head__pencil { display: inline-flex; flex: none; margin-left: 6px; color: var(--grey-400); opacity: 0; transition: opacity var(--duration-row); }
.cl-bp-head:hover .cl-bp-head__pencil, .cl-bp-head__pencil:focus-visible { opacity: 1; }
.cl-bp-head__pencil:hover { color: var(--icon-primary-default); }
.cl-bp-head__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
}
.cl-bp-head__input:focus { border-color: var(--input-solid-border-focused); outline: none; }
.cl-bp-head__space { flex: 1 1 0; min-width: 8px; }
.cl-bp-head__id { flex: none; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 20px; color: var(--text-caption); cursor: pointer; }
.cl-bp-head__id:hover { color: var(--text-secondary); }
.cl-bp-head .cl-help { margin-left: 4px; }
.cl-bp-head__dots { display: inline-flex; flex: none; width: 24px; height: 24px; margin-left: 12px; border-radius: var(--radius-4); color: var(--grey-400); cursor: pointer; }
.cl-bp-head__dots:hover, .cl-bp-head__dots[aria-expanded="true"] { color: var(--icon-primary-default); }

/* Шапка «Соединения»: щелчок по названию превращает его в поле */
.cl-bp-head--edge { height: 47px; cursor: text; }
.cl-bp-head__edge-title { display: inline-flex; flex: 0 1 auto; align-items: center; min-width: 0; cursor: text; }
.cl-bp-head__name { color: var(--text-primary); }
.cl-bp-head__pencil--edge { margin-left: 4px; }
.cl-bp-head__edge-dots { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-6); color: var(--grey-400); cursor: pointer; }
.cl-bp-head__edge-dots:hover, .cl-bp-head__edge-dots[aria-expanded="true"] { background: var(--grey-100); color: var(--icon-primary-default); }
.cl-bp-edgemenu { min-width: 210px; padding: 6px; border: 1px solid var(--border-primary-default); border-radius: var(--radius-12); background: var(--white); box-shadow: var(--bp-edge-menu-shadow); }
.cl-bp-edgemenu__item { display: block; width: 100%; padding: 9px 12px; border-radius: var(--radius-8); font-size: 14px; line-height: 20px; color: var(--text-secondary); text-align: left; white-space: nowrap; cursor: pointer; }
.cl-bp-edgemenu__item:hover, .cl-bp-edgemenu__item:focus-visible { background: var(--grey-100); }

/* Список типов блока — под шапкой, во всю ширину содержимого */
.cl-bp-kinds { padding: 4px 0; border-radius: var(--radius-6); background: var(--white); box-shadow: var(--shadow-dropdown); }
.cl-bp-kinds__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.cl-bp-kinds__row:hover, .cl-bp-kinds__row:focus-visible { background: var(--grey-100); }
.cl-bp-kinds__row.is-current { font-weight: var(--font-weight-medium); }
.cl-bp-kinds__label { flex: 1 1 auto; min-width: 0; }
.cl-bp-kinds__help { display: inline-flex; }

/* Меню «три точки» блока: с «хвостиком» под значком и вложенным списком «Создать рассылку» */
.cl-bp-menu {
  position: relative;
  width: 214px;
  padding: 8px 0;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  box-shadow: var(--shadow-dropdown);
}
.cl-bp-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: var(--bp-menu-tail, 11px);
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--border-primary-default);
  border-left: 1px solid var(--border-primary-default);
  background: var(--white);
  transform: rotate(45deg);
}
.cl-popover[data-side="top"] .cl-bp-menu::before { top: auto; bottom: -6px; transform: rotate(225deg); }
.cl-bp-menu__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.cl-bp-menu__item .cl-icon { color: var(--icon-primary-default); }
.cl-bp-menu__item:hover, .cl-bp-menu__item:focus-visible { background: var(--grey-100); }
.cl-bp-menu__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-bp-menu__chevron { transition: transform var(--duration-row); }
.cl-bp-menu__item[aria-expanded="true"] .cl-bp-menu__chevron { transform: rotate(90deg); }
.cl-bp-menu__sub { background: var(--grey-50); }

/* ============ Секции ============ */
.cl-bp-secs { display: flex; flex-direction: column; }
.cl-bp-sec { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cl-bp-sec--cond, .cl-bp-sec--api, .cl-bp-sec--gsheet, .cl-bp-sec--calc, .cl-bp-sec--action, .cl-bp-sec--time {
  padding: 8px;
  border: 1px solid;
  border-radius: var(--radius-6);
}
.cl-bp-sec--cond { border-color: var(--bp-cond-border); background: var(--bp-cond-fill); }
.cl-bp-sec--api { border-color: var(--bp-api-border); background: var(--bp-api-fill); }
.cl-bp-sec--gsheet { border-color: var(--bp-gsheet-border); background: var(--bp-gsheet-fill); }
.cl-bp-sec--calc { border-color: var(--bp-calc-border); background: var(--bp-calc-fill); }
.cl-bp-sec--action { border-color: var(--bp-action-border); background: var(--bp-action-fill); }
.cl-bp-sec--time { border-color: var(--bp-grey-border); background: var(--bp-grey-fill); }
.cl-bp-sec--edge-cond { padding: 8px 8px 4px; }
.cl-bp-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cl-bp-api__rest { gap: 8px; }

/* Поля формы: подпись 14/18 с отступом 4, поле 40 px */
.cl-bp .cl-field { gap: 4px; }
.cl-bp .cl-field__label, .cl-bp-label { line-height: 18px; }
.cl-bp input.cl-input__control { padding: 8px 5px 8px 10px; }
.cl-bp .cl-input--icon-right input.cl-input__control { padding-right: 40px; }
.cl-bp .cl-input--icon-right .cl-input__icon { right: 8px; }
.cl-bp textarea.cl-input__control { min-height: 67px; padding: 5px 5px 0; }
.cl-bp .cl-input__control:hover, .cl-bp .cl-input__control:focus { background: var(--white); }
.cl-bp-label { display: flex; align-items: center; gap: 4px; height: 18px; font-size: 14px; color: var(--text-primary); }
.cl-bp-label__right { display: inline-flex; margin-left: auto; }
.cl-bp-label .cl-btn--text .cl-btn__label { font-weight: var(--font-weight-medium); }
.cl-bp-hint { font-size: 12px; line-height: 16px; color: var(--text-caption); }
.cl-bp-note { padding: 8px 12px; border-radius: var(--radius-6); background: var(--grey-100); font-size: 14px; line-height: 20px; color: var(--text-secondary); }

/* «Расширенные настройки» / «Скрыть настройки» */
.cl-bp-more {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  margin-top: 0;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 17px;
  color: var(--text-secondary);
  cursor: pointer;
}
.cl-bp-more:hover { color: var(--text-primary); }
.cl-bp-adv { display: flex; flex-direction: column; gap: 8px; }
.cl-bp-toggles { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 3px 0; }
.cl-bp-toggles .cl-toggle { color: var(--text-inherit); }

/* Сетка кнопок-секций */
.cl-bp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.cl-bp-grid__btn { --btn-pad: 8px; width: 100%; font-weight: var(--font-weight-regular); color: var(--text-secondary); }
.cl-bp-grid__btn--wide { grid-column: 1 / -1; }
.cl-bp-grid__btn.is-selected { border-style: dashed; }
.cl-bp-grid__btn.is-danger, .cl-bp-grid__btn.is-danger:hover { border-color: var(--red-700); background: var(--red-100); color: var(--red-700); }
.cl-bp-grid__btn.is-danger .cl-icon { color: var(--red-600); }

/* Виджеты внутри панели */
.cl-bp-sec--message .cl-msged__text { width: 100%; }
/* Десять кнопок 32 px с зазором 4 — это 356 px при содержимом 352–355: ряд заходит на 4 px в правое поле панели
   (как в образце); в узкой панели кнопки переносятся на вторую строку */
.cl-bp-sec--message .cl-msged__tools { flex-wrap: wrap; gap: 4px; margin-right: -4px; }
.cl-bp-sec--message .cl-msged__tool { flex: none; }
.cl-bp-sec--buttons .cl-notice { font-size: 13px; line-height: 18px; }

/* ============ «Действие» ============ */
.cl-bp-actions { display: flex; flex-direction: column; gap: 8px; }
.cl-bp-actions:empty { display: none; }
.cl-bp-action { position: relative; display: flex; flex-direction: column; gap: 4px; }
.cl-bp-action__remove { position: absolute; top: -3px; right: 0; }
.cl-bp-actions__add { display: flex; justify-content: center; }

/* ============ «Передача данных в Google Sheets» ============ */
.cl-bp-gs__info { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cl-bp-gs__title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-bp-gs__a { flex: none; color: var(--link-brand-text-default); text-decoration: none; }
.cl-bp-gs__a:hover { color: var(--link-brand-text-hover); text-decoration: underline; }
.cl-btn.cl-bp-gs__add { --btn-h: 16px; flex: none; font-size: 12px; }
.cl-bp-gs__note { padding: 6px 8px; border-radius: var(--radius-6); background: var(--orange-200); font-size: 12px; line-height: 16px; color: var(--orange-800); overflow-wrap: anywhere; }
.cl-bp-gs__note .cl-bp-gs__a { color: inherit; text-decoration: underline; }
/* «Привязать таблицу…»: ссылка, подпись и кнопки — прямо под списком таблиц */
.cl-bp-gs__link { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px dashed var(--bp-gsheet-border); border-radius: var(--radius-6); background: var(--white); }
.cl-bp-gs__buttons { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.cl-bp-sec--gsheet .cl-field__hint { font-size: 12px; overflow-wrap: anywhere; }
.cl-btn.cl-bp-gs__refresh { gap: 4px; }
/* В списках таблиц и листов длинное название обрезается, пояснение идёт мелкой второй строкой */
.cl-bp-gs__list .cl-option { flex-wrap: wrap; row-gap: 0; }
.cl-bp-gs__list .cl-option__label { flex: 1 1 100%; }
.cl-bp-gs__list .cl-option__hint { flex: 1 1 100%; min-width: 0; overflow: hidden; font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }

/* Строка столбца: буква, значение, «вставить переменную», удалить; над значением — подпись из первой строки листа */
.cl-bp-gs__rows { display: flex; flex-direction: column; gap: 6px; }
.cl-bp-gs__rows:empty { display: none; }
.cl-bp-gs__row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 32px 24px; align-items: start; column-gap: 4px; row-gap: 2px; }
.cl-bp-gs__caption { grid-column: 2 / -1; overflow: hidden; font-size: 12px; line-height: 14px; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.cl-bp-gs__caption.is-empty { color: var(--text-placeholder); }
.cl-bp-gs__col input.cl-input__control { padding: 8px 4px; font-weight: var(--font-weight-medium); text-align: center; text-transform: uppercase; }
.cl-bp-gs__value textarea.cl-input__control { min-height: 40px; padding: 9px 6px 9px 10px; overflow-wrap: anywhere; }
.cl-bp-gs__var { margin-top: 4px; }
.cl-bp-gs__remove { margin-top: 8px; }
.cl-bp-gs__error { grid-column: 1 / -1; font-size: 12px; line-height: 16px; color: var(--border-error); }
.cl-bp-gs__empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
/* В узкой панели «Очистить раздел» уходит на свою строку, к правому краю */
.cl-bp-gs__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.cl-btn.cl-bp-gs__clear { margin-left: auto; color: var(--text-caption); font-weight: var(--font-weight-regular); }
.cl-btn.cl-bp-gs__clear:hover { color: var(--text-danger); }
/* Строка в «API-запросе» блока со старым запросом к таблицам: ссылка на новый раздел */
.cl-btn.cl-bp-gs__jump { --btn-h: 16px; display: inline-flex; font-size: 12px; vertical-align: baseline; white-space: normal; text-align: left; }
.cl-bp-gs__legacy .cl-notice { font-size: 13px; line-height: 18px; }
.cl-bp-gs__legacy-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cl-bp-gs__double { font-size: 12px; line-height: 16px; font-weight: var(--font-weight-medium); }

/* ============ Поле кода ============ */
.cl-bp-code {
  display: flex;
  max-height: var(--code-max, 900px);
  overflow-x: hidden;
  overflow-y: auto;
  /* Обводка поверх содержимого, а не рамка: шесть строк дают ровно 108 px, как в образце */
  outline: 1px solid var(--bp-code-border);
  outline-offset: -1px;
  border-radius: var(--radius-6);
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 18px;
  color: var(--bp-code-text);
}
.cl-bp-code:focus-within { outline-color: var(--input-solid-border-focused); }
.cl-bp-code__gutter { flex: none; width: 42px; color: var(--bp-code-gutter); text-align: right; user-select: none; }
.cl-bp-code__num { position: relative; padding-right: 8px; }
.cl-bp-code__num.is-error, .cl-bp-code__num.is-warning { cursor: help; }
.cl-bp-code__num.is-error { background: var(--red-100); color: var(--red-600); }
.cl-bp-code__num.is-warning { background: var(--orange-200); color: var(--orange-700); }
.cl-bp-code__num.is-error::before, .cl-bp-code__num.is-warning::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.cl-bp-code__body { position: relative; flex: 1 1 auto; min-width: 0; }
.cl-bp-code__input, .cl-bp-code__mirror {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 6px;
  border: 0;
  font: inherit;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  tab-size: 4;
}
.cl-bp-code__input { min-height: var(--code-min, 108px); overflow: hidden; background: transparent; color: inherit; outline: none; resize: none; }
.cl-bp-code__mirror { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; }
.cl-bp-code__caret { position: absolute; top: 0; left: 0; width: 1px; height: 18px; pointer-events: none; }
.cl-bp-suggest {
  min-width: 180px;
  max-height: 208px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-8);
  background: var(--white);
  box-shadow: var(--shadow-dropdown);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 18px;
}
.cl-bp-suggest__item { display: block; width: 100%; padding: 3px 8px; border-radius: var(--radius-4); color: var(--text-primary); text-align: left; cursor: pointer; }
.cl-bp-suggest__item b { font-weight: var(--font-weight-semibold); color: var(--text-brand); }
.cl-bp-suggest__item:hover, .cl-bp-suggest__item.is-active { background: var(--grey-100); }

/* ============ «Соединение» ============ */
.cl-bp-delay { display: grid; grid-template-columns: minmax(0, 1fr) 95px; gap: 4px; }
.cl-bp-edge__tail { margin-bottom: 4px; padding-left: 0; }
/* Поле «Вводимые данные» плавно появляется под переключателем */
.cl-bp-collapse { display: grid; grid-template-rows: 0fr; margin-bottom: 8px; transition: grid-template-rows var(--duration-panel); }
.cl-bp-collapse.is-open { grid-template-rows: 1fr; }
.cl-bp-collapse__inner { min-height: 0; overflow: hidden; }
.cl-bp-collapse:not(.is-open) .cl-bp-collapse__inner { visibility: hidden; }

/* Список кнопок блока-источника под полем «Условие» */
.cl-bp-srcbuttons {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-12);
  background: var(--white);
  box-shadow: var(--shadow-dropdown);
}
.cl-bp-srcbuttons .cl-check { padding: 7px 8px; border-radius: var(--radius-8); }
.cl-bp-srcbuttons .cl-check:hover { background: var(--grey-100); }

/* Выбор времени: часы и минуты, «Сейчас» и «Ok» */
.cl-bp-time { width: 157px; border: 1px solid var(--border-primary-default); border-radius: var(--radius-6); background: var(--white); box-shadow: var(--shadow-dropdown); }
.cl-bp-time__cols { display: flex; height: 228px; padding: 4px 0; }
.cl-bp-time__col { flex: 1 1 0; min-width: 0; padding: 0 3px; overflow-y: auto; }
.cl-bp-time__col + .cl-bp-time__col { border-left: 1px solid var(--border-primary-default); }
.cl-bp-time__cell { display: block; width: 100%; height: 35px; border-radius: var(--radius-6); font-size: 14px; line-height: 35px; color: var(--text-primary); text-align: center; cursor: pointer; }
.cl-bp-time__cell:hover { background: var(--grey-100); }
.cl-bp-time__cell.is-selected { background: var(--brand-100); font-weight: var(--font-weight-medium); color: var(--text-brand); }
.cl-bp-time__foot { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-top: 1px solid var(--border-primary-default); }
.cl-bp-time__now { font-size: 14px; font-weight: var(--font-weight-medium); line-height: 20px; color: var(--link-brand-text-default); cursor: pointer; }
.cl-bp-time__now:hover { color: var(--link-brand-text-hover); }
.cl-bp-time__ok { --btn-pad: 0px; width: 42px; }

/* ============ «Конструктор условий» ============ */
.cl-cb {
  position: fixed;
  z-index: 120;
  display: flex;
  width: 700px;
  min-height: 323px;
  overflow: hidden;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-12);
  background: var(--white);
  box-shadow: var(--bp-float-shadow);
  font-size: 14px;
  color: var(--text-primary);
}
.cl-cb__left { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; padding: 16px 0; }
.cl-cb__chips { display: flex; flex: none; flex-wrap: wrap; gap: 6px; max-height: 84px; margin-bottom: 12px; padding: 0 20px 0 16px; overflow-y: auto; }
.cl-cb__chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 8px; border-radius: var(--radius-4); background: var(--green-200); font-size: 12px; line-height: 20px; color: var(--green-700); }
.cl-cb__chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cb__chip-x { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: var(--radius-4); color: inherit; cursor: pointer; }
.cl-cb__chip-x:hover { background: var(--green-300); }
.cl-cb__content { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 0; padding: 0 20px 0 16px; overflow-y: auto; }
.cl-cb__sections { display: flex; flex: none; flex-wrap: wrap; gap: 6px; }
.cl-cb__section {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 12px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-primary);
  cursor: pointer;
}
.cl-cb__section:hover { background: var(--grey-100); }
.cl-cb__section.is-active { border-color: var(--border-brand); background: var(--brand-100); color: var(--text-brand); }
.cl-cb__section [data-icon="telegram"] { color: var(--messenger-telegram); }
.cl-cb__section [data-icon="vk"] { color: var(--messenger-vk); }
.cl-cb__fields, .cl-cb__stack { display: flex; flex-direction: column; gap: 12px; }
.cl-cb__stack:empty { display: none; }
.cl-cb__text { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.cl-cb__note { padding: 8px 12px; border-radius: var(--radius-6); background: var(--orange-200); font-size: 13px; line-height: 18px; color: var(--orange-800); }

.cl-cb__right { display: flex; flex: none; flex-direction: column; gap: 6px; width: 210px; padding: 10px; background: var(--grey-50); }
.cl-cb__title { display: flex; align-items: center; justify-content: space-between; height: 34px; margin-bottom: 6px; font-weight: var(--font-weight-medium); color: var(--grey-600); }
.cl-cb__tabs { display: flex; flex-direction: column; gap: 6px; margin: 0 -10px; }
.cl-cb__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 14px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.cl-cb__tab:hover { color: var(--text-primary); }
.cl-cb__tab.is-active { background: linear-gradient(90deg, var(--brand-100), transparent); color: var(--text-brand); }
.cl-cb__tab.is-active::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 40px; border-radius: 0 var(--radius-4) var(--radius-4) 0; background: var(--brand-500); }
.cl-cb__actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 12px; }

/* Построитель условий по переменным */
.cl-cb-vars__title { margin-bottom: -8px; font-weight: var(--font-weight-medium); color: var(--text-secondary); }
.cl-cb textarea.cl-input__control { min-height: 67px; padding: 5px 5px 0; }
.cl-cb input.cl-input__control { padding: 8px 5px 8px 10px; }
.cl-cb .cl-field { gap: 4px; }
.cl-cb .cl-field__label { line-height: 18px; }
.cl-cb-vars__rows { display: flex; flex-direction: column; gap: 12px; }
.cl-cb-vars__row { display: grid; grid-template-columns: 176px 24px 220px 20px; align-items: start; column-gap: 4px; }
.cl-cb-vars__op {
  width: 24px;
  height: 24px;
  margin-top: 30px;
  border-radius: var(--radius-5);
  background: var(--brand-100);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 24px;
  color: var(--text-brand);
  text-align: center;
  cursor: pointer;
}
.cl-cb-vars__op:hover { background: var(--brand-200); }
.cl-cb-vars__right { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cl-cb-vars__remove { margin-top: 30px; }
.cl-cb-vars__divider { display: flex; align-items: center; gap: 12px; }
.cl-cb-vars__divider::before, .cl-cb-vars__divider::after { content: ""; flex: 1 1 0; height: 1px; background: var(--border-primary-default); }
.cl-cb-vars__add { font-size: 14px; line-height: 20px; color: var(--text-caption); cursor: pointer; }
.cl-cb-vars__add:hover { color: var(--text-primary); }
.cl-cb-vars__join { align-self: flex-start; }

/* «Выбор бота» */
.cl-cb-bots { display: flex; flex-direction: column; gap: 6px; }
.cl-cb-bots:empty { display: none; }
.cl-cb-bots__item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 4px 4px 8px; border: 1px solid var(--border-primary-default); border-radius: var(--radius-6); }
.cl-cb-bots__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cb-bots__dot { flex: none; width: 20px; height: 20px; border-radius: 50%; }
.cl-cb-bots__dot--tg { background: var(--messenger-telegram); }
.cl-cb-bots__dot--vk { background: var(--messenger-vk); }
.cl-cb-botlist [data-icon="telegram"] { color: var(--messenger-telegram); }
.cl-cb-botlist [data-icon="vk"] { color: var(--messenger-vk); }

/* ============ Вопрос «Нет / Да» (уход с несохранённой формы, вопросы перед сохранением) ============ */
.cl-bp-ask { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--bp-ask-overlay); }
.cl-bp-ask__card {
  position: absolute;
  top: 40%;
  left: 50%;
  width: calc(100% - 40px);
  max-width: 600px;
  min-height: 164px;
  padding: 20px 16px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  transform: translate(-50%, -50%);
}
.cl-bp-ask__close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-4); color: var(--grey-400); cursor: pointer; }
.cl-bp-ask__close:hover, .cl-bp-ask__close:focus-visible { color: var(--icon-primary-default); }
.cl-bp-ask__text { padding-right: 24px; font-size: 16px; line-height: 24px; color: var(--text-caption); }
.cl-bp-ask__actions { display: flex; justify-content: center; gap: 8px; margin-top: 34px; }
