/* Квант — ИИ-помощник сайта. Разметку вставляет js/kbot.js. */
.kb { --k-bg: #F2F2F0; --k-fg: #0A0A0A; --k-mut: #5F5F5F; --k-ln: #D9D9D6; --k-card: #FFFFFF; --k-ink: #0A0A0A;
  position: fixed; right: 24px; bottom: 24px; z-index: 40; font: 400 15px/1.5 var(--cyr, "Manrope", system-ui, sans-serif); color: var(--k-fg); }
.kb *, .kb *::before, .kb *::after { box-sizing: border-box; }

/* кнопка */
.kb__fab { position: relative; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: var(--k-ink); color: #F2F2F0; cursor: pointer; font: inherit; font-size: 15px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.55);
  transition: transform .4s cubic-bezier(.2,0,0,1), opacity .4s ease, box-shadow .4s ease; }
.kb__fab:hover { transform: translateY(-2px); box-shadow: 0 22px 48px -16px rgba(0,0,0,.6); }
.kb__sign { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #1A1A1A; position: relative; overflow: hidden; }
.kb__sign svg { width: 16px; height: 17px; position: relative; z-index: 1; }
/* щель света проходит по знаку: та же механика, что в герое */
.kb__sign::after { content: ""; position: absolute; top: -20%; bottom: -20%; width: 10px; left: -14px; background: linear-gradient(90deg, transparent, rgba(255,250,240,.85), transparent); filter: blur(2px); }
html.motion .kb__sign::after { animation: kb-slit 6s cubic-bezier(.2,0,0,1) 2s infinite; }
@keyframes kb-slit { 0% { transform: translateX(0); } 18%, 100% { transform: translateX(62px); } }
.kb__fab-t { white-space: nowrap; }
.kb__dot { position: absolute; top: 9px; left: 40px; width: 9px; height: 9px; border-radius: 50%; background: #4778FF; box-shadow: 0 0 0 2px var(--k-ink); }
.kb.is-seen .kb__dot { display: none; }
html.loading .kb { opacity: 0; pointer-events: none; }
.kb { transition: opacity .6s ease; }
.kb.is-open .kb__fab { opacity: 0; pointer-events: none; transform: scale(.9); }

/* подсказка рядом с кнопкой */
.kb__tip { position: absolute; right: 0; bottom: 68px; width: max-content; max-width: 260px; padding: 12px 16px; border-radius: 14px; background: var(--k-card); color: var(--k-fg);
  box-shadow: 0 16px 40px -18px rgba(0,0,0,.45); border: 1px solid var(--k-ln); font-size: 14px; line-height: 1.4; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,0,0,1); }
.kb.is-tip .kb__tip { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }

/* окно */
.kb__panel { position: absolute; right: 0; bottom: 0; width: 392px; height: min(620px, calc(100dvh - 48px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--k-bg); border-radius: 20px; border: 1px solid rgba(10,10,10,.08); box-shadow: 0 40px 100px -30px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: 100% 100%; pointer-events: none; visibility: hidden;
  transition: opacity .35s ease, transform .5s cubic-bezier(.16,1,.3,1), visibility 0s .5s; }
.kb.is-open .kb__panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .35s ease, transform .5s cubic-bezier(.16,1,.3,1), visibility 0s; }
.kb__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--k-ink); color: #F2F2F0; }
.kb__head .kb__sign { width: 36px; height: 36px; flex: none; }
.kb__who { flex: 1; min-width: 0; line-height: 1.25; }
.kb__who b { display: block; font-weight: 500; font-size: 15px; }
.kb__who span { font: 400 12px/1.3 var(--latin, system-ui); letter-spacing: .06em; text-transform: uppercase; color: #A6A6A6; }
.kb__who span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3DDC84; margin-right: 6px; vertical-align: 1px; }
.kb__x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; position: relative; flex: none; }
.kb__x:hover { background: #1A1A1A; }
.kb__x::before, .kb__x::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.kb__x::after { transform: rotate(-45deg); }

.kb__log { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.kb__m { max-width: 88%; padding: 10px 14px; border-radius: 16px; word-wrap: break-word; animation: kb-in .45s cubic-bezier(.16,1,.3,1) both; }
@keyframes kb-in { from { opacity: 0; transform: translateY(6px); } }
.kb__m--a { align-self: flex-start; background: var(--k-card); border: 1px solid var(--k-ln); border-bottom-left-radius: 6px; }
.kb__m--u { align-self: flex-end; background: var(--k-ink); color: #F2F2F0; border-bottom-right-radius: 6px; }
.kb__m p { margin: 0; } .kb__m p + p, .kb__m ul + p, .kb__m p + ul { margin-top: 8px; }
.kb__m ul { margin: 0; padding-left: 18px; list-style: disc; }
.kb__m li { margin: 2px 0; }
.kb__m a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.kb__m b { font-weight: 600; }
.kb__dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.kb__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--k-mut); animation: kb-dot 1.2s ease-in-out infinite; }
.kb__dots i:nth-child(2) { animation-delay: .15s; } .kb__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes kb-dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.kb__slow { margin: 6px 0 0 !important; font-size: 13px; color: var(--k-mut); animation: kb-in .45s ease both; }
.kb__tg { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 14px; border-radius: 999px; background: var(--k-ink); color: #F2F2F0 !important; text-decoration: none !important; font-size: 14px; }

.kb__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 10px; }
.kb__chips:empty { display: none; }
.kb__chips button { border: 1px solid var(--k-ln); background: transparent; color: var(--k-fg); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13.5px; cursor: pointer; transition: background .25s ease, border-color .25s ease; }
.kb__chips button:hover { background: var(--k-card); border-color: var(--k-fg); }

.kb__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--k-ln); background: var(--k-card); }
.kb__in { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--k-fg); padding: 10px 6px; resize: none; max-height: 120px; line-height: 1.4; }
.kb__in:focus { outline: none; }
.kb__send { width: 44px; height: 44px; flex: none; align-self: flex-end; border: 0; border-radius: 50%; background: var(--k-ink); color: #F2F2F0; cursor: pointer; display: grid; place-items: center; transition: opacity .2s ease; }
.kb__send:disabled { opacity: .3; cursor: default; }
.kb__send svg { width: 18px; height: 18px; }
.kb__note { margin: 0; padding: 0 16px 10px; background: var(--k-card); font-size: 12px; line-height: 1.35; color: var(--k-mut); }

@media (max-width: 560px) {
  .kb { right: 16px; bottom: 16px; }
  .kb__fab { height: 54px; width: 54px; padding: 0 6px; }
  .kb__fab-t { display: none; }
  .kb__dot { left: 36px; top: 8px; }
  .kb__panel { position: fixed; inset: 0; width: auto; height: 100dvh; border-radius: 0; border: 0; }
  .kb__tip { bottom: 62px; max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) { .kb__m { animation: none; } .kb__panel, .kb__fab, .kb__tip { transition: none; } }
/* кнопка бота не закрывает нижнюю строку подвала */
.ftr__legal { padding-bottom: 72px; }
@media (max-width: 560px) { .ftr__legal { padding-bottom: 64px; } }
