/* ===== Alyona chat widget ===== */
#alyona-widget {
  position: fixed;
  right: 20px;
  bottom: 40px;
  z-index: 9999;
  font-family: inherit;
}

#alyona-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
}

#alyona-cta {
  background: #161719;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 18px;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform .2s ease, opacity .2s ease, visibility .2s ease;
}
#alyona-cta .alyona-cta-arrow { font-size: 14px; line-height: 1; }
#alyona-launcher:hover #alyona-cta { transform: scale(1.04); }
#alyona-cta.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#alyona-bubble {
  width: 76px;
  height: 76px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: transform .2s ease;
}
#alyona-launcher:hover #alyona-bubble { transform: scale(1.06); }
#alyona-bubble .alyona-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
  border: 3px solid #fff;
  background: #161719;
}
#alyona-bubble video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#alyona-bubble .alyona-dot {
  position: absolute;
  top: 0;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: opacity .2s ease;
}
#alyona-bubble .alyona-collapse-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(13,27,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
#alyona-bubble .alyona-collapse-overlay svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}
#alyona-widget.open #alyona-bubble .alyona-collapse-overlay {
  opacity: 1;
  visibility: visible;
}
#alyona-widget.open #alyona-bubble .alyona-dot {
  opacity: 0;
}

#alyona-panel {
  position: absolute;
  right: 0;
  bottom: 100px;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#alyona-panel.open { display: flex; }

#alyona-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #161719;
  color: #fff;
}
#alyona-header .alyona-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
#alyona-header .alyona-avatar-sm video {
  width: 100%; height: 100%; object-fit: cover;
}
#alyona-header .alyona-title { font-weight: 600; font-size: 15px; line-height: 1.2; }
#alyona-header .alyona-subtitle { font-size: 12px; opacity: .75; }
#alyona-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

#alyona-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f4f6f8;
}
.alyona-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.alyona-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.alyona-msg.user {
  align-self: flex-end;
  background: #161719;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.alyona-msg.typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.alyona-msg.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #999;
  animation: alyona-blink 1.2s infinite ease-in-out;
}
.alyona-msg.typing span:nth-child(2) { animation-delay: .2s; }
.alyona-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes alyona-blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

#alyona-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
#alyona-input {
  flex: 1;
  border: 1px solid #d5d9de;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
  resize: none;
}
#alyona-input:focus { border-color: #161719; }
#alyona-send {
  border: none;
  background: #161719;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#alyona-send:disabled { opacity: .5; cursor: default; }

/* оставляем зазор над закреплённой мобильной CTA-панелью (.mobile-cta, см. style.css) */
@media (max-width: 760px) {
  #alyona-widget { bottom: 98px; }
}

@media (max-width: 480px) {
  #alyona-widget { right: 12px; max-width: calc(100vw - 24px); }
  #alyona-cta { display: none; }
  #alyona-panel { width: calc(100vw - 24px); right: -8px; }
}
