/* ============================================================================
   Виджет ЮDизайн (v2, новый алгоритм). Только Verdana и палитра бренда
   (из sajt/assets/css/main.css). Все анимации - своим CSS (keyframes/переходы).
   Никаких сторонних шрифтов, CDN и анимационных библиотек - правило 5 брендбука.
   ========================================================================== */

:root {
  --c-burgundy: #5a2c36;
  --c-burgundy-2: #330f21;
  --c-burgundy-dark: #3d1e25;
  --c-taupe: #9c846f;
  --c-beige: #bfb0a3;
  --c-page: #faf8f6;
  --c-line: #ece6e1;
  --c-ink: #1a1a1a;
  --c-mute: #6f665f;
  --font: Verdana, Geneva, sans-serif;
  --shadow: 0 18px 48px rgba(20, 12, 14, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--c-page);
  color: var(--c-ink);
  /* Тени и transform плавающих элементов не должны давать горизонтальный
     скролл - «страница уходит в бок» (Денис 28.07). */
  overflow-x: hidden;
}

/* Embed-режим (embed.html в iframe на сайте): фон прозрачный - виджет
   "лежит" прямо на странице сайта, iframe не видно. */
body.yd-embed {
  background: transparent;
}

/* Типографика: гарнитура по брендбуку ТОЛЬКО Verdana (сторонние шрифты и CDN
   запрещены), поэтому "играем" начертанием: сглаживание + чуть плотнее
   межбуквенное (Verdana широкая) + воздух в межстрочных. */
.yd-chat,
.yd-launcher,
.yd-invite {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 20px;
}
.page h1 {
  font-size: 1.5rem;
}
.page__note {
  color: var(--c-mute);
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* ======================= Плавающая плашка-открывашка ====================== */
/* Капсула с текстом "Напишите нам" - заметнее круглой кнопки (фидбек владельца
   "не сразу заметил"). Пульс-кольцо + периодическое мягкое покачивание. */
.yd-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #6e3a45, var(--c-burgundy) 45%, var(--c-burgundy-2));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(51, 15, 33, 0.4);
  z-index: 9998;
  font-family: var(--font);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  animation: yd-nudge 7s ease-in-out infinite 4s;
}
.yd-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 40px rgba(51, 15, 33, 0.5);
  animation-play-state: paused;
}
.yd-launcher:active {
  transform: scale(0.96);
}
.yd-launcher__icon {
  width: 26px;
  height: 26px;
  flex: none;
  position: relative;
  z-index: 2;
}
.yd-launcher__label {
  /* Подпись скрыта: свёрнутый вид - компактная иконка (п.1 Дениса 31.07).
     Для скринридеров остаётся aria-label кнопки. */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.yd-launcher__ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid var(--c-burgundy);
  animation: yd-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
.yd-launcher.is-hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  animation: none;
}

@keyframes yd-pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* Мягкое покачивание раз в ~7с - привлекает взгляд, не раздражая. */
@keyframes yd-nudge {
  0%,
  8%,
  100% {
    transform: rotate(0);
  }
  2% {
    transform: rotate(-2.5deg);
  }
  4% {
    transform: rotate(2deg);
  }
  6% {
    transform: rotate(-1deg);
  }
}

/* ================================ Панель ================================= */
.yd-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 9999;
  transform-origin: bottom right;
  transform: translateY(16px) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.5, 1), opacity 0.24s ease;
}
.yd-chat.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Шапка */
.yd-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 14px;
  background: linear-gradient(135deg, var(--c-burgundy) 0%, var(--c-burgundy-2) 100%);
  color: #fff;
  position: relative;
}
.yd-chat__head::after {
  /* мягкий тёплый блик */
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(191, 176, 163, 0.28), transparent 70%);
  pointer-events: none;
}
.yd-avatar {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
/* Фото Алины (/alina.jpg рядом со статикой): widget.js пробует его загрузить и
   вешает yd-has-photo на <html> - тогда ВСЕ аватары показывают фото вместо "ЮD".
   Файла нет - остаются буквы, ничего не ломается. */
.yd-has-photo .yd-avatar {
  background-image: url("/alina.jpg");
  background-size: cover;
  background-position: center 18%;
  color: transparent;
}
.yd-avatar--lg {
  width: 42px;
  height: 42px;
  font-size: 0.8125rem;
}
.yd-avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 0.5625rem;
  background: var(--c-burgundy);
  border-color: transparent;
}
.yd-chat__head-text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  z-index: 1;
}
.yd-chat__title {
  font-size: 0.9375rem;
  font-weight: 700;
}
.yd-chat__subtitle {
  font-size: 0.6875rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}
