@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

.io-pulse-root {
  --card: #171717;
  --surface: #262626;
  --fill-1: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .09);
  --fill-3: rgba(255, 255, 255, .14);
  --text: #fff;
  --text-2: rgba(255, 255, 255, .78);
  --muted: #9a9a9a;
  --muted-2: #828282;
  --green: #34d17a;
  --inverse: #fff;
  --on-inverse: #000;
  --rim: transparent;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  isolation: isolate;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
.io-pulse-root * { box-sizing: border-box; }
.io-pulse-root [hidden] { display: none !important; }

/* Чёрная карточка автоприветствия */
.io-pulse-invite {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 326px;
  background: var(--card);
  color: var(--text);
  border-radius: 24px;
  padding: 16px;
  border: 0;
  cursor: default;
  animation: ioMotionEnter .34s cubic-bezier(0.22, 1, 0.36, 1);
}
.io-pulse-invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.io-pw-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: var(--fill-2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.io-pw-brand-pill img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
  object-fit: contain;
}
.io-pw-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.io-pw-live-dot.offline { background: var(--muted-2); }

.io-pulse-invite-close,
.io-pw-close-btn {
  appearance: none;
  border: 0;
  background: var(--fill-2);
  color: var(--text-2);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.io-pulse-invite-close:hover,
.io-pw-close-btn:hover {
  background: var(--fill-3);
  color: var(--text);
}

.io-pulse-invite-text {
  font-size: 14px;
  line-height: 21px;
  color: var(--text-2);
  margin-bottom: 12px;
}

.io-pw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.io-pw-chip {
  appearance: none;
  border: 0;
  background: var(--fill-2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.io-pw-chip:hover {
  background: var(--fill-3);
  transform: translateY(-1px);
}

.io-pw-cta {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .16s ease, transform .16s ease;
}
.io-pw-cta:hover { opacity: .92; }
.io-pw-cta:active { transform: scale(.98); }

/* Чёрная кнопка-лаунчер справа с иконкой сайта */
.io-pulse-launcher {
  appearance: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  transition: transform .22s cubic-bezier(0.22, 1, 0.36, 1), background .18s ease;
}
.io-pulse-launcher:hover {
  transform: scale(1.06);
  background: var(--surface);
}
.io-pulse-launcher-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.io-pw-heart-svg {
  width: 34px;
  height: 34px;
  overflow: visible;
  display: block;
  pointer-events: none;
}
.io-pw-heart-rig {
  transform-origin: 24px 28px;
  transform-box: view-box;
  will-change: transform;
}
.io-slap-blush {
  fill: #ff1e56;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  will-change: opacity;
}
.io-slap-sparks {
  stroke: #ff8fb8;
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0;
  transform-origin: 41px 29px;
  transform-box: view-box;
  will-change: transform, opacity;
}
.io-pulse-online-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid var(--card);
}
.io-pulse-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff5a5f;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
}

/* Чёрное минималистичное окно чата (Motion Studies) */
.io-pulse-win {
  position: absolute;
  right: 0;
  bottom: 76px;
  z-index: 2;
  width: min(380px, calc(100vw - 32px));
  height: 500px;
  max-height: calc(100vh - 110px);
  background: var(--card);
  color: var(--text);
  border-radius: 28px;
  border: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
  gap: 10px;
  animation: ioMotionEnter .32s cubic-bezier(0.22, 1, 0.36, 1);
}

.io-pw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.io-pulse-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 6px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}
.io-pulse-messages::-webkit-scrollbar { width: 5px; }
.io-pulse-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 999px; }

/* Пузыри в стиле Streaming Reply + физика удара и отскока */
.io-pm-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  font-size: 15px;
  line-height: 22px;
  will-change: transform, opacity;
}
.io-pm-row.io-pm-me {
  align-self: flex-end;
  align-items: flex-end;
}
.io-pm-row.io-pm-ai {
  align-self: flex-start;
  align-items: flex-start;
}
.io-pm-row.io-pm-sys {
  align-self: center;
  max-width: 94%;
}

.io-pm-bubble {
  border-radius: 20px;
  padding: 9px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform .12s ease;
}
.io-pm-row.io-pm-me .io-pm-bubble {
  background: var(--inverse);
  color: var(--on-inverse);
  font-weight: 500;
  transform-origin: bottom right;
}
.io-pm-row.io-pm-ai .io-pm-bubble {
  background: var(--fill-2);
  color: var(--text);
  font-weight: 400;
  transform-origin: bottom left;
}
.io-pm-row.io-pm-sys .io-pm-bubble {
  background: var(--fill-1);
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  padding: 6px 12px;
  border-radius: 999px;
}
.io-pm-row .io-wd {
  display: inline-block;
  will-change: transform, opacity, filter;
}

