/* Общие компоненты. Размеры и состояния — по рецептам docs/spec/00-design-system.md, раздел 3.7. */

/* ============ Кнопки с текстом ============ */
.cl-btn {
  --btn-h: var(--control-height-m);
  --btn-pad: 20px;
  --btn-lh: 20px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: var(--btn-h);
  padding: 0 var(--btn-pad);
  border: 0;
  border-radius: var(--radius-6);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: var(--btn-lh);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--duration-button), color var(--duration-button), border-color var(--duration-button);
}
.cl-btn--l { --btn-h: var(--control-height-l); --btn-pad: 24px; }
.cl-btn--m { --btn-h: var(--control-height-m); --btn-pad: 20px; }
.cl-btn--s { --btn-h: var(--control-height-s); --btn-pad: 12px; }
.cl-btn--xs { --btn-h: var(--control-height-xs); --btn-pad: 12px; --btn-lh: 16px; }
.cl-btn--xxs { --btn-h: var(--control-height-xxs); --btn-pad: 12px; --btn-lh: 14px; }
.cl-btn--block { display: flex; width: 100%; }
.cl-btn__label { overflow: hidden; text-overflow: ellipsis; }

.cl-btn--brand { background: var(--button-primary-background-default); color: var(--text-white); }
.cl-btn--brand:hover { background: var(--button-primary-background-hover); }
.cl-btn--brand:active { background: var(--button-primary-background-pressed); }

/* Рамка прибавляется к полям, как в образце: контурная кнопка на 2 px шире сплошной с той же подписью
   («Отменить» — 107 px, «Настройка папок» — 186 px) */
.cl-btn--outline {
  background: var(--white);
  border: 1px solid var(--border-primary-default);
  color: var(--text-primary);
}
.cl-btn--outline:hover { background: var(--grey-100); }
.cl-btn--outline:active { background: var(--grey-300); }

.cl-btn--soft { background: var(--grey-100); color: var(--text-primary); }
.cl-btn--soft:hover, .cl-btn--soft:active { background: var(--grey-300); }

.cl-btn--soft-brand { background: var(--button-soft-brand-background-default); color: var(--text-brand); }
.cl-btn--soft-brand:hover { background: var(--button-soft-brand-background-hover); }

.cl-btn--dashed {
  background: var(--white);
  border: 1px dashed var(--grey-300);
  color: var(--text-secondary);
}
.cl-btn--dashed:hover { background: var(--grey-100); border-color: var(--grey-400); }

.cl-btn--text { --btn-h: 24px; --btn-pad: 0px; background: transparent; color: var(--button-ghost-foreground-default); }
.cl-btn--text.cl-btn--s { --btn-h: var(--control-height-s); --btn-pad: 12px; }
.cl-btn--text.cl-btn--l { --btn-h: var(--control-height-l); --btn-pad: 24px; }
.cl-btn--text:hover { color: var(--button-ghost-foreground-hover); }

.cl-btn--danger { background: var(--danger-solid); color: var(--text-white); }
.cl-btn--danger:hover { background: var(--danger-solid-hover); }

/* Состояния поверх вида */
.cl-btn.is-selected, .cl-btn.is-selected:hover {
  background: var(--brand-100);
  border-color: var(--border-brand);
  color: var(--text-brand);
}
.cl-btn.is-selected:not(.cl-btn--outline):not(.cl-btn--dashed) { box-shadow: inset 0 0 0 1px var(--border-brand); }
.cl-btn.is-danger, .cl-btn.is-danger:hover {
  background: var(--red-100);
  border-color: var(--red-700);
  color: var(--red-700);
}
.cl-btn.is-danger .cl-icon { color: var(--red-600); }

.cl-btn:disabled, .cl-btn:disabled:hover {
  background: var(--grey-100);
  color: var(--text-disabled);
  cursor: not-allowed;
  box-shadow: none;
}
.cl-btn--outline:disabled, .cl-btn--dashed:disabled { border-color: var(--border-primary-default); }
.cl-btn--text:disabled, .cl-btn--text:disabled:hover { background: transparent; }

.cl-btn.is-loading { pointer-events: none; }
.cl-btn--outline.is-loading, .cl-btn--soft.is-loading, .cl-btn--dashed.is-loading { color: var(--button-outline-foreground-loading); }
.cl-btn.is-loading > .cl-icon { display: none; }

/* ============ Квадратные кнопки с иконкой ============ */
.cl-iconbtn {
  --ib-size: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--ib-size);
  height: var(--ib-size);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-6);
  background: transparent;
  color: var(--icon-primary-default);
  cursor: pointer;
  transition: background-color var(--duration-button), color var(--duration-button), border-color var(--duration-button);
}
.cl-iconbtn--l { --ib-size: 40px; }
.cl-iconbtn--m { --ib-size: 34px; }
.cl-iconbtn--s { --ib-size: 32px; }
.cl-iconbtn--xs { --ib-size: 24px; }
.cl-iconbtn--round { border-radius: var(--radius-pill); }