.yd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-beige);
  box-shadow: 0 0 0 0 rgba(191, 176, 163, 0.7);
  animation: yd-blink 2s ease-in-out infinite;
}
@keyframes yd-blink {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(191, 176, 163, 0.6);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(191, 176, 163, 0);
  }
}
.yd-chat__close {
  position: relative;
  margin-left: auto;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.yd-chat__close svg {
  width: 16px;
  height: 16px;
}
.yd-chat__close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: rotate(90deg);
}

/* Прогресс анкеты */
.yd-progress {
  height: 3px;
  background: var(--c-line);
}
.yd-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-taupe), var(--c-burgundy));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Лента сообщений */
.yd-chat__log {
  height: 380px;
  max-height: 54vh;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--c-page);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.yd-chat__log::-webkit-scrollbar {
  width: 8px;
}
.yd-chat__log::-webkit-scrollbar-thumb {
  background: var(--c-line);
  border-radius: 8px;
}

.yd-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: yd-rise 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.yd-row--user {
  flex-direction: row-reverse;
}
@keyframes yd-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.yd-bubble {
  max-width: 78%;
  min-width: 0;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.58;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(20, 12, 14, 0.06);
}
.yd-row--bot .yd-bubble {
  background: #fff;
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-radius: 14px 14px 14px 4px;
}
.yd-row--user .yd-bubble {
  background: linear-gradient(135deg, var(--c-burgundy), var(--c-burgundy-2));
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

/* Индикатор "печатает" (и "специалист подключается") */
.yd-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 13px 14px;
}
.yd-typing__label {
  font-size: 0.8125rem;
  color: var(--c-mute);
  margin-right: 6px;
}
.yd-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-taupe);
  animation: yd-bounce 1.2s infinite ease-in-out;
}
.yd-typing i:nth-of-type(2) {
  animation-delay: 0.18s;
}
.yd-typing i:nth-of-type(3) {
  animation-delay: 0.36s;
}
@keyframes yd-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Чипы быстрых ответов */
.yd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.yd-chips.is-on {
  max-height: 120px;
  padding: 10px 14px 2px;
}
.yd-chip {
  font-family: var(--font);
  font-size: 0.8125rem;
  padding: 9px 15px;
  border: 1px solid var(--c-beige);
  border-radius: 999px;
  background: #fff;
  color: var(--c-burgundy);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.yd-chip:hover {
  background: var(--c-burgundy);
  color: #fff;
  transform: translateY(-1px);
}
.yd-chip--skip {
  border-style: dashed;
  border-color: var(--c-line);
  color: var(--c-mute);
}
.yd-chip--skip:hover {
  background: var(--c-page);
  color: var(--c-burgundy);
  border-color: var(--c-beige);
}
/* Чипы всплывают по очереди (лёгкий stagger) при появлении. */
.yd-chips.is-on .yd-chip {
  animation: yd-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.yd-chips.is-on .yd-chip:nth-child(2) {
  animation-delay: 0.05s;
}
.yd-chips.is-on .yd-chip:nth-child(3) {
  animation-delay: 0.1s;
}
.yd-chips.is-on .yd-chip:nth-child(4) {
  animation-delay: 0.15s;
}
.yd-chips.is-on .yd-chip:nth-child(5) {
  animation-delay: 0.2s;
}

/* ============ Целевое действие по сегменту (cta от сервера) ============== */
/* cta - обычная реплика Алины в ленте (вечная плашка перегружала виджет).
   На hot - лёгкий бордовый акцент слева, чтобы предложение выделялось. */
.yd-row--bot .yd-bubble--accent {
  border-left: 3px solid var(--c-burgundy);
  background: linear-gradient(135deg, rgba(90, 44, 54, 0.07), #fff 55%);
}

/* Honeypot-антиспам: поле уводим за экран (НЕ display:none - иначе бот его
   пропустит). Человек не видит и не заполняет; бот заполнит -> сервер отсечёт. */
.yd-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ===================== Карточка контактов (любой момент) ================= */
/* Карточка живёт ВНУТРИ ленты как сообщение-карточка (механика Jivo): всплывает
   в потоке разговора и НЕ выталкивает переписку. Раньше была отдельным блоком
   между лентой и полем ввода - при появлении вся панель скачком уезжала вверх. */
.yd-contact {
  background: #fff;
}
.yd-row--card {
  align-items: flex-start;
}
.yd-row--card .yd-contact {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--c-line);
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 6px 18px rgba(20, 12, 14, 0.1);
  overflow: hidden;
  animation: yd-card-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes yd-card-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.yd-contact__toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: linear-gradient(135deg, rgba(90, 44, 54, 0.07), rgba(90, 44, 54, 0.02));
  color: var(--c-burgundy);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.yd-contact__chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--c-burgundy);
  border-bottom: 2px solid var(--c-burgundy);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex: none;
}
.yd-contact.is-collapsed .yd-contact__chev {
  transform: rotate(-135deg);
}
.yd-contact__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 6px;
  max-height: 360px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
}
.yd-contact.is-collapsed .yd-contact__body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}
.yd-contact__input {
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  background: var(--c-page);
  color: var(--c-ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.yd-contact__input:focus {
  border-color: var(--c-taupe);
  background: #fff;
}
.yd-contact__input:disabled {
  opacity: 0.6;
}
.yd-contact__send {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c-burgundy), var(--c-burgundy-2));
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.yd-contact__send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(90, 44, 54, 0.3);
}
.yd-contact__send:disabled {
  background: var(--c-beige);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.yd-contact.is-done .yd-contact__toggle {
  color: var(--c-mute);
  cursor: default;
}
/* HOT-сегмент: подсвечиваем карточку и мягко пульсируем кнопку "Отправить",
   чтобы подтолкнуть к записи на разбор в шоуруме + оставить телефон. */
.yd-contact.is-hot .yd-contact__toggle {
  background: linear-gradient(135deg, rgba(90, 44, 54, 0.17), rgba(90, 44, 54, 0.05));
}
.yd-contact.is-hot .yd-contact__send {
  animation: yd-cta-pulse 1.8s ease-in-out infinite;
}
@keyframes yd-cta-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(90, 44, 54, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(90, 44, 54, 0);
  }
}
.yd-contact__error {
  margin: 0;
  font-size: 0.75rem;
  color: var(--c-burgundy-2);
}
.yd-consent-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--c-mute);
  cursor: pointer;
}
.yd-consent-check input {
  flex: none;
  margin: 1px 0 0;
  width: 15px;
  height: 15px;
  accent-color: var(--c-burgundy);
  cursor: pointer;
}
.yd-consent-check a {
  color: var(--c-burgundy);
  text-decoration: underline;
}

