/* ==========================================================================
   KIYIZGROUP — ИИ-помощница: плавающий виджет (ADR-051, ADR-052, ADR-060).

   Подключается на каждой странице сайта, а вёрстка у страниц разная:
   у страницы основателя нет общего слоя, у /heritage свой. Поэтому:

   - у всех классов приставка `kgw-`. Общие имена уже ломали чужую вёрстку:
     `.card` и `.qa` из прежней версии перебивали сетку и FAQ на /heritage;
   - виджет начинается со сброса — стили страницы до него не дотягиваются;
     SVG из сброса исключены: он стёр бы геометрию иконок;
   - размеры в пикселях, а не в rem: базовый кегль у страниц разный,
     и окно не должно становиться то больше, то меньше.

   Бордовый — из бархата на костюме помощницы. Это единственный цвет сайта
   за пределами монохрома, и живёт он только здесь.
   ========================================================================== */

.kgw {
  --kgw-wine: #8f2740;
  --kgw-wine-hover: #a32d4a;
  --kgw-wine-line: rgba(190, 70, 100, 0.45);
  --kgw-wine-soft: rgba(143, 39, 64, 0.18);
  --kgw-rose: #e0596f;
  --kgw-online: #34c77b;
  --kgw-bg: #151515;
  --kgw-surface: #1f1f1f;
  --kgw-surface-2: #292929;
  --kgw-line: rgba(255, 255, 255, 0.1);
  --kgw-text: #f4f4f4;
  --kgw-muted: rgba(255, 255, 255, 0.56);
  --kgw-err: #f0998a;
  --kgw-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --kgw-y: 20px;
  --kgw-py: 20px;

  /* У корня нет своей коробки — только значения, которые наследуют дети.
     Иначе пустой блок в конце страницы мог бы задеть её вёрстку */
  display: contents;
  font-family:
    'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'PingFang SC',
    'Microsoft YaHei', 'Geeza Pro', sans-serif;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  text-align: start;
  color: var(--kgw-text);
  -webkit-font-smoothing: antialiased;
}

/* Сброс. `:where` не добавляет веса, поэтому правила ниже его перекрывают,
   а правила страниц вида `button { … }` — нет */
.kgw :where(*:not(svg, svg *)) {
  all: revert;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}
.kgw [hidden] {
  display: none !important;
}
.kgw svg {
  display: block;
  flex: 0 0 auto;
}
.kgw-i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kgw-i--fill {
  fill: currentColor;
  stroke: none;
}
.kgw button {
  cursor: pointer;
}

/* ==========================================================================
   Кнопка в углу
   ========================================================================== */

/*
  Слои. Кнопка — ниже корзины каталога (90), мобильного меню и баннера
  cookie (150): открытое окно страницы важнее приглашения к разговору.
  Окно — выше шапки (100): раз его открыли, закрывать его шапкой незачем.
*/
.kgw-fab {
  position: fixed;
  right: 16px;
  bottom: var(--kgw-y);
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: kgw-in 0.5s var(--kgw-ease) 0.35s both;
  transition:
    opacity 0.2s ease,
    transform 0.28s var(--kgw-ease);
}
.kgw[data-side='left'] .kgw-fab {
  right: auto;
  left: 16px;
  flex-direction: row-reverse;
}
.kgw-fab__core {
  position: relative;
  flex: 0 0 auto;
}
.kgw-launch {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1a1a1a;
  box-shadow:
    0 0 0 3px var(--kgw-wine),
    0 12px 32px rgba(0, 0, 0, 0.3);
  /* Жест перетаскивания принадлежит кнопке, а не прокрутке страницы */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition:
    transform 0.2s var(--kgw-ease),
    box-shadow 0.2s ease;
}
.kgw-launch:hover {
  transform: scale(1.06);
}
.kgw-launch:active {
  transform: scale(0.97);
}
.kgw-launch:focus-visible {
  outline: 3px solid var(--kgw-rose);
  outline-offset: 4px;
}
.kgw-launch__img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* «На связи» — зелёная точка, как в любом мессенджере. Красной она
   читалась бы как непрочитанное */
.kgw-launch__dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--kgw-online);
  box-shadow: 0 0 0 2.5px #1a1a1a;
}
.kgw-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--kgw-rose);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  animation: kgw-pop 0.3s var(--kgw-ease) both;
}
.kgw[data-side='left'] .kgw-badge {
  right: auto;
  left: -5px;
}