.cl-iconbtn--ghost:hover { background: var(--grey-200); }
.cl-iconbtn--ghost-brand { color: var(--iconbtn-ghost-brand-foreground); }
.cl-iconbtn--ghost-brand:hover { background: var(--iconbtn-ghost-brand-background-hover); }
.cl-iconbtn--outline { background: var(--white); border-color: var(--border-primary-default); color: var(--icon-black); }
.cl-iconbtn--outline:hover { background: var(--grey-100); }
.cl-iconbtn--outline:active { background: var(--grey-300); }
.cl-iconbtn--outline-grey { background: var(--white); border-color: var(--border-primary-default); color: var(--icon-primary-default); }
.cl-iconbtn--outline-grey:hover { background: var(--grey-200); }
.cl-iconbtn--outline-grey:active { border-color: var(--border-brand); color: var(--icon-brand); }
.cl-iconbtn--plain { color: var(--grey-400); }
.cl-iconbtn--plain:hover { background: var(--grey-100); }
.cl-iconbtn--plain:active { border-color: var(--border-brand); color: var(--icon-brand); }
.cl-iconbtn--soft-brand { background: var(--iconbtn-soft-brand-background); color: var(--icon-brand); }
.cl-iconbtn--soft-brand:hover { background: var(--iconbtn-soft-brand-background-hover); }
.cl-iconbtn--brand { background: var(--iconbtn-solid-brand-background-default); color: var(--icon-white-default); }
.cl-iconbtn--brand:hover { background: var(--iconbtn-solid-brand-background-hover); }

.cl-iconbtn.is-selected, .cl-iconbtn.is-selected:hover {
  background: var(--brand-100);
  border-color: var(--border-brand);
  color: var(--icon-brand);
}
.cl-iconbtn.is-danger, .cl-iconbtn.is-danger:hover {
  background: var(--red-100);
  border-color: var(--red-700);
  color: var(--red-600);
}
.cl-iconbtn:disabled, .cl-iconbtn:disabled:hover { color: var(--grey-300); background: transparent; cursor: not-allowed; }
.cl-iconbtn--outline:disabled, .cl-iconbtn--outline:disabled:hover,
.cl-iconbtn--outline-grey:disabled, .cl-iconbtn--outline-grey:disabled:hover { background: var(--grey-100); color: var(--text-disabled); }
.cl-iconbtn--brand:disabled, .cl-iconbtn--brand:disabled:hover { background: var(--iconbtn-solid-brand-background-disabled); color: var(--icon-white-default); }
.cl-iconbtn.is-loading { pointer-events: none; }
.cl-iconbtn.is-loading > .cl-icon { display: none; }

/* Вращающееся кольцо в кнопке и где угодно */
.cl-spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cl-spin .7s linear infinite;
}
.cl-spinner--s { width: 14px; height: 14px; }
.cl-spinner--l { width: 28px; height: 28px; border-width: 3px; }
@keyframes cl-spin { to { transform: rotate(360deg); } }

/* ============ Поле: подпись → элемент → подсказка ============ */
.cl-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cl-field__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
}
.cl-field__required { color: var(--text-error); }
.cl-field__hint { font-size: 14px; line-height: 16px; color: var(--text-caption); }
.cl-field.is-error .cl-field__hint { color: var(--border-error); }

/* Значок «?» рядом с подписью */
.cl-help {
  display: inline-flex;
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-caption);
  cursor: help;
}

/* ============ Текстовое и многострочное поле ============ */
.cl-input { position: relative; display: block; min-width: 0; }
.cl-input__control {
  display: block;
  width: 100%;
  height: var(--control-height-m);
  padding: 8px 16px;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 19px;
  color: var(--text-primary);
  transition: background-color var(--duration-input) ease-out, border-color var(--duration-input) ease-out;
}
.cl-input--l .cl-input__control { height: var(--control-height-l); padding-top: 12px; padding-bottom: 12px; }
.cl-input--compact .cl-input__control { padding-left: 12px; padding-right: 12px; }
.cl-input--soft .cl-input__control { background: var(--grey-100); }
.cl-input--icon-right .cl-input__control { padding-right: 56px; }
.cl-input--icon-left .cl-input__control { padding-left: 56px; }
.cl-input--compact.cl-input--icon-right .cl-input__control { padding-right: 48px; }
.cl-input--compact.cl-input--icon-left .cl-input__control { padding-left: 48px; }

