/* Окно чата с сотрудником (кнопка и окно на всех страницах, пока есть открытый диалог) */
.chatw-fab { position: fixed; right: 24px; bottom: 98px; z-index: 60; width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c-dark); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform .15s; }
.chatw-fab:hover { transform: scale(1.06); }
.chatw-fab--low { bottom: 24px; }   /* кнопки ИИ-помощника нет (на телефоне со страницы объекта она скрыта) */
.chatw-fab--up { bottom: 84px; }   /* над нижней панелью страницы объекта */
.chatw-fab.is-open { display: none; }
.chatw-fab__badge { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; box-sizing: border-box;
  background: #e5322d; color: #fff; font: 700 12px/22px var(--font, inherit); text-align: center; border: 2px solid #fff; line-height: 18px; }
.chatw-fab__badge[hidden] { display: none; }
.chatw { position: fixed; right: 24px; bottom: 24px; z-index: 85; width: 400px; max-width: calc(100vw - 24px); height: min(640px, calc(100vh - 130px));
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.chatw[hidden] { display: none; }
.chatw__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--c-dark); color: #fff; }
.chatw__head b { flex: 1; font-size: 16px; }
.chatw__head b small { display: block; font-weight: 500; font-size: 12px; color: rgba(255,255,255,.65); }
.chatw__close { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; font-size: 26px; line-height: 1; padding: 0 4px; }
.chatw__close:hover { color: #fff; }
.chatw__body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chatw__frame { flex: 1; width: 100%; border: 0; background: #fff; }
/* Предложение помощи: плашка у кнопки, затем окно с приветствием до диалога */
.chatw-bubble { position: fixed; right: 24px; z-index: 61; max-width: 280px; padding: 12px 34px 12px 14px; background: #fff; color: var(--c-text); border: 1px solid var(--c-line);
  border-radius: 14px 14px 4px 14px; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.4; cursor: pointer; animation: chatw-in .35s ease-out; }
.chatw-bubble__x { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--c-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 4px; }
@keyframes chatw-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chatw-bubble { animation: none; } }
.cwp { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--c-bg-alt, #f5f6f8); }
.cwp__msg { background: #fff; border: 1px solid var(--c-line); border-radius: 12px 12px 12px 4px; padding: 10px 12px; max-width: 92%; }
.cwp__who { font-size: 12px; font-weight: 700; color: var(--c-accent); margin-bottom: 2px; }
.cwp__text { font-size: 15px; line-height: 1.45; }
.cwp__form { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.cwp__input, .cwp__field { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 10px 12px; border: 1.5px solid var(--c-line); border-radius: 10px; background: #fff; resize: none; }
.cwp__input:focus, .cwp__field:focus { outline: none; border-color: var(--c-accent); }
.cwp__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cwp__note, .cwp__check { font-size: 12px; color: var(--c-muted); margin: 0; }
.cwp__check { display: flex; gap: 8px; align-items: flex-start; }
.cwp__err { margin: 0; color: #a12a1f; font-size: 13px; }
.cwp__err[hidden] { display: none; }
.cwp__done { margin: auto 0; font-size: 16px; font-weight: 600; text-align: center; }
@media (max-width: 640px) {
  .chatw { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: calc(100vh - 16px); }
}
