/* CRM: сделки, клиенты, звонки и встречи. Только то, чего нет в app.css;
   цвета и шрифты — переменные кабинета. Десктоп-first, ниже — планшет и телефон. */

/* ---------- общее ---------- */
.page.crm-wide { max-width: none; padding: 22px 24px 24px; }
.crm-screen { display: flex; flex-direction: column; height: calc(100dvh - 60px - 46px); min-height: 440px; }
.crm-screen.as-list, body.has-side .crm-screen.as-list { height: auto; min-height: 0; }
/* с боковой панелью разделов верхней полосы нет — её высота достаётся доске */
@media (min-width: 641px) { body.has-side .crm-screen { height: calc(100dvh - 46px); } }
@media (min-width: 641px) and (max-width: 860px) { body.has-side .crm-screen { height: calc(100dvh - 36px); } }
#crm-main { flex: 1; min-height: 0; display: flex; flex-direction: column; transition: opacity .12s; }
#crm-main.crm-busy { opacity: .5; pointer-events: none; }
.crm-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-head h2 { font-family: var(--disp); font-weight: 600; font-size: 26px; letter-spacing: -.01em; }
.crm-head .spacer { flex: 1; }
.crm-head-acts { display: flex; gap: 10px; align-items: center; }
.crm-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.crm-dim { color: var(--ink-dim); }
.crm-faint { color: var(--ink-faint); }
/* файлы объекта: фильтр по источнику, пометка источника, маленькая копия фото */
.crm-file-src { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
/* [fields] вкладка группы полей amoCRM: значение без правки — текстом на высоте поля */
.crm-ro { min-height: 38px; display: flex; align-items: center; font-size: 14px; line-height: 1.35; color: var(--ink);
  overflow-wrap: anywhere; }
.crm-amo-fields { align-items: start; }
.crm-f-grp { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--ink-faint); }
.crm-amo-fields .crm-f .cpp-cb { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--ink); cursor: pointer; }
.crm-amo-fields .crm-f .cpp-cb input[type=checkbox] { width: 18px; height: 18px; flex: none; padding: 0; margin: 0;
  accent-color: var(--accent); cursor: pointer; }
.crm-file-from { color: var(--ink-dim); font-weight: 600; }
.crm-file-th { flex: none; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--bg-raise);
  border: 1px solid var(--line); }
.crm-file-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* [fields] ленту закрыло правило поля: видна только история этапов */
.crm-feed-closed { font-size: 12.5px; line-height: 1.45; padding: 0 0 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line, #E3E7ED); }
.crm-ic { display: inline-block; vertical-align: -.16em; flex: none; }

/* разделы CRM: сделки · клиенты · звонки и встречи */
.crm-sub { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--line-bright);
  border-radius: 10px; padding: 3px; }
.crm-sub a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  color: var(--ink-dim); padding: 6px 13px; border-radius: 7px; white-space: nowrap; }
.crm-sub a:hover { color: var(--ink); }
.crm-sub a.on { color: #fff; background: var(--accent); }
.crm-sub .n { font-family: var(--mono); font-size: 11px; font-weight: 700; background: var(--red); color: #fff;
  border-radius: 99px; padding: 0 6px; line-height: 17px; }

.crm-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card);
  border: 1px solid var(--line-bright); color: var(--ink-dim); border-radius: 9px; padding: 8px 13px;
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: color .15s, border-color .15s, background .15s; }
.crm-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.crm-btn.on { color: var(--accent); border-color: var(--accent); background: var(--client-soft); }
.crm-btn .n { font-family: var(--mono); font-size: 11px; background: var(--accent); color: #fff; border-radius: 99px;
  padding: 0 6px; line-height: 17px; }
.crm-btn.danger:hover { color: var(--red); border-color: var(--red); }
.crm-btn.icon { padding: 8px 10px; }
.crm-link { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 0; }
.crm-link:hover { text-decoration: underline; }

.crm-input, .crm-select { background: var(--bg-card); border: 1px solid var(--line-bright); border-radius: 9px;
  padding: 8px 12px; color: var(--ink); font-family: var(--body); font-size: 14px; outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s; }
.crm-input:focus, .crm-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,77,166,.13); }
.crm-search { position: relative; flex: 1 1 180px; max-width: 320px; min-width: 150px; }
.crm-search .crm-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-faint);
  pointer-events: none; }
.crm-search input { width: 100%; padding-left: 34px; height: 38px; }

.crm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.crm-toolbar .spacer { flex: 1; }
.crm-pipes { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--line-bright);
  border-radius: 10px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.crm-pipes::-webkit-scrollbar { display: none; }
.crm-pipes button { border: none; background: none; font-size: 13px; font-weight: 700; color: var(--ink-dim);
  padding: 6px 12px; border-radius: 7px; white-space: nowrap; }
.crm-pipes button.on { background: var(--navy); color: #fff; }
.crm-totals { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.crm-totals b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.crm-totals b.sum { color: var(--client); }
/* выбор воронки: кнопка с названием и числом сделок, по нажатию — список */
.crm-pp { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; height: 38px; padding: 0 10px 0 12px;
  background: var(--bg-card); border: 1px solid var(--line-bright); border-radius: 10px; color: var(--ink);
  font-size: 13.5px; font-weight: 700; transition: border-color .15s, box-shadow .15s; }
.crm-pp:hover { border-color: var(--ink-faint); }
.crm-pp[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,77,166,.13); }
.crm-pp .cap { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.crm-pp .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-pp .cnt { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-dim); background: var(--surface-sunken);
  border-radius: 99px; padding: 1px 9px; flex: none; }
.crm-pp > .crm-ic { color: var(--ink-faint); margin-left: auto; }

/* окошко у кнопки: список воронок, действия с этапом, набор цветов */
.crm-pop { position: absolute; z-index: 98; box-sizing: border-box; max-width: calc(100vw - 16px); max-height: min(70vh, 460px);
  overflow-y: auto; background: var(--bg-card); border: 1px solid var(--line-bright); border-radius: 12px; padding: 6px;
  box-shadow: 0 16px 40px rgba(16,24,40,.18); animation: fade .12s both; }
.crm-pop.colors { padding: 12px; width: 344px; }
.crm-mi { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none;
  border-radius: 8px; padding: 9px 10px; color: var(--ink); font-family: var(--body); font-size: 14px; font-weight: 600; cursor: pointer; }
.crm-mi:hover, .crm-mi:focus-visible { background: var(--surface-sunken); outline: none; }
.crm-mi:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.crm-mi.cur { color: var(--accent); }
.crm-mi.danger { color: var(--red); }
.crm-mi:disabled { color: var(--ink-faint); cursor: default; background: none; }
.crm-mi > .crm-ic { color: var(--ink-faint); }
.crm-mi.danger > .crm-ic { color: inherit; }
.crm-mi .lb { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.crm-mi .lb small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-dim); }
.crm-mi:disabled .lb small { color: var(--ink-faint); }
.crm-mi .hint { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-dim); background: var(--surface-sunken);
  border-radius: 99px; padding: 1px 9px; flex: none; }
.crm-mi .tick { color: var(--accent); flex: none; display: inline-flex; }
.crm-mi .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--sc); flex: none; }
.crm-mi-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.crm-mi-cap { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px 4px; }
/* то же самое в шторке на телефоне */
.crm-sheet .crm-pop-body.menu .crm-mi { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; margin-bottom: 6px; font-size: 15px; }
.crm-sheet .crm-pop-body.menu .crm-mi-sep { margin: 10px 0; }

