/* Чат поддержки (support-chat.js) и строка «Ответы готовит ИИ» внизу страницы.
   Цвета — токены темы (style.css), как у меню аккаунта. Минимально: без логотипа, подсказок и мелких надписей. */

/* ── строка про ИИ ── */
.ai-note { margin: 8px 0 0; text-align: center; font-size: 11.5px; line-height: 1.4; color: var(--text-faint);
  letter-spacing: .01em; user-select: none; }
.input-wrapper.has-ai-note { padding-bottom: 12px; }
#homeView > .ai-note-page { flex: none; margin: 0; padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px)); }

/* ── кнопка: серый круг и жирный «?» — без слоёв, колец и логотипа (08.10.2026) ── */
.spc-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--text-muted); color: var(--bg-surface); cursor: pointer; font: inherit;
  transition: background .2s, transform .15s, opacity .2s; }
.spc-fab:hover { background: var(--text-secondary); }
.spc-fab:active { transform: scale(.94); }
.spc-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.spc-q { font-size: 21px; font-weight: 800; line-height: 1; transform: translateY(-.5px); }
/* 13.11.2026 Claude, по слову владельца: значок-сообщение на кнопке вместо «?». Откат — support-chat.css.bak-icon-20261113 */
.spc-ico { display: grid; place-items: center; }
.spc-ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transform: translateY(1px); }
.spc-ico .spc-ico-dots { stroke-width: 2.6; }
.spc-dot { position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg-page); transform: scale(0); transition: transform .2s; }
.spc-fab.unread .spc-dot { transform: scale(1); }
html.spc-open .spc-fab { opacity: 0; pointer-events: none; }

/* Надпись «Ваш личный ассистент» слева от кнопки (13.11.2026 Claude, по команде владельца;
   вид прежней «Нужна помощь?» из guided-tour.css, который больше не подключается). Откат — support-chat.css.bak-assist-20261113 */
.spc-nudge { position: fixed; right: 70px; top: 0; bottom: auto; z-index: 59; translate: 0 -50%;
  color: var(--text-secondary); background: transparent; font-family: var(--font-ui); font-size: 13px; font-weight: 400;
  line-height: 1.4; white-space: nowrap; opacity: 0; transform: translateX(20px); pointer-events: none;
  transition: opacity .28s ease-out, transform .32s cubic-bezier(.22,1,.36,1); }
.spc-nudge.show { opacity: 1; transform: translateX(0); }
html.spc-open .spc-nudge { opacity: 0; }
@media not all and (min-width: 1100px) { .spc-nudge { display: none; } }
@media (prefers-reduced-motion: reduce) { .spc-nudge { transition: none !important; } }

/* ── окно ── */
.spc { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  width: 370px; height: min(560px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .6); overflow: hidden;
  opacity: 0; transform: translateY(10px) scale(.96); transform-origin: calc(100% - 20px) calc(100% - 20px);
  pointer-events: none; visibility: hidden;
  transition: opacity .16s ease, transform .2s ease, visibility 0s linear .2s; }
.spc.on { opacity: 1; transform: none; pointer-events: auto; visibility: visible;
  transition: opacity .24s ease, transform .4s cubic-bezier(.16, 1, .3, 1), visibility 0s; }
.spc.drop { border-color: var(--text-secondary); }
.spc-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--border); }
.spc-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.spc-title strong { font-size: 15px; font-weight: 600; }
.spc-title span { font-size: 12px; color: var(--text-muted); }
.spc-x { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--text-muted); }
.spc-x:hover { background: var(--bg-hover); color: var(--text-primary); }
.spc-x:focus-visible { outline: 2px solid var(--accent); }
.spc-x svg, .spc-send svg, .spc-clip svg, .spc-thumb-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.spc-list { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 8px;
  overscroll-behavior: contain; }