/* Раскрывающаяся подпись: при наведении из кнопки выезжает «Спросить
   ИИ-помощницу» — круг без слов на незнакомом сайте понятен не всем */
.kgw-fab__label {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #111;
  background: #fff;
  border-radius: 999px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateX(10px) scale(0.96);
  transform-origin: right center;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.24s var(--kgw-ease);
}
.kgw[data-side='left'] .kgw-fab__label {
  transform: translateX(-10px) scale(0.96);
  transform-origin: left center;
}
@media (hover: hover) {
  .kgw-fab:hover .kgw-fab__label {
    opacity: 1;
    transform: none;
  }
}
.kgw-launch:focus-visible ~ .kgw-fab__label,
.kgw-fab:focus-within .kgw-fab__label {
  opacity: 1;
  transform: none;
}

/* Крестик «спрятать» — только при наведении: всё время на виду он
   провоцировал бы закрыть помощницу, не узнав, что она умеет */
.kgw-fab__x {
  position: absolute;
  top: -9px;
  left: -9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #111;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 0.15s ease,
    transform 0.2s var(--kgw-ease);
}
.kgw[data-side='left'] .kgw-fab__x {
  left: auto;
  right: -9px;
}
.kgw-fab__x .kgw-i {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
@media (hover: hover) {
  .kgw-fab:hover .kgw-fab__x {
    opacity: 1;
    transform: none;
  }
}
.kgw-fab__x:focus-visible {
  opacity: 1;
  transform: none;
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}

.kgw--open .kgw-fab {
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}
.kgw--hidden .kgw-fab {
  display: none;
}
.kgw--dragging .kgw-fab {
  transition: none;
  animation: none;
}
.kgw--dragging .kgw-launch {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow:
    0 0 0 3px var(--kgw-wine),
    0 20px 44px rgba(0, 0, 0, 0.38);
}
.kgw--dragging .kgw-fab__label,
.kgw--dragging .kgw-fab__x,
.kgw--teaser .kgw-fab__label {
  opacity: 0 !important;
}

/* ---------- облачко с приветствием ---------- */

.kgw-teaser {
  position: fixed;
  right: 16px;
  bottom: calc(var(--kgw-y) + 76px);
  z-index: 85;
  display: flex;
  align-items: flex-start;
  max-width: 280px;
  color: #111;
  background: #fff;
  border-radius: 18px 18px 5px 18px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  transform-origin: bottom right;
  animation: kgw-pop 0.36s var(--kgw-ease) both;
}
.kgw[data-side='left'] .kgw-teaser {
  right: auto;
  left: 16px;
  border-radius: 18px 18px 18px 5px;
  transform-origin: bottom left;
}
.kgw-teaser__body {
  padding: 13px 4px 13px 16px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: start;
  color: #111;
}
.kgw-teaser__x {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 6px 6px 0 0;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.45);
}
.kgw-teaser__x:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.06);
}
.kgw-teaser__x .kgw-i {
  width: 14px;
  height: 14px;
}
.kgw--open .kgw-teaser,
.kgw--hidden .kgw-teaser {
  display: none;
}

/* ---------- язычок, когда помощницу спрятали ---------- */

.kgw-tab {
  position: fixed;
  right: 0;
  bottom: var(--kgw-y);
  z-index: 85;
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 58px;
  background: #1a1a1a;
  border-radius: 14px 0 0 14px;
  box-shadow: -4px 6px 22px rgba(0, 0, 0, 0.25);
  transition: width 0.2s var(--kgw-ease);
}
.kgw-tab:hover,
.kgw-tab:focus-visible {
  width: 40px;
}
.kgw-tab:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}
.kgw[data-side='left'] .kgw-tab {
  right: auto;
  left: 0;
  border-radius: 0 14px 14px 0;
  box-shadow: 4px 6px 22px rgba(0, 0, 0, 0.25);
}
.kgw--hidden .kgw-tab {
  display: flex;
  animation: kgw-pop 0.3s var(--kgw-ease) both;
}
.kgw-tab__img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--kgw-wine);
  pointer-events: none;
}

/* ==========================================================================
   Окно
   ========================================================================== */