.cl-input__control:hover { background: var(--grey-100); }
.cl-input__control:focus { background: var(--grey-100); border-color: var(--input-solid-border-focused); outline: none; }
.cl-input.is-error .cl-input__control { border-color: var(--border-error); }
.cl-input.is-success .cl-input__control { border-color: var(--border-success); }
.cl-input.is-warning .cl-input__control { border-color: var(--border-warning); }
.cl-input__control:read-only { border-color: var(--border-primary-default); }
.cl-input__control:disabled, .cl-input__control:disabled:hover {
  background: var(--grey-50);
  border-color: var(--border-primary-default);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.cl-input__icon {
  position: absolute;
  top: 8px;
  right: 16px;
  display: flex;
  width: 24px;
  height: 24px;
  color: var(--grey-400);
  pointer-events: none;
}
.cl-input--l .cl-input__icon { top: 12px; }
.cl-input--icon-left .cl-input__icon { right: auto; left: 16px; }
.cl-input--compact .cl-input__icon { right: 12px; }
.cl-input--compact.cl-input--icon-left .cl-input__icon { right: auto; left: 12px; }
button.cl-input__icon { pointer-events: auto; border-radius: var(--radius-4); transition: color var(--duration-button); }
button.cl-input__icon:hover { color: var(--icon-primary-default); }

/* Пометка пояса сервиса («МСК») там, где вводят время: в поле даты со временем — перед значком календаря,
   у поля времени — в строке подписи */
.cl-zone { flex: none; font-size: var(--font-size-small); line-height: 16px; color: var(--text-caption); white-space: nowrap; cursor: default; }
.cl-input__zone { position: absolute; top: 12px; right: 44px; }
.cl-input--l .cl-input__zone { top: 16px; }
.cl-input--compact .cl-input__zone { right: 40px; }
/* место под пометку: «МСК» — 25 px; подпись другого пояса («UTC+5:30») длиннее */
.cl-input--zone.cl-input--icon-right .cl-input__control { padding-right: 74px; }
.cl-input--zone-wide.cl-input--icon-right .cl-input__control { padding-right: 108px; }
.cl-field__label .cl-zone { margin-left: 2px; }

textarea.cl-input__control {
  height: auto;
  min-height: 56px;
  resize: vertical;
  overflow-y: auto;
}
textarea.cl-input__control.is-autosize { resize: none; }

/* Поиск-плашка (Диалоги): серая плашка без рамки */
.cl-input--plate .cl-input__control {
  padding: 8px 14px 8px 48px;
  border-color: var(--grey-100);
  background: var(--grey-100);
  color: var(--grey-500);
}
.cl-input--plate .cl-input__control:focus { border-color: var(--grey-100); }
.cl-input--plate .cl-input__icon { left: 12px; right: auto; }

/* ============ Выпадающий список ============ */
.cl-select { position: relative; display: block; min-width: 0; }
.cl-select__trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--control-height-m);
  padding: 0 28px 0 10px;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--duration-input) ease-out;
}
.cl-select__trigger:focus, .cl-select.is-open .cl-select__trigger { border-color: var(--input-solid-border-focused); }
.cl-select.is-error .cl-select__trigger { border-color: var(--border-error); }
.cl-select__trigger:disabled { color: var(--text-disabled); background: var(--grey-50); border-color: var(--border-primary-default); cursor: not-allowed; }
.cl-select__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-select__value.is-placeholder { color: var(--text-placeholder); }
.cl-select__trigger:disabled .cl-select__value.is-placeholder { color: var(--text-disabled); }
/* right считается от внутренней кромки рамки: 9 + 1 px рамки = 10 px от края поля */
.cl-select__chevron {
  position: absolute;
  top: 50%;
  right: 9px;
  display: flex;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  color: var(--icon-primary-default);
  pointer-events: none;
  transition: transform var(--duration-input);
}
.cl-select.is-open .cl-select__chevron { transform: rotate(180deg); }
.cl-select__clear {
  position: absolute;
  top: 50%;
  right: 30px;
  display: flex;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: var(--radius-4);
  color: var(--grey-400);
}
.cl-select__clear:hover { color: var(--icon-primary-default); }
.cl-select--clearable .cl-select__trigger { padding-right: 54px; }

.cl-select-list {
  display: flex;
  flex-direction: column;
  max-height: 250px;
  padding: 6px;
  border: 1px solid var(--border-secondary-default);
  border-radius: var(--radius-12);
  background: var(--white);
  box-shadow: var(--shadow-dropdown);
}
.cl-select-list__search { flex: none; margin: 2px 2px 4px; }
.cl-select-list__items { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cl-select-list__empty { padding: 9px 12px; font-size: 14px; line-height: 22px; color: var(--text-caption); }
.cl-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 2px 0;
  padding: 7px 12px;
  border-radius: var(--radius-8);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 22px;
  color: var(--text-primary);
  cursor: pointer;
}
.cl-option:hover, .cl-option.is-active { background: var(--grey-100); }
.cl-option.is-selected { padding-right: 34px; background: var(--grey-40); font-weight: var(--font-weight-medium); }
.cl-option.is-selected:hover, .cl-option.is-selected.is-active { background: var(--grey-100); }
.cl-option.is-disabled { color: var(--text-option-disabled); cursor: not-allowed; background: transparent; }
.cl-option__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-option__hint { flex: none; color: var(--text-caption); font-weight: var(--font-weight-regular); }
.cl-option__check { position: absolute; top: 50%; right: 12px; margin-top: -8px; color: var(--icon-brand); }
.cl-option .cl-icon { flex: none; }

/* ============ Тумблер ============ */
.cl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  min-height: 23px;
  font-size: 14px;
  line-height: 19px;
  cursor: pointer;
  user-select: none;
}
.cl-toggle__input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.cl-toggle__track {
  position: relative;
  flex: none;
  width: 40px;
  height: 20px;
  border-radius: 15px;
  background: var(--grey-200);
  transition: background-color var(--duration-toggle);
}
.cl-toggle__knob {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-toggle-knob);
  transition: left var(--duration-toggle), background-color var(--duration-toggle);
}
.cl-toggle__input:checked + .cl-toggle__track { background: var(--controls-active-background-default); }
.cl-toggle__input:checked + .cl-toggle__track .cl-toggle__knob { left: 21px; }
.cl-toggle.is-disabled { cursor: not-allowed; }
.cl-toggle.is-disabled .cl-toggle__track,
.cl-toggle.is-disabled .cl-toggle__input:checked + .cl-toggle__track { background: var(--toggle-disabled-track); }
.cl-toggle.is-disabled .cl-toggle__knob { background: var(--toggle-disabled-knob); }
.cl-toggle__input:focus-visible + .cl-toggle__track { box-shadow: 0 0 0 4px var(--brand-alpha-10); }

