/* Мессенджеры: переписка в карточке, экран «Чаты», экран подключения. Только то, чего нет
   в app.css и crm.css; цвета и шрифты — переменные кабинета. Сначала компьютер, ниже —
   планшет и телефон (на телефоне открытая переписка занимает весь экран, поле ввода стоит
   над клавиатурой по --vvh/--vvt из app.js). */

.ac-ic { display: inline-block; vertical-align: -.16em; flex: none; }

/* ---------- мелкие части ---------- */
.ac-type { display: inline-block; width: 9px; height: 9px; border-radius: 99px; background: var(--ink-faint);
  flex: none; margin-right: 6px; vertical-align: .02em; }
.ac-type.ac-wa { background: #25A55B; }
.ac-type.ac-tg { background: #2F8FD8; }
.ac-type.ac-ig { background: linear-gradient(135deg, #F7A23B, #D6336C 55%, #7B3FD1); }
.ac-type.ac-mx { background: #6941C6; }
.ac-type.lg { width: 38px; height: 38px; border-radius: 12px; margin: 0; }

.ac-ava { position: relative; width: 40px; height: 40px; border-radius: 99px; flex: none; display: grid;
  place-items: center; background: var(--client-soft); color: var(--accent); font-weight: 700; font-size: 14px;
  overflow: hidden; letter-spacing: -.01em; }
.ac-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* значок непрочитанного на карточке сделки и в строке списка */
.ac-badge { display: inline-flex; align-items: center; gap: 3px; background: #1F9D57; color: #fff; border-radius: 99px;
  padding: 0 7px 0 6px; line-height: 17px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; }
.ac-badge[hidden] { display: none; }
.ac-badge i { font-style: normal; }
.crm-table .ac-badge { margin-left: 6px; vertical-align: 1px; }

.ac-hint { border: 1px dashed var(--line-bright); border-radius: 14px; padding: 28px 22px; text-align: center;
  color: var(--ink-dim); font-size: 14px; line-height: 1.55; }
.ac-hint b { color: var(--ink); }
.ac-hint > div { margin-top: 14px; }
.ac-hint .btn-amber { display: inline-block; }
.ac-hint.flat { border: none; padding: 14px 4px; text-align: left; }
.ac-load { padding: 40px 16px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }
.ac-fine { font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; margin-top: 10px; }
.ac-strip { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; line-height: 1.45; margin-bottom: 12px;
  background: #FFF6E5; color: #7A4B00; border: 1px solid #F3D9A4; }
.ac-strip.bad { background: #FEF1F0; color: #99231A; border-color: #F6C9C5; }
.ac-strip .crm-link { margin-left: 6px; }

/* ---------- переписка ---------- */
.ac-switch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ac-switch .crm-chip b { font-family: var(--mono); font-size: 11px; color: #fff; background: #1F9D57; border-radius: 99px;
  padding: 0 6px; line-height: 16px; }
.ac-switch .crm-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }

.ac-chat { position: relative; display: flex; flex-direction: column; height: min(64vh, 640px); min-height: 380px;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ac-chat-head { display: flex; align-items: center; gap: 11px; padding: 10px 14px; background: var(--bg-card);
  border-bottom: 1px solid var(--line); flex: none; min-width: 0; }
.ac-chat-head .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ac-chat-head .who b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-chat-head .who b a { color: inherit; }
.ac-chat-head .who b a:hover { color: var(--accent); }
.ac-chat-head .who span { font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-deal { display: inline-flex; align-items: center; gap: 6px; max-width: 40%; font-size: 12.5px; font-weight: 600;
  color: var(--ink-dim); border: 1px solid var(--line-bright); border-radius: 9px; padding: 6px 10px; flex: none; }
.ac-deal span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-deal:hover { color: var(--accent); border-color: var(--accent); }
.ac-chat .ac-back { display: none; }
.ac-note { padding: 8px 14px; font-size: 12.5px; line-height: 1.45; background: var(--surface-sunken);
  color: var(--ink-dim); border-bottom: 1px solid var(--line); }
.ac-note.warn { background: #FFF6E5; color: #7A4B00; }
.ac-note a { font-weight: 700; color: inherit; text-decoration: underline; }

.ac-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 10px; display: flex; flex-direction: column;
  gap: 5px; overscroll-behavior: contain; scrollbar-width: thin; outline: none; }
.ac-empty { margin: auto; color: var(--ink-faint); font-size: 13.5px; }
.ac-more { align-self: center; 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: 6px 14px; margin-bottom: 6px; }
.ac-day { align-self: center; margin: 8px 0 4px; }
.ac-day span { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 99px; padding: 2px 11px; }
.ac-msg { display: flex; flex-direction: column; max-width: min(78%, 540px); align-self: flex-start; align-items: flex-start; }
.ac-msg.out { align-self: flex-end; align-items: flex-end; }
.ac-bubble { background: var(--bg-card); border: 1px solid var(--line); border-radius: 15px 15px 15px 5px;
  padding: 8px 12px 5px; font-size: 14.5px; line-height: 1.42; min-width: 74px; max-width: 100%; }
.ac-msg.out .ac-bubble { background: #E4EEFB; border-color: #CADCF5; border-radius: 15px 15px 5px 15px; }
.ac-msg.failed .ac-bubble { background: #FEF1F0; border-color: #F6C9C5; }
.ac-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ac-text a { color: var(--accent); text-decoration: underline; }
.ac-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 2px;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.ac-meta .who { font-family: var(--body); font-size: 11px; margin-right: auto; padding-right: 8px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ac-tick { display: inline-flex; color: var(--ink-faint); }
.ac-tick.read { color: var(--accent); }
.ac-tick.failed { color: var(--red); }
.ac-fail { font-size: 12px; color: var(--red); margin-top: 3px; text-align: right; line-height: 1.4; max-width: 100%; }
.ac-fail .acts { display: inline-flex; gap: 12px; margin-left: 8px; }
.ac-fail button { border: none; background: none; color: var(--accent); font-weight: 700; font-size: 12px; padding: 0; }
.ac-img { display: block; margin: -2px -6px 5px; border-radius: 11px; overflow: hidden; background: var(--surface-sunken); }
.ac-img img { display: block; max-width: 100%; max-height: 300px; min-height: 60px; min-width: 120px; object-fit: cover; }
.ac-audio { display: block; width: 240px; max-width: 100%; height: 38px; margin-bottom: 4px; }
.ac-file { display: flex; align-items: center; gap: 9px; color: var(--ink); margin-bottom: 4px; min-width: 0; }
.ac-file > .ac-ic { color: var(--accent); }
.ac-file span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ac-file b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.ac-file small { font-size: 11.5px; color: var(--ink-faint); }
.ac-file.off { opacity: .7; }
.ac-newpill { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 2; border: none;
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700; border-radius: 99px; padding: 7px 14px;
  box-shadow: 0 6px 18px rgba(16,24,40,.22); display: inline-flex; align-items: center; gap: 5px; }
.ac-newpill[hidden] { display: none; }

.ac-attach { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--bg-card);
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-dim); flex: none; }
.ac-attach[hidden] { display: none; }
.ac-attach span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-attach b { color: var(--ink); font-weight: 600; }
.ac-attach button { border: none; background: none; color: var(--ink-faint); width: 32px; height: 32px; display: grid;
  place-items: center; border-radius: 8px; }
.ac-compose { display: flex; align-items: flex-end; gap: 4px; padding: 8px; background: var(--bg-card);
  border-top: 1px solid var(--line); flex: none; }
.ac-compose textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line-bright); border-radius: 13px;
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.35;
  padding: 10px 13px; min-height: 44px; max-height: 132px; outline: none; margin: 0 4px; }
.ac-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,77,166,.12); }
.ac-ibtn { width: 44px; height: 44px; border: none; background: none; border-radius: 12px; color: var(--ink-dim);
  display: grid; place-items: center; flex: none; }
.ac-ibtn:hover { background: var(--surface-sunken); color: var(--accent); }
.ac-send { width: 44px; height: 44px; border: none; border-radius: 13px; background: var(--accent); color: #fff;
  display: grid; place-items: center; flex: none; }
.ac-send:hover { background: var(--navy); }
.ac-readonly { padding: 12px 14px; font-size: 13px; color: var(--ink-faint); text-align: center; background: var(--bg-card);
  border-top: 1px solid var(--line); flex: none; }

.ac-tpl { align-items: flex-start; }
.ac-tpl span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ac-tpl small { font-weight: 400; font-size: 12.5px; color: var(--ink-dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- строка переписки ---------- */
.ac-rows { display: flex; flex-direction: column; }
.ac-row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: none; background: none;
  padding: 10px 12px; border-radius: 12px; color: var(--ink); min-height: 64px; }
.ac-row:hover { background: var(--surface-sunken); }
.ac-row.on { background: var(--client-soft); }
.ac-row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ac-row .r1, .ac-row .r2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ac-row .r1 b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-row.waiting .r1 b { font-weight: 800; }
.ac-row time { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); flex: none; }
.ac-row .txt { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-row.waiting .txt { color: var(--ink); }
.ac-row .n { font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff; background: #1F9D57;
  border-radius: 99px; min-width: 19px; text-align: center; padding: 0 6px; line-height: 19px; flex: none; }
.ac-row .wait { width: 9px; height: 9px; border-radius: 99px; background: var(--amber); flex: none; }
.ac-row .r3 { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-row .r3.none { font-style: italic; }

/* ---------- экран «Чаты» ---------- */
.ac-screen { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; height: calc(100dvh - 46px); min-height: 440px; }
.ac-list-pane { display: flex; flex-direction: column; min-height: 0; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 8px 8px; }
.ac-list-pane .crm-head { padding: 0 8px; margin-bottom: 10px; }
.ac-list-pane .crm-head h2 { font-size: 22px; }
.ac-search { flex: none; margin: 0 8px 10px; min-width: 0; }
.ac-search .ac-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-faint);
  pointer-events: none; }
.ac-filters { flex: none; padding: 0 8px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ac-filters::-webkit-scrollbar { display: none; }
.ac-filters .crm-chip { white-space: nowrap; flex: none; }
.ac-filters .crm-chip b { font-family: var(--mono); font-size: 11px; }
.ac-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.ac-chat-pane { min-width: 0; min-height: 0; display: flex; }
.ac-chat-pane > .ac-chat { flex: 1; height: auto; min-height: 0; border-radius: 14px; }
.ac-pane-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--ink-faint); font-size: 14px; border: 1px dashed var(--line-bright); border-radius: 14px; }

/* ---------- экран подключения ---------- */
.ac-lead { color: var(--ink-dim); font-size: 14.5px; max-width: 720px; margin: -6px 0 18px; line-height: 1.5; }
.ac-sec { padding: 18px 20px; margin-bottom: 16px; }
.ac-sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ac-sec-head h3 { font-family: var(--disp); font-weight: 600; font-size: 17px; flex: 1; }
.ac-sec-head .btn-amber { display: inline-flex; align-items: center; gap: 6px; }
.ac-ch { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ac-ch .body { flex: 1 1 220px; min-width: 0; }
.ac-ch .nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ac-ch .sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 2px; }
.ac-ch .sub.err { color: var(--red); }
.ac-ch .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-state { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 99px;
  padding: 2px 9px; background: var(--surface-sunken); color: var(--ink-dim); white-space: nowrap; }
.ac-state.ok { background: var(--margin-soft); color: var(--margin); }
.ac-state.wait { background: #FFF6E5; color: #8A5800; }
.ac-state.bad { background: #FEF1F0; color: #B42318; }
.ac-memo { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; font-size: 13.5px; color: var(--ink-dim); }
.ac-memo summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 28px; }
.ac-memo ul { margin: 8px 0 0 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.ac-memo b { color: var(--ink); }
.ac-money { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.ac-money > div { display: flex; flex-direction: column; gap: 2px; }
.ac-money span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.ac-money b { font-family: var(--mono); font-size: 21px; font-weight: 700; }
.ac-money .go { margin-left: auto; }
.ac-journal { display: flex; flex-direction: column; }
.ac-jrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ac-jrow time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.ac-jrow b { font-weight: 600; display: block; }
.ac-jrow span { color: var(--ink-dim); font-size: 12.5px; overflow-wrap: anywhere; }
.ac-jrow i { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--margin); white-space: nowrap; }
.ac-jrow.ignored i { color: var(--ink-faint); }
.ac-jrow.error i, .ac-jrow.rejected i { color: var(--red); }
.ac-jrow.error span { color: #99231A; }

.ac-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; margin-bottom: 16px; }
.ac-types button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  border: 1px solid var(--line-bright); background: var(--bg-card); border-radius: 12px; padding: 12px; color: var(--ink); min-height: 96px; }
.ac-types button.on { border-color: var(--accent); background: var(--client-soft); box-shadow: 0 0 0 2px rgba(10,77,166,.14); }
.ac-types button:disabled { opacity: .55; }
.ac-types b { font-size: 14px; }
.ac-types small { font-size: 11.5px; color: var(--ink-faint); }
.ac-qr { display: grid; place-items: center; min-height: 256px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px; }
.ac-qr img { width: 240px; height: 240px; image-rendering: pixelated; border-radius: 6px; background: #fff; }
.ac-steps { text-align: center; font-size: 13.5px; color: var(--ink-dim); margin-top: 12px; line-height: 1.5; }
.ac-code { text-align: center; font-family: var(--mono); font-size: 34px; font-weight: 700; letter-spacing: .08em;
  padding: 28px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.ac-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 10px; color: var(--margin); text-align: center; }
.ac-done b { color: var(--ink); font-size: 17px; }
.ac-done span { color: var(--ink-dim); font-size: 13.5px; }

/* ---------- планшет: одна колонка — либо список, либо переписка ---------- */
@media (max-width: 1100px) {
  .ac-screen { grid-template-columns: 300px minmax(0, 1fr); height: calc(100dvh - 36px); }
}
@media (max-width: 860px) {
  .ac-screen { grid-template-columns: minmax(0, 1fr); }
  .ac-screen .ac-chat-pane { display: none; }
  .ac-screen.has-open .ac-list-pane { display: none; }
  .ac-screen.has-open .ac-chat-pane { display: flex; }
  .ac-chat.full .ac-back { display: grid; margin-left: -8px; }
  .ac-deal { max-width: 34%; }
}

/* ---------- телефон ---------- */
@media (max-width: 640px) {
  .ac-screen { display: block; height: auto; min-height: 0; }
  .ac-list-pane { background: none; border: none; border-radius: 0; padding: 0; }
  .ac-list-pane .crm-head, .ac-search, .ac-filters { padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
  .ac-list { overflow: visible; margin: 0 -8px; }
  .ac-row { padding: 11px 10px; min-height: 68px; }
  .ac-filters .crm-chip { padding: 9px 14px; font-size: 13.5px; min-height: 44px; }
  .ac-list-pane .crm-head .crm-btn.icon { min-width: 44px; min-height: 44px; justify-content: center; }
  .ac-switch .crm-chip, .ac-rows + div .crm-btn { min-height: 44px; }
  .ac-search { order: 0; flex: none; }
  .ac-search input { height: 44px; font-size: 16px; }

  /* открытая переписка — на весь видимый экран, поверх верхней и нижней панелей;
     высота = видимая область, поэтому поле ввода всегда стоит прямо над клавиатурой */
  .ac-screen.has-open .ac-chat-pane { position: fixed; z-index: 70; left: 0; right: 0; top: var(--vvt, 0px);
    height: var(--vvh, 100dvh); background: var(--bg); }
  .ac-chat-pane > .ac-chat { border: none; border-radius: 0; }
  .ac-chat.full .ac-chat-head { padding: calc(6px + var(--safe-t)) 10px 6px 8px; gap: 8px; }
  .ac-chat.full .ac-back { margin-left: -2px; color: var(--accent); }
  .ac-chat.full .ac-chat-head .who b a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .ac-chat.full .ac-compose { padding-bottom: calc(8px + var(--safe-b)); }
  body.kb-open .ac-chat.full .ac-compose { padding-bottom: 8px; }
  body.kb-open .ac-chat.full .ac-chat-head { padding-top: 6px; }
  .ac-chat.full .ac-readonly { padding-bottom: calc(12px + var(--safe-b)); }
  body:has(.ac-screen.has-open) { overflow: hidden; }
  /* подсказки не должны закрывать поле ввода — показываем их под шапкой переписки */
  body:has(.ac-screen.has-open) .toast { top: calc(var(--vvt, 0px) + var(--safe-t) + 64px); bottom: auto !important; }
  .ac-deal { padding: 0; width: 44px; height: 44px; justify-content: center; border-radius: 12px; }
  .ac-deal span { display: none; }
  .page .ac-compose textarea { min-height: 44px; }  /* общий минимум высоты полей телефона здесь лишний */
  .ac-msgs { padding: 12px 10px 8px; }
  .ac-msg { max-width: 86%; }
  .ac-bubble { font-size: 15.5px; }
  .ac-fail button { min-height: 32px; padding: 0 2px; font-size: 13px; }
  .ac-more { min-height: 40px; }

  .ac-rows { margin: 0 -6px; }
  .ac-hint { padding: 22px 14px; }
  .ac-sec { padding: 16px 14px; }
  .ac-ch .acts { width: 100%; }
  .ac-ch .acts > * { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .ac-sec-head .btn-amber, .ac-sec-head .crm-btn { min-height: 44px; }
  .ac-money { gap: 16px 24px; }
  .ac-money .go { margin-left: 0; width: 100%; }
  .ac-money .go .crm-btn { width: 100%; justify-content: center; min-height: 44px; }
  .ac-jrow { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .ac-jrow time { grid-column: 1 / -1; }
  .ac-types { grid-template-columns: 1fr 1fr; }
  .ac-code { font-size: 28px; }
  #ac-set .crm-fields { grid-template-columns: 1fr; }
  #ac-set .crm-fields select { font-size: 16px; min-height: 44px; }
  .ac-memo summary { min-height: 44px; display: flex; align-items: center; gap: 6px; }
  .ac-memo summary::before { content: "▸"; }
  .ac-memo[open] summary::before { content: "▾"; }
}

/* тарифы каналов, способы оплаты, последние пополнения */
.ac-money small { font-size: 11.5px; color: var(--ink-faint); }
.ac-plans-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ac-plan-i { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-sunken); }
.ac-plan-i b { font-size: 14px; color: var(--ink); }
.ac-plan-i span { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.ac-plan-i small { font-size: 12px; color: var(--ink-faint); }
.ac-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.ac-plans button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line-bright); border-radius: 10px; background: var(--bg-card); font: inherit; color: var(--ink); cursor: pointer; }
.ac-plans button b { font-size: 14px; }
.ac-plans button span { font-family: var(--mono); font-size: 13px; }
.ac-plans button small { font-size: 12px; color: var(--ink-faint); }
.ac-plans button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--client-soft); }
.ac-pmethods { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; margin: 12px 0 14px; border: 1px solid var(--line-bright);
  border-radius: 10px; background: var(--bg); }
.ac-pmethods button { flex: 1 1 auto; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--ink-dim); cursor: pointer; white-space: nowrap; }
.ac-pmethods button.on { background: var(--bg-card); color: var(--ink); box-shadow: 0 1px 2px rgba(16,36,61,.12); }
.ac-pmethods button:disabled { cursor: default; }
.ac-req { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 4px 0 10px; font-size: 13.5px; }
.ac-req > div { display: contents; }
.ac-req span { color: var(--ink-faint); }
.ac-req b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.ac-pays { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ac-pays-h { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.ac-pay { display: grid; grid-template-columns: 90px 110px minmax(0, 1fr) auto auto; align-items: baseline; gap: 4px 12px; padding: 6px 0;
  font-size: 13.5px; border-bottom: 1px solid var(--line); }
.ac-pay:last-child { border-bottom: 0; }
.ac-pay time { color: var(--ink-faint); font-family: var(--mono); font-size: 12.5px; }
.ac-pay b { font-family: var(--mono); }
.ac-pay span { color: var(--ink-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-pay i { font-style: normal; font-size: 12.5px; color: var(--ink-faint); }
.ac-pay i.paid { color: var(--green, #1E8E5A); }
.ac-pay i.canceled { color: var(--red); }
@media (max-width: 640px) {
  .ac-pay { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ac-pay span { grid-column: 1 / 3; grid-row: 2; }
  .ac-pay em, .ac-pay .crm-link { grid-column: 3; grid-row: 2; justify-self: end; }
}

/* «Как это работает»: живой пример, снимки, как пользоваться */
.ac-how { container: achow / inline-size; }
/* свёрнутые заголовки: сам блок, его пункты и каждый сценарий; знак раскрытия — шеврон справа */
details.ac-how { padding: 0; }
.ac-how summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ac-how summary::-webkit-details-marker { display: none; }
.ac-how summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.ac-how details[open] > summary::after, details.ac-how[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.ac-how > summary { padding: 16px 20px; font-family: var(--disp); font-weight: 600; font-size: 17px; color: var(--ink); }
.ac-how-in { padding: 0 20px 18px; }
.ac-fold { border-top: 1px solid var(--line); }
.ac-fold > summary { padding: 13px 0; font-size: 14.5px; font-weight: 700; color: var(--ink); min-height: 24px; }
.ac-fold > summary:hover, .ac-use > summary:hover { color: var(--accent); }
.ac-fold[open] > summary { padding-bottom: 12px; }
.ac-fold > .ac-demo, .ac-fold > .ac-shots, .ac-fold > .ac-uses { margin-bottom: 16px; }
.ac-fold > .ac-demo-cap { margin: -4px 2px 16px; }
.ac-use > summary { padding: 8px 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.ac-use > p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }
.ac-how-lead { margin: 0 0 12px; max-width: 820px; font-size: 14.5px; line-height: 1.55; color: var(--ink-dim); }
.ac-demo { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.ph-label { margin: 0 0 6px 2px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.ac-demo-ph .ph-screen { display: flex; flex-direction: column; height: 400px; border: 1px solid var(--line-bright); border-radius: 26px;
  background: var(--surface-sunken); overflow: hidden; box-shadow: 0 8px 24px rgba(16,36,61,.08); }
.ph-top { display: flex; align-items: center; gap: 9px; padding: 12px 14px; background: var(--bg-card); border-bottom: 1px solid var(--line); }
.ph-top .ac-ava { width: 32px; height: 32px; font-size: 11.5px; }
.ph-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ph-who b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-who small { font-size: 11.5px; color: var(--ink-faint); }
.ph-msgs { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 10px; }
.ph-b { max-width: 86%; padding: 7px 10px 5px; border-radius: 13px; font-size: 12.5px; line-height: 1.4; background: var(--bg-card);
  border: 1px solid var(--line); align-self: flex-start; animation: ac-pop .28s ease-out; }
.ph-b.me { align-self: flex-end; background: #E7F6E1; border-color: #CFE9C4; color: #14181F; }
.ph-b time { display: block; text-align: right; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 1px; }
.ph-typing { align-self: flex-end; display: inline-flex; gap: 4px; padding: 9px 11px; border-radius: 13px; background: #E7F6E1; }
.ph-typing i { width: 6px; height: 6px; border-radius: 99px; background: #6E9B62; animation: ac-dot 1s infinite ease-in-out; }
.ph-typing i:nth-child(2) { animation-delay: .15s; }
.ph-typing i:nth-child(3) { animation-delay: .3s; }
.ph-bar { margin: 8px; padding: 9px 12px; border-radius: 99px; background: var(--bg-card); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-faint); }
.ac-demo-crm .cw { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 400px; border: 1px solid var(--line-bright);
  border-radius: 14px; background: var(--bg-card); overflow: hidden; box-shadow: 0 8px 24px rgba(16,36,61,.08); }
.cw-list { border-right: 1px solid var(--line); overflow: hidden; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.cw-list .ac-row { padding: 8px; border-radius: 10px; }
.cw-list .ac-row .ac-ava { width: 34px; height: 34px; font-size: 12px; }
.cw-list .ac-row.new { animation: ac-pop .3s ease-out; }
.cw-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-sunken); }
.cw-head { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 8px 12px; background: var(--bg-card); border-bottom: 1px solid var(--line); }
.cw-head:empty { visibility: hidden; }
.cw-head .ac-ava { width: 32px; height: 32px; font-size: 11.5px; }
.cw-head .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.cw-head .who b { font-size: 13.5px; }
.cw-head .who small { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-deal { flex: none; max-width: 48%; padding: 5px 9px; border: 1px solid var(--line-bright); border-radius: 9px; font-size: 11.5px;
  color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: ac-pop .3s ease-out; }
.cw-msgs { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; }
.cw-msgs .ac-msg { max-width: 86%; animation: ac-pop .28s ease-out; }
.cw-msgs .ac-bubble { font-size: 12.5px; padding: 7px 10px 5px; }
.cw-empty { margin: auto; font-size: 12.5px; color: var(--ink-faint); }
.cw-compose { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--bg-card); border-top: 1px solid var(--line); }
.cw-in { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line-bright); border-radius: 11px; background: var(--surface-sunken);
  font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; }
.cw-in.typed { color: var(--ink); white-space: normal; max-height: 3.2em; overflow: hidden; }
.cw-send { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; }
.ac-demo-cap { min-height: 1.6em; margin: 12px 2px 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.ac-shots { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 16px 18px; align-items: start; }
.ac-shots figure { margin: 0; }
.ac-shots a { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-card);
  box-shadow: 0 4px 14px rgba(16,36,61,.06); }
.ac-shots figure.ph a { border-radius: 20px; }
.ac-shots img { display: block; width: 100%; height: auto; }
.ac-shots figcaption { margin-top: 7px; font-size: 13px; line-height: 1.45; color: var(--ink-dim); }
.ac-uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 28px; align-items: start; }
@keyframes ac-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes ac-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@container achow (max-width: 760px) {
  .ac-demo { grid-template-columns: minmax(0, 1fr); }
  .ac-demo-ph { max-width: 320px; }
  .ac-demo-ph .ph-screen { height: 300px; }
  .ac-demo-crm .cw { grid-template-columns: minmax(0, 1fr); height: 360px; }
  .cw-list { display: none; }
  .ac-shots { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ac-shots figure.wide { grid-column: 1 / -1; }
  .ac-uses { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ph-b, .cw-msgs .ac-msg, .cw-list .ac-row.new, .cw-deal { animation: none; }
  .ph-typing i { animation: none; }
}