/*
  Окно вырастает из кнопки: у него тот же угол и та же высота над краем.
  Закрытое остаётся в разметке и прозрачным — иначе нечему было бы
  анимироваться при сворачивании, — но недоступно ни мыши, ни клавиатуре.
*/
.kgw-panel {
  position: fixed;
  right: 16px;
  bottom: var(--kgw-py);
  z-index: 140;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 32px));
  color: var(--kgw-text);
  background: var(--kgw-bg);
  border: 1px solid var(--kgw-line);
  border-radius: 20px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.45),
    0 2px 10px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.95);
  transform-origin: bottom right;
  transition:
    opacity 0.18s ease,
    transform 0.26s var(--kgw-ease),
    visibility 0s linear 0.26s;
}
.kgw[data-side='left'] .kgw-panel {
  right: auto;
  left: 16px;
  transform-origin: bottom left;
}
.kgw--open .kgw-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}
.kgw--pdrag .kgw-panel {
  transition: none;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.5),
    0 2px 10px rgba(0, 0, 0, 0.25);
}

.kgw-screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------- шапка ---------- */

.kgw-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 14px 10px 14px 16px;
  border-bottom: 1px solid var(--kgw-line);
  background: linear-gradient(180deg, rgba(143, 39, 64, 0.26), rgba(143, 39, 64, 0));
  -webkit-user-select: none;
  user-select: none;
}
.kgw-head--form {
  padding-left: 8px;
}
/* Шапка — ручка для перетаскивания окна, и курсор должен это сказать */
@media (pointer: fine) and (min-width: 561px) {
  .kgw-head[data-kgw-drag] {
    cursor: grab;
  }
  .kgw--pdrag .kgw-head {
    cursor: grabbing;
  }
}
.kgw-head__ava {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}
.kgw-head__img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--kgw-wine);
  pointer-events: none;
}
.kgw-head__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kgw-online);
  box-shadow: 0 0 0 2px var(--kgw-bg);
}
.kgw-head__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
/* Имя и заголовок экрана заявки — до двух строк, а не многоточие:
   в переводах они длиннее русских, а обрезанный заголовок читается хуже */
.kgw-head__name {
  display: -webkit-box;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
/* Что отвечает ИИ, сказано прямо под именем (ТЗ: «явно обозначить») */
.kgw-head__note {
  display: -webkit-box;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--kgw-muted);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.kgw-ib {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.kgw-ib:hover,
.kgw-ib[aria-expanded='true'] {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}
.kgw-ib:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 1px;
}
[dir='rtl'] [data-kgw-back] .kgw-i {
  transform: scaleX(-1);
}

/* ---------- меню «⋯» ---------- */

.kgw-menu {
  position: absolute;
  top: calc(100% - 6px);
  right: 10px;
  z-index: 3;
  min-width: 224px;
  padding: 6px;
  background: #222;
  border: 1px solid var(--kgw-line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  transform-origin: top right;
  animation: kgw-pop 0.16s var(--kgw-ease) both;
}
[dir='rtl'] .kgw-menu {
  right: auto;
  left: 10px;
  transform-origin: top left;
}
.kgw-menu__i {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  text-align: start;
  color: var(--kgw-text);
}
.kgw-menu__i:hover,
.kgw-menu__i:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}
.kgw-menu__i .kgw-i {
  width: 16px;
  height: 16px;
  color: var(--kgw-muted);
}

/* ---------- лента ---------- */

.kgw-logwrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}
.kgw-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 16px 12px;
  overflow-y: auto;
  /* Докрутил ленту до конца — страница под окном не поедет следом */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.kgw-log > * {
  flex: 0 0 auto;
}
.kgw-log:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: -2px;
}
.kgw-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}
.kgw-msg--out {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.kgw-msg__ava {
  display: block;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.kgw-msg__b {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  /* Реплики приходят с переносами строк — сохраняем их, а длинную ссылку
     без пробелов всё равно ломаем, иначе пузырь распирает окно */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--kgw-text);
  background: var(--kgw-surface-2);
  border-radius: 16px 16px 16px 5px;
}
.kgw-msg--out .kgw-msg__b {
  color: #fff;
  background: var(--kgw-wine);
  border-radius: 16px 16px 5px 16px;
}
[dir='rtl'] .kgw-msg__b {
  border-radius: 16px 16px 5px 16px;
}
[dir='rtl'] .kgw-msg--out .kgw-msg__b {
  border-radius: 16px 16px 16px 5px;
}
.kgw-msg__b--rich {
  white-space: normal;
}
.kgw-new {
  animation: kgw-rise 0.26s var(--kgw-ease) both;
}

.kgw-msg--wait .kgw-msg__b {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
}
.kgw-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: kgw-dot 1.1s infinite ease-in-out;
}
.kgw-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.kgw-dot:nth-child(3) {
  animation-delay: 0.3s;
}

