/* VetGuardian — ИИ-ассистент (изолированные классы vg-ai-*) */
.vg-ai-section {
  margin-top: 3rem;
  padding: 0 clamp(10px, 2.2vw, 28px) 2.5rem;
  scroll-margin-top: 24px;
  overflow: visible;
}

/* Ряд чат + Luna: на широком экране колонка Luna по высоте = карточка чата; PNG 3:2 — object-fit: contain без crop. */
.vg-ai-split {
  max-width: min(1720px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
}

/* Заголовок секции на всю ширину блока (как у контента ниже) */
.vg-ai-split__header {
  max-width: 100%;
  margin: 0 0 1.25rem;
  text-align: left;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.vg-ai-split__main {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 32px);
  overflow: visible;
}

/* Десктоп: прежняя высота ряда чат + Luna (равная колонкам), лёгкая подрезка снизу у карточки чата */
@media (min-width: 961px) {
  .vg-ai-split__main {
    min-height: clamp(600px, 72vh, 860px);
    align-items: stretch;
  }

  .vg-ai-col--chat,
  .vg-ai-col--luna {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
  }

  .vg-ai-col--luna {
    flex: 1 1 720px;
    max-width: 100%;
  }

  .vg-ai-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
  }

  .vg-ai-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* минимальный зазор под дисклеймером */
    padding-bottom: 4px;
  }

  .vg-ai-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  .vg-ai-luna-figure {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .vg-ai-disclaimer {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.35;
  }
}

.vg-ai-col--chat {
  flex: 0 1 620px;
  min-width: 0;
  max-width: min(620px, 100%);
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.vg-ai-section--inview .vg-ai-col--chat {
  opacity: 1;
  transform: translateX(0);
}

.vg-ai-inner {
  max-width: 620px;
  margin: 0 auto;
}

.vg-ai-header {
  text-align: inherit;
  margin-bottom: 0;
  max-width: 100%;
}

.vg-ai-title {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text, #0c1929);
  margin: 0 0 1rem;
  font-family: var(--font, "TT Days Sans", sans-serif);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  /* якорь «Поддержка»: заголовок целиком под фиксированной шапкой (логотип ~128px + padding) */
  scroll-margin-top: clamp(152px, 22vh, 220px);
}

.vg-ai-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--gray-light, #cbd5e1);
  border-radius: 24px;
  box-shadow: var(--shadow, 0 4px 20px rgba(14, 165, 233, 0.12));
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.8s ease 0.2s;
}

.vg-ai-section--inview .vg-ai-col--chat .vg-ai-card {
  opacity: 1;
}

.vg-ai-messages {
  min-height: 340px;
  max-height: min(68vh, 700px);
  overflow-y: auto;
  padding: 8px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vg-ai-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
}

.vg-ai-row--user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.vg-ai-row--assistant {
  align-self: flex-start;
}

