/* шрифт шапки чата — Geologica, как у всех ассистентов (termo) */
@font-face{font-family:'Geologica';src:url('../fonts/Geologica-wght.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap;}
/* ===== 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-family: 'Geologica', 'Segoe UI', Arial, sans-serif; font-weight: 600; font-size: 15.5px; line-height: 1.2; }
#alyona-header .alyona-subtitle { display: flex; align-items: center; gap: 6px; font-family: 'Geologica', 'Segoe UI', Arial, sans-serif; font-size: 12px; color: #b4b6ba; margin-top: 2px; }
#alyona-header .alyona-subtitle { white-space: nowrap; }
#alyona-header .alyona-subtitle i { width: 7px; height: 7px; border-radius: 50%; background: #5fbf75; flex: none; }
#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; }

/* строка согласия под полем ввода — как #polina-consent на sneg.dskd24.com */
#alyona-consent { margin: 0; padding: 0 8px 8px; background: #fff; font-size: 10.5px; line-height: 1.3; text-wrap: balance; color: #8a8f95; text-align: center; }
#alyona-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#alyona-consent a:hover { color: #f2722c; }
@media (max-width: 380px) { #alyona-consent { font-size: 10px; padding: 0 6px 8px; } }

/* оставляем зазор над закреплённой мобильной CTA-панелью (.mobile-cta, см. style.css) */
@media (max-width: 760px) {
  #alyona-widget { bottom: 98px; }
}
/* пока видна плашка куки (main.js: html.cookie-open, --cookie-h) — Алёна над ней, а не поверх */
@media (max-width: 760px) {
  #alyona-widget { transition: bottom .3s ease; }
  html.cookie-open #alyona-widget { bottom: calc(80px + var(--cookie-h, 70px) + 12px); }
  /* панель открывается над кружком (bottom:100px) — высота не больше, чем остаётся до верха экрана (на 320×640 иначе уходит за верх) */
  #alyona-panel { max-height: calc(100vh - 98px - 100px - 12px); max-height: calc(100dvh - 98px - 100px - 12px); }
  /* открыт чат — плашка временно прячется, Алёна на обычном месте, панель полной высоты (как на эталоне sneg.dskd24.com) */
  html.cookie-open:has(#alyona-widget.open) .cookie-bar { opacity: 0; transform: translateY(10px); pointer-events: none; }
  html.cookie-open:has(#alyona-widget.open) #alyona-widget { bottom: 98px; }
}
/* 761–860px: плашка куки (до 560px) упирается в надпись «Вопрос по рейсам?» — прячем надпись, пока плашка открыта */
@media (max-width: 860px) {
  html.cookie-open #alyona-cta { opacity: 0; visibility: hidden; pointer-events: none; }
}

@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; }
}

/* jbi: страница в один экран, у правого края — тёмная полоса маршрута.
   Надпись у кружка не показываем (в промо-полосе есть «Спросить Алёну»), кружок держит свой угол. */
#alyona-cta { display: none; }
@media (min-width: 761px) { #alyona-widget { bottom: 24px; } }
#alyona-input { font-family: inherit; }