/* ============ Галочка и радио ============ */
/* Промежуток 11 + внешний отступ квадрата 1 = подпись через 12 px от квадрата */
.cl-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}
.cl-check__input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.cl-check__box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px;
  border-radius: var(--radius-5);
  background: var(--white);
  box-shadow: 0 0 0 1px var(--border-primary-default);
  color: var(--white);
  transition: background-color var(--duration-button), box-shadow var(--duration-button);
}
.cl-check--radio .cl-check__box { border-radius: 50%; }
.cl-check__box > * { opacity: 0; transition: opacity var(--duration-button); }
.cl-check:hover .cl-check__box { box-shadow: 0 0 0 1px var(--border-brand); }
.cl-check__input:focus-visible + .cl-check__box { box-shadow: 0 0 0 1px var(--border-brand), 0 0 0 4px var(--brand-alpha-10); }
.cl-check__input:checked + .cl-check__box,
.cl-check__input[type="checkbox"]:indeterminate + .cl-check__box {
  background: var(--controls-active-background-default);
  box-shadow: 0 0 0 1px var(--controls-active-background-default);
}
.cl-check__input:checked + .cl-check__box > .cl-check__mark { opacity: 1; }
/* У радио :indeterminate означает «в группе ничего не выбрано» — поэтому правило только для галочек */
.cl-check__input[type="checkbox"]:indeterminate + .cl-check__box > .cl-check__mark { opacity: 0; }
.cl-check__input[type="checkbox"]:indeterminate + .cl-check__box > .cl-check__dash { opacity: 1; }
.cl-check__dash { position: absolute; width: 10px; height: 2px; border-radius: 1px; background: var(--white); }
.cl-check__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--white); }
.cl-check__input:checked + .cl-check__box > .cl-check__dot { opacity: 1; }

/* «Исключить»: красная галочка с крестиком */
.cl-check--exclude .cl-check__input:checked + .cl-check__box {
  background: var(--border-error);
  box-shadow: 0 0 0 1px var(--border-error);
}
.cl-check.is-error .cl-check__box { box-shadow: 0 0 0 1px var(--border-error); }
.cl-check.is-disabled { cursor: not-allowed; }
.cl-check.is-disabled .cl-check__box { opacity: .7; box-shadow: 0 0 0 1px var(--border-primary-default); }
.cl-check.is-disabled .cl-check__input:checked + .cl-check__box { opacity: .4; box-shadow: 0 0 0 1px var(--controls-active-background-default); }
.cl-check__label { min-width: 0; padding-top: 1px; }
.cl-check-group { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cl-check-group--row { flex-direction: row; flex-wrap: wrap; gap: 12px 20px; }

/* Выбор цвета: квадраты 28×28, выбранный — в двойном кольце */
.cl-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-6);
  background: var(--swatch, var(--grey-100));
  cursor: pointer;
  transition: box-shadow var(--duration-row);
}
.cl-swatch.is-selected { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--grey-200); }
.cl-swatch:focus-visible { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--brand-300); }

/* ============ Вкладки ============ */
/* А. Сегменты */
.cl-tabs--segment {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-8);
  background: var(--grey-100);
}
.cl-tabs--segment .cl-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-6);
  background: transparent;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-tab), color var(--duration-tab), box-shadow var(--duration-tab);
}
.cl-tabs--segment.cl-tabs--s .cl-tab { height: 28px; }
.cl-tabs--segment.cl-tabs--l .cl-tab { height: 44px; }
.cl-tabs--segment.cl-tabs--block { display: flex; }
.cl-tabs--segment.cl-tabs--block .cl-tab { flex: 1 1 0; }
.cl-tabs--segment .cl-tab:hover { background: var(--grey-200); }
.cl-tabs--segment .cl-tab.is-active { background: var(--white); color: var(--text-primary); box-shadow: var(--shadow-segment); }
.cl-tabs--segment .cl-tab.is-active:hover { box-shadow: var(--shadow-segment-hover); }
.cl-tabs--segment .cl-tab:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; }

/* Б. Подчёркнутые со счётчиком */
.cl-tabs--underline {
  display: flex;
  align-items: stretch;
  height: 45px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-primary-default);
  background: var(--white);
}
.cl-tabs--underline .cl-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  margin-left: 14px;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 17px;
  color: var(--grey-500);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-tab), border-color var(--duration-tab);
}
.cl-tabs--underline .cl-tab:hover { border-bottom-color: var(--grey-400); }
.cl-tabs--underline .cl-tab.is-active { color: var(--tab-items-text-active); border-bottom-color: var(--tab-items-indicator); }
.cl-tabs--underline .cl-tab--more { gap: 5px; }
.cl-tabs--underline .cl-tab--more:hover { color: var(--text-primary); border-bottom-color: transparent; }
.cl-tabs__leading { display: flex; align-items: center; flex: none; }
/* Первая ячейка строки вкладок (кнопка фильтров) — квадрат 36×36 */
.cl-tabs--underline .cl-tabs__leading > .cl-iconbtn { width: 36px; height: 36px; }
.cl-tab__count {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--grey-100);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 16px;
  color: var(--grey-500);
}

/* В. Подчёркнутые с иконкой */
.cl-tabs--icon {
  display: flex;
  align-items: flex-start;
  height: 44px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-primary-default);
}
/* Вкладка на 1 px выше содержимого строки: её нижняя кромка накрывает линию строки */
.cl-tabs--icon .cl-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 44px;
  padding: 12px 12px 10px;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-tab), border-color var(--duration-tab);
}
.cl-tabs--icon .cl-tab:hover { color: var(--text-primary); }
.cl-tabs--icon .cl-tab.is-active { color: var(--tab-items-text-active); border-bottom-color: var(--tab-items-indicator); cursor: default; }
.cl-tabs--underline .cl-tab:focus-visible, .cl-tabs--icon .cl-tab:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; border-radius: var(--radius-4); }