/* Прокрутил выше — новые реплики не выдёргивают из чтения, а ждут здесь */
.kgw-newmsg {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #111;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  animation: kgw-rise 0.2s var(--kgw-ease) both;
}
.kgw-newmsg .kgw-i {
  width: 14px;
  height: 14px;
}

/* ---------- карточки изделий под репликой ---------- */

/* Полоса прокручивается вбок внутри себя: карточек до четырёх, и в узком
   окне они в ряд не помещаются */
.kgw-cards {
  display: flex;
  gap: 10px;
  margin-left: 34px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
[dir='rtl'] .kgw-cards {
  margin-left: 0;
  margin-right: 34px;
}
.kgw-card {
  display: block;
  flex: 0 0 150px;
  overflow: hidden;
  color: inherit;
  background: var(--kgw-surface);
  border: 1px solid var(--kgw-line);
  border-radius: 12px;
  transition:
    border-color 0.2s ease,
    transform 0.2s var(--kgw-ease);
}
.kgw-card:hover {
  border-color: var(--kgw-wine-line);
  transform: translateY(-2px);
}
.kgw-card__img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
}
.kgw-card__b {
  display: block;
  padding: 10px 12px 12px;
}
.kgw-card__n {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}
/* Цена приходит с сервера из той же витрины, что рисует каталог */
.kgw-card__p {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--kgw-muted);
}

/* Кнопка под репликой: переход в конструктор и сбор заявки */
.kgw-cta {
  align-self: flex-start;
  display: inline-block;
  margin-left: 34px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--kgw-wine);
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
[dir='rtl'] .kgw-cta {
  margin-left: 0;
  margin-right: 34px;
}
.kgw-cta:hover {
  background: var(--kgw-wine-hover);
}
.kgw-cta:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}

/* ---------- переход к менеджеру ---------- */

/*
  Кнопки мессенджеров — внутри реплики помощницы, а не отдельной плашкой:
  переход к человеку — продолжение разговора. Значки — фирменных цветов
  мессенджеров: по ним их узнают быстрее, чем по подписи.
*/
.kgw-handoff__t {
  white-space: pre-wrap;
}
.kgw-handoff__btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.kgw-handoff__btns:first-child {
  margin-top: 0;
}
.kgw-handoff__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.kgw-handoff__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
.kgw-handoff__btn:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}
.kgw-handoff__btn .kgw-i {
  width: 20px;
  height: 20px;
}
.kgw-handoff__btn--tg .kgw-i--fill {
  color: #2aabee;
}
.kgw-handoff__btn--wa .kgw-i--fill {
  color: #25d366;
}
.kgw-handoff__l {
  flex: 1 1 auto;
}
.kgw-handoff__btn .kgw-i:last-child {
  width: 15px;
  height: 15px;
  color: var(--kgw-muted);
}
.kgw-handoff__hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--kgw-muted);
}

/* ---------- быстрые действия ---------- */

.kgw-quick {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  /* Ряд гаснет к краю — видно, что за краем есть ещё кнопки */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}
[dir='rtl'] .kgw-quick {
  -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(270deg, #000 calc(100% - 36px), transparent);
}
.kgw-quick::-webkit-scrollbar {
  display: none;
}
.kgw-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 8px 13px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--kgw-text);
  border: 1px solid var(--kgw-wine-line);
  border-radius: 999px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.kgw-chip:hover:not(:disabled) {
  background: var(--kgw-wine-soft);
  border-color: rgba(224, 89, 111, 0.7);
}
.kgw-chip:disabled {
  opacity: 0.45;
  cursor: default;
}
.kgw-chip:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}
.kgw-chip .kgw-i {
  width: 16px;
  height: 16px;
  color: #e07a92;
}

/* ---------- ввод ---------- */