/* наборы фильтров и включённые условия */
.crm-saved { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -2px 0 10px; }
.crm-saved .f { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-bright); background: var(--bg-card); border-radius: 99px; padding: 5px 12px;
  color: var(--ink-dim); white-space: nowrap; transition: color .12s, border-color .12s, background .12s; }
.crm-saved .f:hover { color: var(--ink); border-color: var(--ink-faint); }
.crm-saved .f.on { border-color: var(--accent); color: var(--accent); background: var(--client-soft); }
.crm-saved .f .crm-ic { color: var(--amber); fill: currentColor; }
.crm-saved .crm-link { margin-left: 6px; font-size: 12.5px; white-space: nowrap; }
.crm-active { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -2px 0 10px; }
.crm-active[hidden] { display: none; }
.crm-fchip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; font-size: 12.5px; font-weight: 600; color: var(--accent);
  background: var(--client-soft); border: 1px solid rgba(10,77,166,.3); border-radius: 8px; padding: 0 2px 0 10px; min-height: 28px; }
.crm-fchip button { border: none; background: none; color: inherit; opacity: .65; font-size: 17px; line-height: 1; width: 26px;
  height: 26px; border-radius: 6px; flex: none; }
.crm-fchip button:hover { opacity: 1; background: rgba(10,77,166,.1); }
.crm-active .crm-link { margin-left: 6px; font-size: 12.5px; }
.crm-hint { font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); margin: 8px 0 0; }
.crm-group > h4 + .crm-hint { margin: -4px 0 10px; }
.crm-frow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crm-frow .crm-select { flex: 1 1 180px; width: auto; }
.crm-chip { cursor: pointer; }
.crm-setrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.crm-setrow:last-child { border-bottom: none; }
.crm-setrow .star { width: 36px; height: 36px; flex: none; border: none; background: none; border-radius: 9px; color: var(--line-bright);
  display: grid; place-items: center; }
.crm-setrow .star:hover { background: var(--surface-sunken); color: var(--amber); }
.crm-setrow .star.on { color: var(--amber); }
.crm-setrow .star.on .crm-ic { fill: currentColor; }
.crm-setrow .nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.crm-setrow span.nm small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-dim); }
.crm-setrow .sh { flex: none; font-size: 13px; padding: 0; white-space: nowrap; }

/* ---------- доска ----------
   Листается целиком: вниз — все этапы разом, вбок — между этапами. Шапки колонок прилипают
   к верху, полоса прокрутки вбок всегда у нижнего края окна. */
.crm-stabs { display: none; }
/* Доска — серый лоток, этап — дорожка с лёгким оттенком своего цвета, сделка — белая карточка:
   три уровня заметно разные, карточки не сливаются ни с колонкой, ни друг с другом */
.crm-board { flex: 1; min-height: 0; overflow: auto; background: #E9EDF2; border: 1px solid var(--line);
  border-radius: 14px; overscroll-behavior: contain; }
.crm-board-in { display: flex; gap: 10px; width: max-content; min-width: 100%; min-height: 100%; padding: 10px;
  box-sizing: border-box; }
.crm-col { --lane: color-mix(in srgb, var(--sc, #98A2B3) 8%, #F5F7FA); flex: 0 0 276px; min-width: 0;
  display: flex; flex-direction: column; background: var(--lane); border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,.05); }
.crm-col:last-child { flex-grow: 1; }
.crm-col.off { display: none; }
.crm-col-head { position: sticky; top: 0; z-index: 2; flex: none; padding: 10px 12px 8px; background: var(--lane);
  border-radius: 12px 12px 0 0; }
/* полоска цвета этапа; бледному цвету ободок потемнее — иначе на светлой дорожке её не видно */
.crm-col-head::before { content: ""; display: block; height: 4px; border-radius: 99px; margin-bottom: 9px;
  background: var(--sc, var(--ink-faint)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sct, transparent) 30%, transparent); }
.crm-col-head .r1 { display: flex; align-items: center; gap: 8px; }
.crm-col-head .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--sc); flex: none; }
.crm-col-head .nm { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-col-head .cnt { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-dim);
  background: var(--bg-card); border-radius: 99px; padding: 1px 9px; box-shadow: 0 0 0 1px rgba(16,24,40,.06); }
.crm-col-head .add { border: none; background: none; color: var(--ink-faint); padding: 2px 4px; border-radius: 6px;
  font-size: 17px; line-height: 1; }