/* Г. Фильтр-чипы */
.cl-tabs--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-tabs--chips .cl-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-tab), border-color var(--duration-tab), color var(--duration-tab);
}
.cl-tabs--chips .cl-tab:hover { background: var(--grey-50); border-color: var(--border-primary-hover); }
.cl-tabs--chips .cl-tab.is-active { background: var(--brand-100); border-color: var(--brand-300); color: var(--text-brand); }
.cl-tabs--chips .cl-tab:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; }
.cl-tab__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--grey-400)); }
.cl-tab__num { font-size: 12px; font-weight: var(--font-weight-medium); color: var(--text-caption); }
.cl-tabs--chips .cl-tab.is-active .cl-tab__num { color: var(--text-brand); }
.cl-tab:disabled { opacity: .5; cursor: not-allowed; }

/* ============ Всплывающая панель (основа списков, меню, календаря) ============ */
.cl-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-popover);
  opacity: 0;
  transition: opacity .12s;
}
.cl-popover.is-open { opacity: 1; }

/* ============ Меню «три точки» ============ */
.cl-menu {
  min-width: 160px;
  max-width: 360px;
  max-height: min(420px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 6px 0;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  box-shadow: var(--shadow-dropdown);
}
.cl-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-row);
}
.cl-menu__item .cl-icon { color: var(--icon-primary-default); }
.cl-menu__item:hover, .cl-menu__item:focus, .cl-menu__item.is-active { background: var(--grey-100); }
.cl-menu__item--danger, .cl-menu__item--danger .cl-icon { color: var(--text-danger); }
.cl-menu__item:disabled { color: var(--text-disabled); cursor: not-allowed; background: none; }
.cl-menu__item:disabled .cl-icon { color: var(--grey-300); }
.cl-menu__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-menu__hint { flex: none; margin-left: 12px; color: var(--text-caption); }
.cl-menu__check { flex: none; margin-left: 8px; color: var(--icon-brand) !important; }
.cl-menu__divider { height: 1px; margin: 6px 15px; background: var(--border-primary-default); }
.cl-menu__title {
  padding: 8px 12px 4px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-caption);
}

/* ============ Модальное окно ============ */
.cl-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--duration-modal);
}
.cl-overlay.is-open { opacity: 1; }
/* Закрытое окно ещё 0,25 с гаснет в DOM: щелчки в это время должны доходить до страницы под ним */
.cl-overlay:not(.is-open) { pointer-events: none; }
.cl-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--modal-width);
  max-height: 89vh;
  border-radius: var(--radius-12);
  background: var(--white);
  box-shadow: var(--shadow-modal);
  opacity: 0;
  transform: translateY(-14px) scale(.97);
  transition: opacity var(--duration-modal), transform var(--duration-modal);
}
.cl-overlay.is-open .cl-modal { opacity: 1; transform: none; }
.cl-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  height: 63px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-primary-default);
}
.cl-modal__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-primary);
}
.cl-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 22px;
  overflow-y: auto;
  color: var(--text-primary);
}
.cl-modal__body .cl-field { gap: 4px; }
.cl-modal__body .cl-field__label { line-height: 19px; }
.cl-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  padding: 2px 22px 14px;
}
.cl-modal__footer--between { justify-content: space-between; }
.cl-modal__footer--start { justify-content: flex-start; }
.cl-modal__footer--line { padding: 14px 22px; border-top: 1px solid var(--border-primary-default); }

/* Окно подтверждения: без шапки, всё по центру */
.cl-modal--confirm {
  max-width: var(--modal-width-narrow);
  padding: 16px 20px;
  box-shadow: var(--shadow-confirm);
}
.cl-confirm__title {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  line-height: 27px;
  text-align: center;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.cl-confirm__text {
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.cl-confirm__word { margin-bottom: 16px; }
.cl-confirm__word .cl-field__label { color: var(--text-caption); }
.cl-confirm__word .cl-input__control { border-color: var(--border-primary-default); }
.cl-confirm__word .cl-input__control:focus { border-color: var(--input-solid-border-focused); }
.cl-confirm__warn { margin-bottom: 16px; }
.cl-confirm__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ============ Подсказка ============ */
.cl-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-tooltip);
  max-width: 320px;
  padding: 8px 16px;
  border-radius: var(--radius-6);
  background: var(--background-tooltip);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 19px;
  color: var(--text-white);
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.cl-tooltip::after {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  bottom: -7px;
  margin-left: -7px;
  border: 7px solid transparent;
  border-bottom-width: 0;
  border-top-color: var(--background-tooltip);
}
.cl-tooltip--bottom::after {
  top: -7px;
  bottom: auto;
  border-width: 0 7px 7px;
  border-top-color: transparent;
  border-bottom-color: var(--background-tooltip);
}
.cl-tooltip--info {
  padding: 10px 16px;
  font-weight: var(--font-weight-regular);
  box-shadow: var(--shadow-tooltip-info);
  animation: cl-fade .2s;
}
.cl-tooltip--info::after { display: none; }
.cl-tooltip--wide { max-width: 480px; }
@keyframes cl-fade { from { opacity: 0; } to { opacity: 1; } }

/* ============ Тосты ============ */
.cl-toasts {
  position: fixed;
  top: 10%;
  left: 50%;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100vw - 40px);
  transform: translateX(-50%);
  pointer-events: none;
}
.cl-toast {
  max-width: 640px;
  padding: 8px 16px;
  border: 1px solid var(--background-toast);
  border-radius: var(--radius-6);
  background: var(--background-toast);
  box-shadow: var(--shadow-dropdown);
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  line-height: 24px;
  color: var(--text-white);
  text-align: center;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: auto;
  transition: opacity var(--duration-toast) ease-in-out;
}
.cl-toast.is-open { opacity: 1; }

