/* Чат с ассистентом */
.chatw { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50; font-family: var(--font-body); }
.chatw__launch { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 600 15px var(--font-body); cursor: pointer; box-shadow: 0 12px 30px -10px rgba(15, 26, 21, .45); transition: transform .15s; }
.chatw__launch:hover { transform: translateY(-2px); }
.chatw.is-open .chatw__launch { display: none; }
.chatw__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(42, 168, 107, .6); animation: chatwPulse 2s infinite; }
@keyframes chatwPulse { 70% { box-shadow: 0 0 0 8px rgba(42, 168, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(42, 168, 107, 0); } }
.chatw__panel { width: 380px; height: min(580px, calc(100vh - 40px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 60px -20px rgba(15, 26, 21, .35); overflow: hidden; }
.chatw__panel[hidden] { display: none; }
.chatw__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chatw__avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 700 16px var(--font-display); flex: none; }
.chatw__title { flex: 1; min-width: 0; line-height: 1.25; }
.chatw__title b { display: block; font-size: 15px; }
.chatw__title small { color: var(--accent); font-size: 13px; }
.chatw__close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.chatw__close:hover { background: var(--bg); color: var(--ink); }
.chatw__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chatw__msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatw__msg--in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chatw__msg--out { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chatw__msg a { color: var(--accent); }
.chatw__typing { display: inline-flex; gap: 4px; padding: 14px; }
.chatw__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chatwDot 1.2s infinite; }
.chatw__typing i:nth-child(2) { animation-delay: .15s; } .chatw__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatwDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chatw__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; background: var(--bg); }
.chatw__chips:not(:empty) { padding-bottom: 12px; }
.chatw__chip { border: 1px solid var(--accent); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--font-body); cursor: pointer; text-align: left; }
.chatw__chip:hover { background: #e3f3ea; }
.chatw__form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 6px; border-top: 1px solid var(--line); }
.chatw__input { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font: 400 15px/1.4 var(--font-body); color: var(--ink); background: var(--surface); max-height: 120px; }
.chatw__input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.chatw__send { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chatw__send:disabled { opacity: .5; cursor: default; }
.chatw__note { margin: 0; padding: 0 14px 10px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.chatw__note a { color: var(--muted); }
.chatw button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) {
  .chatw { right: 12px; bottom: 12px; left: auto; }
  .chatw.is-open { left: 0; right: 0; bottom: 0; top: 0; }
  .chatw.is-open .chatw__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .chatw__launch { padding: 13px 18px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .chatw__dot, .chatw__typing i { animation: none; } }

/* Блок «Попробуйте ИИ-агента» */
.ai-demo-wrap { padding-block: 0 72px; }
.ai-demo { display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; padding: 32px 36px; border-radius: 22px; background: var(--ink); color: #eef3ef; }
.ai-demo__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ai-demo h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); text-wrap: balance; }
.ai-demo p:not(.tag) { margin: 0; color: #b7c4bc; max-width: 46em; }
.ai-demo .btn { flex: none; }
@media (max-width: 600px) { .ai-demo { padding: 24px 20px; } .ai-demo .btn { width: 100%; text-align: center; } }

/* Кнопка чата прячется, пока виден блок про ассистента */
.chatw__launch { transition: transform .25s ease, opacity .25s ease; }
.chatw.is-tucked:not(.is-open) .chatw__launch { opacity: 0; transform: translateY(16px); pointer-events: none; }