/* Streaming Reply (растущий пузырь от "Оператор печатает…" к тексту) */
.io-pm-bubble.io-sr-anim {
  position: relative;
  overflow: hidden;
  padding: 0;
  will-change: width, height, transform, opacity;
}
.io-sr-think {
  position: absolute;
  left: 14px;
  top: 9px;
  white-space: nowrap;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  background: linear-gradient(90deg, var(--muted-2) 20%, var(--text) 50%, var(--muted-2) 80%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ioSrShine 1.4s linear infinite;
  pointer-events: none;
}
@keyframes ioSrShine {
  to { background-position: -200% 0; }
}
.io-pm-bubble.io-sr-anim .io-sr-text {
  position: absolute;
  left: 14px;
  top: 9px;
  margin: 0;
}
.io-pm-bubble:not(.io-sr-anim) .io-sr-text {
  position: static;
  margin: 0;
}

.io-pm-img {
  max-width: 210px;
  max-height: 210px;
  border-radius: 12px;
  display: block;
  margin-top: 6px;
}
.io-pm-product {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border-radius: 16px;
  padding: 9px;
  margin-top: 6px;
  text-decoration: none;
  color: var(--text);
}
.io-pm-product img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
}
.io-pm-product-btn {
  display: inline-block;
  margin-top: 4px;
  background: var(--inverse);
  color: var(--on-inverse);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* Индикатор набора текста оператором над полем ввода (Goo Thinking) */
.io-pw-typing {
  flex-shrink: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  will-change: height, opacity;
}
.io-pw-typing-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 6px;
}
.io-pw-goo-bubble {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--fill-2);
  overflow: hidden;
  flex-shrink: 0;
}
.io-pw-goo {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 26px;
  filter: url(#io-dotgoo);
}
.io-pw-goo i {
  position: absolute;
  left: 0;
  top: 0;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--text-2);
  will-change: transform;
}
.io-pw-typing-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Оценка диалога */
.io-pulse-rate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--fill-1);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}
.io-pulse-rate button {
  appearance: none;
  border: 0;
  background: var(--fill-2);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.io-pulse-rate button:hover { background: var(--fill-3); }

/* Prompt Box (композер сообщений в стиле DesignBookmark Motion) */
.io-pw-pb {
  flex-shrink: 0;
  width: 100%;
  padding: 10px 10px 10px 18px;
  background: var(--surface);
  border-radius: 24px;
  transform-origin: center bottom;
  will-change: transform;
}

.io-pw-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
#io-pw-input {
  flex: 1;
  min-width: 0;
  height: 22px;
  margin: 0 0 5px;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  background: none;
  color: var(--text);
  font: 400 15px/22px Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  caret-color: var(--text);
  box-shadow: none;
}
#io-pw-input::placeholder { color: var(--muted-2); }

.io-pw-send {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  flex: none;
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--fill-3);
  color: var(--muted);
  transform-origin: center center;
  will-change: transform;
  transition: background .2s ease, color .2s ease;
}
.io-pw-send.ready {
  background: var(--inverse);
  color: var(--on-inverse);
}
.io-pw-send i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  will-change: transform;
}
.io-pw-send svg { width: 16px; height: 16px; }

/* Слой жидкостного отрыва и полёта бабла */
.io-pw-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
  border-radius: inherit;
}
.io-pw-fx-goo {
  position: absolute;
  inset: 0;
  filter: url(#io-sendgoo);
  pointer-events: none;
}
.io-fx-drop {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--inverse);
  border-radius: 999px;
  transform-origin: center center;
  will-change: transform, opacity;
}
.io-fx-bubble {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--inverse);
  color: var(--on-inverse);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform, width, height, border-radius, opacity;
}
.io-fx-bubble-txt {
  display: block;
  will-change: opacity, transform;
}

@keyframes ioMotionEnter {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
  .io-pulse-root { right: 12px; bottom: 74px; }
  .io-pulse-launcher { width: 54px; height: 54px; }
  .io-pulse-launcher-circle { width: 40px; height: 40px; }
  .io-pw-heart-svg { width: 30px; height: 30px; }
  .io-pulse-invite { right: 0; width: calc(100vw - 24px); max-width: 320px; bottom: 64px; }
  .io-pulse-win {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: 138px;
    width: auto;
    height: 62vh;
  }
}
