/* === AI Teaser base === */
#ai-teaser {
    --inno-visual: 260px;
    --inno-blob: 220px;
}

#ai-teaser .teaser-body {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 18px;
    padding: 20px;
    min-height: 280px;
}

#ai-teaser .teaser-visual {
    position: relative;
    z-index: 1;
}

#ai-teaser .teaser-copy {
    position: relative;
    z-index: 2;
}

@media (min-width: 640px) {
    #ai-teaser .teaser-body {
        grid-template-columns: var(--inno-visual) 1fr;
        gap: 24px;
        padding: 24px;
        min-height: 300px;
    }
}

/* === Blob visual === */
.ai-blob-wrap {
    position: relative;
    width: var(--inno-visual);
    aspect-ratio: 1/1;
    margin: 0 auto;
    display: grid;
    place-items: center;
}

.ai-blob {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--inno-blob, 220px);
    height: var(--inno-blob, 220px);
}

.ai-blob__chip {
    width: var(--inno-blob);
    height: var(--inno-blob);
    border-radius: 24px;
}

.ai-blob__img-wrap {
    position: relative;
    inset: 0;
    display: grid;
    place-items: center;
    height: 100%;
    width: 100%;
    will-change: transform;
}

.ai-blob__img {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    display: block;
    margin: auto;
    pointer-events: none;
    will-change: transform;
}

@media (min-width: 640px) {
    .ai-blob__img {
        max-width: 66%;
        max-height: 66%;
    }
}

/* Hover/animation states */
.ai-blob:hover .no-pause {
    animation-play-state: running !important;
}

.ai-blob:hover .ai-blob__bg,
.ai-blob:hover .ai-spark {
    animation-play-state: paused;
}

.ai-blob:hover .ai-blob__img:not(.boop) {
    animation-play-state: paused;
}

/* Boop animation */
.ai-blob__img.boop {
    animation: aiBoop 320ms ease-out;
    animation-play-state: running !important;
}

@keyframes aiBoop {
    0% {
        transform: scale(1) rotate(0deg);
    }
    40% {
        transform: scale(1.08) rotate(2deg);
    }
    70% {
        transform: scale(1.02) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

#ai-chat a {
    text-decoration: underline;
    color: #38bdf8;
}

#ai-chat a:hover {
    text-decoration-thickness: 2px;
}


#ai-chat ul {
    list-style-type: disc; /* кружочки */
    margin-left: 1.25rem;
    padding-left: 1.25rem;
}

#ai-chat ol {
    list-style-type: decimal;
    margin-left: 1.25rem;
    padding-left: 1.25rem;
}

#ai-chat ul ul {
    list-style-type: circle;
}

#ai-chat ul ul ul {
    list-style-type: square;
}


/* Hearts */
.ai-heart {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: aiHeart 900ms ease-out forwards;
    font-size: 16px;
    color: #7c8fff;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .35));
}

.ai-heart i {
    display: block;
}

.ai-heart svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes aiHeart {
    0% {
        transform: translate(-50%, -30%) scale(.6);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -120%) scale(1.1);
        opacity: 0;
    }
}

/* Performance & a11y */
.ai-blob__chip,
.ai-blob__img,
.ai-blob__bg {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .ai-blob__bg,
    .ai-blob__chip,
    .ai-blob__img {
        animation: none !important;
        transform: none !important;
    }
}

/* === Chat typography === */
#ai-chat {
    line-height: 1.55;
}

#ai-chat .border-white\/10.p-3 > * + * { /* класс с "/" уже экранирован */
    margin-top: 0.8em;
}

#ai-chat ul, #ai-chat ol {
    padding-left: 1.2em;
}

#ai-chat li + li {
    margin-top: 0.35em;
}

#ai-chat p,
#ai-chat ul,
#ai-chat ol,
#ai-chat pre,
#ai-chat blockquote {
    margin: 0;
}


#ai-chat, #inno-chat-log { line-height: 1.55; }

#ai-chat .border-white\/10.p-3 > * + *,
#inno-chat-log .border-white\/10.p-3 > * + * { margin-top: 0.8em; }


/* одинаковая межстрочность */
#ai-chat, #inno-chat-log { line-height: 1.55; }

/* отступы между соседними блоками внутри пузыря с border-white/10 и p-3 */
#ai-chat .border-white\/10.p-3 > * + *,
#inno-chat-log .border-white\/10.p-3 > * + * { margin-top: 0.8em; }

/* списки */
#ai-chat ul, #ai-chat ol,
#inno-chat-log ul, #inno-chat-log ol { padding-left: 1.2em; }

#ai-chat li + li,
#inno-chat-log li + li { margin-top: 0.35em; }

/* обнуляем базовые margin для типовых элементов внутри пузыря */
#ai-chat p, #ai-chat ul, #ai-chat ol, #ai-chat pre, #ai-chat blockquote,
#inno-chat-log p, #inno-chat-log ul, #inno-chat-log ol, #inno-chat-log pre, #inno-chat-log blockquote { margin: 0; }


/* ссылки */
#ai-chat a,
#inno-chat-log .msg-text a {
  text-decoration: underline;
  color: #38bdf8;
}
#ai-chat a:hover,
#inno-chat-log .msg-text a:hover {
  text-decoration-thickness: 2px;
}

/* списки */
#ai-chat ul, #ai-chat ol,
#inno-chat-log .msg-text ul, #inno-chat-log .msg-text ol {
  list-style-position: outside;
  padding-left: 1.2em;
  margin-left: 0;
}
#ai-chat ol,
#inno-chat-log .msg-text ol {
  list-style-type: decimal;
}
#ai-chat ul,
#inno-chat-log .msg-text ul {
  list-style-type: disc;
}
#ai-chat li + li,
#inno-chat-log .msg-text li + li {
  margin-top: 0.35em;
}

/* одинаковые отступы между блоками внутри пузыря */
#ai-chat .border-white\/10.p-3 > * + *,
#inno-chat-log .border-white\/10.p-3 > * + * {
  margin-top: 0.8em;
}

/* обнуление базовых margin, чтобы не дралось с Tailwind */
#ai-chat p, #ai-chat ul, #ai-chat ol, #ai-chat pre, #ai-chat blockquote,
#inno-chat-log .msg-text p, #inno-chat-log .msg-text ul, #inno-chat-log .msg-text ol,
#inno-chat-log .msg-text pre, #inno-chat-log .msg-text blockquote {
  margin: 0;
}