.vg-ai-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pastel, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.vg-ai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vg-ai-avatar--user {
  background: linear-gradient(160deg, #7dd3fc, #38bdf8) !important;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.vg-ai-pending-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--pastel, #e0f2fe);
  border: 1px solid rgba(14, 165, 233, 0.35);
  font-family: var(--font, "TT Days Sans", sans-serif);
}

.vg-ai-pending-wrap[hidden] {
  display: none !important;
}

.vg-ai-pending-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.vg-ai-pending-name {
  flex: 1 1 auto;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, #334155);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vg-ai-pending-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text, #0c1929);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.vg-ai-pending-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.vg-ai-bubble {
  max-width: min(100%, 78%);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 1rem;
  line-height: 1.55;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  word-break: break-word;
  font-family: var(--font, "TT Days Sans", sans-serif);
}

.vg-ai-bubble--assistant {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text, #0c1929);
  border-bottom-left-radius: 6px;
}

.vg-ai-bubble--user {
  background: linear-gradient(145deg, #38bdf8, #0ea5e9);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.vg-ai-bubble--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.vg-ai-bubble-text {
  white-space: normal;
  word-break: break-word;
}

.vg-ai-thumb {
  margin-top: 8px;
  border-radius: 12px;
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.vg-ai-audio {
  margin-top: 8px;
  width: 100%;
  max-width: 280px;
}

.vg-ai-meta {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 6px;
}

.vg-ai-typing {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  align-self: flex-start;
  margin-left: 12px;
  background: #f1f5f9;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.vg-ai-typing--hidden {
  display: none;
}

.vg-ai-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky-dark, #0ea5e9);
  animation: vg-ai-dot 1.2s infinite ease-in-out both;
}

.vg-ai-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.vg-ai-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes vg-ai-dot {
  0%,
  80%,
  100% {
    transform: scale(0.65);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.vg-ai-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.vg-ai-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Микрофон: высота как у кнопки вложения; пульс записи — поверх потока, не сдвигает ряд */
.vg-ai-mic-stack {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vg-ai-rec-pulse {
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #cbd5e1;
  opacity: 0;
  transform: scale(0.55);
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.vg-ai-mic-stack--recording .vg-ai-rec-pulse {
  opacity: 1;
  animation: vg-ai-rec-breath 1.05s ease-in-out infinite;
}

@keyframes vg-ai-rec-breath {
  0%,
  100% {
    transform: scale(0.65);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.vg-ai-tool-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s ease;
  font-family: inherit;
  box-shadow: none;
  padding: 0;
}

.vg-ai-tool-btn:hover {
  background: rgba(241, 245, 249, 0.95);
  border-color: #e2e8f0;
}

.vg-ai-tool-btn:active {
  transform: scale(0.96);
}

.vg-ai-mic-stack--recording .vg-ai-tool-btn {
  background: rgba(241, 245, 249, 0.85);
  border-color: #e2e8f0;
}

.vg-ai-tool-img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.vg-ai-mic-stack--recording .vg-ai-tool-btn .vg-ai-tool-img {
  transform: scale(1.12);
}

.vg-ai-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.vg-ai-textarea {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  resize: none;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--gray-light, #cbd5e1);
  font-family: var(--font, "TT Days Sans", sans-serif);
  font-size: 1rem;
  line-height: 1.45;
  background: #fff;
  color: var(--text, #0c1929);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.vg-ai-textarea:focus {
  outline: none;
  border-color: var(--sky-dark, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.vg-ai-send-btn {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(145deg, #0ea5e9, #0284c7);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: var(--font, "TT Days Sans", sans-serif);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s, opacity 0.2s;
}

.vg-ai-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.vg-ai-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.vg-ai-send-arrow {
  font-size: 1rem;
  line-height: 1;
}

.vg-ai-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  text-align: center;
  margin: 4px 0 0;
  font-family: var(--font, "TT Days Sans", sans-serif);
}

.vg-ai-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Колонка Luna: забирает всё свободное место в ряду (без искусственного max 920px) */
.vg-ai-col--luna {
  display: flex;
  flex-direction: column;
  flex: 1 1 min(520px, 50vw);
  min-width: min(300px, 100%);
  max-width: 100%;
  min-height: 0;
  overflow: visible;
  align-self: stretch;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s, transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}

.vg-ai-section--inview .vg-ai-col--luna {
  opacity: 1;
  transform: translateX(0);
}

.vg-ai-luna-figure {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  /* Фон «карточки Luna» как в макете: бирюза за PNG, чат остаётся белой карточкой слева */
  background: linear-gradient(155deg, #bae6fd 0%, #38bdf8 28%, #0ea5e9 62%, #0284c7 100%);
  box-shadow: 0 12px 40px rgba(14, 165, 233, 0.25);
}

/* <picture> не должен ломать absolute-раскладку img внутри figure */
.vg-ai-luna-figure > picture {
  display: contents;
}

.vg-ai-luna-img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  /* cover — без «полей» сверху/снизу у PNG в высокой карточке (contain оставлял полосы) */
  object-fit: cover;
  object-position: center 22%;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.vg-ai-luna-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

/* Одна колонка для заголовка и ul — общий right/left с кнопками, без отдельного absolute у текста */
.vg-ai-luna-rail {
  position: absolute;
  left: 52%;
  /* чуть левее — заголовок и список ближе к центру картинки */
  right: 4.5%;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px max(10px, 2.2%) 0 0;
  box-sizing: border-box;
  min-width: 0;
  pointer-events: none;
}

.vg-ai-luna-rail > * {
  pointer-events: auto;
}

.vg-ai-luna-head {
  position: relative;
  flex: 0 0 auto;
  flex-shrink: 1;
  /* min-width: 0 — иначе flex не сжимает блок ниже ширины nowrap-текста и текст вылезает за figure */
  min-width: 0;
  margin: 0;
  margin-top: 2.5%;
  margin-bottom: clamp(14px, 2.4vw, 22px);
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  display: block;
  padding: 0 0 0 4px;
  padding-right: max(12px, 0.35em);
  box-sizing: border-box;
  font-family: var(--font, "TT Days Sans", sans-serif);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.18;
  text-align: right;
  text-shadow: none;
  /* заголовок: заметнее влево на странице (блок правого края) */
  transform: translateX(-clamp(22px, 3.2vw, 64px));
}

.vg-ai-luna-head-br {
  display: block;
  margin: 0.08em 0 0;
}

/* По умолчанию как раньше: ряд, блок списка тянется по высоте под колонку чата */
.vg-ai-luna-cards-wrap {
  position: relative;
  flex: 1 1 auto;
  flex-shrink: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  gap: 0;
}

.vg-ai-luna-mob-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  /* не min-height:0 — иначе колонка Luna сжимается по высоте относительно чата */
  min-height: auto;
  align-self: stretch;
}

.vg-ai-luna-mob-nav {
  display: none;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  padding: 0 2px;
  box-sizing: border-box;
  gap: 8px;
}

.vg-ai-luna-mob-arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text, #0c1929);
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
  font-family: inherit;
}

.vg-ai-luna-mob-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.vg-ai-luna-mob-arrow:not(:disabled):active {
  transform: scale(0.96);
}

.vg-ai-luna-line1,
.vg-ai-luna-line2 {
  display: block;
  width: 100%;
  text-align: right;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.85s ease, transform 0.85s ease;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* Ровно две строки: «ОБРАТИТЕ ВНИМАНИЕ» | «НА ВАШЕГО ПИТОМЦА» */
.vg-ai-luna-line1 {
  font-size: clamp(1.15rem, 2.95vw, 2.52rem);
}

.vg-ai-luna-line2 {
  font-size: clamp(1.02rem, 2.62vw, 2.2rem);
  letter-spacing: 0.05em;
}

.vg-ai-section--inview .vg-ai-luna-line1 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.35s;
}

.vg-ai-section--inview .vg-ai-luna-line2 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.55s;
}

.vg-ai-luna-cards {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
  overflow: visible;
}

.vg-ai-check-item {
  margin: 0;
  padding: 6px 8px;
  overflow: visible;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.vg-ai-section--inview .vg-ai-check-item:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.7s;
}

.vg-ai-section--inview .vg-ai-check-item:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.78s;
}

.vg-ai-section--inview .vg-ai-check-item:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.86s;
}

.vg-ai-section--inview .vg-ai-check-item:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.94s;
}

.vg-ai-section--inview .vg-ai-check-item:nth-child(5) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.02s;
}

.vg-ai-check-toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  border: 1px solid rgba(226, 232, 240, 0.98);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 15px;
  padding: 15px 17px;
  margin: 0;
  min-height: 3.25rem;
  cursor: pointer;
  font-family: var(--font, "TT Days Sans", sans-serif);
  font-size: clamp(0.92rem, 1.18vw, 1.1rem);
  font-weight: 600;
  color: var(--text, #0c1929);
  line-height: 1.28;
  box-sizing: border-box;
  transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.vg-ai-check-title-row {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.vg-ai-check-short {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
  transition: color 0.2s ease;
}

.vg-ai-check-chevron {
  flex: 0 0 auto;
  width: 0.55em;
  height: 0.55em;
  margin-top: 0.35em;
  border-right: 2px solid rgba(15, 23, 42, 0.45);
  border-bottom: 2px solid rgba(15, 23, 42, 0.45);
  transform: rotate(45deg);
  transition: transform 0.32s ease, border-color 0.2s ease;
}

.vg-ai-check-item.is-expanded .vg-ai-check-chevron {
  transform: rotate(225deg);
  margin-top: 0.55em;
}

.vg-ai-check-item:hover .vg-ai-check-toggle,
.vg-ai-check-item:focus-within .vg-ai-check-toggle {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(148, 163, 184, 0.55);
}

.vg-ai-check-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.vg-ai-check-item.is-expanded .vg-ai-check-drawer {
  grid-template-rows: 1fr;
}

.vg-ai-check-drawer-inner {
  min-height: 0;
  overflow: hidden;
}

.vg-ai-check-long {
  margin: 0;
  padding: 10px 12px 12px 56px;
  font-weight: 600;
  font-size: clamp(0.75rem, 1vw, 0.88rem);
  letter-spacing: 0.01em;
  line-height: 1.45;
  color: var(--text, #0c1929);
}

.vg-ai-paw-wrap {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}

.vg-ai-paw {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  object-fit: contain;
  transition: opacity 0.32s ease;
}

.vg-ai-paw--on {
  opacity: 0;
}

.vg-ai-check-item:hover .vg-ai-paw--on,
.vg-ai-check-item:focus-within .vg-ai-paw--on,
.vg-ai-check-item.is-expanded .vg-ai-paw--on {
  opacity: 1;
}

.vg-ai-check-item:hover .vg-ai-paw--off,
.vg-ai-check-item:focus-within .vg-ai-paw--off,
.vg-ai-check-item.is-expanded .vg-ai-paw--off {
  opacity: 0;
}

@media (max-width: 960px) {
  .vg-ai-split__main {
    flex-direction: column;
    align-items: stretch;
  }

  .vg-ai-col--chat {
    flex-basis: 100%;
    max-width: 100%;
    transform: translateX(-18px);
  }

  .vg-ai-section--inview .vg-ai-col--chat {
    transform: translateX(0);
  }

  .vg-ai-col--luna {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    align-self: stretch;
    transform: translateX(40px);
  }

  .vg-ai-section--inview .vg-ai-col--luna {
    transform: translateX(0);
  }

  .vg-ai-luna-figure {
    flex: 0 0 auto;
    aspect-ratio: 3 / 2;
    width: 100%;
    max-width: 100%;
  }

  .vg-ai-luna-rail {
    left: 48%;
    right: 5.5%;
    padding: 8px max(10px, 2.4%) 0 0;
  }

  .vg-ai-luna-head {
    margin-top: 2%;
    width: 100%;
    max-width: 100%;
    transform: translateX(-clamp(16px, 2.8vw, 40px));
  }

  .vg-ai-luna-cards {
    max-width: 100%;
  }

  .vg-ai-luna-line1 {
    font-size: clamp(1.06rem, 3.05vw, 1.9rem);
  }

  .vg-ai-luna-line2 {
    font-size: clamp(0.92rem, 2.58vw, 1.58rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vg-ai-col--chat,
  .vg-ai-col--luna,
  .vg-ai-card,
  .vg-ai-luna-line1,
  .vg-ai-luna-line2,
  .vg-ai-check-item {
    transition-duration: 0.2s !important;
    transition-delay: 0ms !important;
  }

  .vg-ai-col--chat {
    transform: translateX(-8px);
  }

  .vg-ai-section--inview .vg-ai-col--chat {
    transform: translateX(0);
  }

  .vg-ai-col--luna {
    transform: translateX(8px);
  }

  .vg-ai-section--inview .vg-ai-col--luna {
    transform: translateX(0);
  }

  .vg-ai-check-toggle {
    transition-duration: 0.15s !important;
  }

  .vg-ai-check-drawer {
    transition-duration: 0.15s !important;
  }
}

@media (max-width: 600px) {
  .vg-ai-section {
    padding: 0 clamp(10px, 3.5vw, 18px) 1.5rem;
    margin-top: 2rem;
    scroll-margin-top: 20px;
  }

  .vg-ai-inner {
    max-width: 100%;
  }

  .vg-ai-split__header {
    max-width: 100%;
  }

  .vg-ai-title {
    font-size: clamp(0.72rem, 3.2vw, 1.35rem);
    margin-bottom: 0.65rem;
  }

  .vg-ai-luna-rail {
    left: 40%;
    right: 4.5%;
    padding: 6px max(8px, 2.4%) 0 0;
  }

  .vg-ai-luna-head {
    margin-top: 2%;
    width: 100%;
    max-width: 100%;
    transform: translateX(-clamp(10px, 2.2vw, 28px));
  }

  .vg-ai-luna-line1 {
    font-size: clamp(0.78rem, 3.65vw, 1.22rem);
  }

  .vg-ai-luna-line2 {
    font-size: clamp(0.68rem, 3.12vw, 1.04rem);
  }

  .vg-ai-check-toggle {
    font-size: clamp(0.62rem, 2.75vw, 0.78rem);
    padding: 7px 9px;
    min-height: 2.75rem;
    gap: 6px;
    border-radius: 11px;
  }

  .vg-ai-paw-wrap {
    width: 24px;
    height: 24px;
  }

  .vg-ai-paw {
    width: 24px;
    height: 24px;
  }

  .vg-ai-luna-cards {
    gap: 7px;
    max-width: 100%;
    padding: 0 4px 0 12px;
  }

  .vg-ai-check-long {
    font-size: clamp(0.64rem, 2.6vw, 0.78rem);
    padding-left: 40px;
  }

  .vg-ai-check-chevron {
    width: 0.5em;
    height: 0.5em;
    margin-top: 0.28em;
  }

  .vg-ai-card {
    padding: 14px 12px 12px;
    border-radius: 18px;
  }

  .vg-ai-messages {
    min-height: 300px;
    max-height: min(62vh, 620px);
  }

  .vg-ai-tool-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .vg-ai-mic-stack {
    width: 52px;
    height: 52px;
  }

  .vg-ai-tool-img {
    width: 30px;
    height: 30px;
  }

  .vg-ai-send-btn {
    min-height: 52px;
    padding: 0 14px;
    font-size: 0.9rem;
  }

  .vg-ai-send-label {
    display: none;
  }

  .vg-ai-bubble {
    max-width: 88%;
    font-size: 0.95rem;
  }

  .vg-ai-avatar {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

/* Luna: портрет телефона — белый блок, голубой заголовок, текст, стрелки по бокам */
@media (max-width: 960px) and (orientation: portrait) {
  /* весь оверлей строго внутри бирюзовой карточки — без заезда на блок ниже */
  .vg-ai-luna-figure:has(.vg-ai-luna--slide-mode) {
    overflow: hidden;
    margin-bottom: 0;
  }

  .vg-ai-luna-figure:has(.vg-ai-luna--slide-mode) .vg-ai-luna-overlay {
    overflow: hidden;
  }

  .vg-ai-luna-rail:has(.vg-ai-luna--slide-mode) {
    padding: 6px max(8px, 2vw) 10px 0;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .vg-ai-luna-rail:has(.vg-ai-luna--slide-mode) .vg-ai-luna-head {
    margin-top: 0.5%;
    margin-bottom: 4px;
    flex: 0 0 auto;
  }

  /* оставшееся место под заголовком rail — ограничиваем высоту, чтобы слайд не вылезал */
  .vg-ai-luna-cards-wrap.vg-ai-luna--slide-mode {
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    overflow: hidden;
  }

  .vg-ai-luna-cards-wrap.vg-ai-luna--slide-mode .vg-ai-luna-mob-nav {
    display: none !important;
  }

  .vg-ai-luna-cards-wrap.vg-ai-luna--slide-mode .vg-ai-luna-mob-viewport {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2.5% 10px;
    box-sizing: border-box;
  }

  .vg-ai-luna-cards-wrap.vg-ai-luna--slide-mode .vg-ai-luna-cards {
    display: none !important;
  }

  .vg-ai-luna-cards-wrap.vg-ai-luna--slide-mode .vg-ai-luna-slideview:not([hidden]) {
    display: block;
    width: 100%;
    max-width: min(92vw, 410px);
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    padding: 2px 0 4px;
    box-sizing: border-box;
    transform: none;
  }

  /* сетка: стрелки по краям, заголовок на всю ширину центра, под ним — фиксированная колонка скролла */
  .vg-ai-luna-slide-panel {
    position: relative;
    width: 100%;
    max-width: none;
    max-height: 100%;
    min-height: 0;
    height: 100%;
    padding: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.98);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 0;
    row-gap: 4px;
    align-items: stretch;
    overflow: hidden;
  }

  .vg-ai-luna-slide-inner {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 10px 10px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .vg-ai-luna-slide-arrow {
    position: static;
    z-index: 2;
    width: 36px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #0369a1;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    align-self: center;
  }

  .vg-ai-luna-slide-arrow--prev {
    grid-column: 1;
    grid-row: 1 / -1;
    justify-self: center;
    justify-content: flex-start;
    padding-left: 0;
  }

  .vg-ai-luna-slide-arrow--next {
    grid-column: 3;
    grid-row: 1 / -1;
    justify-self: center;
    justify-content: flex-end;
    padding-right: 0;
  }

  .vg-ai-luna-slide-arrow:disabled {
    opacity: 0.28;
    cursor: default;
  }

  .vg-ai-luna-slide-title {
    grid-column: 2;
    grid-row: 1;
    margin: 8px 4px 2px;
    padding: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: clamp(0.78rem, 2.85vw, 0.92rem);
    font-weight: 800;
    color: #0284c7;
    font-family: var(--font, "TT Days Sans", sans-serif);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  .vg-ai-luna-slide-text {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    min-height: 0;
    font-size: clamp(0.76rem, 2.85vw, 0.88rem);
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    transform: none;
    color: var(--text, #0c1929);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
    overflow-anchor: none;
    scrollbar-gutter: stable;
  }

  .vg-ai-luna-head-br {
    margin: 0.02em 0 -0.14em;
  }

  .vg-ai-luna-line2 {
    display: inline-block;
    margin-top: -0.3em;
  }
}

/* телефон в альбоме: та же подтяжка второй строки */
@media (max-width: 768px) {
  .vg-ai-luna-head-br {
    margin: 0.02em 0 -0.12em;
  }

  .vg-ai-luna-line2 {
    display: inline-block;
    margin-top: -0.28em;
  }
}

@media (max-width: 960px) and (orientation: portrait) and (prefers-reduced-motion: reduce) {
  .vg-ai-luna-slide-text {
    scroll-behavior: auto;
  }
}

/* Заголовок Luna: компактные две фразы только на узких телефонах */
@media (max-width: 600px) {
  .vg-ai-luna-head {
    line-height: 1.12;
  }

  .vg-ai-luna-head-br {
    display: none;
  }

  .vg-ai-luna-line1 {
    display: inline;
    white-space: normal;
  }

  .vg-ai-luna-line2 {
    display: inline !important;
    margin-left: 0.35em !important;
    margin-top: 0 !important;
  }
}

@media (min-width: 601px) {
  .vg-ai-send-arrow {
    display: none;
  }
}