/* Тост с действием: пилюля снизу по центру */
.cl-toast-action {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--background-toast-action);
  box-shadow: var(--shadow-toast-action);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-white);
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity var(--duration-toast) ease-in-out;
}
.cl-toast-action.is-open { opacity: 1; }
.cl-toast-action__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-toast-action__link { color: var(--brand-300); cursor: pointer; transition: color var(--duration-button); }
.cl-toast-action__link:hover { color: var(--text-white); }
.cl-toast-action__count { color: var(--grey-300); font-variant-numeric: tabular-nums; }

/* ============ Плашка в тексте страницы ============ */
.cl-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-6);
  background: var(--grey-100);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}
.cl-notice .cl-icon { margin: -2px 0; }
.cl-notice__body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cl-notice__note { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--text-caption); }
.cl-notice--red { background: var(--red-200); color: var(--red-700); }
.cl-notice--green { background: var(--green-200); color: var(--green-700); }
.cl-notice--orange-pale { background: var(--orange-200); color: var(--orange-800); }
.cl-notice--orange { background: var(--orange-400); color: var(--orange-800); }
.cl-notice--red-pale { background: var(--red-100); color: var(--red-700); }
.cl-notice--grey-pale { background: var(--grey-50); }

/* ============ Метка-бейдж ============ */
.cl-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  height: 22px;
  padding: 3px 8px;
  border-radius: var(--radius-4);
  background: var(--grey-100);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-caption);
  white-space: nowrap;
}
.cl-badge--l { height: 26px; padding: 3px 12px; }
.cl-badge--s { height: 18px; padding: 2px 5px; line-height: 12px; }
.cl-badge--pill { border-radius: var(--radius-pill); }
.cl-badge--brand-soft { background: var(--tag-soft-background-brand); color: var(--text-primary); }
.cl-badge--brand-soft-accent { background: var(--tag-soft-background-brand); color: var(--text-brand); }
.cl-badge--brand { background: var(--tag-solid-background-brand); color: var(--text-white); }
.cl-badge--green { background: var(--green-200); color: var(--green-700); }
.cl-badge--red { background: var(--red-200); color: var(--red-700); }
.cl-badge--orange { background: var(--orange-200); color: var(--orange-700); }
.cl-badge--violet { background: var(--violet-100); color: var(--violet-700); }
.cl-badge--outline { background: var(--white); box-shadow: inset 0 0 0 1px var(--border-primary-default); color: var(--text-secondary); }
.cl-badge--orange-solid { background: var(--orange-400); color: var(--orange-800); }
.cl-badge--red-solid { background: var(--red-600); color: var(--text-white); }

/* Акцентная метка («N в списке») */
.cl-accent-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 12px 0 8px;
  border-radius: var(--radius-6);
  background: var(--brand-100);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 20px;
  color: var(--text-brand);
  white-space: nowrap;
}
.cl-accent-tag .cl-icon { color: var(--brand-400); }

/* Счётчик группы */
.cl-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-6);
  background: var(--grey-100);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  color: var(--text-caption);
  font-variant-numeric: tabular-nums;
}
.cl-counter--outline { height: 22px; border-radius: var(--radius-pill); background: var(--white); box-shadow: inset 0 0 0 1px var(--border-primary-default); }
/* Счётчик непрочитанного: фирменная пилюля */
.cl-counter--brand {
  min-width: 16px;
  height: 16px;
  padding: 2px 5px;
  border-radius: 50px;
  background: var(--brand-500);
  line-height: 12px;
  color: var(--text-white);
}

/* Бейдж номера «#760236» */
.cl-idbadge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 1px 7px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--grey-100);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  color: var(--text-caption);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color var(--duration-row), color var(--duration-row);
}
button.cl-idbadge { cursor: pointer; }
button.cl-idbadge:hover { background: var(--grey-200); color: var(--text-secondary); }

/* ============ Статус-пилюля ============ */
.cl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--grey-100);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  color: var(--grey-500);
  white-space: nowrap;
}
.cl-status__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cl-status--active { background: var(--success-background); color: var(--success-text); }
.cl-status--inactive { background: var(--warning-background); color: var(--warning-text); }
.cl-status--error { background: var(--danger-background); color: var(--danger-text); }
.cl-status--neutral { background: var(--grey-100); color: var(--grey-500); }
.cl-status--brand { background: var(--brand-100); color: var(--text-brand); }
.cl-status--waiting { background: var(--brand-90); color: var(--text-brand); }

/* ============ Чипы ============ */
.cl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chips--tight { gap: 4px; }
.cl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 26px;
  padding: 3px 3px 3px 8px;
  border-radius: var(--radius-4);
  background: var(--chip-bg, var(--brand-90));
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-primary);
  white-space: nowrap;
}
.cl-chip--plain { padding-right: 8px; }
.cl-chip--m { height: 24px; padding: 3px 6px 3px 8px; font-size: 14px; line-height: 18px; }
.cl-chip--m.cl-chip--plain { padding-right: 8px; }
.cl-chip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-chip__mode {
  flex: none;
  padding: 1px 6px;
  border-radius: var(--radius-4);
  background: var(--alpha-black-06);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  color: inherit;
  cursor: pointer;
}
.cl-chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-4);
  color: inherit;
  opacity: .6;
  cursor: pointer;
  transition: opacity var(--duration-row), background-color var(--duration-row);
}
.cl-chip--m .cl-chip__remove { width: 18px; height: 18px; }
.cl-chip__remove:hover { opacity: 1; background: var(--alpha-black-06); }
.cl-chip.is-excluded { background: var(--red-200); color: var(--red-700); }
button.cl-chip { cursor: pointer; }