.kgw-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0 12px;
  padding: 6px 6px 6px 16px;
  background: var(--kgw-surface);
  border: 1px solid var(--kgw-line);
  border-radius: 22px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.kgw-compose:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(143, 39, 64, 0.3);
}
/* Поле растёт вместе с текстом до пяти строк, дальше прокручивается */
.kgw-compose__input {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 132px;
  padding: 9px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--kgw-text);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  overflow-y: auto;
  scrollbar-width: thin;
}
.kgw-compose__input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  opacity: 1;
}
.kgw-send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #111;
  background: #fff;
  transition:
    transform 0.15s var(--kgw-ease),
    opacity 0.15s ease;
}
.kgw-send:hover:not(:disabled) {
  transform: scale(1.07);
}
.kgw-send:disabled {
  opacity: 0.3;
  cursor: default;
}
.kgw-send:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}
.kgw-send .kgw-i {
  width: 17px;
  height: 17px;
  /* Стрелка нарисована со смещением вправо: в круге она выглядит
     сдвинутой к центру, пока её не подвинуть на пиксель */
  transform: translateX(1px);
}
[dir='rtl'] .kgw-send .kgw-i {
  transform: scaleX(-1) translateX(1px);
}
.kgw-status {
  margin: 8px 16px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--kgw-muted);
}
.kgw-status:empty {
  display: none;
}
.kgw-status.is-err {
  color: var(--kgw-err);
}

/* ---------- подвал окна ---------- */

.kgw-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex: 0 0 auto;
  padding: 8px 8px 10px;
}
.kgw-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 9px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.kgw-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
.kgw-link:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 1px;
}
.kgw-link .kgw-i {
  width: 15px;
  height: 15px;
}

/* ---------- экран заявки ---------- */

.kgw-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.kgw-form__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.kgw-form__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--kgw-muted);
}
.kgw-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kgw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.kgw-field__l {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.kgw-field__l.is-req::after {
  content: ' *';
  color: var(--kgw-rose);
}
.kgw-field__i {
  display: block;
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--kgw-text);
  background: var(--kgw-surface);
  border: 1px solid var(--kgw-line);
  border-radius: 11px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
textarea.kgw-field__i {
  min-height: 78px;
  resize: vertical;
}
.kgw-field__i:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(143, 39, 64, 0.3);
}
.kgw-field__i[aria-invalid='true'] {
  border-color: var(--kgw-err);
}
.kgw-form__note {
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.45);
}
.kgw-form__note a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.kgw-form__foot {
  flex: 0 0 auto;
  padding: 12px 16px 16px;
  background: var(--kgw-bg);
  border-top: 1px solid var(--kgw-line);
}
.kgw-form__foot .kgw-status {
  margin: 0 0 10px;
}
.kgw-submit {
  display: block;
  width: 100%;
  height: 46px;
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  color: #111;
  background: #fff;
  border-radius: 12px;
  transition: background-color 0.15s ease;
}
.kgw-submit:hover:not(:disabled) {
  background: #ececec;
}
.kgw-submit:disabled {
  opacity: 0.55;
  cursor: progress;
}
.kgw-submit:focus-visible {
  outline: 2px solid var(--kgw-rose);
  outline-offset: 2px;
}
.kgw-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Телефон
   ========================================================================== */

/*
  На телефоне окно — на весь экран: с открытой клавиатурой от карточки
  в углу осталась бы полоска, в которой не видно ни ответа, ни своего
  вопроса. Страница под окном не прокручивается. Кегль полей — 16 px:
  меньше iOS увеличивает страницу при вводе.
*/
@media (max-width: 560px) {
  .kgw-fab {
    right: 12px;
  }
  .kgw[data-side='left'] .kgw-fab {
    left: 12px;
  }
  .kgw-launch {
    width: 56px;
    height: 56px;
  }
  .kgw-fab__label,
  .kgw-fab__x,
  .kgw-teaser {
    display: none;
  }
  .kgw[data-side] .kgw-panel {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    transform: translateY(24px);
    transform-origin: bottom center;
  }
  .kgw--open[data-side] .kgw-panel {
    transform: none;
  }
  .kgw-head {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .kgw-foot {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .kgw-form__foot {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .kgw-compose__input,
  .kgw-field__i {
    font-size: 16px;
  }
  .kgw-msg {
    max-width: 92%;
  }
}
html.kgw-lock,
html.kgw-lock body {
  overflow: hidden;
}

/* ---------- движение ---------- */

@keyframes kgw-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.8);
  }
}
@keyframes kgw-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}
@keyframes kgw-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes kgw-dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.kgw-newmsg {
  animation-name: kgw-rise-center;
}
@keyframes kgw-rise-center {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .kgw *,
  .kgw *::before,
  .kgw *::after {
    animation: none !important;
    transition: none !important;
  }
}