.spc-msg { display: flex; max-width: 100%; animation: spc-in .3s cubic-bezier(.16, 1, .3, 1) both; }
.spc-mine { justify-content: flex-end; }
.spc-bub { display: flex; flex-direction: column; gap: 3px; max-width: 84%; padding: 8px 12px 6px; border-radius: 16px;
  font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.spc-theirs .spc-bub { background: var(--bg-elevated); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.spc-mine .spc-bub { background: var(--text-primary); color: var(--bg-surface); border-bottom-right-radius: 6px; }
.spc-bub-pics { padding: 4px 4px 4px; }
.spc-bub-pics .spc-time { padding: 0 6px 2px; }
.spc-text { white-space: pre-wrap; }
.spc-time { align-self: flex-end; font-size: 10.5px; opacity: .55; font-variant-numeric: tabular-nums; }
.spc-pics { display: flex; flex-wrap: wrap; gap: 4px; }
.spc-pic { display: block; border-radius: 12px; overflow: hidden; max-width: 220px; }
.spc-pic img { display: block; max-width: 100%; max-height: 200px; object-fit: cover; }
.spc-dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.spc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: spc-dot 1.2s ease-in-out infinite; }
.spc-dots i:nth-child(2) { animation-delay: .15s; } .spc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes spc-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes spc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.spc-foot { padding: 8px 12px 12px; border-top: 1px solid var(--border); }
.spc-tray { display: flex; gap: 6px; margin-bottom: 8px; }
.spc-tray[hidden] { display: none; }
.spc-thumb { position: relative; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); }
.spc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spc-thumb-x { all: unset; cursor: pointer; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .65); color: #fff; }
.spc-thumb-x svg { width: 11px; height: 11px; stroke-width: 2.4; }
.spc-compose { display: flex; align-items: flex-end; gap: 6px; padding: 5px 5px 5px 6px; border-radius: 16px;
  border: 1px solid var(--border-strong); background: var(--input-bg, var(--bg-elevated)); transition: border-color .15s; }
.spc-compose:focus-within { border-color: var(--text-faint); }
.spc-clip { all: unset; cursor: pointer; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--text-muted); }
.spc-clip:hover { color: var(--text-primary); background: var(--bg-hover); }
.spc-clip:focus-visible { outline: 2px solid var(--accent); }
.spc-input { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--text-primary);
  font: inherit; font-size: 14px; line-height: 1.45; padding: 7px 0; max-height: 140px; }
.spc-input::placeholder { color: var(--input-placeholder, var(--text-faint)); }
.spc-send { all: unset; cursor: pointer; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--text-primary); color: var(--bg-surface); transition: opacity .15s, transform .12s; }
.spc-send:disabled { opacity: .28; cursor: default; }
.spc-send:not(:disabled):active { transform: scale(.92); }
.spc-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spc-err { margin: 6px 4px 0; font-size: 12px; color: #e5484d; }
.spc-err:empty { display: none; }

/* Кнопка — только на широком экране: на телефоне справа внизу отправка сообщения,
   чат открывается из меню аккаунта. */
@media not all and (min-width: 1100px) { .spc-fab { display: none; } }

/* Телефон: окно — во весь экран, как отдельный экран переписки. */
@media (pointer: coarse) and (max-width: 768px), (max-width: 560px) {
  .spc { inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; border: 0; transform: translateY(24px);
    padding-top: env(safe-area-inset-top, 0px); }
  .spc.on { transform: none; }
  .spc-head { padding: 10px 8px 10px 14px; }
  .spc-x { width: 40px; height: 40px; }
  .spc-bub { max-width: 86%; font-size: 15px; }
  .spc-input { font-size: 16px; } /* меньше 16px — iOS увеличивает страницу при вводе */
  .spc-send, .spc-clip { width: 40px; height: 40px; }
  .spc-pic { max-width: 240px; }
  .spc-foot { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .ai-note { font-size: 11px; margin-top: 6px; }
  .ai-note-more { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spc, .spc-fab, .spc-msg {
    transition: none !important; animation: none !important; }
}

/* Новый ответ команды: точка на кружке аккаунта, у пункта меню и на кнопке меню телефона. */
html.spc-unread .acc-me .acc-ava, html.spc-unread .acc-support, html.spc-unread #topbarMenuBtn { position: relative; }
html.spc-unread .acc-me .acc-ava::after, html.spc-unread .acc-support::after, html.spc-unread #topbarMenuBtn::after {
  content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-surface); }
html.spc-unread .acc-me .acc-ava::after { top: -1px; right: -1px; }
html.spc-unread .acc-support::after { top: 50%; right: 14px; margin-top: -4px; }
html.spc-unread #topbarMenuBtn::after { top: 8px; right: 8px; }

/* Где есть кнопка «Связаться с нами» (широкий экран) — пункт в меню аккаунта не дублируем.
   На телефоне кнопки нет (справа внизу — отправка сообщения), пункт меню остаётся единственным входом. */
@media (min-width: 1100px) { .acc-support { display: none; } }

/* Предупреждение о скриншотах (RosKom8, 11.10.2026) */
.spc-note { margin: 6px 2px 0; font-size: 11.5px; line-height: 1.4; color: var(--text-muted); }