/* Кнопки-чипы выбора (периоды и т. п.) */
.cl-choice {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 17px;
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-tab), border-color var(--duration-tab), color var(--duration-tab);
}
.cl-choice:hover { background: var(--grey-100); }
.cl-choice.is-selected { background: var(--brand-100); border-color: var(--border-brand); color: var(--text-brand); }

/* ============ Пустое состояние ============ */
.cl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 220px;
  padding: 20px;
  background: var(--white);
  text-align: center;
}
.cl-empty__picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 127px;
  height: 127px;
  margin-bottom: 17px;
  color: var(--grey-300);
}
.cl-empty__title { font-size: 18px; font-weight: var(--font-weight-semibold); line-height: 24px; color: var(--text-inherit); }
.cl-empty__text { max-width: 460px; margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--text-caption); }
.cl-empty__action { margin-top: 16px; }
.cl-empty--dashed {
  height: auto;
  min-height: 0;
  padding: 32px 20px;
  border: 1px dashed var(--empty-dashed-border);
  border-radius: var(--radius-12);
  background: var(--empty-dashed-background);
}
.cl-empty--dashed .cl-empty__title { font-size: 16px; line-height: 22px; color: var(--empty-dashed-title); }
.cl-empty--dashed .cl-empty__text { margin: 6px 0 16px; font-size: 13px; line-height: 18px; color: var(--empty-dashed-text); }
.cl-empty--dashed .cl-empty__action { margin-top: 0; }
.cl-empty--dashed .cl-empty__text:last-child { margin-bottom: 0; }

/* ============ Загрузка ============ */
.cl-skeleton {
  display: block;
  flex: none;
  height: 12px;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--grey-200), var(--grey-100), var(--grey-200));
  background-size: 200% 100%;
  animation: cl-skeleton 1.4s ease-in-out infinite;
}
.cl-skeleton--line2 { height: 9px; }
.cl-skeleton--rect { height: 40px; border-radius: var(--radius-6); }
.cl-skeleton--field { height: 36px; border-radius: var(--radius-6); }
.cl-skeleton--pill { width: 56px; height: 24px; border-radius: var(--radius-pill); }
.cl-skeleton--pill-s { width: 44px; height: 18px; border-radius: var(--radius-pill); }
.cl-skeleton--circle { width: 40px; height: 40px; border-radius: 50%; }
.cl-skeleton--tile { width: 38px; height: 38px; border-radius: var(--radius-10); }
@keyframes cl-skeleton {
  0%, 100% { background-position: 0% 0; opacity: .7; }
  50% { background-position: 100% 0; opacity: 1; }
}
.cl-skeleton-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 12px; }
.cl-skeleton-row__body { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-width: 0; }

/* Подгрузка списка: три точки и подпись */
.cl-loading-dots { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; font-size: 14px; line-height: 19px; color: var(--text-secondary); }
.cl-loading-dots__dots { display: flex; gap: 5px; }
.cl-loading-dots__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); animation: cl-dot 1.1s ease-in-out infinite; }
.cl-loading-dots__dots i:nth-child(2) { animation-delay: .18s; }
.cl-loading-dots__dots i:nth-child(3) { animation-delay: .36s; }
@keyframes cl-dot { 0%, 60%, 100% { transform: scale(.6); opacity: .5; } 30% { transform: scale(1); opacity: 1; } }

/* Полоса загрузки сверху области */
.cl-loading-bar { position: relative; height: 4px; overflow: hidden; background: var(--grey-100); }
.cl-loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: var(--brand-600);
  animation: cl-loading-bar 2s ease-in-out infinite;
}
@keyframes cl-loading-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* Блокирующая загрузка области */
.cl-blocker {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-blocking);
}
.cl-blocker__spin { position: relative; width: 70px; height: 70px; animation: cl-spin 2s linear infinite; }
.cl-blocker__spin i { position: absolute; left: 17.500px; width: 35px; height: 35px; border-radius: 50%; background: var(--white); animation: cl-pulse 2s ease-in-out infinite; }
.cl-blocker__spin i:first-child { top: 0; }
.cl-blocker__spin i:last-child { bottom: 0; animation-delay: -1s; }
@keyframes cl-pulse { 0%, 100% { transform: scale(.2); } 50% { transform: scale(1); } }

/* ============ Полоса хода ============ */
.cl-progress {
  position: relative;
  display: block;
  flex: none;
  width: 148px;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-6);
  background: var(--grey-100);
}
.cl-progress__fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--brand-500);
  transition: width var(--duration-button);
}
.cl-progress--thin { width: 90px; height: 3px; border-radius: 17px; background: var(--alpha-black-05); }
.cl-progress--thin .cl-progress__fill { min-width: 0; background: var(--orange-500); }
.cl-progress--orange .cl-progress__fill { background: var(--orange-500); }
.cl-progress--green .cl-progress__fill { background: var(--success-solid); }
.cl-progress--red .cl-progress__fill { background: var(--red-500); }
.cl-progress--block { width: 100%; }
.cl-progress-row { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 21px; color: var(--text-caption); }