.crm-col-head .add:hover { color: var(--accent); background: var(--client-soft); }
.crm-col-head .sum { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; padding-left: 16px; min-height: 17px; }
.crm-col-body { flex: 1; padding: 2px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.crm-col.drop { --lane: var(--client-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.crm-col.drop .crm-col-head { background: var(--client-soft); }
.crm-col-empty { padding: 16px 8px; text-align: center; color: var(--ink-faint); font-size: 12px;
  border: 1px dashed color-mix(in srgb, var(--sct, #98A2B3) 30%, var(--line-bright)); border-radius: 10px; }
.crm-more { flex: none; border: 1px dashed var(--line-bright); background: rgba(255,255,255,.55); border-radius: 10px; color: var(--accent);
  font-family: var(--body); font-size: 12.5px; font-weight: 600; padding: 9px 8px; }
.crm-more:hover { border-color: var(--accent); background: var(--client-soft); }
/* доску тянут мышью: зажатым колесом или левой кнопкой за пустое место */
.crm-board.crm-panning, .fn-board.crm-panning { cursor: grabbing; user-select: none; -webkit-user-select: none; scroll-snap-type: none !important; }
.crm-board.crm-panning *, .fn-board.crm-panning * { cursor: grabbing !important; }
/* точка цвета этапа видна и на белом: у светлого цвета появляется ободок потемнее */
.crm-col-head .dot, .crm-opt .dot, .crm-chip .dot, .crm-stbtn .dot, .crm-stabs .dot, .crm-mi .dot {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sct, transparent) 55%, transparent); }

.crm-card { position: relative; display: block; flex: none; min-width: 0; background: var(--bg-card); border: 1px solid #DCE1E8;
  border-radius: 10px; padding: 11px 12px; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.07);
  transition: box-shadow .12s, border-color .12s, transform .12s; cursor: pointer; }
.crm-card:hover { border-color: var(--line-bright); box-shadow: 0 6px 16px rgba(16,24,40,.12); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .crm-card:hover { transform: none; } }
.crm-card.dragging { opacity: .45; }
.crm-card.late { border-left: 3px solid var(--red); padding-left: 9px; }
.crm-card .ttl { font-weight: 650; font-size: 13.5px; line-height: 1.35; padding-right: 26px; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-card .ttl:hover { color: var(--accent); }
.crm-card .who { font-size: 12px; color: var(--ink-dim); margin-top: 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.crm-card .adr { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.crm-card .foot { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; margin-top: 9px; padding-top: 8px;
  border-top: 1px solid var(--line); }
.crm-card .foot .todo-box { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.crm-card .sum { font-family: var(--mono); font-weight: 700; font-size: 12.5px; color: var(--client); white-space: nowrap; }
.crm-card .sum.zero { font-weight: 500; font-size: 11px; color: var(--ink-faint); }
.crm-card .num { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.crm-card .mv { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none; background: none;
  color: var(--ink-faint); border-radius: 7px; display: grid; place-items: center; opacity: 0; transition: opacity .12s; }
.crm-card:hover .mv, .crm-card .mv:focus-visible { opacity: 1; }
.crm-card .mv:hover { background: var(--surface-sunken); color: var(--accent); }
@media (hover: none) { .crm-card .mv { opacity: 1; } }

/* Цвет метки и этапа задаёт человек, он бывает почти белым. Сам цвет — в лёгкую заливку,
   текст и обводка — в тот же оттенок, затемнённый до читаемого (--tct / --sct считает crm.js). */
.crm-tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; white-space: nowrap;
  color: var(--tct, var(--tc, #667085)); background: var(--surface-sunken); border: 1px solid var(--line-bright);
  background: color-mix(in srgb, var(--tc, #667085) 14%, transparent);
  border-color: color-mix(in srgb, var(--tct, var(--tc, #667085)) 34%, transparent); }
.crm-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap;
  padding: 2px 10px; border-radius: 99px; color: var(--scf, var(--sct, #344054));
  background: var(--scb, var(--sc, #E4E7EC)); border: 1px solid transparent;
  border-color: color-mix(in srgb, var(--sct, #667085) 28%, transparent); }
.crm-ava { width: 22px; height: 22px; border-radius: 99px; background: var(--client-soft); color: var(--accent);
  font-size: 9.5px; font-weight: 800; display: inline-grid; place-items: center; flex: none; margin-left: -5px;
  border: 1.5px solid var(--bg-card); }
.crm-ava:first-child { margin-left: 0; }
.crm-ava.ext { background: var(--surface-sunken); color: var(--ink-dim); }
.crm-todo { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 10.5px;
  font-weight: 600; color: var(--ink-faint); white-space: nowrap; }
.crm-todo.late { color: #fff; background: var(--red); border-radius: 99px; padding: 0 7px; line-height: 17px; }
.crm-todo.none { color: var(--amber-deep); }
.crm-warn { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--amber-deep);
  background: rgba(224,138,0,.1); border: 1px solid rgba(224,138,0,.35); border-radius: 6px; padding: 1px 7px; }

/* ---------- список ---------- */
.crm-list { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.crm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crm-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-sunken);
  white-space: nowrap; }
.crm-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.crm-table tr:last-child td { border-bottom: none; }
.crm-table tbody tr { cursor: pointer; transition: background .1s; }
.crm-table tbody tr:hover { background: var(--bg-raise); }
.crm-table .r { text-align: right; }
.crm-table .t1 { font-weight: 600; color: var(--ink); }
.crm-table .t2 { font-size: 12px; color: var(--ink-faint); }
.crm-table a { color: inherit; }
.crm-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; font-size: 13px;
  color: var(--ink-faint); }
.crm-rows { display: none; }

/* ---------- шторка (выбор этапа, фильтры) ---------- */
.crm-veil { position: fixed; inset: 0; z-index: 96; background: rgba(0,21,61,.4); display: grid; place-items: center;
  padding: 20px; animation: fade .18s both; }
.crm-sheet { width: 100%; max-width: 480px; max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 24px 60px rgba(16,24,40,.2);
  animation: rise .25s both; }
.crm-sheet.wide { max-width: 620px; }
.crm-sheet-title { font-family: var(--disp); font-weight: 600; font-size: 18px; margin-bottom: 4px; display: flex;
  align-items: center; gap: 10px; }
.crm-sheet-title .x { margin-left: auto; border: none; background: none; color: var(--ink-faint); font-size: 22px; line-height: 1; padding: 0 4px; }
.crm-sheet-sub { color: var(--ink-dim); font-size: 13px; margin-bottom: 14px; }
.crm-sheet .sec { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin: 16px 0 8px; }
.crm-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 6px; color: var(--ink);
  font-size: 14px; font-weight: 600; transition: border-color .12s, background .12s; }
.crm-opt:hover { border-color: var(--accent); }
.crm-opt.cur { background: var(--surface-sunken); border-color: var(--line-bright); }
.crm-opt .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--sc, var(--ink-faint)); flex: none; }
.crm-opt .hint { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink-faint); }
.crm-sheet .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.crm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-chip { border: 1px solid var(--line-bright); background: var(--bg-card); color: var(--ink-dim); font-size: 12.5px;
  font-weight: 600; border-radius: 99px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; }
.crm-chip.on { border-color: var(--accent); background: var(--client-soft); color: var(--accent); }
.crm-chip .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--sc, var(--ink-faint)); }
.crm-check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink); padding: 5px 0; cursor: pointer; }
.crm-check input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.crm-lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 5px; }
.modal .crm-input, .modal .crm-select, .crm-sheet .crm-input, .crm-sheet .crm-select { width: 100%; background: var(--bg);
  padding: 11px 13px; border-radius: 10px; }
.modal textarea.crm-input, .crm-sheet textarea.crm-input { resize: vertical; min-height: 74px; line-height: 1.45; }
.modal .crm-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .crm-seg, .crm-sheet .crm-seg { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line-bright);
  border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.crm-seg button { flex: 1; border: none; background: none; font-size: 13px; font-weight: 700; color: var(--ink-dim);
  padding: 8px 6px; border-radius: 7px; }
.crm-seg button.on { background: var(--accent); color: #fff; }

/* ---------- карточка сделки ---------- */
.crm-deal-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-deal-head .main { flex: 1 1 380px; min-width: 0; }
.crm-deal-head .crumb { color: var(--ink-faint); font-size: 13px; margin-bottom: 4px; }
.crm-deal-head .crumb a { color: var(--ink-dim); }
.crm-title { width: 100%; font-family: var(--disp); font-weight: 600; font-size: 26px; letter-spacing: -.01em;
  color: var(--ink); border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 2px 8px;
  margin-left: -9px; outline: none; display: block; resize: none; overflow: hidden; line-height: 1.2; }
.page textarea.crm-title { min-height: 0; }   /* на телефоне у полей-абзацев своя высота, названию она не нужна */
.crm-title:hover { border-color: var(--line-bright); }
.crm-title:focus { border-color: var(--accent); background: var(--bg-card); }
.crm-deal-head .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px;
  color: var(--ink-dim); }
.crm-stbtn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-bright);
  border-color: color-mix(in srgb, var(--sct, var(--sc)) 45%, transparent);
  background: color-mix(in srgb, var(--sc) 12%, var(--bg-card)); color: var(--ink); font-weight: 700; font-size: 14px;
  border-radius: 10px; padding: 9px 14px; }
.crm-stbtn .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--sc); flex: none; }
.crm-stbtn:hover { border-color: var(--sct, var(--sc)); }

.crm-steps { display: flex; gap: 3px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.crm-steps::-webkit-scrollbar { display: none; }
.crm-steps button { flex: 1 1 0; min-width: 84px; border: none; background: var(--line); color: var(--ink-dim);
  font-size: 11.5px; font-weight: 700; padding: 7px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: filter .12s, background .12s; }
.crm-steps button:first-child { border-radius: 8px 0 0 8px; }
.crm-steps button:last-child { border-radius: 0 8px 8px 0; }
.crm-steps button.done { background: color-mix(in srgb, var(--sc) 30%, var(--bg-card)); color: var(--ink); }
/* текущий шаг залит цветом этапа: на светлой заливке текст тёмный, на тёмной — белый (--scf) */
.crm-steps button.cur { background: var(--scb, var(--sc)); color: var(--scf, #fff); }
.crm-steps button:hover { filter: brightness(.95); }
.crm-steps button:disabled { opacity: 1; cursor: default; filter: none; }

.crm-money { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.crm-money .m { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.crm-money .m span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); }
.crm-money .m b { display: block; font-family: var(--mono); font-size: 18px; font-weight: 700; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-money .m small { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.crm-money .m.main b { color: var(--client); }
.crm-money .m.paid b { color: var(--margin); }

.crm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
/* ноутбук: лента чуть уже — карточке хватает места на навигацию слева и поля в две колонки */
@media (min-width: 1101px) and (max-width: 1360px) { .crm-cols { grid-template-columns: minmax(0, 1fr) 320px; } }
/* широкий монитор: ленте — чуть просторнее */
@media (min-width: 1700px) { .crm-cols { grid-template-columns: minmax(0, 1fr) 420px; } }
.crm-panel { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; }
.crm-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto;
  scrollbar-width: none; }
.crm-tabs::-webkit-scrollbar { display: none; }
.crm-tabs button { border: none; background: none; font-size: 13.5px; font-weight: 700; color: var(--ink-dim);
  padding: 9px 13px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.crm-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.crm-tabs button .n { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-left: 4px; }
.crm-tabs button .n.late { color: #fff; background: var(--red); border-radius: 99px; padding: 0 6px; }
.crm-tabs .only-narrow { display: none; }
.crm-tab-body { padding: 16px 18px 18px; }

/* ---------- карточка сделки: навигация слева ----------
   разделы сделки, всё по объекту (ссылками на экраны проекта) и группы полей amoCRM */
.crm-dcard { container: dcard / inline-size; }
.crm-dcard-in { display: grid; grid-template-columns: 196px minmax(0, 1fr); align-items: start; }
.crm-cnav { align-self: stretch; min-width: 0; border-right: 1px solid var(--line); padding: 10px 8px 16px; }
.crm-cnav-pick { display: none; }
/* список едет вместе с прокруткой длинного «Основного»; не помещается по высоте — листается сам */
.crm-cnav-list { position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; }
.crm-cnav-sec { display: flex; flex-direction: column; gap: 1px; }
.crm-cnav-sec + .crm-cnav-sec { margin-top: 14px; }
.crm-cnav-h { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  padding: 4px 10px 5px; }
.crm-cnav-h .nc { text-transform: none; letter-spacing: .02em; }
.crm-cnav-i { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0;
  border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.25;
  text-align: left; text-decoration: none; cursor: pointer; }
.crm-cnav-i .l { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-cnav-i .v, .crm-cnav-i .n { flex: none; font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink-faint);
  margin: 0; }
.crm-cnav-i .n.late, .crm-cnav-i .late { color: #fff; background: var(--red); border-radius: 99px; padding: 0 6px; line-height: 17px; }
.crm-cnav-i:hover { background: var(--surface-sunken); color: var(--ink); }
.crm-cnav-i.on, .crm-cnav-i.on:hover { background: var(--navy, #0F1E36); color: #fff; }
.crm-cnav-i.on .v, .crm-cnav-i.on .n { color: rgba(255,255,255,.78); }
.crm-cnav-i.go { font-weight: 500; }
.crm-cnav-i.cta .v { font-family: var(--body); font-size: 12.5px; font-weight: 700; color: var(--accent); }
.crm-cnav-i.off { color: var(--ink-faint); cursor: default; }
.crm-cnav-i.off:hover { background: none; color: var(--ink-faint); }
.crm-cnav-q.crm-input { height: 34px; margin: 2px 0 6px; padding: 0 10px; font-size: 13.5px; }
.crm-cnav-more { border: 0; background: none; padding: 6px 10px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--accent); text-align: left; cursor: pointer; }
.crm-cnav-more:hover { text-decoration: underline; }
.crm-cnav-empty { display: flex; flex-direction: column; gap: 1px; }
/* название группы amoCRM бывает длинным — в две строки, а не обрывом */
.crm-cnav-i[data-t^="amo:"] .l { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow-wrap: anywhere; }
.crm-cnav-empty .crm-cnav-i { color: var(--ink-dim); font-weight: 500; }
.crm-cnav-empty .crm-cnav-i.on { color: #fff; }
.crm-cnav .only-narrow { display: none; }
/* [card-layout] подгруппы полей amoCRM: свой заголовок, линия между подгруппами, колонки по выбору */
.crm-tab-body { container: dtab / inline-size; }
.crm-fsub + .crm-fsub { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.crm-fsub > h5 { margin: 0 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); }
.crm-fsub > .crm-fields + .crm-stages, .crm-fsub > .crm-stages + .crm-fields { margin-top: 12px; }
.crm-fields.c1 { grid-template-columns: minmax(0, 1fr); }
.crm-fields.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crm-fields.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crm-fields.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* этапы строками: слева номер, справа одни и те же поля в одном порядке — колонки совпадают */
.crm-stage { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 14px; align-items: start; padding: 10px 0;
  border-top: 1px dashed var(--line); }
.crm-stage:first-child { border-top: 0; padding-top: 0; }
.crm-stage-n { padding-top: 27px; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.crm-stage .crm-fields { grid-template-columns: repeat(auto-fill, minmax(max(128px, calc((100% - (var(--k) - 1) * 14px) / var(--k))), 1fr)); }
.crm-gap { visibility: hidden; }
@container dtab (max-width: 620px) {
  .crm-fields.c3, .crm-fields.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container dtab (max-width: 460px) {
  .crm-fields.c2, .crm-fields.c3, .crm-fields.c4 { grid-template-columns: minmax(0, 1fr); }
  .crm-stage { grid-template-columns: minmax(0, 1fr); }
  .crm-stage-n { padding-top: 0; margin-bottom: 6px; }
  .crm-gap { display: none; }
}
.crm-amo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crm-linkbtn { margin-left: 10px; border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--accent); cursor: pointer; }
.crm-linkbtn:hover { text-decoration: underline; }
.crm-btn.main { background: var(--accent); border-color: var(--accent); color: #fff; }
.crm-btn.main:hover { background: var(--navy, #0F1E36); border-color: var(--navy, #0F1E36); color: #fff; }

/* [card-layout] редактор расположения */
.crm-lay { display: flex; flex-direction: column; gap: 12px; }
.crm-lay-top h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.crm-lay-note { font-size: 13px; line-height: 1.5; color: var(--ink-dim); max-width: 760px; }
.crm-lay-secs { display: flex; flex-direction: column; gap: 10px; }
.crm-lay-sec { border: 1px solid var(--line-bright); border-radius: 12px; background: var(--bg-card); }
.crm-lay-sec.hid { border-style: dashed; background: var(--surface-sunken); }
.crm-lay-sh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.crm-lay-sh .sp { flex: 1 1 auto; }
.crm-lay-sh b { font-size: 13.5px; color: var(--ink); }
.crm-lay-sh .crm-faint { font-size: 12.5px; }
.crm-lay-title.crm-input { flex: 1 1 220px; min-width: 0; height: 36px; padding: 0 10px; font-size: 14px; font-weight: 600; }
.crm-lay-cols.crm-input { flex: 0 0 auto; width: auto; height: 36px; padding: 0 8px; font-size: 13px; }
.crm-lay-sh .crm-btn { padding: 6px 10px; font-size: 12.5px; }
.crm-lay-items { display: flex; flex-wrap: wrap; gap: 6px; min-height: 52px; padding: 10px 12px; align-content: flex-start; }
.crm-lay-items:empty::before { content: 'Перетащите сюда поля'; align-self: center; font-size: 12.5px; color: var(--ink-faint); }
.crm-lay-chip { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line-bright); background: var(--bg-card); font-size: 13px; font-weight: 600; color: var(--ink);
  cursor: grab; user-select: none; }
.crm-lay-chip .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-lay-chip .t { flex: none; font-size: 11px; font-weight: 500; color: var(--ink-faint); }
.crm-lay-chip:hover { border-color: var(--accent); }
.crm-lay-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.crm-lay-chip.drag { opacity: .45; }
.crm-lay-chip.picked { border-color: var(--accent); background: var(--client-soft); box-shadow: 0 0 0 2px var(--accent); }
.crm-lay-foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
/* группа полей amoCRM: название и «Все / Заполненные / Пустые» */
.crm-amo-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.crm-amo-top h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.crm-amo-show { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-bright); border-radius: 10px;
  background: var(--bg); }
.crm-amo-show button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--ink-dim); cursor: pointer; white-space: nowrap; }
.crm-amo-show button .n { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.crm-amo-show button.on { background: var(--bg-card); color: var(--ink); box-shadow: 0 1px 2px rgba(16,36,61,.12); }
/* узкая карточка (телефон, планшет, ноутбук с лентой справа): кнопка «все разделы», список раскрывается под ней */
@container dcard (max-width: 640px) {
  .crm-dcard-in { grid-template-columns: minmax(0, 1fr); }
  .crm-cnav { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .crm-cnav-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 42px;
    padding: 6px 12px; border: 1px solid var(--line-bright); border-radius: 10px; background: var(--bg-card); color: var(--ink);
    font: inherit; font-size: 14.5px; font-weight: 700; text-align: left; cursor: pointer; }
  .crm-cnav-pick .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crm-cnav-pick .h { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600;
    color: var(--ink-faint); }
  .crm-cnav-pick[aria-expanded="true"] .h svg { transform: rotate(180deg); }
  .crm-cnav-list { position: static; display: none; max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 2px; }
  .crm-cnav-list.open { display: block; }
  .crm-cnav-i { min-height: 40px; }
}
.crm-side { position: sticky; top: 76px; }
.crm-side-title { font-size: 14px; font-weight: 700; color: var(--ink); padding: 13px 16px 12px;
  border-bottom: 1px solid var(--line); }
.crm-side .crm-feed { padding: 14px 14px 16px; max-height: calc(100dvh - 150px); overflow-y: auto; }

.crm-group { margin-bottom: 20px; }
.crm-group:last-child { margin-bottom: 0; }
.crm-group > h4 { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 10px; }
.crm-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; }
.crm-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.crm-f.w2 { grid-column: span 2; }
.crm-f.full { grid-column: 1 / -1; }
.crm-f > span { font-size: 12px; color: var(--ink-dim); }
.crm-f input, .crm-f select, .crm-f textarea { width: 100%; background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; color: var(--ink); font-family: var(--body); font-size: 14px; outline: none;
  min-width: 0; transition: border-color .15s, background .15s, box-shadow .15s; }
.crm-f textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.crm-f input:hover, .crm-f select:hover, .crm-f textarea:hover { border-color: var(--line-bright); }
.crm-f input:focus, .crm-f select:focus, .crm-f textarea:focus { border-color: var(--accent); background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(10,77,166,.12); }
.crm-f input:disabled, .crm-f select:disabled, .crm-f textarea:disabled { opacity: 1; color: var(--ink); background: transparent;
  border-color: transparent; padding-left: 0; -webkit-text-fill-color: var(--ink); }
.crm-f.mono input { font-family: var(--mono); }
.crm-f.saved::after { content: "сохранено"; position: absolute; right: 2px; top: 1px; font-size: 10.5px; font-weight: 700;
  color: var(--green); animation: fade .2s both; }
.crm-f.err input, .crm-f.err select, .crm-f.err textarea { border-color: var(--red); }
.crm-flags { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.crm-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 13px; }
.crm-kv dt { color: var(--ink-faint); }
.crm-kv dd { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.crm-tagedit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-tagedit .crm-tag { font-size: 12px; padding: 3px 4px 3px 9px; display: inline-flex; align-items: center; gap: 3px; }
.crm-tagedit .crm-tag button { border: none; background: none; color: inherit; opacity: .6; font-size: 14px; line-height: 1; padding: 0 3px; }
.crm-tagedit .crm-tag button:hover { opacity: 1; }
.crm-tagedit input { width: 150px; background: var(--surface-sunken); border: 1px dashed var(--line-bright); border-radius: 7px;
  padding: 5px 9px; font-size: 13px; font-family: var(--body); outline: none; }
.crm-tagedit input:focus { border-style: solid; border-color: var(--accent); }

/* клиенты сделки, дела, файлы — общие строки */
.crm-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.crm-row:last-child { border-bottom: none; }
.crm-row .body { flex: 1; min-width: 0; }
.crm-row .nm { font-weight: 600; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.crm-row .nm a { color: inherit; }
.crm-row .nm a:hover { color: var(--accent); }
.crm-row .sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.crm-row .sub a { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.crm-row .sub a[href^="tel:"] { white-space: nowrap; }
.crm-row .sub > * { min-width: 0; }
.crm-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.crm-row .acts .crm-btn { padding: 6px 10px; font-size: 12.5px; }
.crm-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  border: 1px solid rgba(10,77,166,.35); background: var(--client-soft); border-radius: 5px; padding: 1px 6px; }
.crm-kind { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--client-soft); color: var(--accent); }
/* значок задачи — цвета её типа (справочник «Типы задач»); просрочено, сделано, отменено — поверх */
.crm-kind[style] { color: var(--sct, var(--accent)); background: var(--client-soft);
  background: color-mix(in srgb, var(--sc, var(--accent)) 13%, var(--bg-card)); }
.crm-kind.late { background: rgba(217,45,32,.1); color: var(--red); }
.crm-kind.done { background: var(--margin-soft); color: var(--margin); }
.crm-kind.cancelled { background: var(--surface-sunken); color: var(--ink-faint); }
.crm-when { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.crm-when.late { color: var(--red); }
.crm-row.muted .nm { color: var(--ink-dim); font-weight: 500; }
.crm-row.cancelled .nm { text-decoration: line-through; }
.crm-result { font-size: 13px; color: var(--ink); background: var(--surface-sunken); border-radius: 8px; padding: 6px 10px;
  margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-addbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

/* лента */
.crm-compose { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.crm-compose textarea { width: 100%; min-height: 62px; resize: vertical; background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: var(--body); font-size: 14px;
  color: var(--ink); outline: none; line-height: 1.45; }
.crm-compose textarea:focus { border-color: var(--accent); background: var(--bg-card); }
.crm-compose .btn-amber { align-self: flex-end; padding: 8px 16px; font-size: 13px; }
/* Лента: комментарий — облачко рядом с аватаром автора; история (этапы, служебное, звонки) — короткая
   строка со значком, без облачка; дни разделены подписью */
.crm-evs { display: flex; flex-direction: column; gap: 14px; }
.crm-ev { font-size: 13.5px; min-width: 0; }
.crm-ev .h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-faint); margin-bottom: 5px; min-width: 0; }
.crm-ev .h b { color: var(--ink); font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-ev .h .t { margin-left: auto; font-family: var(--mono); font-size: 11px; white-space: nowrap; flex: none; }
.crm-ev .h .vb { white-space: nowrap; }
.crm-ev .av { width: 24px; height: 24px; border-radius: 99px; flex: none; display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 800; background: var(--client-soft); color: var(--accent); }
.crm-ev .av.ic { background: var(--bg-card); color: var(--ink-dim); box-shadow: inset 0 0 0 1px var(--line-bright); }
.crm-ev .src { flex: none; font-size: 10.5px; font-weight: 700; color: var(--ink-dim); background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; line-height: 16px; }
.crm-ev.cm .txt { margin-left: 32px; padding: 9px 12px; background: #F3F5F8; border: 1px solid var(--line);
  border-radius: 3px 12px 12px 12px; line-height: 1.5; }
.crm-ev.status .txt, .crm-ev.sys .txt { margin-left: 32px; }
.crm-ev .txt.clamp { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.crm-ev .more { margin: 4px 0 0 32px; }
.crm-fday { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.crm-fday::before, .crm-fday::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.crm-ev .h button { border: none; background: none; color: var(--ink-faint); font-size: 14px; line-height: 1; padding: 0 2px; }
.crm-ev .h button:hover { color: var(--red); }
.crm-ev .txt { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.crm-ev.sys .txt, .crm-ev.status .txt { color: var(--ink-dim); font-size: 13px; }
.crm-ev .mv { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-faint); }
.crm-ev .why { color: var(--red); font-weight: 600; }

/* файлы */
.crm-drop { border: 1px dashed var(--line-bright); border-radius: 11px; padding: 14px; text-align: center; color: var(--ink-dim);
  font-size: 13px; margin-bottom: 8px; cursor: pointer; transition: border-color .12s, background .12s; }
.crm-drop:hover, .crm-drop.over { border-color: var(--accent); background: var(--client-soft); color: var(--accent); }
.crm-file-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-sunken); color: var(--ink-dim);
  display: grid; place-items: center; flex: none; font-size: 9.5px; font-weight: 800; font-family: var(--mono); text-transform: uppercase; }
.crm-file-ic.photo { background: var(--margin-soft); color: var(--margin); }
.crm-file-ic.video { background: var(--master-soft); color: var(--violet); }

/* ---------- клиенты ---------- */
.crm-client-ava { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--navy)); }
.crm-client-ava.company { background: linear-gradient(135deg, #6941C6, #42307D); }
.crm-client-ava.ip { background: linear-gradient(135deg, #1F9D57, #14653A); }
.crm-client-ava.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 18px; }
.crm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.crm-phone-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.crm-phone-row input { min-width: 0; }
.crm-phone-row .p { flex: 1.3; }
.crm-phone-row .l { flex: 1; }
.crm-phone-row button { flex: none; border: none; background: none; color: var(--ink-faint); font-size: 18px; padding: 0 4px; }
.crm-phone-row button:hover { color: var(--red); }
.crm-dup { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.crm-dup label { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.crm-dup input { margin-top: 3px; accent-color: var(--accent); }

/* ---------- звонки и встречи ---------- */
.crm-day { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  padding: 16px 18px 6px; display: flex; align-items: center; gap: 10px; }
.crm-day.late { color: var(--red); }
.crm-day .n { font-family: var(--mono); font-weight: 600; letter-spacing: 0; }
.crm-plan .crm-row { padding: 12px 18px; }

/* ---------- настройки воронок ---------- */
.crm-set { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.crm-set-cap { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  margin: 2px 0 8px 4px; }
.crm-set-panel { padding: 18px 20px; scroll-margin-top: 70px; }
.crm-set-top { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.crm-set-name { flex: 1 1 260px; min-width: 0; display: block; }
.crm-set-top .crm-f { flex: 0 1 200px; }
.crm-ttl-in { display: block; width: 100%; font-family: var(--disp); font-weight: 600; font-size: 21px; letter-spacing: -.01em;
  color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 3px 8px; margin-left: -9px;
  outline: none; text-overflow: ellipsis; transition: border-color .15s, background .15s; }
.crm-ttl-in:hover { border-color: var(--line-bright); }
.crm-ttl-in:focus { border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(10,77,166,.12); }
.crm-set-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding-top: 14px; margin-top: 20px; }
.crm-set-foot .crm-faint { font-size: 12.5px; flex: 1 1 260px; }
.crm-set-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 600; color: var(--amber-deep);
  background: rgba(224,138,0,.09); border: 1px solid rgba(224,138,0,.35); border-radius: 10px; padding: 9px 12px; margin: 0 0 10px; }
.crm-set-warn .crm-ic { margin-top: 2px; }
.crm-set-empty { border: 1px dashed var(--line-bright); border-radius: 11px; padding: 18px; text-align: center; color: var(--ink-dim);
  font-size: 13.5px; }
.crm-addrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.crm-addrow .crm-input { flex: 1 1 220px; }
.crm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* список, строки которого перетаскивают за ручку */
.crm-sort { position: relative; display: flex; flex-direction: column; gap: 6px; }
.crm-sort.sorting > [data-id] { transition: transform .16s cubic-bezier(.2,.8,.2,1); }
.crm-sort > [data-id].drag { position: relative; z-index: 3; transition: none; box-shadow: 0 12px 28px rgba(16,24,40,.2);
  border-color: var(--accent); background: var(--bg-card); }
.crm-slot { position: absolute; left: 0; right: 0; border: 2px dashed var(--accent); border-radius: 11px;
  background: var(--client-soft); pointer-events: none; z-index: 0; }
.crm-grip { flex: none; width: 30px; height: 34px; display: grid; place-items: center; border: none; background: none; border-radius: 8px;
  color: var(--ink-faint); cursor: grab; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.crm-grip:hover { color: var(--ink-dim); background: var(--surface-sunken); }
.crm-grip:focus-visible { outline: none; color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.crm-grip .crm-ic { fill: currentColor; }
body.crm-sorting { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.crm-sorting * { cursor: grabbing !important; }

/* воронки */
.crm-prow { display: flex; align-items: center; gap: 2px; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 11px; padding: 3px 4px; }
.crm-prow.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.crm-prow .pick { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: left; border: none; background: none;
  border-radius: 8px; padding: 6px 8px; color: var(--ink); font-family: var(--body); }
.crm-prow .pick:hover { background: var(--surface-sunken); }
.crm-prow .pick .nm { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-prow .pick .sub { font-size: 12px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-prow.on .pick .nm { color: var(--accent); }

/* этапы */
.crm-strow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 11px; padding: 4px 6px; }
.crm-strow.fresh { animation: crm-fresh 1.6s ease-out both; }
@keyframes crm-fresh { from { background: var(--client-soft); border-color: var(--accent); } }
.crm-strow .sw { width: 26px; height: 26px; border-radius: 99px; border: 3px solid var(--bg-card); background: var(--sc); flex: none; padding: 0;
  box-shadow: 0 0 0 1px var(--line-bright); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sct, var(--line-bright)) 55%, var(--line-bright)); }
.crm-strow .sw:hover, .crm-strow .sw[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }
.crm-strow .mid { flex: 1 1 150px; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-strow input.nm { flex: 1 1 130px; min-width: 0; border: 1px solid transparent; background: none; font-size: 14px; font-weight: 600;
  font-family: var(--body); color: var(--ink); padding: 6px 8px; border-radius: 8px; outline: none; text-overflow: ellipsis; }
.crm-strow input.nm:hover { border-color: var(--line-bright); }
.crm-strow input.nm:focus { border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(10,77,166,.12); }
.crm-strow .cnt { flex: none; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-dim); background: var(--surface-sunken);
  border-radius: 99px; padding: 1px 9px; }
.crm-strow .more { flex: none; width: 32px; height: 34px; border: none; background: none; border-radius: 8px; color: var(--ink-faint);
  display: grid; place-items: center; }
.crm-strow .more:hover, .crm-strow .more[aria-expanded="true"] { background: var(--surface-sunken); color: var(--ink); }
.crm-strow .more .crm-ic { fill: currentColor; }
.crm-strow .reasons { flex: 1 1 100%; padding: 2px 6px 8px 38px; }
.crm-strow .reasons textarea { width: 100%; min-height: 84px; }
.crm-strow .reasons .crm-hint { margin: 0 0 6px; }
.crm-kindb { flex: none; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.crm-kindb.won { color: var(--margin); background: var(--margin-soft); border: 1px solid rgba(26,125,73,.3); }
.crm-kindb.lost { color: #B42318; background: rgba(217,45,32,.07); border: 1px solid rgba(217,45,32,.28); }
.crm-kindb.first { color: var(--ink-dim); background: var(--surface-sunken); border: 1px solid var(--line-bright); }
.crm-kindb.amo { color: var(--accent); background: var(--client-soft); border: 1px solid rgba(10,77,166,.28); }

/* типы задач: выбор в форме, кнопки в карточках, окно «Типы задач» */
.crm-kic { display: inline-flex; color: var(--sct, currentColor); }
.crm-types .crm-chip { padding: 6px 12px; }
.crm-types .crm-chip.on { color: var(--sct, var(--accent)); border-color: var(--sct, var(--accent));
  background: var(--client-soft); background: color-mix(in srgb, var(--sc, var(--accent)) 12%, var(--bg-card)); }
.crm-ttrow .tt-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; border: none; display: grid; place-items: center;
  color: var(--sct, var(--accent)); background: var(--client-soft); background: color-mix(in srgb, var(--sc, var(--accent)) 14%, var(--bg-card)); }
.crm-ttrow .tt-ic:not(:disabled):hover, .crm-ttrow .tt-ic[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }
.crm-ttrow .tt-ic:disabled { opacity: 1; cursor: default; }
.crm-ttrow.off .mid input.nm { color: var(--ink-faint); }
.crm-ttrow.off .tt-ic { filter: grayscale(1); opacity: .6; }
.crm-ttrow input.nm:disabled { opacity: 1; -webkit-text-fill-color: var(--ink); }
.crm-iconset { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.crm-iconset button { height: 34px; min-width: 0; border-radius: 9px; border: 1px solid var(--line-bright); background: var(--bg-card);
  color: var(--ink-dim); display: grid; place-items: center; cursor: pointer; }
.crm-iconset button:hover, .crm-iconset button:focus-visible { border-color: var(--ink-faint); color: var(--ink); outline: none; }
.crm-iconset button.on { border-color: var(--accent); color: var(--accent); background: var(--client-soft); box-shadow: 0 0 0 1px var(--accent); }
.crm-ttamo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.crm-ttamo .crm-hint { margin: 0; flex: 1 1 260px; }
.crm-sheet .crm-set-warn { margin-top: 10px; }

/* набор цветов */
.crm-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.crm-palette button { height: 34px; min-width: 0; border-radius: 10px; border: 3px solid var(--bg-card); background: var(--sc); padding: 0;
  box-shadow: 0 0 0 1px var(--line-bright); cursor: pointer; }
.crm-palette button:hover, .crm-palette button:focus-visible { box-shadow: 0 0 0 2px var(--ink-faint); outline: none; }
.crm-palette button.on { box-shadow: 0 0 0 2px var(--ink); }
.crm-own { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.crm-own input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line-bright); border-radius: 8px; background: none; cursor: pointer; }
.crm-own.on input[type=color] { box-shadow: 0 0 0 2px var(--ink); }


/* ============ планшет ============ */
@media (max-width: 1100px) {
  .crm-cols { grid-template-columns: minmax(0, 1fr); }
  .crm-side { display: none; }
  .crm-tabs .only-narrow { display: inline-block; }
  .crm-cnav .only-narrow { display: flex; }
  .crm-set { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .page.crm-wide { padding: 16px 16px 20px; }
  .crm-screen { height: calc(100dvh - 60px - 36px); }
  .crm-col { flex-basis: 262px; }
  .crm-two { grid-template-columns: minmax(0, 1fr); }
  .crm-money { grid-template-columns: repeat(2, 1fr); }
  /* итог в две строки — умещается рядом с поиском и фильтрами */
  .crm-totals { text-align: right; font-size: 12px; line-height: 1.35; white-space: normal; }
  .crm-totals .sep { display: none; }
  .crm-totals .sum { display: block; }
}

/* ============ телефон ============ */
@media (max-width: 640px) {
  .page.crm-wide { padding: 12px 12px 56px; }
  .crm-screen { height: auto; min-height: 0; display: block; }
  .crm-head { gap: 10px; margin-bottom: 10px; }
  .crm-head h2 { font-size: 21px; }
  .crm-sub { order: 5; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .crm-sub::-webkit-scrollbar { display: none; }
  .crm-sub a { flex: 1; justify-content: center; padding: 8px 10px; }
  .crm-toolbar { gap: 8px; }
  .crm-search { flex: 1 1 100%; max-width: none; order: -1; }
  .crm-search input { height: 42px; font-size: 16px; }
  .crm-toolbar .spacer { display: none; }
  #cl-type, #pl-range { flex: 1 1 100%; }
  .crm-pp { flex: 1 1 100%; height: 44px; font-size: 15px; }
  .crm-active { margin-bottom: 8px; }
  .crm-fchip { min-height: 36px; }
  .crm-fchip button { width: 32px; height: 34px; }
  .crm-saved .f { padding: 8px 13px; }
  .crm-saved .crm-link { flex: none; padding: 8px 4px; }
  #cl-type button, #pl-range button { flex: 1; }
  .crm-pipes button { padding: 8px 12px; }
  .crm-totals { flex: 1 1 0; min-width: 0; }
  .crm-saved { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -2px -12px 10px; padding: 0 12px; }
  .crm-saved::-webkit-scrollbar { display: none; }
  .crm-saved .f { flex: none; }
  .crm-btn { padding: 9px 13px; }

  /* доска: этапы — лентой сверху, на экране одна колонка во всю ширину, листается страницей */
  .crm-stabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 2px 12px;
    position: sticky; top: 54px; z-index: 5; background: var(--bg); }
  .crm-stabs::-webkit-scrollbar { display: none; }
  .crm-stabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-bright);
    background: var(--bg-card); color: var(--ink-dim); font-size: 13px; font-weight: 700; border-radius: 99px; padding: 8px 13px; }
  .crm-stabs button .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--sc); }
  .crm-stabs button .n { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink-faint); }
  .crm-stabs button.on { border-color: var(--sct, var(--sc)); color: var(--ink); background: color-mix(in srgb, var(--sc) 12%, var(--bg-card)); }
  .crm-board { display: block; overflow: visible; background: none; border: none; box-shadow: none; border-radius: 0; }
  .crm-board-in { display: block; width: auto; min-width: 0; min-height: 0; padding: 0; }
  .crm-col { display: none; border: none; background: none; box-shadow: none; border-radius: 0; }
  .crm-col-head::before { display: none; }
  .crm-col.on { display: block; }
  .crm-col-head { position: static; padding: 0 2px 8px; border-top: none; border-bottom: none; background: none; }
  .crm-more { width: 100%; padding: 12px 8px; font-size: 13.5px; }
  .crm-col-head .nm, .crm-col-head .dot, .crm-col-head .cnt { display: none; }
  .crm-col-head .sum { padding-left: 0; margin-top: 0; font-size: 12.5px; }
  .crm-col-head .r1 { float: right; }
  .crm-col-head .add { font-size: 13px; font-weight: 700; color: var(--accent); }
  .crm-col-head .add::after { content: " сделка"; }
  .crm-col-body { padding: 0; gap: 9px; }
  .crm-card { padding: 12px 13px; border-radius: 12px; }
  .crm-card .ttl { font-size: 14.5px; padding-right: 34px; }
  .crm-card .who { font-size: 13px; }
  .crm-card .adr { font-size: 12.5px; }
  .crm-card .sum { font-size: 14px; }
  .crm-card .mv { width: 36px; height: 36px; top: 5px; right: 4px; }

  /* список: строки-карточки вместо таблицы */
  .crm-list { background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; }
  .crm-table { display: none !important; }
  .crm-rows { display: flex; flex-direction: column; gap: 9px; }
  .crm-rows .crm-card .st { margin-top: 7px; }

  /* шторка выезжает снизу */
  .crm-veil { place-items: end center; padding: 0; }
  .crm-sheet, .crm-sheet.wide { max-width: none; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-b, env(safe-area-inset-bottom)));
    max-height: 88dvh; animation: crm-up .24s cubic-bezier(.2,.9,.3,1) both; }
  .crm-opt { padding: 14px; font-size: 15px; }
  .crm-sheet .acts { flex-direction: column-reverse; }
  .crm-sheet .acts > * { width: 100%; justify-content: center; }
  .crm-grid2, .modal .crm-f2 { grid-template-columns: 1fr; }
  .modal .crm-input, .modal .crm-select, .crm-sheet .crm-input, .crm-sheet .crm-select { font-size: 16px; }

  /* карточка сделки */
  .crm-title { font-size: 21px; margin-left: -7px; padding: 2px 6px; }
  .crm-deal-head { gap: 10px; }
  .crm-deal-head .main { flex: 1 1 0; }
  .crm-deal-head > .btn-amber { flex: 1 1 100%; }
  .crm-head-acts { flex: 1 1 100%; }
  .crm-head-acts > * { flex: 1; justify-content: center; }
  /* карточка клиента: сначала сделки и дела, потом анкета */
  .crm-two > .crm-panel:last-child { order: -1; }
  .crm-phone-row { flex-wrap: wrap; }
  .crm-phone-row .p { flex: 1 1 0; }
  .crm-phone-row .l { order: 5; flex: 1 1 100%; }
  .crm-stbtn { width: 100%; justify-content: flex-start; padding: 12px 14px; }
  .crm-stbtn .chev { margin-left: auto; }
  .crm-steps { display: none; }
  .crm-money { gap: 8px; }
  .crm-money .m { padding: 10px 12px; }
  .crm-money .m b { font-size: 15.5px; }
  .crm-deal-head .meta #cd-st { display: none; }
  .crm-tab-body { padding: 14px 13px 16px; }
  .crm-cnav-q.crm-input { font-size: 16px; height: 40px; }
  .crm-tabs button { padding: 11px 12px 12px; }
  .crm-fields { grid-template-columns: 1fr 1fr; gap: 10px; }
  .crm-f.w2 { grid-column: 1 / -1; }
  .crm-f input, .crm-f select, .crm-f textarea { font-size: 16px; padding: 10px 11px; }
  .crm-row { flex-wrap: wrap; }
  .crm-row .acts { width: 100%; justify-content: flex-start; padding-left: 45px; }
  .crm-row .acts .crm-btn { padding: 8px 10px; font-size: 12.5px; }
  .crm-plan .crm-row { padding: 12px 13px; }
  .crm-day { padding: 14px 13px 4px; }
  .crm-compose textarea { font-size: 16px; }
  /* настройки воронок */
  .crm-set-panel { padding: 14px 12px; }
  .crm-ttl-in { font-size: 19px; }
  .crm-set-top .crm-f { flex: 1 1 100%; }
  .crm-strow { padding: 4px; gap: 4px; }
  .crm-strow .reasons { padding-left: 6px; }
  .crm-addrow .crm-btn { flex: 1 1 100%; justify-content: center; }
  .crm-set-foot .crm-btn { flex: 1 1 100%; justify-content: center; }
  .crm-sheet .crm-pop-body.colors .crm-palette { gap: 10px; }
  .crm-setrow { flex-wrap: wrap; }
  .crm-setrow .nm { flex: 1 1 60%; }
}
@media (min-width: 641px) { .crm-stbtn { display: none; } }
@keyframes crm-up { from { transform: translateY(40px); opacity: 0; } }

/* Планшет и другие сенсорные экраны шире телефона: кнопки под палец, а не под курсор */
@media (pointer: coarse) {
  .crm-grip { width: 40px; height: 40px; }
  .crm-ttrow .tt-ic { width: 40px; height: 40px; }
  .crm-iconset button { height: 38px; }
  .crm-addbar .crm-btn { min-height: 40px; }
  .crm-strow .sw { width: 36px; height: 36px; border-width: 5px; }
  .crm-strow .more { width: 40px; height: 40px; }
  .crm-prow .pick { min-height: 44px; justify-content: center; }
  .crm-mi { min-height: 44px; }
  .crm-palette button { min-height: 36px; }
  .crm-pop.colors { width: 384px; }
  .crm-own input[type=color] { width: 48px; height: 40px; }
  .crm-saved .f { min-height: 36px; }
  .crm-fchip { min-height: 36px; }
  .crm-fchip button { width: 32px; height: 34px; }
  .crm-more { min-height: 40px; }
  .crm-setrow .star { width: 40px; height: 40px; }
  /* на сенсорном экране колонка доски встаёт ровно при листании вбок */
  .crm-board { scroll-snap-type: x proximity; }
  .crm-col { scroll-snap-align: start; }
}
@media (pointer: coarse) and (min-width: 641px) {
  .crm-pipes button { min-height: 40px; padding-left: 14px; padding-right: 14px; }
  .crm-pp { height: 42px; }
  .crm-col-head .add, .crm-card .mv { min-width: 36px; min-height: 36px; }
  .crm-btn { min-height: 40px; }
  .crm-st { min-height: 34px; }
  .crm-steps button { min-height: 40px; }
  .crm-phone-row button { min-width: 36px; min-height: 36px; }
  .crm-link { padding-top: 8px; padding-bottom: 8px; }
}
