/* Семантический CSS поверх Tailwind. Tailwind остаётся для прочих страниц.
 * Здесь — компоненты с динамическими цветами которые Tailwind безопасным
 * списком обслуживал плохо: .scenario-card, .hero-card, .sidebar. */

/* ============ Sidebar ============ */
.sidebar {
  width: 256px;
  height: 100dvh; /* dvh: на мобиле учитывает тулбар браузера (100vh прятал низ) */
  background: #1a1a2e;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  overflow-y: auto;
}
.sidebar__brand {
  /* left=24px — выравниваем «Tich-CRM»/«Retention-CRM» по колонке иконок меню
     (.sidebar__nav padding 12 + .sidebar__item padding 12 = 24), раньше 12 → уезжал влево. */
  padding: 16px 12px 20px 24px;
}
.sidebar__brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.sidebar__brand p {
  font-size: 12px;
  color: #9ca3af;
  margin: 2px 0 0 0;
}
.sidebar__nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #d1d5db;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar__item svg { flex-shrink: 0; }
/* NEW-бейдж (пункт «Триггерные») */
.sidebar__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
.sidebar__item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar__item.is-active {
  background: #3b82f6;
  color: #fff;
}
.sidebar__footer {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #6b7280;
  /* На низком экране (.sidebar = flex column) футер БЕЗ этого сжимался flex'ом, а его
     дети фикс-размера (баланс/свежесть/кнопка аккаунта) налезали друг на друга. flex-shrink:0
     закрепляет футер на натуральной высоте → переполнение уходит в скролл nav (overflow-y:auto). */
  flex-shrink: 0;
}
.sidebar__footer button {
  background: none;
  border: 0;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.sidebar__footer button:hover { color: #fff; }

/* ============ Account switcher (мультилогин) ============ */
/* Единый размер/шрифт/выравнивание для ВСЕХ строк (текущий, другие акки, добавить,
   выйти). `.sidebar__footer .acct-row` (2 класса) перебивает legacy
   `.sidebar__footer button {font-size:12px;padding:0}` (класс+элемент) по специфичности. */
.acct-switch { position: relative; margin-bottom: 8px; }
.acct-menu {
  position: absolute;          /* всплывает НАД кнопкой — текущий аккаунт не прыгает */
  bottom: 100%;
  left: 0; right: 0;
  margin-bottom: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  background: #23234a;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}
.sidebar__footer .acct-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: #d1d5db;
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar__footer .acct-row:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar__footer .acct-row--current { background: rgba(255, 255, 255, 0.06); color: #fff; }
.acct-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row__chev { flex-shrink: 0; color: #9ca3af; transition: transform 0.15s; }
.acct-row__chev--open { transform: rotate(180deg); }

/* ============ Mobile drawer (sidebar) ============ */
@media (max-width: 767px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.is-open { transform: translateX(0); }
  .js-mobile-only { /* виден только на mobile */ }
  /* На мобиле drawer — тач-таргеты ≥44px (десктоп компактнее, py-2). */
  .sidebar__item { min-height: 44px; }
}
@media (min-width: 768px) {
  .js-mobile-only { display: none !important; }
}

/* ============ Hero / Потенциальная выручка ============ */
.hero-card {
  background: #059669;          /* emerald-600 */
  color: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.hero-card__label  { font-size: 14px; opacity: .9; }
.hero-card__value  { font-size: 36px; font-weight: 700; margin-top: 4px; word-break: break-word; }
.hero-card__meta   { font-size: 14px; opacity: .9; margin-top: 4px; }

/* ============ Scenario card (Где деньги) — 5 вариантов цвета ============ */
.scenario-card {
  --bg: #fef3c7;
  --border: #fcd34d;
  --accent: #d97706;
  --btn-bg: #fbbf24;
  --btn-hover: #f59e0b;
  --btn-text: #78350f;

  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.scenario-card--vip    { --bg: #fef3c7; --border: #fcd34d; --accent: #b45309; --btn-bg: #fbbf24; --btn-hover: #f59e0b; --btn-text: #78350f; }
.scenario-card--loyal  { --bg: #d1fae5; --border: #6ee7b7; --accent: #047857; --btn-bg: #34d399; --btn-hover: #10b981; --btn-text: #064e3b; }
.scenario-card--new    { --bg: #dbeafe; --border: #93c5fd; --accent: #1d4ed8; --btn-bg: #60a5fa; --btn-hover: #3b82f6; --btn-text: #1e3a8a; }
.scenario-card--active { --bg: #ede9fe; --border: #c4b5fd; --accent: #6d28d9; --btn-bg: #a78bfa; --btn-hover: #8b5cf6; --btn-text: #4c1d95; }
.scenario-card--lost   { --bg: #ffe4e6; --border: #fda4af; --accent: #be123c; --btn-bg: #fb7185; --btn-hover: #f43f5e; --btn-text: #881337; }

.scenario-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.scenario-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.scenario-card__title { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0; }
.scenario-card__subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }

.scenario-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.scenario-card__metric {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  min-width: 0;
}
.scenario-card__metric-label { font-size: 12px; color: #64748b; }
.scenario-card__metric-value { font-size: 18px; font-weight: 700; color: var(--accent); word-break: break-word; }

.scenario-card__sms {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}
.scenario-card__sms-label { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.scenario-card__sms-text  { font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #1e293b; margin: 0; }

.scenario-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.scenario-card__btn:hover { background: var(--btn-hover); }

/* ============ AI Ассистент — quick prompts (pill row) ============ */
.assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.assistant-quick__btn {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.assistant-quick__btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.assistant-quick__btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ ИИ-маркетолог /ai (O7, мокап ai-chat.html) ============ */
/* Центральная колонка ~780px: «чат не делит экран ни с чем» + не узкий.
   Высота = вьюпорт минус p-4/p-8 паддинги <main> (как было у страницы). */
.aichat {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 4rem);
}
@media (max-width: 767px) {
  .aichat { height: calc(100dvh - 2rem); }
}

/* ============ Chat (AI Ассистент) ============ */
.chat-shell {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 520px;
}
.chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  /* overflow-x:hidden — без него overflow-y:auto делает X тоже `auto` (CSS-спек:
     visible→auto когда другая ось не visible) → широкий контент (таблица/seg-card)
     заставлял ВЕСЬ чат свайпаться вбок на телефоне. Широкие таблицы скроллятся
     внутри себя (см. .chat-bubble table ниже), остальное вписано mobile-капом пузыря. */
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
/* Ряд — flex; align-self на ряду = ключ от растягивания внутри chat-body (flex-col, stretch). */
.chat-row {
  display: flex;
  gap: 10px;                 /* mockup gap-2.5 */
  align-items: flex-start;
  margin-bottom: 16px;       /* mockup space-y-4 */
}
.chat-row--assistant { align-self: flex-start; justify-content: flex-start; }
.chat-row--user      { align-self: flex-end;   justify-content: flex-end; }
.chat-avatar {
  width: 28px; height: 28px; /* mockup w-7 h-7 */
  border-radius: 9999px;
  flex: 0 0 28px;
  display: flex; align-items: center; justify-content: center;
}
.chat-avatar svg { width: 16px; height: 16px; }
.chat-avatar--ai { background: #dbeafe; color: #2563eb; }
.chat-avatar--user { background: #2563eb; color: #fff; }
/* Bubble: flex:0 0 auto + width:fit-content + max-width — иначе block-дети от marked.js тянут шире. */
.chat-bubble,
.chat-bubble--ai {
  flex: 0 0 auto !important;
  min-width: 0;
  width: fit-content;
  max-width: 85%;            /* mockup max-w-[85%] */
  border-radius: 16px;       /* mockup rounded-2xl */
  padding: 10px 14px;        /* mockup px-3.5 py-2.5 */
  font-size: 13px;           /* mockup text-[13px] */
  line-height: 1.375;        /* mockup leading-snug */
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
/* «хвост» пузыря — острый верхний угол со стороны автора (mockup rounded-tl-sm / rounded-tr-sm) */
.chat-bubble--ai   { border-top-left-radius: 4px; }
.chat-bubble--user {
  max-width: 85%;
  white-space: pre-wrap;
  border-top-right-radius: 4px;
}
/* Контент от marked.js (p, ul, ol, div) не должен растягивать родителя */
.chat-bubble > p,
.chat-bubble > ul,
.chat-bubble > ol,
.chat-bubble > pre,
.chat-bubble > div,
.chat-bubble > blockquote {
  margin: 0 0 8px 0;
  max-width: 100% !important;
}
.chat-bubble > *:last-child { margin-bottom: 0; }
.chat-bubble--ai:has(.seg-card) {
  max-width: min(720px, 92vw);
  padding: 0;
  background: transparent;
}
.chat-bubble--ai   { background: #f1f5f9; color: #1f2937; }  /* mockup bg-slate-100 */
.chat-bubble--user { background: #2563eb; color: #fff; }     /* mockup bg-blue-600 */
.chat-bubble--tool { background: #f8fafc; color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; border: 1px solid #e2e8f0; }
.chat-bubble__time { font-size: 11px; opacity: .7; margin-top: 6px; }
.chat-bubble--user .chat-bubble__time { color: #bfdbfe; }
.chat-bubble--ai   .chat-bubble__time { color: #9ca3af; }

/* Anti-overflow for long <pre><code> blocks (SQL, code) emitted by AI via marked.js */
.chat-bubble pre, .chat-bubble--ai pre {
  overflow-x: auto;
  white-space: pre;
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble pre code, .chat-bubble--ai pre code { white-space: pre; word-break: normal; }

/* Typing dots */
.chat-typing {
  display: flex; gap: 4px; align-items: center;
}
.chat-typing__dot {
  width: 8px; height: 8px; border-radius: 9999px; background: #60a5fa;
  animation: chat-bounce 0.9s infinite;
}
.chat-typing__dot:nth-child(2) { animation-delay: 150ms; }
.chat-typing__dot:nth-child(3) { animation-delay: 300ms; }
@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .55; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Input bar */
.chat-input {
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input textarea {
  flex: 1 1 auto;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  background: #fff;
  outline: none;
  /* авто-рост (JS autoGrow) капается тут → дальше скролл внутри поля, не обрезка */
  max-height: 140px;
  overflow-y: auto;
  transition: box-shadow .15s, border-color .15s;
}
.chat-input textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.chat-input__send {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 8px;
  background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.chat-input__send:hover { background: #1d4ed8; }
.chat-input__send:disabled { opacity: .5; cursor: not-allowed; }

/* ============ Segment preview card (внутри AI ответа) ============ */
.seg-card {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.seg-card__head {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  color: #fff;
  padding: 10px 16px;
}
.seg-card__head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.seg-card__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.seg-card__desc { font-size: 13px; color: #4b5563; margin: 0; }
.seg-card__metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 700px) {
  .seg-card__metrics { grid-template-columns: repeat(2, 1fr); }
}
.seg-metric {
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.seg-metric__label { font-size: 11px; color: #6b7280; margin: 0; }
.seg-metric__value { font-size: 15px; font-weight: 700; margin: 2px 0 0; }
.seg-metric--guests   { background: #eff6ff; }
.seg-metric--guests .seg-metric__value   { color: #1d4ed8; }
.seg-metric--conv     { background: #ecfdf5; }
.seg-metric--conv   .seg-metric__value   { color: #047857; }
.seg-metric--avg      { background: #fffbeb; }
.seg-metric--avg    .seg-metric__value   { color: #b45309; }
.seg-metric--rev      { background: #f5f3ff; }
.seg-metric--rev    .seg-metric__value   { color: #6d28d9; }
.seg-metric--romi     { background: #ecfdf5; }
.seg-metric--romi   .seg-metric__value   { color: #047857; }

.seg-card__sms {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
}
.seg-card__sms-label { font-size: 11px; color: #6b7280; margin: 0 0 4px; }
.seg-card__sms-text  { font-size: 13px; font-style: italic; color: #1f2937; margin: 0; }

.seg-card__criteria summary {
  font-size: 12px; color: #6b7280; cursor: pointer; padding: 4px 0;
}
.seg-card__criteria summary:hover { color: #1f2937; }
.seg-card__criteria code {
  display: block; margin-top: 6px; padding: 8px 10px;
  background: #f8fafc; border-radius: 6px;
  font-size: 11px; word-break: break-all;
}

.seg-card__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 0;
  text-decoration: none;
  white-space: normal;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1.2;
}
.seg-btn svg { flex-shrink: 0; }

/* seg-card должна нормально рендерить пробелы (внутри chat-bubble--ai наследует pre-wrap) */
.seg-card, .seg-card * { white-space: normal; }
.seg-card .seg-card__sms-text { white-space: pre-wrap; }
.seg-btn--ghost {
  background: #fff; color: #374151; border: 1px solid #d1d5db;
}
.seg-btn--ghost:hover { background: #f9fafb; }
.seg-btn--primary {
  background: #2563eb; color: #fff;
}
.seg-btn--primary:hover { background: #1d4ed8; }

/* ============ KPI card (Обзор) ============ */
.kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.kpi-card__label  { font-size: 13px; color: #6b7280; }
.kpi-card__value  { font-size: 26px; font-weight: 700; color: #0f172a; word-break: break-word; line-height: 1.2; }
.kpi-card__delta  {
  font-size: 12px;
  color: #047857;
  display: inline-flex; align-items: center; gap: 4px;
}
.kpi-card__delta--neutral { color: #6b7280; }
.kpi-card__icon {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 9999px;
  background: #dbeafe;
  color: #2563eb;
  display: flex; align-items: center; justify-content: center;
}

/* ============ Insights cards ============ */
.ins-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-width: 0;
}
.ins-card__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; color: #0f172a;
  margin: 0;
}
.ins-card__title-icon { display: inline-flex; }
.ins-card__subtitle { font-size: 12px; color: #6b7280; margin: -8px 0 0; }
.ins-card__big { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.1; }

/* LTV pair */
.ins-ltv {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.ins-ltv__cell {
  border-radius: 8px; padding: 10px 12px;
}
.ins-ltv__cell--hi { background: #ecfdf5; }
.ins-ltv__cell--lo { background: #fef2f2; }
.ins-ltv__cell-label { font-size: 11px; font-weight: 600; }
.ins-ltv__cell--hi .ins-ltv__cell-label { color: #047857; }
.ins-ltv__cell--lo .ins-ltv__cell-label { color: #b91c1c; }
.ins-ltv__cell-value { font-size: 18px; font-weight: 700; color: #0f172a; }
.ins-ltv__cell-hint  { font-size: 11px; color: #6b7280; }

/* Todo (Что делать сегодня) */
.todo-card {
  border-left: 4px solid #94a3b8;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  background: #f8fafc;
  display: flex; flex-direction: column; gap: 4px;
}
.todo-card--urgent    { border-color: #ef4444; background: #fef2f2; }
.todo-card--important { border-color: #f59e0b; background: #fffbeb; }
.todo-card--normal    { border-color: #3b82f6; background: #eff6ff; }
.todo-card__head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.todo-card__title { font-size: 14px; font-weight: 600; color: #0f172a; margin: 0; }
.todo-card__chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
}
.todo-card--urgent    .todo-card__chip { background: #fecaca; color: #b91c1c; }
.todo-card--important .todo-card__chip { background: #fde68a; color: #92400e; }
.todo-card--normal    .todo-card__chip { background: #dbeafe; color: #1d4ed8; }
.todo-card__big   { font-size: 22px; font-weight: 700; color: #0f172a; }
.todo-card__hint  { font-size: 12px; color: #4b5563; }

/* Bar lists */
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row__head { display: flex; justify-content: space-between; font-size: 13px; color: #0f172a; margin-bottom: 4px; }
.bar-row__track { height: 8px; background: #f1f5f9; border-radius: 9999px; overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 9999px; background: #3b82f6; }
.bar-row__fill--amber { background: #f59e0b; }
.bar-row__fill--emerald { background: #10b981; }

/* ============ Утилиты для legacy x-cloak (Alpine) ============ */
[x-cloak] { display: none !important; }

/* ============ Mobile (≤767px) — адаптив контента (стандарт §templates/CLAUDE.md) ============ */
@media (max-width: 767px) {
  /* iOS auto-zoom: любой input/textarea/select с font-size <16px дёргает зум при
     фокусе. !important обязателен — бьёт Tailwind-утилиту text-sm и класс
     .chat-input textarea (иначе их специфичность не перекрыть). НЕ user-scalable=no. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea, select { font-size: 16px !important; }
}
/* AI Ассистент: на телефоне 6 quick-prompt чипов едят экран до чата →
   один свайпаемый ряд вместо стопки (кнопки уже flex:0 0 auto + white-space:nowrap). */
@media (max-width: 640px) {
  .assistant-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .assistant-quick::-webkit-scrollbar { display: none; }
  .assistant-quick__btn { min-height: 44px; }
  /* Пузырь на телефоне: десктопный кап min(600px,88vw) НЕ учитывает аватар(32)+gap(12)
     +padding чата(32) → ряд не влезал в экран. Кап = 100vw − ~112px (всё это chrome). */
  .chat-bubble,
  .chat-bubble--ai,
  .chat-bubble--user,
  .chat-bubble--ai:has(.seg-card) { max-width: calc(100vw - 112px); }
}

/* AI-чат: markdown-таблицы из ответов агента (выручка по дням/часам, сегменты) →
   компактная мини-таблица вместо «текста колонками». marked.js рендерит GFM | таблицы | в <table>. */
.chat-bubble table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 13px;
  /* display:block + width:max-content + overflow-x:auto = таблица сама себе
     горизонтальный скролл-контейнер, капнутый шириной пузыря. Иначе nowrap-ячейки
     (см. ниже) распирали таблицу шире пузыря и тянули весь чат вбок (mobile-свайп). */
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble th,
.chat-bubble td {
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  text-align: left;
  white-space: nowrap;
}
.chat-bubble th {
  background: #f1f5f9;
  font-weight: 600;
}
.chat-bubble td:not(:first-child),
.chat-bubble th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.chat-bubble table tr:nth-child(even) td { background: #f8fafc; }

/* 

==== Триггеры (/triggers, O4) — классы из мокапа rassylki-v2/_shared.css ============ */
/* Тумблер вкл/выкл триггера */
.tgl { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: background .15s; flex-shrink: 0; border: 0; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tgl.is-on { background: #16a34a; }
.tgl.is-on::after { transform: translateX(18px); }

/* Карточка триггера */
.trig-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, border-color .15s; }
.trig-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.07); border-color: #cbd5e1; }
.trig-card.is-off { background: #f8fafc; }
.trig-card.is-off .trig-card__title, .trig-card.is-off .trig-metrics { opacity: .45; }
.trig-card__title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.trig-card__rule { font-size: 12px; color: #64748b; }
.trig-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.trig-metrics div { background: #f8fafc; border-radius: 8px; padding: 6px 8px; }
.trig-metrics b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.trig-metrics span { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .03em; }

/* Бейдж сегмента на карточке */
.seg-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.seg-chip--sleep { background: #ede9fe; color: #6d28d9; }
.seg-chip--risk  { background: #fef3c7; color: #b45309; }
.seg-chip--lost  { background: #fee2e2; color: #b91c1c; }
.seg-chip--vip   { background: #fce7f3; color: #be185d; }
.seg-chip--new   { background: #dcfce7; color: #15803d; }
.seg-chip--deliv { background: #dbeafe; color: #1d4ed8; }
/* hotfix 2026-06-11: серый фоллбэк — «Все гости» + неизвестные старые segment_key */
.seg-chip--none  { background: #f1f5f9; color: #64748b; }

/* Вкладка «Рассылки» (R1, мокап final-mailings.html): карточка = <a> поверх .trig-card,
   статус-пилюли РОВНО ТРЁХ UI-статусов (ключи = services/mailings.ui_status). */
.mail-card { cursor: pointer; color: inherit; text-decoration: none; }
.mail-card:hover { border-color: #93c5fd; }
.st-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.st-pill--draft { background: #f1f5f9; color: #64748b; }
.st-pill--planned { background: #dbeafe; color: #1d4ed8; }
.st-pill--sent { background: #dcfce7; color: #15803d; }

/* Карточка-форма создания (дашед-рамка) + раскрытая правка карточки: одни поля */
.trig-create { border: 1.5px dashed #94a3b8; background: #fff; }
.trig-create input, .trig-create select, .trig-create textarea,
.trig-edit input, .trig-edit select, .trig-edit textarea {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: #fff;
}
.trig-create input:focus, .trig-create select:focus, .trig-create textarea:focus,
.trig-edit input:focus, .trig-edit select:focus, .trig-edit textarea:focus {
  outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px #dbeafe;
}
.trig-create label, .trig-edit label {
  display: block; font-size: 10.5px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px;
}
/* ── Календарь /calendar (UI v2 O6) — классы мокапа rassylki-v2/_shared.css ──
   Чипы: серый done = факт отправки, синий camp = запланированная разовая,
   фиолетовый trig = триггер (план/~прогноз). Ячейки: mute = чужой месяц,
   today = обводка сегодняшнего дня. seg-chip — ярлык сегмента (легенда шапки). */
/* фидбэк Владимира 2026-06-11: чипы крупнее (шрифт 10.5→12px) + 2 строки вместо
   однострочной обрезки названия (line-clamp вместо nowrap+ellipsis) */
.cal-chip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; line-height: 1.25; font-weight: 600; padding: 3px 7px; border-radius: 6px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip--camp { background: #dbeafe; color: #1d4ed8; }
.cal-chip--trig { background: #ede9fe; color: #6d28d9; }
.cal-chip--done { background: #f1f5f9; color: #64748b; }
.cal-cell { min-height: 118px; border: 1px solid #f1f5f9; padding: 5px 7px; font-size: 13px; background: #fff; } /* фидбэк Владимира: ячейки дней покрупнее (86→118px, шрифт 12→13px) */
.cal-cell--mute { background: #f8fafc; color: #cbd5e1; }
.cal-cell--today { outline: 2px solid #2563eb; outline-offset: -2px; border-radius: 4px; }

/* ── Гости /guests (UI v2 O8) — классы мокапа rassylki-v2/final-guests.html ──
   chip-row = ряд чипов слоя (Жизненный цикл / Поведение); fchip = чип-фильтр
   (is-on = активен); flt-pop = строка ручного конструктора условий;
   gkpis = KPI-строка выбранной базы. */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-row .lbl, .flt-pop .lbl { font-size: 11px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.fchip { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.fchip:hover { border-color: #cbd5e1; }
.fchip.is-on { background: #2563eb; border-color: #2563eb; color: #fff; }
.fchip small { font-weight: 400; opacity: .75; }
.flt-pop { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.flt-pop select, .flt-pop input { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: #fff; }
.gkpis { display: flex; gap: 26px; flex-wrap: wrap; padding: 13px 0; }
.gkpis b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.gkpis span { font-size: 10.5px; color: #94a3b8; text-transform: uppercase; letter-spacing: .03em; }

/* ── Настройки /settings (UI v2 O9) — классы мокапов final-settings*.html ──
   Карточка-сет, плитки выбора провайдера, поля, кнопки, бейджи статусов,
   прогресс-полоса бутстрапа. Вариант 2: одна кнопка «Сохранить». */
.set-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; max-width: 620px; }
.set-card + .set-card { margin-top: 16px; }
.set-card.is-dev { opacity: .55; }
/* Узкие селекты настроек (тихие часы «22:00»/«09:00», час рекомендаций) — appearance:none
   + кастомный шеврон фоном справа, а утилита px-2 даёт padding-right всего 8px → стрелка
   ЛОЖИТСЯ на последние цифры («22:0|0»). Даём место под шеврон. Грузится после app.css +
   специфичность .set-card select > .px-2 → перебивает. (custom.css, без Tailwind-пересборки.) */
.set-card select { padding-right: 2rem; background-position: right 0.6rem center; }
.prov-pick { display: flex; gap: 10px; }
.prov { flex: 1; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 14px; background: #fff; text-align: left; }
.prov.is-sel { border-color: #2563eb; background: #eff6ff; }
.prov small { font-size: 11px; color: #94a3b8; font-weight: 400; display: block; }
.fld { margin-top: 12px; }
.fld label { display: block; font-size: 10.5px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.fld input { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.fld input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px #dbeafe; }
.fld .hint { font-size: 11.5px; color: #94a3b8; margin-top: 3px; }
.btn { border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.btn--blue { background: #2563eb; color: #fff; }
.btn--blue:hover { background: #1d4ed8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ok-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #15803d; background: #dcfce7; border-radius: 999px; padding: 3px 10px; }
.err-badge { display: inline-flex; font-size: 12px; font-weight: 600; color: #b91c1c; background: #fee2e2; border-radius: 999px; padding: 3px 10px; }
.dev-badge { display: inline-flex; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 2px 9px; }
.conn-row { display: flex; align-items: center; gap: 12px; }
.conn-ico { width: 40px; height: 40px; border-radius: 10px; background: #f1f5f9; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.lim-input { width: 64px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 14px; font-weight: 700; text-align: center; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: #2563eb; border-radius: 50%; animation: o9-sp .7s linear infinite; vertical-align: -2px; }
@keyframes o9-sp { to { transform: rotate(360deg); } }
/* Крупный спиннер для оверлея поиска Гостей (виден внутри #guests-busy-overlay). */
.spin--lg { width: 34px; height: 34px; border-width: 3px; vertical-align: middle; }
/* Оверлей ожидания поиска базы: накрывает #guests-live белым полотном + крутящийся круг
   по центру → таблица «исчезает» на время запроса (запрос владельца 2026-06-13). htmx
   управляет видимостью через .htmx-indicator (.htmx-request → opacity 1). pointer-events:none
   — в скрытом состоянии (opacity 0) клики проходят к таблице насквозь. */
.guests-busy-overlay { position: absolute; inset: 0; z-index: 20; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 220px; background: rgba(255,255,255,.94); border-radius: 12px; pointer-events: none; }
.sync-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: 8px; }
.sync-bar div { height: 100%; width: 0%; background: #16a34a; border-radius: 999px; transition: width .3s; }
.sync-bar .sync-bar__fill { animation: o9-pulse 1.6s ease-in-out infinite; }
@keyframes o9-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* 🔴 hx-boost + head-support FIX (2026-06-24): htmx инжектит `.htmx-indicator{opacity:0}`
   ДИНАМИЧЕСКИ в <style> при загрузке. head-support при boost-навигации (клик вкладки)
   ПЕРЕМЁРЖИВАЕТ <head> и УДАЛЯЕТ этот htmx-style (его нет в серверном HTML) → правило
   opacity:0 пропадало → ВСЕ индикаторы (спиннер «Ищем…» #guests-find-spin, оверлей
   #guests-busy-overlay) зависали ВИДИМЫМИ навсегда после возврата на /guests кликом вкладки
   (F5 чинил — htmx инжектил заново; boost ломал). Дублируем правило СТАТИЧЕСКИ в link-CSS
   (head-support не трогает <link>-стили) → индикаторы скрыты по умолчанию и после boost. */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* «Интеграции» iiko шаг 2: кнопка «Подключить и загрузить» + бар прогресса справа
   в одну строку (бар = трекер bootstrap_progress.html в #iiko-connect-flow). */
.iiko-connect-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.iiko-connect-row > .btn { flex: none; white-space: nowrap; }
.iiko-connect-flow { flex: 1; min-width: 0; }

/* ОБЪЕКТ 2 (/segments): tooltip-ⓘ расшифровка сегмента (hover/focus).
   app.css компилируется не-JIT — произвольные классы могли не попасть в сборку,
   потому критичное позиционирование держим в custom.css (грузится глобально). */
.seg-tip { position: relative; display: inline-flex; }
.seg-tip__pop {
  display: none; position: absolute; z-index: 20; bottom: 140%; left: 0; width: 230px;
  background: #0f172a; color: #e2e8f0; font-size: 11px; line-height: 1.45; padding: 8px 10px;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-weight: 400; white-space: normal;
}
.seg-tip:hover .seg-tip__pop, .seg-tip:focus .seg-tip__pop { display: block; }

/* ============ Сценарии — список (/scenarios, §3, мокап scenarios-list.html) ============ */
/* без max-width: страница заполняет ширину контента как остальные разделы (иначе на широком
   мониторе контент жмётся в 1080px и прижат влево — владелец: «страница сжалась непонятно») */
.sc-page { width: 100%; }
.sc-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.sc-head h1 { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0; }
.sc-head p { font-size: 13px; color: #64748b; margin: 4px 0 0; }
.sc-head__spacer { flex: 1; }
.sc-btn { height: 38px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid #e5e7eb; background: #fff; color: #334155;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  text-decoration: none; }
.sc-btn:hover { background: #f8fafc; }
.sc-btn--primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.sc-btn--primary:hover { background: #2563eb; }

.sc-kpis { display: flex; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.sc-kpi { flex: 1; min-width: 150px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.sc-kpi__v { font-size: 24px; font-weight: 700; color: #0f172a; }
.sc-kpi__v.ok { color: #047857; }
.sc-kpi__l { font-size: 12px; color: #64748b; margin-top: 2px; }

.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.sc-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 13px;
  transition: box-shadow .14s, border-color .14s; }
.sc-card:hover { box-shadow: 0 8px 24px -8px rgba(15,23,42,.16); border-color: #cbd5e1; }
.sc-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-card__title { font-size: 15.5px; font-weight: 700; color: #0f172a; }
.sc-card__sub { font-size: 12px; color: #64748b; margin-top: 1px; }
.sc-card__state { font-size: 12px; color: #64748b; }
.sc-pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 9999px; white-space: nowrap; }
.sc-pill--live { background: #d1fae5; color: #047857; }
.sc-pill--draft { background: #fef3c7; color: #92400e; }
.sc-pill--paused { background: #e2e8f0; color: #475569; }

.sc-flowmini { display: flex; align-items: center; gap: 5px; padding: 10px 0; flex-wrap: wrap; min-height: 26px; }
.sc-fm-badge { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.sc-fm-arrow { color: #cbd5e1; font-size: 12px; }

.sc-metrics { display: flex; gap: 0; border-top: 1px solid #f1f5f9; padding-top: 12px; }
.sc-metric { flex: 1; }
.sc-metric b { font-size: 17px; font-weight: 700; color: #0f172a; display: block; }
.sc-metric b.ok { color: #047857; }
.sc-metric span { font-size: 11px; color: #64748b; }

.sc-card__foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid #f1f5f9; padding-top: 12px; }
.sc-foot-spacer { flex: 1; }
.sc-tgl { width: 40px; height: 23px; border-radius: 9999px; background: #cbd5e1; position: relative;
  cursor: pointer; flex-shrink: 0; transition: background .15s; border: 0; }
.sc-tgl.on { background: #10b981; }
.sc-tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sc-tgl.on::after { left: 19px; }
.sc-tgl:disabled { opacity: .5; cursor: not-allowed; }

.sc-new { border: 1.5px dashed #cbd5e1; background: #fafbfc; display: grid; place-items: center;
  min-height: 220px; padding: 0; }
.sc-new:hover { border-color: #3b82f6; background: #f5f8ff; box-shadow: none; }
.sc-new__inner { text-align: center; background: none; border: 0; cursor: pointer; padding: 20px; width: 100%; }
.sc-new__icon { width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 10px; display: grid;
  place-items: center; background: linear-gradient(135deg,#a78bfa,#7c3aed); color: #fff;
  box-shadow: 0 6px 18px -4px rgba(124,58,237,.45); }
.sc-new__t { font-size: 14px; font-weight: 600; color: #0f172a; display: block; }
.sc-new__s { font-size: 12px; color: #94a3b8; margin-top: 3px; display: block; }

@media (max-width: 767px) {
  .sc-grid { grid-template-columns: 1fr; }
  .sc-kpis { gap: 8px; }
  .sc-kpi { min-width: calc(50% - 4px); }
}

/* drawer «Показать примеры» (/scenarios) */
.sc-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 55; }
.sc-exdrawer { position: fixed; top: 0; right: 0; height: 100dvh; width: 412px; max-width: 92vw; z-index: 60;
  background: #fff; border-left: 1px solid #e5e7eb; box-shadow: -18px 0 50px -20px rgba(15,23,42,.35);
  display: flex; flex-direction: column; }
.sc-exdrawer__head { padding: 16px 18px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: flex-start; gap: 10px; }
.sc-exdrawer__head h3 { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0; }
.sc-exdrawer__head p { font-size: 12px; color: #64748b; margin: 3px 0 0; line-height: 1.4; }
.sc-exdrawer__x { margin-left: auto; width: 30px; height: 30px; border: 0; background: none; border-radius: 8px;
  color: #94a3b8; cursor: pointer; font-size: 18px; flex-shrink: 0; }
.sc-exdrawer__x:hover { background: #f1f5f9; color: #334155; }
.sc-exdrawer__body { flex: 1; overflow: auto; padding: 16px 18px; }
.sc-excard { border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px; margin-bottom: 14px;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.sc-excard__title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.sc-excard .sc-btn { height: 32px; font-size: 12.5px; margin-top: 6px; }

/* ============ Сценарии — редактор-холст (/scenarios/{id}, §4, мокап flow-builder.html) ============ */
/* full-bleed: гасим паддинг <main> (p-4/md:p-8) и тянем на высоту вьюпорта */
.fe-wrap { display: flex; height: 100dvh; margin: -1rem; background: #f8fafc; overflow: hidden; }
@media (min-width: 768px) { .fe-wrap { margin: -2rem; } }
.fe-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fe-topbar { min-height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; gap: 12px; padding: 9px 18px; }
.fe-back { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff;
  display: grid; place-items: center; color: #475569; cursor: pointer; flex-shrink: 0; text-decoration: none; }
.fe-back:hover { background: #f1f5f9; }
.fe-title { font-weight: 700; font-size: 15px; color: #0f172a; white-space: nowrap; }
.fe-title__sub { font-size: 12px; color: #64748b; margin-top: 1px; }
.fe-status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 9999px; background: #fef3c7; color: #92400e; }
.fe-status.live { background: #d1fae5; color: #047857; }
.fe-spacer { flex: 1; }
.fe-btn { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid #e5e7eb; background: #fff; color: #334155; display: inline-flex; align-items: center; gap: 7px; }
.fe-btn:hover { background: #f8fafc; }
.fe-btn--primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.fe-btn--primary:hover { background: #2563eb; }
.fe-btn--ai { background: #faf5ff; border-color: #e9d5ff; color: #7c3aed; text-decoration: none; }
.fe-btn--ai:hover { background: #f3e8ff; }

/* drawer примеров В РЕДАКТОРЕ (vanilla-toggle .open, без Alpine) — id-scoped, чтобы не
   задеть Alpine-drawer списка /scenarios (там x-show переключает display) */
.sc-exscrim { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 55;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.sc-exscrim.open { opacity: 1; visibility: visible; }
#feExDrawer { transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1); }
#feExDrawer.open { transform: translateX(0); }
/* цветные бейджи шагов в мини-схеме примера (порядковый номер внутри) */
.sc-fm-badge { font-size: 12px; font-weight: 700; }
.sc-fm-badge--entry { background: linear-gradient(135deg,#34d399,#059669); }
.sc-fm-badge--sms { background: linear-gradient(135deg,#60a5fa,#2563eb); }
.sc-fm-badge--wait { background: linear-gradient(135deg,#fcd34d,#f59e0b); }
.sc-fm-badge--condition { background: linear-gradient(135deg,#38bdf8,#0284c7); }
.sc-fm-badge--exit { background: linear-gradient(135deg,#fb7185,#e11d48); }
.fe-toast { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: #1e1b4b; color: #e9d5ff; font-size: 12.5px; font-weight: 600; padding: 8px 14px;
  border-radius: 9999px; box-shadow: 0 8px 24px -6px rgba(76,29,149,.5); opacity: 0; transition: opacity .25s; pointer-events: none; }
.fe-toast.show { opacity: 1; }
.fe-toast.err { background: #7f1d1d; color: #fecaca; }
.fe-toast .fe-dot { width: 7px; height: 7px; border-radius: 50%; background: #c4b5fd; display: inline-block;
  margin-right: 8px; vertical-align: middle; animation: fe-toast-blink .9s infinite; }
@keyframes fe-toast-blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* Анимация «ИИ расставляет блоки»: ноды влетают по очереди сверху-вниз (вертикаль-поток),
   рёбра дорисовываются stroke-dashoffset, лейблы — мягкий фейд (мокап flow-builder.html §анимация). */
@keyframes fe-node-pop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.9); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1.03); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
}
@keyframes fe-spawn-ring { 0% { box-shadow: 0 0 0 0 rgba(124,58,237,.45); } 100% { box-shadow: 0 0 0 16px rgba(124,58,237,0); } }
.fe-node.anim-spawn { animation: fe-node-pop .42s cubic-bezier(.34,1.56,.64,1) both, fe-spawn-ring .7s ease-out .2s both; }
.fe-edges.edges-draw path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: fe-edge-draw .6s ease-out forwards; }
@keyframes fe-edge-draw { to { stroke-dashoffset: 0; } }
.fe-elabel.anim-fade, .fe-addstep.anim-fade { animation: fe-fade-soft .4s ease both; }
@keyframes fe-fade-soft { from { opacity: 0; } to { opacity: 1; } }

.fe-canvas { flex: 1; position: relative; overflow: auto; background-color: #f8fafc;
  background-image: radial-gradient(#d8dee9 1px, transparent 1px); background-size: 22px 22px; }
/* вертикаль-поток: сцена фиксированной ширины по центру, высоту задаёт JS под контент; transform=zoom */
.fe-stage { position: relative; width: 1000px; min-height: 700px; margin: 0 auto; transform-origin: 50% 0; padding-bottom: 80px; }

/* зум-док (как n8n: − % + ⤢) */
.fe-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 20; display: flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 6px 18px -8px rgba(15,23,42,.22); padding: 3px; }
.fe-zoom button { width: 30px; height: 30px; border: 0; background: none; border-radius: 7px; cursor: pointer;
  color: #475569; font-size: 17px; line-height: 0; display: grid; place-items: center; }
.fe-zoom button:hover { background: #f1f5f9; color: #0f172a; }
.fe-zoom__lvl { min-width: 46px; text-align: center; font-size: 12px; font-weight: 650; color: #334155; font-variant-numeric: tabular-nums; cursor: pointer; }

/* чип автосохранения (n8n-style: «Сохранение…» / «Все изменения сохранены ✓» / «Не сохранено») */
.fe-savechip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #64748b;
  padding: 5px 11px; border-radius: 9999px; background: #f1f5f9; white-space: nowrap; }
.fe-savechip .fe-sdot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.fe-savechip.saving { color: #b45309; background: #fffbeb; }
.fe-savechip.saving .fe-sdot { background: #f59e0b; animation: fe-toast-blink .9s infinite; }
.fe-savechip.saved { color: #047857; background: #ecfdf5; }
.fe-savechip.saved .fe-sdot { background: #10b981; }
.fe-savechip.err { color: #be123c; background: #fff1f2; }
.fe-savechip.err .fe-sdot { background: #f43f5e; }
.fe-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.fe-edges path { fill: none; stroke: #cbd5e1; stroke-width: 2; }
.fe-elabel { position: absolute; transform: translate(-50%,-50%); z-index: 6; font-size: 10px; font-weight: 700;
  padding: 1px 8px; border-radius: 9999px; background: #fff; border: 1px solid #e5e7eb; }
.fe-elabel.yes { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.fe-elabel.no { color: #be123c; border-color: #fecdd3; background: #fff1f2; }

.fe-node { position: absolute; transform: translateX(-50%); z-index: 4; width: 280px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: pointer;
  user-select: none; transition: box-shadow .14s, border-color .14s; }
.fe-node:hover { box-shadow: 0 8px 24px -8px rgba(15,23,42,.18); }
.fe-node.sel { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18), 0 8px 24px -8px rgba(15,23,42,.18); }
.fe-node__head { display: flex; align-items: center; gap: 10px; padding: 11px 12px 9px; }
.fe-badge { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px -1px rgba(0,0,0,.25); }
.fe-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.fe-ntitle { font-size: 13.5px; font-weight: 650; color: #0f172a; line-height: 1.25; margin-top: 1px; }
.fe-node__body { padding: 0 12px 12px; }
.fe-summary { font-size: 12px; color: #475569; background: #f8fafc; border: 1px solid #eef2f6; border-radius: 8px; padding: 8px 10px; line-height: 1.4; }
/* вертикаль-поток: вход сверху по центру, выход снизу по центру */
.fe-port { position: absolute; left: 50%; transform: translateX(-50%); width: 9px; height: 9px; border-radius: 9999px; background: #fff; border: 2px solid #cbd5e1; z-index: 5; }
.fe-port.in { top: -5px; } .fe-port.out { bottom: -5px; }
.fe-node.sel .fe-port { border-color: #3b82f6; }
.fe-node::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bar, transparent); }
.fe-addstep { position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; width: 26px; height: 26px;
  border-radius: 9999px; border: 1.5px dashed #cbd5e1; background: #fff; color: #94a3b8; display: grid; place-items: center;
  cursor: pointer; font-size: 16px; line-height: 0; }
.fe-addstep:hover { border-color: #3b82f6; color: #3b82f6; border-style: solid; }

.fe-empty { position: absolute; inset: 0; display: grid; place-items: center; z-index: 12; }
.fe-empty__card { width: 380px; max-width: 90%; background: #fff; border: 1px solid #e5e7eb; border-radius: 18px;
  box-shadow: 0 8px 24px -8px rgba(15,23,42,.18); padding: 28px; text-align: center; }
.fe-empty__icon { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 14px; display: grid; place-items: center;
  background: linear-gradient(135deg,#a78bfa,#7c3aed); color: #fff; box-shadow: 0 6px 18px -4px rgba(124,58,237,.5); }
.fe-empty__card h2 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }
.fe-empty__card p { font-size: 13px; color: #64748b; margin: 0 0 20px; line-height: 1.5; }
.fe-empty__card .fe-btn { width: 100%; justify-content: center; height: 40px; margin-bottom: 9px; }

.fe-palette { position: fixed; z-index: 50; width: 240px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 14px; box-shadow: 0 16px 48px -12px rgba(15,23,42,.28); padding: 6px; max-height: 380px; overflow: auto; }
.fe-pitem { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; }
.fe-pitem:hover { background: #f1f5f9; }
.fe-pitem .fe-badge { width: 28px; height: 28px; border-radius: 8px; }
.fe-plbl { font-size: 13px; font-weight: 550; color: #0f172a; }

.fe-props { width: 330px; flex-shrink: 0; background: #fff; border-left: 1px solid #e5e7eb; display: flex; flex-direction: column; overflow: hidden; }
.fe-props__head { padding: 14px 16px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 10px; }
.fe-props__title { font-size: 14px; font-weight: 700; color: #0f172a; }
.fe-props__kind { font-size: 11px; color: #64748b; }
.fe-props__body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.fe-props__empty { font-size: 13px; color: #94a3b8; padding: 24px 16px; text-align: center; }
.fe-field label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.fe-field input, .fe-field select, .fe-field textarea { width: 100%; border: 1px solid #e5e7eb; border-radius: 9px;
  padding: 8px 10px; font-size: 13px; color: #0f172a; background: #fff; font-family: inherit; }
.fe-field textarea { resize: vertical; min-height: 72px; }
.fe-field input:focus, .fe-field select:focus, .fe-field textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.fe-props__foot { padding: 12px 16px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px; }
.fe-props__foot .fe-btn { flex: 1; justify-content: center; }
.fe-danger { color: #be123c; border-color: #fecdd3; }
.fe-danger:hover { background: #fff1f2; }

@media (max-width: 900px) { .fe-props { display: none; } }

/* ============ Общий холст «Все процессы» (/scenarios/board) ============ */
/* Все сценарии дорожками на одной доске. Переиспользует .fe-topbar/.fe-canvas/.fe-zoom. */
.bd-stage { position: relative; display: flex; gap: 44px; align-items: flex-start; padding: 28px 40px 80px;
  width: max-content; transform-origin: 0 0; }
.bd-lane { width: 296px; flex-shrink: 0; }
.bd-lane__head { display: block; text-decoration: none; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); margin-bottom: 26px; cursor: pointer;
  transition: box-shadow .14s, border-color .14s; }
.bd-lane__head:hover { border-color: #3b82f6; box-shadow: 0 8px 24px -8px rgba(15,23,42,.18); }
.bd-lane__top { display: flex; align-items: center; gap: 8px; }
.bd-lane__name { font-size: 14px; font-weight: 700; color: #0f172a; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-lane__sub { font-size: 11.5px; color: #94a3b8; margin-top: 3px; }
.bd-chip { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; white-space: nowrap; flex-shrink: 0;
  color: #64748b; background: #f1f5f9; }
.bd-chip.live { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.bd-flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.bd-node { width: 100%; background: #fff; border: 1px solid #e5e7eb; border-radius: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  position: relative; }
.bd-node::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bar, transparent); }
.bd-node__head { display: flex; align-items: center; gap: 9px; padding: 10px 12px 8px; }
.bd-node__body { padding: 0 12px 11px; }
.bd-node .fe-badge { width: 30px; height: 30px; border-radius: 9px; }
.bd-kind { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.bd-ntitle { font-size: 12.5px; font-weight: 650; color: #0f172a; line-height: 1.2; margin-top: 1px; }
.bd-summary { font-size: 11px; color: #475569; background: #f8fafc; border: 1px solid #eef2f6; border-radius: 7px; padding: 6px 8px; line-height: 1.35; }
.bd-conn { width: 2px; height: 22px; background: #cbd5e1; flex-shrink: 0; }
.bd-lane__empty { font-size: 12px; color: #94a3b8; text-align: center; padding: 18px; border: 1px dashed #e5e7eb; border-radius: 12px; }
.bd-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.bd-empty__card { text-align: center; max-width: 380px; }
.bd-empty__card h2 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }
.bd-empty__card p { font-size: 13px; color: #64748b; margin: 0 0 18px; line-height: 1.5; }

/* ============================================================================
   Раздел «Интеграции» (UI v2) — порт design/mockups/integrations.html.
   Классы .intg/.cfg-row/.panel/.bar/.add-tile/.st — карточки источников/провайдеров
   + панель «База рассылок». Inline-<style> в шаблоне запрещён → стили тут.
   ============================================================================ */
.intg-page { --line:#e5e7eb; --ink:#0f172a; --muted:#64748b; --accent:#2563eb; --shadow:0 1px 2px rgba(0,0,0,.04); color:var(--ink); }
.intg-page .page-head h1 { font-size:22px; font-weight:700; margin:0; }
.intg-page .page-sub { font-size:13px; color:var(--muted); margin:6px 0 24px; max-width:640px; }

.intg-page .btn { height:34px; padding:0 14px; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; border:1px solid var(--line); background:#fff; color:#334155; display:inline-flex; align-items:center; gap:7px; box-shadow:var(--shadow); text-decoration:none; }
.intg-page .btn:hover { background:#f8fafc; }
.intg-page .btn--primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.intg-page .btn--primary:hover { background:#1d4ed8; }
.intg-page .btn--ghost { border-color:transparent; box-shadow:none; background:transparent; color:#94a3b8; }
.intg-page .btn--ghost:hover { background:#f1f5f9; color:#334155; }
.intg-page .btn--sm { height:30px; padding:0 11px; font-size:12px; }

/* двухколоночный каркас: слева подключения, справа — база рассылок */
.intg-page .cols { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(300px,1fr); gap:26px; align-items:start; }
@media (max-width:900px){ .intg-page .cols { grid-template-columns:1fr; } }

.intg-page .group-label { font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#94a3b8; margin:4px 0 10px; }
.intg-page .group-label:not(:first-child){ margin-top:24px; }

.intg-page .intg { background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); margin-bottom:12px; overflow:hidden; }
.intg-page [data-expandable] .intg__head { cursor:pointer; }
.intg-page .intg__head { display:flex; align-items:center; gap:16px; padding:16px 18px; }
.intg-page .intg__logo { width:48px; height:48px; border-radius:12px; display:grid; place-items:center; flex-shrink:0; font-size:20px; font-weight:800; color:#fff; }
.intg-page .l-goulash { background:#06b6d4; } .intg-page .l-iiko { background:#ef4444; } .intg-page .l-sms { background:#6366f1; } .intg-page .l-p1 { background:#0ea5e9; } .intg-page .l-smsc { background:#7c3aed; } .intg-page .l-mail { background:#10b981; }
.intg-page .intg__body { flex:1; min-width:0; }
.intg-page .intg__title { font-size:15px; font-weight:700; display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.intg-page .intg__meta { font-size:12.5px; color:var(--muted); margin-top:3px; }
.intg-page .intg__act { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.intg-page .chev { transition:transform .15s; color:#94a3b8; }
.intg-page .intg.is-open .chev { transform:rotate(180deg); }

.intg-page .intg__detail { border-top:1px solid #eef2f7; padding:16px 18px 18px; background:#fcfdfe; display:none; }
.intg-page .intg.is-open .intg__detail { display:block; }
.intg-page .cfg-row { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px dashed #eef2f7; font-size:13px; gap:12px; }
.intg-page .cfg-row:last-child { border-bottom:0; }
.intg-page .cfg-row .k { color:var(--muted); }
.intg-page .cfg-row .v { font-weight:600; text-align:right; }
.intg-page .pts { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.intg-page .pt { font-size:12px; background:#eff6ff; color:#1d4ed8; border:1px solid #dbeafe; border-radius:999px; padding:2px 9px; }
.intg-page .cfg-actions { display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; align-items:center; }
.intg-page .cfg-actions form { margin:0; }

.intg-page .st { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; border-radius:999px; padding:3px 9px; }
.intg-page .st--ok { color:#15803d; background:#dcfce7; }
.intg-page .st--err { color:#b91c1c; background:#fee2e2; }
.intg-page .st--idle { color:#64748b; background:#f1f5f9; }
.intg-page .st__dot { width:7px; height:7px; border-radius:50%; background:currentColor; }

.intg-page .add-tile { border:1.5px dashed #d3dbe6; border-radius:12px; padding:13px; text-align:center; color:#64748b; font-weight:600; font-size:13px; cursor:pointer; background:#fff; margin-bottom:12px; }
.intg-page .add-tile:hover { border-color:#94a3b8; background:#f8fafc; }
.intg-page .add-tile__form { margin-top:12px; text-align:left; cursor:default; }
.intg-page .add-tile__tiles { display:flex; gap:8px; margin-bottom:10px; }
.intg-page .add-tile__pick { flex:1; height:34px; border-radius:9px; border:1px solid var(--line); background:#fff; font-size:13px; font-weight:600; cursor:pointer; }
.intg-page .add-tile__pick.is-on { border-color:var(--accent); color:var(--accent); background:#eff6ff; }
.intg-page .add-tile__input { width:100%; height:34px; padding:0 11px; margin-bottom:8px; border:1px solid var(--line); border-radius:9px; font-size:13px; }

/* Ряд иконок-сервисов «подключить» (UI v3, 2026-06-22) — плитки секций Источники/Провайдеры.
   status: available=кликабельна, connected=серая ✓ (управление в карточке выше), locked=одна CRM. */
.intg-page .svc-block { margin-bottom:12px; }
.intg-page .svc-rail { display:flex; flex-wrap:wrap; gap:10px; }
.intg-page .svc { display:flex; flex-direction:column; align-items:center; gap:6px; width:108px; padding:12px 10px; border:1.5px solid var(--line); border-radius:12px; background:#fff; cursor:pointer; text-align:center; transition:border-color .12s, background .12s; }
.intg-page button.svc { font:inherit; }
.intg-page button.svc:hover { border-color:#94a3b8; background:#f8fafc; }
.intg-page .svc.is-on { border-color:var(--accent); background:#eef4f0; }
.intg-page .svc__logo { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; color:#fff; font-weight:800; font-size:15px; flex-shrink:0; }
.intg-page .svc__name { font-size:12.5px; font-weight:700; color:#0f172a; line-height:1.15; }
.intg-page .svc__hint { font-size:11px; color:#64748b; font-weight:600; }
.intg-page .svc--connected { cursor:default; background:#f1f5f9; border-color:#e2e8f0; }
.intg-page .svc--connected .svc__logo { filter:grayscale(1); opacity:.55; }
.intg-page .svc--connected .svc__name { color:#64748b; }
.intg-page .svc--connected .svc__hint { color:#16a34a; }
.intg-page .svc--locked { cursor:not-allowed; background:#fff; border-style:dashed; border-color:#e2e8f0; opacity:.5; }
.intg-page .svc-form { margin-top:12px; }
.intg-page .svc-form__input { width:100%; height:36px; padding:0 11px; margin-bottom:8px; border:1px solid var(--line); border-radius:9px; font-size:13px; }

/* Бренд-логотип в плитке/карточке (реестр SERVICE_LOGO → static/logos/*.png).
   Цветной фон logo_class заменяется белым (логотип несёт свой фон/форму); object-fit
   вписывает картинку, overflow обрезает по радиусу. Фоллбэк на буквы — через onerror. */
.intg-page .svc__logo--img, .intg-page .intg__logo--img { background:#fff; border:1px solid var(--line); padding:0; overflow:hidden; }
.intg-page .svc__logo--img img, .intg-page .intg__logo--img img { width:100%; height:100%; object-fit:contain; display:block; }
.intg-page .svc--connected .svc__logo--img { filter:none; opacity:1; }   /* лого подключённого — не глушим (серость даёт сама плитка) */

.intg-page .panel { background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); padding:18px; position:sticky; top:24px; }
.intg-page .panel h3 { font-size:15px; font-weight:700; margin:0 0 4px; }
.intg-page .panel .sub { font-size:12.5px; color:var(--muted); margin:0 0 16px; }
.intg-page .fill { margin-bottom:14px; }
.intg-page .fill__top { display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:5px; }
.intg-page .fill__top b { font-weight:700; }
.intg-page .bar { height:8px; border-radius:999px; background:#eef2f7; overflow:hidden; }
.intg-page .bar > i { display:block; height:100%; border-radius:999px; }
.intg-page .bar--phone > i { background:#10b981; } .intg-page .bar--email > i { background:#6366f1; }
.intg-page .drop { margin-top:8px; border:1.5px dashed #cdd7e5; border-radius:12px; padding:18px; text-align:center; background:#fbfdff; }
.intg-page .drop .ico { font-size:24px; }
.intg-page .drop p { font-size:12.5px; color:#64748b; margin:7px 0 12px; }
.intg-page .hint { font-size:11.5px; color:#94a3b8; margin-top:10px; line-height:1.5; }
.intg-page .mb-4 { margin-bottom:16px; }

/* ═══════════════════════════════════════════════════════════════════════
   История рассылок · карточки кампаний — вариант B «Card with rail»
   (план 2026-06-18 п.4; мокап design/mockups/campaigns-notion.html).
   GOAL: «дорогая» Notion-палитра БЕЗ ретемы всего сайта — токены scoped
   на .cc-list (не глобальные Tailwind-токены). Левый цветной рельс = статус,
   метрики чипами-таблетками, мягкая тень при наведении. Поведение (HTMX
   expand на клик) НЕ меняется — меняется только вид.
   ═══════════════════════════════════════════════════════════════════════ */
.cc-list {
  --cc-ink:#1a1a18; --cc-ink2:#6b6b66; --cc-ink3:#9a9a93;
  --cc-card:#ffffff; --cc-line:#ecebe7;
  --cc-good:#3f7d5f; --cc-good-bg:#eef4f0;
  --cc-bad:#a8543f; --cc-bad-bg:#f6efec; --cc-warn:#9a7b3f; --cc-accent:#2f6f8f;
  display:flex; flex-direction:column; gap:12px;
}
.cc-card {
  background:var(--cc-card); border:1px solid var(--cc-line); border-radius:14px;
  padding:18px 20px 16px; position:relative; cursor:pointer;
  transition:box-shadow .15s, transform .05s;
}
.cc-card:hover { box-shadow:0 1px 3px rgba(26,26,24,.06), 0 6px 20px rgba(26,26,24,.05); }
.cc-card::before {
  content:""; position:absolute; left:0; top:14px; bottom:14px; width:3px;
  border-radius:3px; background:var(--cc-good);
}
.cc-card.is-fail::before { background:var(--cc-bad); }
.cc-card.is-warn::before { background:var(--cc-warn); }
.cc-card.is-sending::before { background:var(--cc-accent); }
.cc-card.is-import { opacity:.72; }
.cc-card.is-import::before { background:var(--cc-ink3); }
.cc-head { display:flex; align-items:center; gap:10px; margin-bottom:2px; padding-left:6px; flex-wrap:wrap; }
.cc-head .cc-name { font-size:15px; font-weight:600; color:var(--cc-ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.cc-head .cc-seq { color:var(--cc-ink3); font-weight:600; }

/* Карточка v3 (план 2026-06-18 объекты 2+3): редактируемое имя + бейджи-строка + чипы-фильтры. */
.cc-name-wrap { display:inline-flex; align-items:center; gap:6px; min-width:0; flex:1 1 auto; }
.cc-edit { border:0; background:none; cursor:pointer; color:var(--cc-ink3); padding:2px 4px;
  border-radius:6px; flex:none; line-height:0; display:inline-flex; }
.cc-edit:hover { background:#f3f3f0; color:var(--cc-ink2); }
.cc-name-edit { display:flex; align-items:center; gap:6px; width:100%; min-width:0; }
.cc-name-edit input { flex:1 1 auto; min-width:0; font:inherit; font-size:15px; font-weight:600;
  color:var(--cc-ink); border:1.5px solid var(--cc-good); border-radius:8px; padding:5px 10px;
  outline:none; background:#fff; }
.cc-mini { font:inherit; font-size:12px; padding:6px 12px; border-radius:8px; border:1px solid var(--cc-line);
  background:#fff; cursor:pointer; color:var(--cc-ink2); white-space:nowrap; }
.cc-mini--ok { background:var(--cc-good); color:#fff; border-color:var(--cc-good); }
/* Бейджи статуса/способа — отдельная строка под именем (длинное имя их не вытесняет). */
.cc-badges { display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding-left:6px; margin:8px 0 2px; }
/* Чипы выбранных фильтров аудитории — тёплый нейтрал, отличный от метрик-чипов. */
.cc-filters { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding-left:6px; margin-top:12px; }
.cc-flbl { font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--cc-ink3); margin-right:2px; }
.cc-fchip { background:#f1efe9; color:#5a5550; border:1px solid #e6e3dc; border-radius:8px;
  padding:4px 10px; font-size:12px; font-weight:500; white-space:nowrap; }
.cc-pill { font-size:11px; padding:2px 9px; border-radius:6px; font-weight:500; white-space:nowrap; }
.cc-pill.sent { background:var(--cc-good-bg); color:var(--cc-good); }
.cc-pill.fail { background:var(--cc-bad-bg); color:var(--cc-bad); }
.cc-pill.warn { background:#f5f0e4; color:var(--cc-warn); }
.cc-pill.sending { background:#e9f1f5; color:var(--cc-accent); }
.cc-pill.mut { background:#f3f3f0; color:var(--cc-ink2); }
.cc-origin { font-size:11px; padding:2px 8px; border-radius:6px; font-weight:500;
  background:#f3f3f0; color:var(--cc-ink2); white-space:nowrap; }
.cc-import-note { font-size:11px; color:var(--cc-ink3); white-space:nowrap; }
/* Каскад «мессенджер→SMS» — фиолетовый бейдж, та же геометрия что .cc-origin. */
.cc-cascade { font-size:11px; padding:2px 8px; border-radius:6px; font-weight:600;
  background:#f3e8ff; color:#7c3aed; white-space:nowrap; }
.cc-when { margin-left:auto; font-size:12px; color:var(--cc-ink3); white-space:nowrap; }
.cc-text { font-size:13px; color:var(--cc-ink2); font-style:italic; padding-left:6px;
  margin-bottom:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cc-metrics { display:flex; gap:8px; padding-left:6px; flex-wrap:wrap; }
.cc-chip { background:#faf9f7; border:1px solid var(--cc-line); border-radius:9px;
  padding:7px 13px; min-width:78px; }
.cc-chip .k { font-size:10px; letter-spacing:.03em; text-transform:uppercase; color:var(--cc-ink3); }
.cc-chip .v { font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; margin-top:2px; color:var(--cc-ink); }
.cc-chip .v.good { color:var(--cc-good); } .cc-chip .v.bad { color:var(--cc-bad); } .cc-chip .v.mut { color:var(--cc-ink3); }
/* На узком мобайле чипы тянутся на всю ширину парами (не рвут вёрстку <390px) */
@media (max-width:480px){ .cc-chip { flex:1 1 calc(33% - 8px); min-width:0; text-align:center; } }
/* iPhone SE (320px): уплотняем карточку/чипы — анти-overflow (make check-overflow) */
@media (max-width:400px){
  .cc-card { padding:14px 14px 13px; }
  .cc-metrics { gap:6px; }
  .cc-chip { padding:6px 8px; }
  .cc-head { gap:7px; }
  /* Карточка v3: чипы-фильтры переносятся (не nowrap) + меньше паддинг → анти-overflow /campaigns@320. */
  .cc-filters { gap:5px; margin-top:10px; }
  .cc-fchip { padding:3px 8px; font-size:11px; white-space:normal; }
  .cc-badges { gap:6px; margin-top:7px; }
}