/* ============ Группа строк и карточка ============ */
.cl-group {
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-12);
  background: var(--white);
  overflow: hidden;
}
.cl-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-tertiary-default);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 21px;
  color: var(--text-primary);
}
.cl-group__head--grey { height: 41px; background: var(--grey-50); }
.cl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-tertiary-default);
  background: var(--white);
  transition: background-color var(--duration-row);
}
.cl-row:last-child { border-bottom: 0; }
.cl-row--clickable { cursor: pointer; }
.cl-row--clickable:hover, .cl-row.is-hover { background: var(--grey-50); }
.cl-row.is-selected { background: var(--brand-75); }
.cl-row__body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cl-row__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 21px;
  color: var(--text-primary);
}
.cl-row__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 21px; color: var(--text-caption); }
.cl-row__actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* Плитка-иконка строки */
.cl-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-10);
  background: var(--brand-100);
  color: var(--icon-brand);
}
.cl-tile--grey { background: var(--grey-100); color: var(--icon-primary-default); }
.cl-tile--l { width: 40px; height: 40px; border-radius: var(--radius-12); }
.cl-tile--telegram { background: var(--messenger-telegram); color: var(--white); }
.cl-tile--vk { background: var(--messenger-vk); color: var(--white); }

.cl-card {
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-12);
  background: var(--white);
}
.cl-card + .cl-card { margin-top: 8px; }
.cl-card__row { display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 14px 20px; }
.cl-card__title { font-size: 16px; font-weight: var(--font-weight-medium); line-height: 22px; color: var(--text-primary); }

/* Аватар-заглушка */
.cl-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--avatar-bg, var(--avatar-blue));
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  color: var(--text-secondary);
  user-select: none;
}
.cl-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Выбор даты и времени ============ */
.cl-calendar {
  width: 297px;
  padding-bottom: 9px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-6);
  background: var(--white);
  box-shadow: var(--shadow-calendar);
  user-select: none;
}
.cl-calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 8px;
  border-radius: 5px 5px 0 0;
  background: var(--brand-500);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--text-white);
}
.cl-calendar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-4);
  color: var(--text-white);
  cursor: pointer;
  transition: background-color var(--duration-row);
}
.cl-calendar__nav:hover { background: var(--brand-480); }
.cl-calendar__grid { display: grid; grid-template-columns: repeat(7, 40px); justify-content: center; }
.cl-calendar__weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-size: 13px;
  line-height: 16px;
  color: var(--text-caption);
}
.cl-calendar__day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-6);
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 20px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color var(--duration-row);
}
.cl-calendar__day:hover { background: var(--grey-100); }
.cl-calendar__day.is-other { color: var(--grey-400); }
.cl-calendar__day.is-today { box-shadow: inset 0 0 0 2px var(--brand-500); color: var(--text-brand); font-weight: var(--font-weight-medium); }
.cl-calendar__day.is-selected, .cl-calendar__day.is-selected:hover { background: var(--brand-500); color: var(--text-white); box-shadow: none; }
.cl-calendar__day:disabled { color: var(--grey-300); cursor: not-allowed; background: none; }
.cl-calendar__time { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px 0; font-weight: var(--font-weight-medium); color: var(--text-primary); }
.cl-calendar__time .cl-select { width: 133px; }

/* ============ Мелочи ============ */
.cl-divider { height: 1px; background: var(--border-primary-default); border: 0; margin: 0; }
.cl-kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-4);
  background: var(--grey-50);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
  color: var(--text-secondary);
}
.cl-form { display: flex; flex-direction: column; gap: 16px; }

/* ============ Витрина компонентов (#/_ui) ============ */
.cl-ui { background: var(--white); }
.cl-ui__layout { display: flex; align-items: flex-start; gap: 24px; max-width: 1400px; margin: 0 auto; padding: 20px; }
.cl-ui__toc {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  flex: none;
  width: 210px;
  max-height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-12);
}
.cl-ui__toc-link {
  padding: 7px 10px;
  border-radius: var(--radius-8);
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  color: var(--text-secondary);
  transition: background-color var(--duration-row);
}
.cl-ui__toc-link:hover { background: var(--grey-100); }
.cl-ui__content { display: flex; flex-direction: column; gap: 32px; flex: 1 1 auto; min-width: 0; padding-bottom: 80px; }
.cl-ui__section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 20px; }
.cl-ui__title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-primary-default);
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  line-height: 24px;
  color: var(--text-primary);
}
.cl-ui__sub { margin-top: 6px; font-size: 12px; font-weight: var(--font-weight-medium); line-height: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-caption); }
.cl-ui__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cl-ui__cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cl-ui__sample { display: flex; align-items: center; min-height: 24px; }
.cl-ui__caption { font-size: 12px; line-height: 16px; color: var(--text-caption); }
.cl-ui__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
.cl-ui__stack { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.cl-ui__type { display: flex; flex-direction: column; gap: 4px; }
.cl-ui__swatch {
  display: flex;
  align-items: flex-end;
  width: 92px;
  height: 56px;
  padding: 6px 8px;
  border: 1px solid var(--border-primary-default);
  border-radius: var(--radius-8);
  font-size: 11px;
  line-height: 14px;
  color: var(--text-primary);
}
.cl-ui__swatch--dark { color: var(--text-white); }
.cl-ui__box { border: 1px solid var(--border-primary-default); border-radius: var(--radius-12); overflow: hidden; }
.cl-ui__embed { height: 520px; border: 1px solid var(--border-primary-default); border-radius: var(--radius-12); overflow: hidden; }
.cl-ui__kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: center; }
.cl-ui__icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.cl-ui__icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 8px;
  border: 1px solid var(--border-tertiary-default);
  border-radius: var(--radius-8);
  color: var(--icon-primary-default);
  transition: background-color var(--duration-row), color var(--duration-row);
}
.cl-ui__icon:hover { background: var(--grey-50); color: var(--icon-brand); }
.cl-ui__icon span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 14px; color: var(--text-caption); }
