/* Chat assistant: light window in the site's colors */

.chat { --c-blue: #2b59ff; --c-ink: #121722; --c-slate: #586172; --c-line: #e2e5ea; --c-mist: #f3f4f6; font-family: "Manrope", "Segoe UI", system-ui, sans-serif; }

.chat__launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  display: grid; place-items: center; width: 60px; height: 60px;
  border: 0; border-radius: 50%; background: var(--c-blue); color: #fff; cursor: pointer;
  box-shadow: 0 16px 34px -12px rgba(43, 89, 255, 0.75);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
}
.chat__launcher:hover { transform: translateY(-3px); background: #1d43d6; }
.chat__launcher:focus-visible { outline: 2.5px solid var(--c-ink); outline-offset: 3px; }
.chat__ic { width: 27px; height: 27px; }
.chat__ic--close { display: none; width: 22px; height: 22px; }
.chat.is-open .chat__ic--open { display: none; }
.chat.is-open .chat__ic--close { display: block; }
.chat__badge {
  position: absolute; top: -2px; right: -2px; display: grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; border: 2px solid #fff;
  background: #e5484d; color: #fff; font: 700 11px/1 "Manrope", sans-serif;
}
.js .chat__launcher { animation: chat-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1s both; }
@keyframes chat-in { from { opacity: 0; transform: translateY(16px) scale(0.9); } }
body.chat-open .tg-float { opacity: 0; pointer-events: none; transform: translateY(10px); }

.chat__panel {
  position: fixed; right: 20px; bottom: 94px; z-index: 70;
  display: flex; flex-direction: column;
  width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100vh - 130px));
  overflow: hidden; border-radius: 20px; background: #fff;
  box-shadow: 0 0 0 1px rgba(18, 23, 34, 0.08), 0 40px 80px -30px rgba(18, 23, 34, 0.5);
  animation: chat-open 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat__panel[hidden] { display: none; }
@keyframes chat-open { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--c-line); }
.chat__avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--c-mist); color: var(--c-ink); }
.chat__avatar svg { width: 24px; height: 24px; }
.chat__who { flex: 1; min-width: 0; }
.chat__title { margin: 0; font: 700 15.5px/1.2 "Manrope", sans-serif; color: var(--c-ink); letter-spacing: -0.01em; }
.chat__sub { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font-size: 12.5px; color: var(--c-slate); }
.chat__sub i { width: 7px; height: 7px; border-radius: 50%; background: #1fbf75; }
.chat__x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--c-slate); cursor: pointer; }
.chat__x:hover { background: var(--c-mist); color: var(--c-ink); }

.chat__log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat__row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chat__row--user { align-items: flex-end; }
.chat__msg {
  max-width: 86%; padding: 10px 13px; border-radius: 16px 16px 16px 6px;
  background: var(--c-mist); color: var(--c-ink); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere;
}
.chat__row--user .chat__msg { border-radius: 16px 16px 6px 16px; background: var(--c-blue); color: #fff; }
.chat__link { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--c-blue); text-decoration: underline; text-underline-offset: 3px; }
.chat__dots { display: inline-flex; gap: 4px; padding: 3px 0; }
.chat__dots i { width: 6px; height: 6px; border-radius: 50%; background: #9aa2b0; animation: chat-dot 1s infinite ease-in-out; }
.chat__dots i:nth-child(2) { animation-delay: 0.15s; }
.chat__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat__handoff { width: 86%; padding: 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--c-line); background: #fff; }
.chat__hl { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--c-ink); }
.chat__hrow { display: flex; gap: 8px; }
.chat__hin { flex: 1; min-width: 0; padding: 9px 10px; border: 1.5px solid #cdd3dc; border-radius: 9px; font: 400 14px/1.3 "Manrope", sans-serif; color: var(--c-ink); }
.chat__hin:focus { outline: none; border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(43, 89, 255, 0.14); }
.chat__hin[aria-invalid="true"] { border-color: #e5484d; }
.chat__hbtn { padding: 0 12px; border: 0; border-radius: 9px; background: var(--c-ink); color: #fff; font: 700 13px/1 "Manrope", sans-serif; cursor: pointer; white-space: nowrap; }
.chat__hbtn[disabled] { opacity: 0.6; cursor: progress; }
.chat__herr { margin: 6px 0 0; font-size: 12.5px; color: #c4262c; }

.chat__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
.chat__quick[hidden] { display: none; }
.chat__chip {
  padding: 7px 11px; border: 1px solid #cdd3dc; border-radius: 999px; background: #fff;
  font: 600 12.5px/1.2 "Manrope", sans-serif; color: var(--c-ink); cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.chat__chip:hover { border-color: var(--c-blue); color: var(--c-blue); }

.chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--c-line); }
.chat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat__input {
  flex: 1; min-height: 42px; max-height: 120px; padding: 10px 12px; resize: none;
  border: 1.5px solid #cdd3dc; border-radius: 12px; font: 400 14.5px/1.4 "Manrope", sans-serif; color: var(--c-ink);
}
.chat__input:focus { outline: none; border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(43, 89, 255, 0.14); }
.chat__send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; background: var(--c-blue); color: #fff; cursor: pointer; }
.chat__send:hover { background: #1d43d6; }

@media (max-width: 639px) {
  .chat__launcher { right: 14px; bottom: 14px; width: 56px; height: 56px; }
  .chat__panel { right: 10px; left: 10px; bottom: 80px; width: auto; height: min(640px, calc(100svh - 100px)); }
}