/* Плейсхолдеры: явный контраст (дефолтный браузерный часто <4.5:1). */
.yd-chat__input::placeholder,
.yd-contact__input::placeholder {
  color: #6f665f;
  opacity: 1;
}

/* Поле ввода */
.yd-chat__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--c-line);
  background: #fff;
}
.yd-chat__input {
  flex: 1;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 11px 16px;
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  background: var(--c-page);
  color: var(--c-ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.yd-chat__input:focus {
  border-color: var(--c-taupe);
  background: #fff;
}
.yd-chat__input:disabled {
  opacity: 0.6;
}
.yd-chat__send {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-burgundy), var(--c-burgundy-2));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.yd-chat__send svg {
  width: 19px;
  height: 19px;
}
.yd-chat__send:hover svg {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}
.yd-chat__send:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 18px rgba(90, 44, 54, 0.3);
}
.yd-chat__send:disabled {
  background: var(--c-beige);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.yd-chat__meter {
  padding: 6px 14px;
  font-size: 0.625rem;
  color: var(--c-mute);
  background: var(--c-page);
  border-top: 1px solid var(--c-line);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ===================== Проактивное приглашение ========================== */
.yd-invite {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 264px;
  max-width: calc(100vw - 48px);
  text-align: left;
  border: 1px solid var(--c-line);
  border-radius: 14px 14px 4px 14px;
  background: #fff;
  color: var(--c-ink);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 9997;
  font-family: var(--font);
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.5, 1), opacity 0.24s ease;
}
.yd-invite.is-on {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.yd-invite__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.yd-avatar--inv {
  width: 34px;
  height: 34px;
  font-size: 0.6875rem;
  background: var(--c-burgundy);
  border-color: transparent;
  color: #fff;
}
.yd-invite__who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.yd-invite__who b {
  font-size: 0.9375rem;
}
.yd-invite__tag {
  color: var(--c-mute);
  font-size: 0.625rem;
  letter-spacing: 0.02em;
}
.yd-invite__text {
  display: block;
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ============================== Мобильная ================================ */
@media (max-width: 480px) {
  .yd-chat {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  /* iOS Safari авто-зумит страницу при фокусе поля со шрифтом <16px -
     «страница увеличивается и уходит вбок» (Денис 28.07). 16px решает. */
  .yd-chat__input,
  .yd-contact__input {
    font-size: 16px;
  }
  .yd-chat__log {
    height: auto;
    max-height: none;
    flex: 1;
  }
  /* Тач-таргеты >=44px там, где палец, а не курсор. */
  .yd-chip {
    min-height: 44px;
    padding: 12px 16px;
  }
  .yd-consent-check {
    padding: 8px 0;
  }
  .yd-chat__close {
    width: 44px;
    height: 44px;
  }
  /* Капсула и приглашение не упираются в жестовую зону iPhone. */
  .yd-launcher {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .yd-invite {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
}

/* ==================== Уважение к настройке "меньше движения" ============== */
@media (prefers-reduced-motion: reduce) {
  *,
  .yd-launcher,
  .yd-chat,
  .yd-invite,
  .yd-row,
  .yd-launcher__ring,
  .yd-dot,
  .yd-typing i,
  .yd-progress__bar,
  .yd-contact.is-hot .yd-contact__send {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
  .yd-chat.is-open {
    transform: none;
  }
}

/* Кнопка "Оставить телефон" под репликой бота: форма больше не всплывает сама,
   её открывает клик по этой кнопке (фидбек Дениса 30.07). */
.yd-row--cta,
.yd-row--rate {
  align-items: center;
}
.yd-avatar--ghost {
  visibility: hidden;
}
.yd-cta-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 44px;
  background: linear-gradient(135deg, #6e3a45, var(--c-burgundy) 45%, var(--c-burgundy-2));
  color: #fff;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(51, 15, 33, 0.28);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.yd-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(51, 15, 33, 0.36);
}
.yd-cta-btn:active {
  transform: scale(0.97);
}

/* "Назад" - тише остальных чипов: исправить предыдущий ответ. */
.yd-chip--back {
  background: transparent;
  border-color: var(--c-line);
  color: var(--c-mute);
}
.yd-chip--back:hover {
  color: var(--c-burgundy);
  border-color: var(--c-taupe);
}

/* EMBED: внутри iframe виджет прижимаем к правому нижнему углу без отступов -
   внешние отступы (чтобы не наложиться на кнопку "Наверх" и липкую панель
   сайта) задаёт loader.js через data-атрибуты сниппета. */
body.yd-embed .yd-launcher {
  right: 8px;
  bottom: 8px;
}
body.yd-embed .yd-invite {
  right: 8px;
  bottom: 74px;
}
body.yd-embed .yd-chat {
  right: 8px;
  bottom: 8px;
}
@media (max-width: 480px) {
  body.yd-embed .yd-chat {
    right: 0;
    bottom: 0;
  }
}

/* Ссылки в репликах бота (например на страницу работ): читаемые и кликабельные,
   тач-таргет не меньше строки (фидбек Дениса 30.07 "ссылка не активная"). */
.yd-link {
  color: var(--c-burgundy);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
  font-weight: 700;
}
.yd-link:hover,
.yd-link:focus-visible {
  color: var(--c-burgundy-2);
  text-decoration-thickness: 2px;
}
.yd-bubble--accent .yd-link {
  color: #fff;
}

/* Оценка диалога: две кнопки-иконки (палец вверх/вниз). Свои SVG, не эмодзи -
   брендбук. Тач-таргет 44px (идея Дениса 31.07: собирать статистику). */
.yd-rate {
  display: flex;
  gap: 10px;
  align-items: center;
}
.yd-rate__btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: #fff;
  color: var(--c-taupe);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s ease,
    border-color 0.18s ease, background 0.18s ease;
}
.yd-rate__btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.yd-rate__btn:hover {
  transform: translateY(-2px);
  border-color: var(--c-taupe);
}
.yd-rate__btn--up:hover {
  color: var(--c-burgundy);
  background: #fdf7f4;
}
.yd-rate__btn--down:hover {
  color: var(--c-mute);
  background: var(--c-page);
}
.yd-rate__btn:active {
  transform: scale(0.94);
}

/* Приветствие: контейнер с кнопкой-крестиком (п.2 Дениса 31.07 - посетитель
   должен уметь свернуть приветствие, если мешает). Сам текст остаётся
   кликабельным - открывает чат. */
.yd-invite__open {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-family: var(--font);
  color: inherit;
  cursor: pointer;
}
.yd-invite__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-mute);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  z-index: 2;
}
.yd-invite__close svg {
  width: 14px;
  height: 14px;
}
.yd-invite__close:hover {
  background: var(--c-page);
  color: var(--c-burgundy);
}
/* Место под крестик, чтобы он не наезжал на имя. */
.yd-invite .yd-invite__head {
  padding-right: 26px;
}
