/* Logozavr Calliope AI assistant */
:root {
  --lg-ai-blue: #0f2d52;
  --lg-ai-emerald: #059669;
}
body:not(.lg-has-app-dock) .lg-ai-fab {
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}
/* STRELA — ИИ-ассистент: плавающая кнопка и панель чата */
.lg-ai-overlay,
.lg-ai-panel,
.lg-ai-panel button,
.lg-ai-panel input,
.lg-ai-panel textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ── Плавающая кнопка (облачко) ──
   Яркое цветное градиентное облачко ИИ с единичной аккуратной анимацией появления. */
.lg-ai-fab {
    position: fixed;
    right: 14px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    background: linear-gradient(135deg, #0f2d52 0%, #0f2d52 36%, #0b2342 70%, #059669 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(197, 154, 64, 0.42), 0 2px 8px rgba(184, 140, 50, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.45);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease, border-color 0.2s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    animation: saiFabEntrance 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s 1 backwards;
}
.lg-ai-fab::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, #0f2d52, #0b2342, #059669);
    z-index: -1;
    pointer-events: none;
    animation: saiFabRipple 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1.1s 1 forwards;
    opacity: 0;
}
.lg-ai-fab:hover {
    transform: translateY(-2px) scale(1.06);
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 26px rgba(197, 154, 64, 0.55), 0 0 20px rgba(184, 140, 50, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}
.lg-ai-fab:active {
    transform: scale(0.94);
}
.lg-ai-fab-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: transparent;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
    animation: saiIcoWiggle 1s ease-out 0.9s 1;
}
.lg-ai-fab-ico svg {
    width: 25px;
    height: 25px;
    display: block;
}
.lg-ai-fab-label,
.lg-ai-fab-hint,
.lg-ai-fab-copy {
    display: none;
}
.lg-ai-fab.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    pointer-events: none;
    animation: none;
}

/* Клавиатура открыта — кнопка мешает вводу */
html.lg-keyboard-open .lg-ai-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    animation: none;
}

/* ПК: красивое облачко у правого края */
@media (min-width: 1024px) {
    .lg-ai-fab {
        right: max(22px, calc((100vw - 1260px) / 2 + 22px));
        bottom: 22px;
        width: 52px;
        height: 52px;
        min-width: 52px;
        border-radius: 26px;
        box-shadow: 0 6px 22px rgba(197, 154, 64, 0.45), 0 2px 10px rgba(184, 140, 50, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    }
    .lg-ai-fab:hover {
        transform: translateY(-3px) scale(1.07);
        border-color: rgba(255, 255, 255, 0.85);
        box-shadow: 0 10px 30px rgba(197, 154, 64, 0.65), 0 0 24px rgba(184, 140, 50, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    }
    .lg-ai-fab:active {
        transform: translateY(0) scale(0.96);
    }
    .lg-ai-fab-ico {
        width: 28px;
        height: 28px;
    }
    .lg-ai-fab-ico svg {
        width: 28px;
        height: 28px;
    }
}

[data-theme="light"] .lg-ai-fab {
    background: linear-gradient(135deg, #0f2d52 0%, #0f2d52 36%, #0b2342 70%, #059669 100%);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(197, 154, 64, 0.38), 0 2px 8px rgba(184, 140, 50, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
[data-theme="light"] .lg-ai-fab:hover {
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 26px rgba(197, 154, 64, 0.48), 0 3px 12px rgba(184, 140, 50, 0.35);
}
[data-theme="light"] .lg-ai-fab-ico {
    color: #ffffff;
    background: transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}
@media (min-width: 1024px) {
    [data-theme="light"] .lg-ai-fab {
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 8px 24px rgba(197, 154, 64, 0.4), 0 2px 10px rgba(184, 140, 50, 0.28);
    }
    [data-theme="light"] .lg-ai-fab:hover {
        border-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 10px 30px rgba(197, 154, 64, 0.55), 0 0 24px rgba(184, 140, 50, 0.4);
    }
}

/* ── Единичная анимация при загрузке страницы ── */
@keyframes saiFabEntrance {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.7) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px) scale(1.14) rotate(4deg);
    }
    75% {
        transform: translateY(0) scale(0.97) rotate(-1deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes saiFabRipple {
    0% {
        transform: scale(0.95);
        opacity: 0.75;
    }
    60% {
        transform: scale(1.55);
        opacity: 0.15;
    }
    100% {
        transform: scale(1.75);
        opacity: 0;
    }
}

@keyframes saiIcoWiggle {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    35% {
        transform: rotate(14deg) scale(1.18);
    }
    65% {
        transform: rotate(-8deg) scale(1.1);
    }
    85% {
        transform: rotate(3deg) scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg-ai-fab,
    .lg-ai-fab::after,
    .lg-ai-fab-ico {
        animation: none !important;
    }
}

@media print {
    .lg-ai-fab,
    .lg-ai-fab::after,
    .lg-ai-overlay,
    .lg-ai-click-shield,
    #lgAiFab,
    #lgAiOverlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* ── Оверлей и панель ──
   Мобилка: полноэкранный выезд снизу.
   ПК: крупная боковая панель справа. */
.lg-ai-overlay {
    position: fixed;
    inset: 0;
    z-index: 100400;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--bg2, #1e293b);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s;
}
.lg-ai-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* После закрытия ещё мгновение ловим «сквозной» click (крестик совпадает с бургером). */
.lg-ai-overlay.is-closing {
    opacity: 0;
    visibility: visible;
    pointer-events: auto;
}
body.lg-ai-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}
body.lg-ai-modal-open #menuButton,
body.lg-ai-modal-open .hv2-burger,
body.lg-ai-modal-open .hh-menu-btn,
body.lg-ai-closing-guard #menuButton,
body.lg-ai-closing-guard .hv2-burger,
body.lg-ai-closing-guard .hh-menu-btn {
    pointer-events: none !important;
}
.lg-ai-click-shield {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: none;
    background: transparent;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-click-shield.is-on {
    display: block;
    pointer-events: auto;
}
.lg-ai-panel {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    padding-top: 0;
    background:
        radial-gradient(circle at 50% -20px, rgba(15, 45, 82, 0.10), rgba(5, 150, 105, 0.06) 35%, transparent 70%),
        var(--bg2, #1e293b);
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: translate3d(0, 100%, 0);
    transition:
        transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.28s ease,
        box-shadow 0.28s ease;
    overflow: hidden;
    will-change: transform;
}
.lg-ai-overlay.is-open .lg-ai-panel {
    transform: translate3d(0, 0, 0);
}
@supports (height: 100dvh) {
    .lg-ai-panel {
        height: 100dvh;
    }
}
@media (prefers-reduced-motion: reduce) {
    .lg-ai-panel {
        transition: none;
    }
}
.lg-ai-handle {
    width: 44px;
    height: 5px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(197, 154, 64, 0.5), rgba(184, 140, 50, 0.7), rgba(255, 199, 44, 0.5));
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-handle::before {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -14px;
    left: -24px;
    right: -24px;
}
.lg-ai-handle:active {
    cursor: grabbing;
}
.lg-ai-panel.is-dragging {
    transition: none !important;
    user-select: none;
    -webkit-user-select: none;
}
@media (min-width: 640px) {
    .lg-ai-handle {
        display: none;
    }
}

/* ПК / широкий планшет: крупная боковая панель справа */
@media (min-width: 860px) {
    .lg-ai-overlay {
        align-items: stretch;
        justify-content: flex-end;
        padding: 14px 14px 14px 0;
        background: rgba(2, 6, 23, 0.42);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    .lg-ai-panel {
        width: min(560px, calc(100vw - 28px));
        height: calc(100dvh - 28px);
        max-height: calc(100dvh - 28px);
        background:
            radial-gradient(circle at 18% -24px, rgba(197, 154, 64, 0.16), rgba(184, 140, 50, 0.08) 36%, transparent 68%),
            var(--bg2, #1e293b);
        border: 1px solid rgba(197, 154, 64, 0.22);
        border-radius: 22px;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.05),
            -8px 0 40px rgba(15, 23, 42, 0.18),
            0 24px 72px rgba(0, 0, 0, 0.42);
        transform: translate3d(28px, 0, 0);
        opacity: 0.94;
    }
    .lg-ai-overlay.is-open .lg-ai-panel {
        transform: none;
        opacity: 1;
    }
}
@media (min-width: 1200px) {
    .lg-ai-panel {
        width: min(640px, calc(100vw - 40px));
    }
}
@media (min-width: 1440px) {
    .lg-ai-panel {
        width: min(700px, 46vw);
    }
}

/* ── Шапка ── */
.lg-ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 16px 10px;
    padding-top: 4px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background: transparent;
}
.lg-ai-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 0;
    background: transparent;
    color: #0f2d52;
    border: 0;
    box-shadow: none;
}
.lg-ai-header-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    stroke: #ffffff;
    stroke-width: 0.5;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}
.lg-ai-header-text {
    flex: 1;
    min-width: 0;
}
.lg-ai-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--txt, #f8fafc);
    line-height: 1.2;
}
.lg-ai-title-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lg-ai-beta {
    flex-shrink: 0;
    padding: 2px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(197, 154, 64, 0.2), rgba(184, 140, 50, 0.2), rgba(255, 199, 44, 0.15));
    border: 1px solid rgba(184, 140, 50, 0.35);
    color: #059669;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.lg-ai-subtitle {
    margin: 2px 0 0;
    font-size: 11.5px;
    color: var(--txt2, #94a3b8);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lg-ai-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 199, 44, 0.42);
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.08);
    color: var(--txt2, #94a3b8);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.08);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.lg-ai-icon-btn:hover,
.lg-ai-icon-btn:focus-visible {
    color: var(--txt, #f8fafc);
    background: rgba(255, 199, 44, 0.14);
    border-color: rgba(255, 199, 44, 0.62);
    outline: none;
}
.lg-ai-icon-btn:active {
    background: rgba(255, 255, 255, 0.08);
}
.lg-ai-icon-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}
.lg-ai-mute-btn.is-muted {
    color: #059669;
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.45);
}
.lg-ai-mute-btn .lg-ai-mute-ico[hidden] {
    display: none !important;
}

/* ── Тело: колонка контента, без растягивания ── */
.lg-ai-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 16px 20px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.lg-ai-body > * {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.lg-ai-history-toggle {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: var(--text, #f1f5f9);
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.lg-ai-history-toggle:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
}
.lg-ai-history-toggle[hidden] {
    display: none;
}
.lg-ai-history-toggle-ico {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--accent, #059669);
    background: rgba(5, 150, 105, 0.12);
}
.lg-ai-history-toggle-ico svg {
    width: 19px;
    height: 19px;
}
.lg-ai-history-toggle-copy {
    flex: 1;
    min-width: 0;
}
.lg-ai-history-toggle-copy strong,
.lg-ai-history-toggle-copy small {
    display: block;
}
.lg-ai-history-toggle-copy strong {
    font-size: 13px;
    line-height: 1.3;
}
.lg-ai-history-toggle-copy small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted, #94a3b8);
    font-size: 10.5px;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.lg-ai-history-toggle-arrow {
    display: grid;
    place-items: center;
    color: var(--muted, #94a3b8);
    transition: transform 0.2s ease;
}
.lg-ai-history-toggle-arrow svg {
    width: 18px;
    height: 18px;
}
.lg-ai-history-toggle[aria-expanded="true"] .lg-ai-history-toggle-arrow {
    transform: rotate(180deg);
}
.lg-ai-history-toggle.is-loading {
    opacity: 0.65;
    pointer-events: none;
}
.lg-ai-history-day {
    align-self: center;
    margin: 3px 0 -2px;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--muted, #94a3b8);
    background: rgba(255, 255, 255, 0.055);
    font-size: 10px;
    line-height: 1.3;
}
.lg-ai-history-empty {
    padding: 28px 15px;
    color: var(--muted, #94a3b8);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}
.lg-ai-history-panel {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin: -4px 0 12px;
    padding: 10px 0 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.lg-ai-history-panel.is-open {
    display: flex;
}
.lg-ai-history-panel[hidden] {
    display: none !important;
}
.lg-ai-history-panel .lg-ai-msg--history {
    margin: 4px 0;
    width: 100%;
}
.lg-ai-history-panel .lg-ai-msg--history.lg-ai-msg--user {
    align-items: flex-end;
}
.lg-ai-history-panel .lg-ai-msg--history.lg-ai-msg--assistant {
    align-items: flex-start;
}
.lg-ai-history-panel .lg-ai-msg--history .lg-ai-bubble {
    max-width: min(92%, 420px);
}
.lg-ai-history-panel .lg-ai-msg,
.lg-ai-history-panel .lg-ai-cards,
.lg-ai-history-panel .lg-ai-actions,
.lg-ai-history-panel .lg-ai-phone-wrap {
    opacity: 0.92;
}
.lg-ai-history-panel .lg-ai-msg--history {
    animation: none;
}
.lg-ai-suggest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.lg-ai-suggest-label {
    margin: 0 0 0 2px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--txt2, #94a3b8);
    opacity: 0.75;
}
.lg-ai-suggest-hide {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
}
.lg-ai-suggest-hide[hidden] {
    display: none;
}
.lg-ai-suggest-hide:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.4);
}
/* Список вернули по кнопке «Назад к вопросам» */
.lg-ai-intro.is-returned {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

/* Стартовые подсказки — строки-действия, а не мелкие чипсы */
.lg-ai-suggest {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lg-ai-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid rgba(255, 199, 44, 0.38);
    border-radius: 14px;
    background: var(--bg3, rgba(255, 255, 255, 0.045));
    color: var(--txt, #f8fafc);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.06);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-suggest-item:hover {
    border-color: rgba(197, 154, 64, 0.45);
    background: linear-gradient(135deg, rgba(197, 154, 64, 0.08), rgba(255, 199, 44, 0.06));
    box-shadow: inset 0 0 0 1px rgba(197, 154, 64, 0.15), 0 2px 8px rgba(197, 154, 64, 0.1);
}
.lg-ai-suggest-item:active {
    transform: scale(0.985);
}
.lg-ai-suggest-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.13);
    color: var(--accent, #059669);
}
.lg-ai-suggest-ico svg {
    width: 18px;
    height: 18px;
}
.lg-ai-suggest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lg-ai-suggest-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
}
.lg-ai-suggest-hint {
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--txt2, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lg-ai-suggest-arrow {
    display: flex;
    flex-shrink: 0;
    color: var(--txt2, #94a3b8);
    opacity: 0.6;
}
.lg-ai-suggest-arrow svg {
    width: 16px;
    height: 16px;
}

/* ── Стартовый визард ── */
.lg-ai-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 2px 0 18px;
    padding: 18px;
    border: 1px solid rgba(197, 154, 64, 0.24);
    border-radius: 22px;
    background: linear-gradient(125deg, rgba(197, 154, 64, 0.13), rgba(5, 150, 105, 0.06) 58%, rgba(255, 199, 44, 0.07));
    box-shadow: 0 12px 34px rgba(2, 6, 23, 0.16), inset 0 1px rgba(255, 255, 255, 0.045);
}
.lg-ai-intro:not(.is-returned) { margin-top: auto; margin-bottom: auto; }
.lg-ai-welcome-bot {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    border-radius: 25px;
    background: linear-gradient(145deg, #334155, #1f2937);
    box-shadow: 0 0 28px rgba(197, 154, 64, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.lg-ai-bot-face {
    position: relative;
    width: 48px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    border-radius: 16px 16px 14px 14px;
    background: linear-gradient(145deg, #f8fafc, #cfd5e5);
    box-shadow: inset 0 -3px 0 rgba(90, 98, 123, 0.18), 0 0 18px rgba(255, 255, 255, 0.22);
    animation: sai-bot-float 3s ease-in-out infinite;
}
.lg-ai-bot-eye {
    display: block;
    width: 5px;
    height: 8px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.45);
    transform-origin: center;
    animation: sai-bot-blink 4.2s infinite;
}
.lg-ai-bot-eye:nth-child(2) { animation-delay: 0.08s; }
.lg-ai-bot-mouth {
    position: absolute;
    left: 50%;
    bottom: 7px;
    width: 9px;
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: #e777a5;
    transform: translateX(-50%);
}
.lg-ai-bot-orbit {
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(197, 154, 64, 0.3);
    border-radius: 50%;
}
.lg-ai-bot-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(145deg, #eef1f4, #dce1e7);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 2px 5px rgba(31,41,55,.12);
}
.lg-ai-bot-mark .lg-ai-bot-face { transform: scale(.58); animation: none; }
.lg-ai-bot-mark .lg-ai-bot-orbit { inset: 2px; }
.lg-ai-welcome-copy { flex: 1; min-width: 0; }
.lg-ai-welcome-text {
    margin: 0;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 550;
}
.lg-ai-welcome-play,
.lg-ai-welcome-options {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 9px;
    padding: 5px 9px 5px 6px;
    border: 1px solid rgba(5, 150, 105, 0.28);
    border-radius: 999px;
    color: #047857;
    background: #ecfdf5;
    font: inherit;
    font-size: 10.5px;
    cursor: pointer;
}
.lg-ai-welcome-play {
    color: #fff;
    background: #059669;
    border-color: #059669;
}
.lg-ai-welcome-play svg { width: 14px; height: 14px; }
.lg-ai-welcome-play.is-speaking { color: #fff; background: #047857; border-color: #047857; }
.lg-ai-welcome-options { margin-left: 5px; }
.lg-ai-voice-wave { display: none; align-items: center; justify-content: center; gap: 2px; height: 14px; }
.lg-ai-voice-wave i { width: 2px; height: 4px; border-radius: 2px; background: currentColor; }
.lg-ai-welcome-play.is-speaking svg { display: none; }
.lg-ai-welcome-play.is-speaking .lg-ai-voice-wave { display: inline-flex; }
.lg-ai-welcome-play.is-speaking .lg-ai-voice-wave i { animation: sai-voice-wave .65s ease-in-out infinite alternate; }
.lg-ai-welcome-play.is-speaking .lg-ai-voice-wave i:nth-child(2),
.lg-ai-welcome-play.is-speaking .lg-ai-voice-wave i:nth-child(4) { animation-delay: .18s; }
.lg-ai-welcome-play.is-speaking .lg-ai-voice-wave i:nth-child(3) { animation-delay: .34s; }
.lg-ai-welcome.is-speaking .lg-ai-bot-orbit { border-color: rgba(5, 150, 105, .72); box-shadow: 0 0 12px rgba(5, 150, 105, .2); }
@keyframes sai-voice-wave { to { height: 13px; } }
@keyframes sai-bot-blink {
    0%, 44%, 48%, 100% { transform: scaleY(1); }
    46% { transform: scaleY(0.12); }
}
@keyframes sai-bot-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@media (max-width: 420px) {
    .lg-ai-welcome { gap: 12px; padding: 15px; }
    .lg-ai-welcome-bot { width: 64px; height: 64px; flex-basis: 64px; border-radius: 21px; }
    .lg-ai-welcome-text { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .lg-ai-bot-eye, .lg-ai-bot-face, .lg-ai-bot-orbit { animation: none; }
}
.lg-ai-wizard {
    display: none;
    flex-direction: column;
    gap: 12px;
}
.lg-ai-intro.is-options-open .lg-ai-wizard { display: flex; }
.lg-ai-wizard-top {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}
.lg-ai-wizard-top:has(.lg-ai-wizard-back[hidden]:only-child),
.lg-ai-wizard-top:empty {
    display: none;
}
.lg-ai-wizard-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 4px 10px 4px 7px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}
.lg-ai-wizard-back[hidden] {
    display: none;
}
.lg-ai-wizard-back svg {
    width: 14px;
    height: 14px;
}
.lg-ai-wizard-progress {
    flex: 0 0 auto;
    margin: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 199, 44, 0.08);
    color: var(--accent, #059669);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
}
.lg-ai-wizard-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 0 2px;
}
.lg-ai-wizard-context[hidden] {
    display: none;
}
.lg-ai-wizard-context-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--txt2, #94a3b8);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lg-ai-wizard-context-sep {
    color: var(--txt2, #64748b);
    font-size: 10px;
    opacity: 0.65;
    user-select: none;
}
.lg-ai-wizard-option.is-pin {
    margin-top: 4px;
    border-style: dashed;
}
.lg-ai-wizard-heading {
    position: relative;
    margin-bottom: 2px;
    /* Место справа под бейдж шага — заголовок и 1/3 всегда на одном уровне */
    padding-right: 46px;
}
.lg-ai-wizard-title-row {
    display: block;
}
.lg-ai-wizard-title {
    margin: 0;
    color: var(--txt, #f8fafc);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.lg-ai-wizard-heading > .lg-ai-wizard-title-row > .lg-ai-wizard-progress,
.lg-ai-wizard-title-row .lg-ai-wizard-progress {
    position: absolute;
    top: 2px;
    right: 0;
    z-index: 1;
    margin: 0;
}
.lg-ai-wizard-note {
    margin: 6px 0 0;
    color: var(--txt2, #94a3b8);
    font-size: 13px;
    line-height: 1.45;
}
.lg-ai-wizard-search-wrap[hidden] {
    display: none;
}
.lg-ai-wizard-search {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 14px;
}
.lg-ai-wizard-search:focus {
    outline: none;
    border-color: rgba(255, 199, 44, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.08);
}
.lg-ai-wizard-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lg-ai-msg .lg-ai-wizard-options,
.lg-ai-msg .lg-ai-chip-row {
    margin: 8px 0 0;
    padding: 0 2px 4px;
}
.lg-ai-msg .lg-ai-wizard-option.is-compact {
    justify-content: center;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

/* Шаг назад к предыдущему сообщению / выбору */
.lg-ai-step-back {
    align-self: flex-start;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(15, 45, 82, 0.55);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-step-back:hover,
.lg-ai-step-back:focus-visible {
    color: #059669;
    outline: none;
}
.lg-ai-msg--user .lg-ai-step-back {
    align-self: flex-end;
}
html:not([data-theme="light"]) .lg-ai-step-back,
[data-theme="dark"] .lg-ai-step-back {
    color: rgba(229, 234, 241, 0.55);
}
html:not([data-theme="light"]) .lg-ai-step-back:hover,
html:not([data-theme="light"]) .lg-ai-step-back:focus-visible,
[data-theme="dark"] .lg-ai-step-back:hover,
[data-theme="dark"] .lg-ai-step-back:focus-visible {
    color: #34d399;
}

/* iOS-лаконичные чипы выбора (город / специализация) */
.lg-ai-pick {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin: 4px 0 8px;
}
.lg-ai-pick .lg-ai-bubble {
    margin: 0;
}
.lg-ai-pick__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 0;
}
.lg-ai-pick__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-height: 34px;
    max-width: 100%;
    padding: 6px 14px;
    border: 1px solid rgba(15, 45, 82, 0.12);
    border-radius: 999px;
    background: #fff;
    color: #0f2d52;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.lg-ai-pick__chip:hover,
.lg-ai-pick__chip:focus-visible {
    border-color: #9ed4c0;
    background: #ecfdf5;
    color: #059669;
    outline: none;
}
.lg-ai-pick__chip:active {
    transform: scale(0.97);
}
.lg-ai-pick__chip.is-active {
    border-color: #059669;
    background: #059669;
    color: #fff;
}
.lg-ai-pick__chip:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}
/* После выбора — только активный чип. */
.lg-ai-pick.is-picked .lg-ai-pick__chip:not(.is-active) {
    display: none !important;
}
.lg-ai-pick.is-picked .lg-ai-pick__chip.is-active {
    opacity: 1;
}
.lg-ai-pick__chip--muted {
    border-style: dashed;
    background: transparent;
    color: rgba(15, 45, 82, 0.55);
    font-weight: 550;
}
.lg-ai-pick__chip--muted:hover,
.lg-ai-pick__chip--muted:focus-visible {
    border-color: rgba(15, 45, 82, 0.28);
    background: rgba(15, 45, 82, 0.04);
    color: #0f2d52;
}
html:not([data-theme="light"]) .lg-ai-pick__chip,
[data-theme="dark"] .lg-ai-pick__chip {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f2ede1;
}
html:not([data-theme="light"]) .lg-ai-pick__chip:hover,
html:not([data-theme="light"]) .lg-ai-pick__chip:focus-visible,
[data-theme="dark"] .lg-ai-pick__chip:hover,
[data-theme="dark"] .lg-ai-pick__chip:focus-visible {
    border-color: rgba(5, 150, 105, 0.55);
    background: rgba(5, 150, 105, 0.18);
    color: #ecfdf5;
}
html:not([data-theme="light"]) .lg-ai-pick__chip.is-active,
[data-theme="dark"] .lg-ai-pick__chip.is-active {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
html:not([data-theme="light"]) .lg-ai-pick__chip--muted,
[data-theme="dark"] .lg-ai-pick__chip--muted {
    background: transparent;
    color: rgba(242, 237, 225, 0.62);
}
.lg-ai-wizard-option {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1.5px solid var(--border, rgba(255, 255, 255, 0.14));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: transform 0.13s ease, border-color 0.16s ease, background 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-wizard-option:hover {
    border-color: rgba(197, 154, 64, 0.4);
    background: linear-gradient(135deg, rgba(197, 154, 64, 0.07), rgba(255, 199, 44, 0.05));
    box-shadow: inset 0 0 0 1px rgba(197, 154, 64, 0.12);
}
.lg-ai-wizard-option:active {
    transform: scale(0.985);
}
.lg-ai-wizard-option[hidden] {
    display: none;
}
.lg-ai-wizard-option.is-compact {
    min-height: 50px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.lg-ai-wizard-option-ico {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.1);
    color: var(--accent, #059669);
}
.lg-ai-wizard-option-ico svg {
    width: 17px;
    height: 17px;
}
.lg-ai-wizard-option-ico.has-img {
    position: relative;
    overflow: hidden;
    padding: 6px;
    border: 1px solid rgba(255, 199, 44, 0.14);
    background: rgba(255, 199, 44, 0.1);
}
.lg-ai-wizard-option-ico .lg-ai-wizard-type-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* SVG футера (чёрная заливка) → фирменный жёлтый на тёмной теме. */
    filter: brightness(0) saturate(100%) invert(83%) sepia(83%) saturate(1127%) hue-rotate(336deg) brightness(104%) contrast(103%);
}
.lg-ai-wizard-option-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lg-ai-wizard-option-text strong {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.lg-ai-wizard-option-text small {
    overflow: hidden;
    color: var(--txt2, #94a3b8);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lg-ai-wizard-option-arrow {
    display: flex;
    flex-shrink: 0;
    color: var(--txt2, #94a3b8);
    opacity: 0.45;
}
.lg-ai-wizard-option-arrow svg {
    width: 15px;
    height: 15px;
}
.lg-ai-wizard-manual {
    min-height: 42px;
    margin-top: 4px;
    padding: 10px 14px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.lg-ai-wizard-manual:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.4);
    background: rgba(255, 199, 44, 0.04);
}
.lg-ai-wizard-empty {
    margin: 8px 0;
    color: var(--txt2, #94a3b8);
    font-size: 12.5px;
    text-align: center;
}
.lg-ai-wizard-load-error {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 8px 0;
    color: var(--txt2, #94a3b8);
    font-size: 12.5px;
    line-height: 1.45;
    text-align: center;
}
.lg-ai-wizard-retry {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(142, 164, 201, .25);
    border-radius: 999px;
    background: rgba(142, 164, 201, .1);
    color: var(--txt, #f8fafc);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.lg-ai-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lg-ai-messages:not(:empty) {
    margin-top: 16px;
}
/* Контейнер сообщения — без «двойного пузыря»; стиль только у .lg-ai-bubble */
.lg-ai-msg {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    white-space: normal;
    word-break: normal;
}

/* Новый ответ мягко появляется из индикатора набора. Карточки и кнопки
   продолжают движение с небольшой задержкой — без эффекта «прыжка». */
.lg-ai-enter {
    animation: sai-answer-in 0.38s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    transform-origin: left bottom;
}
.lg-ai-msg-user.lg-ai-enter {
    animation-name: sai-user-message-in;
    transform-origin: right bottom;
}
.lg-ai-cards.lg-ai-enter {
    animation-delay: 70ms;
}
.lg-ai-actions.lg-ai-enter {
    animation-delay: 110ms;
}
.lg-ai-cards.lg-ai-enter .lg-ai-card {
    animation: sai-card-in 0.38s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    animation-delay: calc(90ms + var(--sai-enter-delay, 0ms));
}
@keyframes sai-answer-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(0.975);
        filter: blur(2px);
    }
    55% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}
@keyframes sai-user-message-in {
    0% {
        opacity: 0;
        transform: translate3d(10px, 6px, 0) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}
@keyframes sai-card-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 8px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}
.lg-ai-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #059669 0%, #f0a500 100%);
    color: #1a1200;
    border-bottom-right-radius: 6px;
    font-weight: 500;
}
.lg-ai-msg-ai {
    align-self: flex-start;
    background: linear-gradient(145deg, rgba(197, 154, 64, 0.08) 0%, rgba(255, 255, 255, 0.045) 45%, rgba(255, 199, 44, 0.035) 100%);
    color: var(--txt, #f8fafc);
    border: 1.5px solid rgba(197, 154, 64, 0.28);
    border-bottom-left-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
    box-shadow: 0 4px 16px rgba(197, 154, 64, 0.12), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.lg-ai-msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}
.lg-ai-msg-error {
    align-self: flex-start;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.lg-ai-speak-btn {
    align-self: flex-start;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0.72;
    transition: color 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-speak-btn svg {
    width: 15px;
    height: 15px;
    display: block;
    pointer-events: none;
}
.lg-ai-speak-btn .lg-ai-speak-stop {
    display: none;
}
.lg-ai-speak-btn:hover,
.lg-ai-speak-btn:focus-visible {
    color: #059669;
    background: rgba(5, 150, 105, 0.12);
    opacity: 1;
    outline: none;
}
.lg-ai-speak-btn:active {
    transform: scale(0.94);
}
.lg-ai-speak-btn.is-speaking {
    color: #059669;
    background: rgba(5, 150, 105, 0.14);
    opacity: 1;
    animation: sai-speak-pulse 1.4s ease-in-out infinite;
}
.lg-ai-speak-btn.is-speaking .lg-ai-speak-ico {
    display: none;
}
.lg-ai-speak-btn.is-speaking .lg-ai-speak-stop {
    display: block;
}
.lg-ai-speak-btn.is-loading {
    color: #059669;
    opacity: 1;
    pointer-events: none;
}
.lg-ai-speak-btn.is-loading .lg-ai-speak-ico {
    animation: sai-speak-wait 0.9s linear infinite;
}
@keyframes sai-speak-wait {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}
@keyframes sai-speak-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(255, 199, 44, 0); }
}

/* Индикатор «думает»: фиксированное облачко, внутри плывут силуэты техники */
.lg-ai-typing {
    --sai-typing-w: 58px;
    --sai-typing-h: 34px;
    align-self: flex-start;
    position: relative;
    box-sizing: border-box;
    width: var(--sai-typing-w);
    height: var(--sai-typing-h);
    min-width: var(--sai-typing-w);
    max-width: var(--sai-typing-w);
    min-height: var(--sai-typing-h);
    max-height: var(--sai-typing-h);
    overflow: hidden;
    flex: 0 0 auto;
    display: block;
    padding: 0;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    background: var(--bg3, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.lg-ai-typing-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
}
.lg-ai-typing-track {
    position: absolute;
    left: 0;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 18px;
    width: max-content;
    transform: translate3d(0, -50%, 0);
    animation: sai-typing-drift 14s linear infinite;
    will-change: transform;
    color: var(--txt2, #94a3b8);
}
.lg-ai-typing-ico {
    display: block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    opacity: 0.55;
    background-color: currentColor;
    -webkit-mask: var(--sai-eq) center / contain no-repeat;
    mask: var(--sai-eq) center / contain no-repeat;
    animation: sai-typing-bob 2.8s ease-in-out infinite;
}
.lg-ai-typing-ico:nth-child(2n) { animation-delay: -0.9s; opacity: 0.42; }
.lg-ai-typing-ico:nth-child(3n) { animation-delay: -1.6s; opacity: 0.5; }
@keyframes sai-typing-drift {
    from { transform: translate3d(0, -50%, 0); }
    to   { transform: translate3d(-50%, -50%, 0); }
}
@keyframes sai-typing-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-1.5px); }
}

@media (prefers-reduced-motion: reduce) {
    .lg-ai-enter,
    .lg-ai-cards.lg-ai-enter .lg-ai-card,
    .lg-ai-typing-track,
    .lg-ai-typing-ico {
        animation: none !important;
    }
    .lg-ai-typing-track {
        transform: translate3d(-12%, -50%, 0);
    }
}

/* ── Карточки техники ── */
.lg-ai-cards {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lg-ai-card {
    display: flex;
    gap: 13px;
    padding: 11px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    border-radius: 16px;
    background: var(--bg3, rgba(255, 255, 255, 0.04));
}
.lg-ai-card--center {
    border-color: rgba(15, 45, 82, 0.14);
}
.lg-ai-card--center .lg-ai-card-body small {
    color: rgba(15, 45, 82, 0.62);
}
html:not([data-theme="light"]) .lg-ai-card--center,
[data-theme="dark"] .lg-ai-card--center {
    border-color: rgba(158, 212, 192, 0.22);
}
html:not([data-theme="light"]) .lg-ai-card--center .lg-ai-card-body small,
[data-theme="dark"] .lg-ai-card--center .lg-ai-card-body small {
    color: rgba(158, 212, 192, 0.78);
}
.lg-ai-card-media {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lg-ai-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lg-ai-card-media.is-icon img {
    position: relative;
    z-index: 1;
    width: 91%;
    height: 91%;
    object-fit: contain;
    filter:
        drop-shadow(0 9px 9px rgba(0, 0, 0, 0.38))
        saturate(1.08)
        contrast(1.04);
}
.lg-ai-card-media.is-icon {
    border-color: rgba(255, 199, 44, 0.16);
    background:
        radial-gradient(circle at 48% 42%, rgba(255, 199, 44, 0.17), transparent 57%),
        linear-gradient(145deg, rgba(255, 199, 44, 0.10), rgba(255, 255, 255, 0.025) 55%, rgba(0, 0, 0, 0.08));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 8px 20px rgba(0, 0, 0, 0.12);
}
.lg-ai-card-media.is-icon::after {
    content: '';
    position: absolute;
    right: 7px;
    bottom: 7px;
    left: 7px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.23);
    filter: blur(6px);
}
.lg-ai-card-media.is-empty {
    color: rgba(255, 199, 44, 0.72);
    background: linear-gradient(145deg, rgba(255, 199, 44, 0.11), rgba(255, 255, 255, 0.025));
}
.lg-ai-card-media.is-empty svg {
    width: 35px;
    height: 35px;
}
.lg-ai-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.lg-ai-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--txt, #f8fafc);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lg-ai-card-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    margin-left: 5px;
    vertical-align: middle;
}
.lg-ai-card-verified svg {
    width: 15px;
    height: 15px;
}
.lg-ai-card-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lg-ai-card-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent, #059669);
}
.lg-ai-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 1px 6px;
    border-radius: 6px;
    line-height: 1.3;
}
.lg-ai-card-rating svg {
    width: 12px;
    height: 12px;
    fill: #f59e0b;
}
.lg-ai-card-exp {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.24);
    padding: 2px 7px;
    border-radius: 6px;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}
.lg-ai-card-exp svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.lg-ai-card-meta {
    font-size: 11.5px;
    color: var(--txt2, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lg-ai-card-top {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 199, 44, 0.16);
    color: var(--accent, #059669);
    font-size: 10px;
    font-weight: 700;
}
.lg-ai-card-top.lg-ai-card-bl {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
.lg-ai-card-actions {
    display: flex;
    gap: 7px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.lg-ai-card-actions .lg-ai-btn {
    flex: 1 1 auto;
    min-width: 88px;
}

/* ── Проверка номера: заголовок снаружи, карточки — только авторизованным ── */
.lg-ai-phone-wrap {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lg-ai-phone-heading {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--txt, #f8fafc);
    padding: 0 2px;
}
.lg-ai-phone-heading.is-blacklist {
    color: #f87171;
}
.lg-ai-phone-heading.is-profile {
    color: #34d399;
}
.lg-ai-phone-heading.is-empty {
    color: var(--txt, #f8fafc);
}
.lg-ai-phone-meta {
    padding: 0 2px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--txt2, #94a3b8);
}
.lg-ai-phone-meta-sep {
    opacity: 0.55;
}
.lg-ai-phone-block {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    background: var(--bg3, rgba(255, 255, 255, 0.04));
    overflow: hidden;
}
.lg-ai-phone-list {
    display: flex;
    flex-direction: column;
}
.lg-ai-phone-empty {
    padding: 14px;
    font-size: 12.5px;
    color: var(--txt2, #94a3b8);
    line-height: 1.45;
}
.lg-ai-phone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    animation: sai-chip-in 0.38s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    animation-delay: var(--sai-enter-delay, 0ms);
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-phone-item:first-child {
    border-top: none;
}
.lg-ai-phone-item:hover,
.lg-ai-phone-item:active {
    background: rgba(255, 255, 255, 0.04);
}
.lg-ai-phone-item.is-blacklist {
    background: rgba(239, 68, 68, 0.05);
}
.lg-ai-phone-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.lg-ai-phone-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #059669;
    background: rgba(255, 199, 44, 0.12);
}
.lg-ai-phone-item.is-blacklist .lg-ai-phone-avatar-fallback {
    color: #f87171;
    background: rgba(239, 68, 68, 0.14);
}
.lg-ai-phone-info {
    min-width: 0;
    flex: 1;
}
.lg-ai-phone-item-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 650;
    color: var(--txt, #f8fafc);
    line-height: 1.3;
}
.lg-ai-phone-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.lg-ai-phone-badge.tone-danger {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
.lg-ai-phone-badge.tone-ok {
    background: rgba(52, 211, 153, 0.14);
    color: #34d399;
}
.lg-ai-phone-item-sub,
.lg-ai-phone-item-phone,
.lg-ai-phone-lock {
    margin-top: 3px;
    font-size: 12px;
    color: var(--txt2, #94a3b8);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.lg-ai-phone-item-phone {
    font-variant-numeric: tabular-nums;
    -webkit-line-clamp: 1;
}
.lg-ai-phone-lock {
    color: #fbbf24;
    font-weight: 600;
}
.lg-ai-phone-chevron {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--txt2, #94a3b8);
    opacity: 0.7;
}
.lg-ai-phone-chevron svg {
    width: 18px;
    height: 18px;
    display: block;
}
.lg-ai-phone-item.is-locked {
    opacity: 0.92;
}
.lg-ai-phone-item.is-locked .lg-ai-phone-info {
    filter: none;
}
@media (min-width: 480px) {
    .lg-ai-phone-item {
        padding: 13px 16px;
    }
}

/* ── Кнопки ── */
.lg-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 10px 16px;
    border: 1.5px solid rgba(255, 199, 44, 0.45);
    border-radius: 12px;
    background: rgba(255, 199, 44, 0.10);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.08);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-btn:hover {
    border-color: rgba(255, 199, 44, 0.55);
    background: rgba(255, 199, 44, 0.16);
}
.lg-ai-btn:active {
    transform: scale(0.975);
}
.lg-ai-btn-primary {
    border: 1.5px solid rgba(180, 83, 9, 0.35);
    background: linear-gradient(135deg, #059669 0%, #f0a500 100%);
    color: #1a1200;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(240, 165, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.lg-ai-btn-primary:hover {
    opacity: 0.93;
    background: linear-gradient(135deg, #059669 0%, #f0a500 100%);
}
.lg-ai-btn-whatsapp,
.lg-ai-btn-whatsapp:hover {
    border-color: #25d366;
    background: #25d366;
    color: #062b15;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.22);
}
.lg-ai-btn-whatsapp:hover {
    background: #20bd5a;
}
.lg-ai-btn-block {
    width: 100%;
    min-height: 48px;
    font-size: 14.5px;
}
.lg-ai-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

/* Кнопки под ответом — во всю ширину, их трудно промахнуть */
.lg-ai-actions {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lg-ai-actions .lg-ai-btn {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
}
.lg-ai-actions-chips {
    flex-direction: row;
    flex-wrap: wrap;
}
.lg-ai-actions-chips .lg-ai-chip-btn {
    width: auto;
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    min-height: 42px;
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.96);
    animation: sai-chip-in 0.42s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    animation-delay: var(--sai-enter-delay, 0ms);
}
@keyframes sai-chip-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}
@media (min-width: 480px) {
    .lg-ai-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .lg-ai-actions .lg-ai-btn {
        flex: 1 1 46%;
        width: auto;
    }
    .lg-ai-actions-chips .lg-ai-chip-btn {
        flex: 1 1 calc(33% - 8px);
    }
}

/* ── Форма обратного звонка ── */
.lg-ai-lead {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    background: linear-gradient(180deg, rgba(255, 199, 44, 0.06) 0%, rgba(255, 199, 44, 0.015) 100%);
}
.lg-ai-lead > * {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.lg-ai-lead[hidden] {
    display: none;
}
.lg-ai-lead-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.lg-ai-lead-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.lg-ai-lead-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 199, 44, 0.14);
    color: var(--accent, #059669);
}
.lg-ai-lead-ico svg {
    width: 18px;
    height: 18px;
}
.lg-ai-lead-title {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--txt, #f8fafc);
    line-height: 1.25;
}
.lg-ai-lead-note {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--txt2, #94a3b8);
}
.lg-ai-lead-cancel {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 5px 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.lg-ai-lead-cancel:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.4);
}
.lg-ai-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.lg-ai-field-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--txt2, #94a3b8);
    letter-spacing: 0.01em;
}
.lg-ai-field-label em {
    color: var(--accent, #059669);
    font-style: normal;
}
.lg-ai-field-hint {
    font-size: 11px;
    color: var(--txt2, #94a3b8);
    opacity: 0.8;
}
.lg-ai-field-hint.is-error {
    color: #fca5a5;
    opacity: 1;
}
.lg-ai-lead input,
.lg-ai-lead textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    background: var(--bg, #0f172a);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    resize: none;
}
.lg-ai-lead input:focus,
.lg-ai-lead textarea:focus {
    outline: none;
    border-color: rgba(255, 199, 44, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.10);
}
.lg-ai-lead input.is-invalid,
.lg-ai-lead textarea.is-invalid {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.lg-ai-lead input::placeholder,
.lg-ai-lead textarea::placeholder {
    color: var(--txt2, #94a3b8);
}
.lg-ai-lead #lgAiLeadSubmit {
    margin-top: 2px;
}

/* ── Подвал с вводом ── */
.lg-ai-footer {
    flex-shrink: 0;
    padding: 12px 16px 14px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(12px + max(var(--strela-android-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    background: var(--bg2, #1e293b);
}
.lg-ai-footer > * {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
/* Возврат к списку быстрых вопросов после первого ответа */
.lg-ai-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 10px 2px;
    padding: 6px 12px 6px 9px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-back-btn[hidden] {
    display: none;
}
.lg-ai-back-btn:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.35);
    background: rgba(255, 199, 44, 0.05);
}
.lg-ai-back-btn svg {
    width: 14px;
    height: 14px;
}

/* Ввод — единая «капсула»: рамка подсвечивается целиком при фокусе,
   кнопка отправки живёт внутри поля и включается только при наборе текста. */
.lg-ai-compose {
    display: block;
}
.lg-ai-compose-field {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 7px 7px 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.lg-ai-compose-field:focus-within {
    border-color: rgba(5, 150, 105, 0.55);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14), 0 0 16px rgba(5, 150, 105, 0.1);
}
.lg-ai-compose textarea {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    max-height: 140px;
    padding: 9px 4px 9px 2px;
    border: none;
    background: transparent;
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    resize: none;
}
.lg-ai-compose textarea:focus {
    outline: none;
}
.lg-ai-compose textarea::placeholder {
    color: var(--txt2, #94a3b8);
    opacity: 0.72;
}
.lg-ai-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: linear-gradient(135deg, #0f2d52 0%, #0f2d52 36%, #0b2342 70%, #059669 100%);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.28), 0 0 8px rgba(15, 45, 82, 0.18);
    transition: opacity 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}
.lg-ai-send:hover:not([disabled]) {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4), 0 0 12px rgba(15, 45, 82, 0.22);
}
.lg-ai-send:active {
    transform: scale(0.92);
}
.lg-ai-send[disabled] {
    background: rgba(255, 255, 255, 0.08);
    border-color: transparent;
    color: var(--txt2, #94a3b8);
    box-shadow: none;
    cursor: default;
}
.lg-ai-send svg {
    width: 17px;
    height: 17px;
    margin-left: -1px;
}
.lg-ai-disclaimer {
    margin: 8px 4px 0;
    font-size: 10px;
    line-height: 1.35;
    color: var(--txt2, #94a3b8);
    opacity: 0.65;
    text-align: center;
}

/* ── Светлая тема ── */
[data-theme="light"] .lg-ai-overlay {
    background: #f7f8fa;
}
[data-theme="light"] .lg-ai-panel {
    background: #f7f8fa;
    border-color: transparent;
    box-shadow: none;
}
@media (min-width: 860px) {
    [data-theme="light"] .lg-ai-overlay {
        background: rgba(15, 23, 42, 0.28);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
    [data-theme="light"] .lg-ai-panel {
        background: #ffffff;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.7) inset,
            0 28px 80px rgba(15, 23, 42, 0.18);
    }
}
[data-theme="light"] .lg-ai-handle {
    background: linear-gradient(90deg, rgba(197, 154, 64, 0.45), rgba(184, 140, 50, 0.65), rgba(255, 199, 44, 0.55));
}
[data-theme="light"] .lg-ai-header {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: none;
}
[data-theme="light"] .lg-ai-footer {
    background: #f7f8fa;
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: none;
}
@media (min-width: 860px) {
    [data-theme="light"] .lg-ai-footer {
        background: #ffffff;
    }
}
[data-theme="light"] .lg-ai-body {
    background: transparent;
    scrollbar-color: #cbd5e1 transparent;
}
[data-theme="light"] .lg-ai-title,
[data-theme="light"] .lg-ai-card-title,
[data-theme="light"] .lg-ai-msg-ai,
[data-theme="light"] .lg-ai-suggest-item,
[data-theme="light"] .lg-ai-btn {
    color: #1e293b;
}
[data-theme="light"] .lg-ai-title {
    color: #0f172a;
}
[data-theme="light"] .lg-ai-subtitle {
    color: #64748b;
}
[data-theme="light"] .lg-ai-header-icon {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #0f2d52;
}
[data-theme="light"] .lg-ai-beta {
    background: linear-gradient(135deg, rgba(197, 154, 64, 0.12), rgba(184, 140, 50, 0.12), rgba(255, 199, 44, 0.15));
    border: 1px solid rgba(184, 140, 50, 0.3);
    color: #b45309;
}
[data-theme="light"] .lg-ai-icon-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
}
[data-theme="light"] .lg-ai-icon-btn:hover {
    color: #047857;
    background: rgba(5, 150, 105, 0.08);
    border-color: #059669;
}
[data-theme="light"] .lg-ai-msg-ai {
    background: linear-gradient(145deg, rgba(5, 150, 105, 0.04) 0%, #ffffff 55%, rgba(15, 45, 82, 0.02) 100%);
    border: 1.5px solid rgba(5, 150, 105, 0.18);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .lg-ai-btn.is-copied {
    color: #15803d !important;
    border-color: rgba(34, 197, 94, 0.45) !important;
}
[data-theme="light"] .lg-ai-speak-btn {
    background: transparent;
    border: none;
    color: #64748b;
}
[data-theme="light"] .lg-ai-speak-btn:hover,
[data-theme="light"] .lg-ai-speak-btn:focus-visible,
[data-theme="light"] .lg-ai-speak-btn.is-speaking {
    color: #b45309;
    background: rgba(245, 158, 11, 0.10);
}
[data-theme="light"] .lg-ai-msg-user {
    color: #3b2600;
    background: linear-gradient(135deg, #ffd55b 0%, #fbbf24 100%);
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.13);
}
[data-theme="light"] .lg-ai-phone-block {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.055);
}
[data-theme="light"] .lg-ai-phone-heading {
    color: #0f172a;
}
[data-theme="light"] .lg-ai-phone-heading.is-profile {
    color: #059669;
}
[data-theme="light"] .lg-ai-phone-heading.is-blacklist {
    color: #dc2626;
}
[data-theme="light"] .lg-ai-phone-meta {
    color: #64748b;
}
[data-theme="light"] .lg-ai-phone-item-title {
    color: #0f172a;
}
[data-theme="light"] .lg-ai-phone-item:hover,
[data-theme="light"] .lg-ai-phone-item:active {
    background: #f8fafc;
}
[data-theme="light"] .lg-ai-phone-item.is-blacklist {
    background: rgba(239, 68, 68, 0.04);
}
[data-theme="light"] .lg-ai-phone-avatar-fallback {
    background: #fff7df;
}
[data-theme="light"] .lg-ai-msg-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}
[data-theme="light"] .lg-ai-typing {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.045);
}
[data-theme="light"] .lg-ai-typing-track {
    color: #94a3b8;
}
[data-theme="light"] .lg-ai-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.055);
}
[data-theme="light"] .lg-ai-card-media {
    background: #fff8e7;
    border: 1px solid #fef0c7;
}
[data-theme="light"] .lg-ai-card-top {
    background: #fff4d1;
    color: #92400e;
}
[data-theme="light"] .lg-ai-card-verified {
    color: #15803d;
}
[data-theme="light"] .lg-ai-card-rating {
    color: #b45309;
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.28);
}
[data-theme="light"] .lg-ai-card-rating svg {
    fill: #b45309;
}
[data-theme="light"] .lg-ai-card-exp {
    color: #0369a1;
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.2);
}
[data-theme="light"] .lg-ai-suggest-item {
    background: #ffffff;
    border: 1.5px solid #f3cc74;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.035), inset 0 0 0 1px rgba(245, 158, 11, 0.06);
}
[data-theme="light"] .lg-ai-suggest-item:hover {
    background: #fffbeb;
    border-color: #eab308;
}
[data-theme="light"] .lg-ai-suggest-ico {
    background: #fff7df;
    border: 1px solid #fde9b3;
}
[data-theme="light"] .lg-ai-suggest-arrow {
    color: #94a3b8;
}
[data-theme="light"] .lg-ai-suggest-hide {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .lg-ai-wizard-title,
[data-theme="light"] .lg-ai-wizard-option-text strong {
    color: #0f172a;
}
[data-theme="light"] .lg-ai-wizard-note,
[data-theme="light"] .lg-ai-wizard-option-text small,
[data-theme="light"] .lg-ai-wizard-option-arrow,
[data-theme="light"] .lg-ai-wizard-manual,
[data-theme="light"] .lg-ai-wizard-empty {
    color: #64748b;
}
[data-theme="light"] .lg-ai-wizard-option {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .lg-ai-wizard-option:hover {
    background: #fffbeb;
    border-color: #eab308;
}
[data-theme="light"] .lg-ai-wizard-option-ico {
    color: #b45309;
    background: #fff7df;
    border: 1px solid #fde9b3;
}
[data-theme="light"] .lg-ai-wizard-option-ico.has-img {
    background: #fff7df;
    border-color: #fde9b3;
}
[data-theme="light"] .lg-ai-wizard-option-ico .lg-ai-wizard-type-img {
    /* SVG футера → тот же янтарный тон, что у иконок футера на светлой теме */
    filter: brightness(0) saturate(100%) invert(37%) sepia(93%) saturate(1117%) hue-rotate(4deg) brightness(93%) contrast(96%);
}
[data-theme="light"] .lg-ai-wizard-search {
    color: #1e293b;
    background: #ffffff;
    border-color: #dbe3ed;
}
[data-theme="light"] .lg-ai-wizard-search:focus {
    border-color: #e2a91f;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.10);
}
[data-theme="light"] .lg-ai-wizard-back {
    color: #64748b;
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .lg-ai-wizard-progress {
    color: #92400e;
    background: #fff4d1;
}
[data-theme="light"] .lg-ai-wizard-context-chip {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}
[data-theme="light"] .lg-ai-wizard-context-sep {
    color: #94a3b8;
}
[data-theme="light"] .lg-ai-wizard-manual {
    border-color: #cbd5e1;
}
[data-theme="light"] .lg-ai-compose-field,
[data-theme="light"] .lg-ai-lead input,
[data-theme="light"] .lg-ai-lead textarea {
    background: #ffffff;
    border-color: #dbe3ed;
}
[data-theme="light"] .lg-ai-compose-field {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}
[data-theme="light"] .lg-ai-compose-field:focus-within,
[data-theme="light"] .lg-ai-lead input:focus,
[data-theme="light"] .lg-ai-lead textarea:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}
[data-theme="light"] .lg-ai-compose textarea,
[data-theme="light"] .lg-ai-lead input,
[data-theme="light"] .lg-ai-lead textarea {
    color: #1e293b;
}
[data-theme="light"] .lg-ai-lead-title {
    color: #1e293b;
}
[data-theme="light"] .lg-ai-lead {
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
    border-color: #f1e2bd;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.045);
}
[data-theme="light"] .lg-ai-lead-ico {
    background: #fff1c2;
    border: 1px solid #f9db7b;
}
[data-theme="light"] .lg-ai-lead-cancel {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .lg-ai-send[disabled] {
    background: #eef2f7;
    color: #94a3b8;
}
[data-theme="light"] .lg-ai-btn:not(.lg-ai-btn-primary) {
    color: #78350f;
    background: #fff8e7;
    border: 1.5px solid #eab308;
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.12);
}
[data-theme="light"] .lg-ai-btn:not(.lg-ai-btn-primary):hover {
    background: #ffefbd;
    border-color: #ca8a04;
}
[data-theme="light"] .lg-ai-btn-primary {
    color: #3b2600;
    background: linear-gradient(135deg, #ffd55b 0%, #fbbf24 100%);
    border: 1.5px solid #d97706;
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
[data-theme="light"] .lg-ai-btn.lg-ai-btn-whatsapp,
[data-theme="light"] .lg-ai-btn.lg-ai-btn-whatsapp:hover {
    color: #063d1d;
    background: #25d366;
    border: 1.5px solid #15803d;
    box-shadow: 0 3px 12px rgba(22, 163, 74, 0.18);
}
[data-theme="light"] .lg-ai-subtitle,
[data-theme="light"] .lg-ai-card-meta,
[data-theme="light"] .lg-ai-suggest-hint,
[data-theme="light"] .lg-ai-suggest-label,
[data-theme="light"] .lg-ai-suggest-hide,
[data-theme="light"] .lg-ai-back-btn,
[data-theme="light"] .lg-ai-lead-note,
[data-theme="light"] .lg-ai-field-label,
[data-theme="light"] .lg-ai-field-hint,
[data-theme="light"] .lg-ai-disclaimer,
[data-theme="light"] .lg-ai-icon-btn {
    color: #64748b;
}
[data-theme="light"] .lg-ai-back-btn {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .lg-ai-intro.is-returned {
    border-color: #e2e8f0;
}
[data-theme="light"] .lg-ai-card-price,
[data-theme="light"] .lg-ai-beta,
[data-theme="light"] .lg-ai-suggest-ico {
    color: #b45309;
}
[data-theme="light"] .lg-ai-header-icon {
    color: #0f2d52;
}

/* История — светлая тема, лаконичнее */
[data-theme="light"] .lg-ai-history-toggle {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
[data-theme="light"] .lg-ai-history-toggle:hover {
    border-color: rgba(5, 150, 105, 0.35);
    background: #ecfdf5;
}
[data-theme="light"] .lg-ai-history-toggle-copy small,
[data-theme="light"] .lg-ai-history-toggle-arrow {
    color: #64748b;
}
[data-theme="light"] .lg-ai-history-toggle-ico {
    background: #ecfdf5;
    color: #059669;
}
[data-theme="light"] .lg-ai-history-panel {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .lg-ai-history-day {
    background: rgba(15, 23, 42, 0.05);
    color: #64748b;
}
[data-theme="light"] .lg-ai-compose-field {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .lg-ai-send[disabled] {
    background: #e2e8f0;
    color: #94a3b8;
}

/* ПК: воздух в боковой панели */
@media (min-width: 860px) {
    .lg-ai-header {
        padding: 16px 24px 14px;
    }
    .lg-ai-body {
        padding: 20px 24px 26px;
    }
    .lg-ai-footer {
        padding: 14px 24px 18px;
    }
    .lg-ai-lead {
        padding-left: 24px;
        padding-right: 24px;
    }
    .lg-ai-body > *,
    .lg-ai-footer > *,
    .lg-ai-lead > * {
        max-width: none;
    }
    .lg-ai-msg {
        max-width: 88%;
        font-size: 15px;
    }
    .lg-ai-wizard-title {
        font-size: 21px;
    }
    .lg-ai-wizard-heading {
        padding-right: 52px;
    }
    .lg-ai-wizard-option {
        min-height: 60px;
        padding: 13px 15px;
    }
    .lg-ai-card {
        padding: 14px;
    }
    .lg-ai-card-title {
        font-size: 15.5px;
    }
}




/* Native-feeling neutral presentation for the assistant panel. */
.lg-ai-fab {
    border: 1px solid rgba(15,23,42,.08);
    background: #0f2d52;
    color: #1f2937;
    box-shadow: 0 3px 11px rgba(100,77,29,.18);
    animation: none;
}
.lg-ai-fab::after { display: none; }
.lg-ai-fab:hover { background: #0b2342; box-shadow: 0 4px 13px rgba(100,77,29,.2); }
.lg-ai-fab-ico svg { display: none; }
.lg-ai-fab-ico::before,
.lg-ai-header-icon::before {
    content: '\f544';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}
.lg-ai-fab-ico::before { font-size: 21px; }
.lg-ai-overlay {
    align-items: flex-end;
    background: rgba(15,23,42,.24);
    -webkit-backdrop-filter: saturate(145%) blur(8px);
    backdrop-filter: saturate(145%) blur(8px);
}
.lg-ai-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: 0;
    background: #f7f8fa;
    border: 1px solid rgba(15,23,42,.08);
    border-bottom: 0;
    border-radius: 0;
    box-shadow: 0 -10px 34px rgba(15,23,42,.14);
    transform: translate3d(0,100%,0);
}
.lg-ai-overlay.is-open .lg-ai-panel { transform: translate3d(0,0,0); }
.lg-ai-handle { background: #cbd1d9; }
.lg-ai-header-icon {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #0f2d52;
}
.lg-ai-header-icon svg { display: none; }
.lg-ai-header-icon::before { font-size: 20px; }
.lg-ai-beta { background: #eef0f3; color: #64748b; }
.lg-ai-suggest-item {
    background: #fff;
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: none;
}
.lg-ai-suggest-item:hover,
.lg-ai-suggest-item:focus-visible {
    background: #f1f3f6;
    border-color: rgba(15,23,42,.14);
    box-shadow: none;
}
.lg-ai-suggest-ico { background: #eef0f3; color: #667085; }
.lg-ai-wizard-option:hover,
.lg-ai-wizard-option:focus-visible {
    border-color: rgba(15,23,42,.14);
    background: #f1f3f6;
    box-shadow: none;
}
.lg-ai-msg-user {
    background: #e8ebef;
    color: #1f2937;
}
.lg-ai-msg-ai {
    background: #fff;
    border: 1px solid rgba(15,23,42,.08);
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.lg-ai-send {
    border: 0;
    background: #0f2d52;
    color: #1f2937;
    box-shadow: none;
}
.lg-ai-send:hover:not([disabled]) { background: #0b2342; box-shadow: none; }
.lg-ai-btn-primary {
    border: 1px solid rgba(154,112,31,.22);
    background: #0f2d52;
    color: #1f2937;
    box-shadow: none;
}
.lg-ai-btn-primary:hover { background: #0b2342; box-shadow: none; }
[data-theme="dark"] .lg-ai-overlay,
html:not([data-theme="light"]) .lg-ai-overlay { background: rgba(0,0,0,.38); }
[data-theme="dark"] .lg-ai-panel,
html:not([data-theme="light"]) .lg-ai-panel {
    background: #111a2b;
    border-color: rgba(255,255,255,.09);
    box-shadow: 0 -10px 34px rgba(0,0,0,.3);
}
[data-theme="dark"] .lg-ai-handle,
html:not([data-theme="light"]) .lg-ai-handle { background: #536176; }
[data-theme="dark"] .lg-ai-header-icon, html:not([data-theme="light"]) .lg-ai-header-icon { background: transparent; border: 0; box-shadow: none; color: #a9c7ff; }
[data-theme="dark"] .lg-ai-beta,
html:not([data-theme="light"]) .lg-ai-beta { background: #263246; color: #aab6c8; }
[data-theme="dark"] .lg-ai-suggest-item,
html:not([data-theme="light"]) .lg-ai-suggest-item { background: #182338; border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .lg-ai-suggest-item:hover,
html:not([data-theme="light"]) .lg-ai-suggest-item:hover { background: #202d43; border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .lg-ai-suggest-ico,
html:not([data-theme="light"]) .lg-ai-suggest-ico { background: #263246; color: #b7c2d2; }
[data-theme="dark"] .lg-ai-wizard-option:hover,
html:not([data-theme="light"]) .lg-ai-wizard-option:hover,
[data-theme="dark"] .lg-ai-wizard-option:focus-visible,
html:not([data-theme="light"]) .lg-ai-wizard-option:focus-visible {
    border-color: rgba(255,255,255,.14);
    background: #202d43;
    box-shadow: none;
}
[data-theme="dark"] .lg-ai-msg-user,
html:not([data-theme="light"]) .lg-ai-msg-user { background: #334155; color: #f1f5f9; }
[data-theme="dark"] .lg-ai-msg-ai,
html:not([data-theme="light"]) .lg-ai-msg-ai { background: #1b2639; border-color: rgba(255,255,255,.08); color: #e5eaf1; }
[data-theme="dark"] .lg-ai-send,
html:not([data-theme="light"]) .lg-ai-send,
[data-theme="dark"] .lg-ai-btn-primary,
html:not([data-theme="light"]) .lg-ai-btn-primary { background: #ad8435; color: #fff; }
[data-theme="dark"] .lg-ai-send:hover:not([disabled]),
html:not([data-theme="light"]) .lg-ai-send:hover:not([disabled]),
[data-theme="dark"] .lg-ai-btn-primary:hover,
html:not([data-theme="light"]) .lg-ai-btn-primary:hover { background: #bd9440; }
@media (min-width: 860px) {
    .lg-ai-overlay {
        align-items: stretch;
        justify-content: flex-end;
        padding: 14px 14px 14px 0;
    }
    .lg-ai-panel {
        width: min(560px, calc(100vw - 28px));
        height: calc(100dvh - 28px);
        max-height: calc(100dvh - 28px);
        padding-top: 0;
        border: 1px solid rgba(15,23,42,.08);
        border-radius: 22px;
        box-shadow:
            -8px 0 40px rgba(15, 23, 42, 0.14),
            0 24px 72px rgba(15, 23, 42, 0.18);
        transform: translate3d(28px, 0, 0);
    }
    .lg-ai-overlay.is-open .lg-ai-panel { transform: none; }
    [data-theme="dark"] .lg-ai-panel,
    html:not([data-theme="light"]) .lg-ai-panel { border-color: rgba(255,255,255,.09); }
}
@media (min-width: 1200px) {
    .lg-ai-panel {
        width: min(640px, calc(100vw - 40px));
    }
}
@media (min-width: 1440px) {
    .lg-ai-panel {
        width: min(700px, 46vw);
    }
}
@media (prefers-reduced-motion: reduce) {
    .lg-ai-fab, .lg-ai-fab::after, .lg-ai-fab-ico { animation: none; }
}

/* Мобилка: панель до верха экрана, без щели сверху. */
@media (max-width: 859px) {
    .lg-ai-panel {
        height: 100dvh;
        max-height: 100dvh;
        margin-top: 0;
        border-radius: 0;
    }
}
/* Android APK: панель до самого верха экрана; safe-area только в шапке. */
html.strela-native-app .lg-ai-overlay,
html.strela-android-edge .lg-ai-overlay {
    align-items: stretch;
}
html.strela-native-app .lg-ai-panel,
html.strela-android-edge .lg-ai-panel {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin-top: 0;
    border-radius: 0;
    border-top: 0;
}
.lg-ai-panel { background-image: none; }
.lg-ai-handle { background: #cbd0d8; }
.lg-ai-fab,
.lg-ai-send,
.lg-ai-btn-primary {
    background: #292a2d;
    border-color: transparent;
    color: #fff;
    box-shadow: none;
}
.lg-ai-fab:hover,
.lg-ai-send:hover:not([disabled]),
.lg-ai-btn-primary:hover { background: #414247; color: #fff; box-shadow: none; }
.lg-ai-header-icon { color: #3f4146; }
.lg-ai-suggest-ico,
.lg-ai-wizard-option-ico,
.lg-ai-wizard-option-ico.has-img { background: #eceef1; color: #555b65; border-color: transparent; }
.lg-ai-wizard-option-ico .lg-ai-wizard-type-img { filter: grayscale(1) brightness(.68); }
.lg-ai-msg-user { background: #e8e9eb; color: #242528; }
.lg-ai-msg-ai { background: #fff; border-color: #e7e8ea; box-shadow: none; }
.lg-ai-wizard-option:hover,
.lg-ai-wizard-option:focus-visible { background: #f0f1f3; border-color: #dfe1e5; }
[data-theme="dark"] .lg-ai-panel,
html:not([data-theme="light"]) .lg-ai-panel {
    background:
        radial-gradient(ellipse at 15% 0%, rgba(50,93,166,.2), transparent 42%),
        linear-gradient(180deg, #0d1830 0%, #080f22 100%);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(50,93,166,.2), transparent 42%),
        linear-gradient(180deg, #0d1830 0%, #080f22 100%);
}
[data-theme="dark"] .lg-ai-fab,
html:not([data-theme="light"]) .lg-ai-fab,
[data-theme="dark"] .lg-ai-send,
html:not([data-theme="light"]) .lg-ai-send,
[data-theme="dark"] .lg-ai-btn-primary,
html:not([data-theme="light"]) .lg-ai-btn-primary { background: #f0f1f2; color: #202124; }
[data-theme="dark"] .lg-ai-fab:hover,
html:not([data-theme="light"]) .lg-ai-fab:hover,
[data-theme="dark"] .lg-ai-send:hover:not([disabled]),
html:not([data-theme="light"]) .lg-ai-send:hover:not([disabled]),
[data-theme="dark"] .lg-ai-btn-primary:hover,
html:not([data-theme="light"]) .lg-ai-btn-primary:hover { background: #d8dade; color: #202124; }
[data-theme="dark"] .lg-ai-header-icon, html:not([data-theme="light"]) .lg-ai-header-icon { background: transparent; border: 0; box-shadow: none; color: #a9c7ff; }
[data-theme="dark"] .lg-ai-handle,
html:not([data-theme="light"]) .lg-ai-handle { background: #66799f; }
[data-theme="dark"] .lg-ai-suggest-item,
html:not([data-theme="light"]) .lg-ai-suggest-item { background: #111f3b; border-color: rgba(255,255,255,.09); }
[data-theme="dark"] .lg-ai-suggest-item:hover,
html:not([data-theme="light"]) .lg-ai-suggest-item:hover,
[data-theme="dark"] .lg-ai-wizard-option:hover,
html:not([data-theme="light"]) .lg-ai-wizard-option:hover,
[data-theme="dark"] .lg-ai-wizard-option:focus-visible,
html:not([data-theme="light"]) .lg-ai-wizard-option:focus-visible { background: #202d47; border-color: rgba(255,255,255,.15); }
[data-theme="dark"] .lg-ai-suggest-ico,
html:not([data-theme="light"]) .lg-ai-suggest-ico,
[data-theme="dark"] .lg-ai-wizard-option-ico,
html:not([data-theme="light"]) .lg-ai-wizard-option-ico,
[data-theme="dark"] .lg-ai-wizard-option-ico.has-img,
html:not([data-theme="light"]) .lg-ai-wizard-option-ico.has-img { background: #2c2e32; color: #d0d2d6; border-color: transparent; }
[data-theme="dark"] .lg-ai-wizard-option-ico .lg-ai-wizard-type-img,
html:not([data-theme="light"]) .lg-ai-wizard-option-ico .lg-ai-wizard-type-img { filter: grayscale(1) brightness(1.5); }
[data-theme="dark"] .lg-ai-msg-user,
html:not([data-theme="light"]) .lg-ai-msg-user { background: #202d47; color: #f4f6ff; }
[data-theme="dark"] .lg-ai-msg-ai,
html:not([data-theme="light"]) .lg-ai-msg-ai { background: #111f3b; border-color: rgba(255,255,255,.09); color: #f4f6ff; }
.lg-ai-panel .lg-ai-btn:not(.lg-ai-btn-primary),
.lg-ai-panel .lg-ai-btn-whatsapp,
.lg-ai-panel .lg-ai-btn-whatsapp:hover {
    background: #f0f1f3;
    border-color: #dfe1e5;
    color: #34363a;
    box-shadow: none;
}
.lg-ai-panel .lg-ai-speak-btn:hover,
.lg-ai-panel .lg-ai-speak-btn:focus-visible,
.lg-ai-panel .lg-ai-speak-btn.is-speaking,
.lg-ai-panel .lg-ai-speak-btn.is-loading { color: #555b65; background: #eceef1; }
.lg-ai-panel .lg-ai-card-media.is-icon,
.lg-ai-panel .lg-ai-card-media.is-empty { color: #727782; background: #eceef1; border-color: #e1e3e7; box-shadow: none; }
.lg-ai-panel .lg-ai-card-media.is-icon img { filter: grayscale(.75) saturate(.35); }
.lg-ai-panel .lg-ai-card-price,
.lg-ai-panel .lg-ai-card-top { color: #555b65; }
.lg-ai-panel .lg-ai-card-top,
.lg-ai-panel .lg-ai-card-rating,
.lg-ai-panel .lg-ai-card-exp { background: #f0f1f3; border-color: #e1e3e7; color: #555b65; box-shadow: none; }
.lg-ai-panel .lg-ai-card-rating svg { fill: currentColor; }
.lg-ai-panel .lg-ai-lead { background: #f7f8fa; border-color: #e5e7eb; }
.lg-ai-panel .lg-ai-lead-ico { background: #eceef1; color: #555b65; }
.lg-ai-panel .lg-ai-lead-cancel:hover { border-color: #c8cbd1; }
[data-theme="dark"] .lg-ai-panel .lg-ai-btn:not(.lg-ai-btn-primary),
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-btn:not(.lg-ai-btn-primary),
[data-theme="dark"] .lg-ai-panel .lg-ai-btn-whatsapp,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-btn-whatsapp,
[data-theme="dark"] .lg-ai-panel .lg-ai-btn-whatsapp:hover,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-btn-whatsapp:hover { background: #2c2e32; border-color: #414349; color: #eceef0; }
[data-theme="dark"] .lg-ai-panel .lg-ai-card-media.is-icon,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-media.is-icon,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-media.is-empty,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-media.is-empty,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-top,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-top,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-rating,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-rating,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-exp,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-exp { background: #2c2e32; border-color: #414349; color: #d0d2d6; }
[data-theme="dark"] .lg-ai-panel .lg-ai-lead,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-lead { background: #0d1830; border-color: rgba(255,255,255,.09); }
[data-theme="dark"] .lg-ai-panel .lg-ai-lead-ico,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-lead-ico { background: #202d47; color: #d9e4ff; }

[data-theme="dark"] .lg-ai-panel .lg-ai-footer,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-footer { background: #0d1830; border-color: rgba(255,255,255,.09); }
[data-theme="dark"] .lg-ai-panel .lg-ai-compose-field,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-compose-field { background: #0d1830; border-color: rgba(255,255,255,.12); box-shadow: none; }
[data-theme="dark"] .lg-ai-panel .lg-ai-compose-field:focus-within,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-compose-field:focus-within { border-color: rgba(147,164,195,.5); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
[data-theme="dark"] .lg-ai-panel .lg-ai-suggest-ico,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-suggest-ico,
[data-theme="dark"] .lg-ai-panel .lg-ai-wizard-option-ico,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-wizard-option-ico,
[data-theme="dark"] .lg-ai-panel .lg-ai-wizard-option-ico.has-img,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-wizard-option-ico.has-img,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-media.is-icon,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-media.is-icon,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-media.is-empty,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-media.is-empty,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-top,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-top,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-rating,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-rating,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-exp,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-exp,
[data-theme="dark"] .lg-ai-panel .lg-ai-btn:not(.lg-ai-btn-primary),
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-btn:not(.lg-ai-btn-primary),
[data-theme="dark"] .lg-ai-panel .lg-ai-btn-whatsapp,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-btn-whatsapp,
[data-theme="dark"] .lg-ai-panel .lg-ai-btn-whatsapp:hover,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-btn-whatsapp:hover { background: #202d47; border-color: rgba(255,255,255,.1); color: #e6edfb; }

[data-theme="dark"] .lg-ai-panel .lg-ai-card-media.is-icon,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-media.is-icon,
[data-theme="dark"] .lg-ai-panel .lg-ai-card-media.is-empty,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-media.is-empty { background: #202d47; }
[data-theme="dark"] .lg-ai-panel .lg-ai-card,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card { background: #111f3b; border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .lg-ai-panel .lg-ai-card--top,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card--top {
  border-color: rgba(212, 175, 55, .45);
  background:
    linear-gradient(180deg, rgba(212, 175, 55, .14), #111f3b 48%),
    #111f3b;
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, .16),
    0 8px 22px rgba(0, 0, 0, .28);
}
[data-theme="dark"] .lg-ai-panel .lg-ai-card-body strong,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-body strong { color: #f4f6ff; }
[data-theme="dark"] .lg-ai-panel .lg-ai-card-body small,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-card-body small { color: rgba(244, 246, 255, .58); }
[data-theme="dark"] .lg-ai-fab,
html:not([data-theme="light"]) .lg-ai-fab {
    background: #1b2d4b;
    border-color: rgba(169,199,255,.18);
    color: #a9c7ff;
    box-shadow: 0 5px 18px rgba(0,0,0,.28);
}
[data-theme="dark"] .lg-ai-fab:hover,
html:not([data-theme="light"]) .lg-ai-fab:hover { background: #243b60; }
[data-theme="dark"] .lg-ai-fab-ico,
html:not([data-theme="light"]) .lg-ai-fab-ico { color: #a9c7ff; filter: none; }
.lg-ai-fab-ico::before,
.lg-ai-header-icon::before { content: none !important; }
.lg-ai-fab-ico { width: 38px; height: 38px; filter: none; animation: none; }
.lg-ai-welcome-bot { background: linear-gradient(145deg, #eef1f4, #dce1e7); box-shadow: 0 5px 16px rgba(31,41,55,.12), inset 0 0 0 1px rgba(255,255,255,.75); }
.lg-ai-header-icon { background: transparent; border: 0; color: #1f2937; box-shadow: none; }
[data-theme="dark"] .lg-ai-welcome-bot,
html:not([data-theme="light"]) .lg-ai-welcome-bot { background: linear-gradient(145deg, #2b3748, #202d3e); box-shadow: 0 5px 16px rgba(0,0,0,.24), inset 0 0 0 1px rgba(255,255,255,.08); }
[data-theme="dark"] .lg-ai-header-icon,
html:not([data-theme="light"]) .lg-ai-header-icon { background: transparent; border: 0; color: #a9c7ff; box-shadow: none; }
[data-theme="dark"] .lg-ai-bot-mark,
html:not([data-theme="light"]) .lg-ai-bot-mark { background: linear-gradient(145deg, #2b3748, #202d3e); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 2px 5px rgba(0,0,0,.2); }
[data-theme="dark"] .lg-ai-welcome-text,
html:not([data-theme="light"]) .lg-ai-welcome-text { color: #f3f4f6; }
[data-theme="dark"] .lg-ai-welcome-play,
[data-theme="dark"] .lg-ai-welcome-options,
html:not([data-theme="light"]) .lg-ai-welcome-play,
html:not([data-theme="light"]) .lg-ai-welcome-options { color: #f3f4f6; background: #29384c; border-color: rgba(255,255,255,.18); }
[data-theme="dark"] .lg-ai-welcome-play.is-speaking,
html:not([data-theme="light"]) .lg-ai-welcome-play.is-speaking { color: #fff; background: #047857; border-color: #047857; }

/* Use the same floating robot from the home page AI card throughout the assistant. */
.lg-ai-welcome {
    gap: 20px;
    padding: 22px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.lg-ai-panel .lg-ai-welcome-text { color: #1f2937; font-size: 16px; line-height: 1.55; }
.lg-ai-panel .lg-ai-welcome-play {
    color: #fff;
    background: #059669;
    border-color: #059669;
}
.lg-ai-panel .lg-ai-welcome-options {
    color: #047857;
    background: #ecfdf5;
    border-color: rgba(5, 150, 105, 0.28);
}
.lg-ai-panel .lg-ai-welcome-play.is-speaking { background: #047857; border-color: #047857; }
.lg-ai-mascot-stage {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at 50% 46%, rgba(5,150,105,.1), transparent 66%);
}
.lg-ai-mascot-stage::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 50%;
}
.lg-ai-mascot-stage .lg-ai-bot { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; animation: hv2-ai-bob 3.2s ease-in-out infinite; }
.lg-ai-mascot-stage .lg-ai-bot-antenna { position: relative; width: 2px; height: 9px; background: #718096; }
.lg-ai-mascot-stage .lg-ai-bot-antenna i { position: absolute; top: -5px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.16); animation: hv2-ai-pulse 2.4s ease-in-out infinite; }
.lg-ai-mascot-stage .lg-ai-bot-head { position: relative; display: flex; width: 52px; height: 44px; align-items: center; flex-direction: column; padding-top: 10px; border: 1px solid #d5dbe3; border-radius: 15px; background: linear-gradient(145deg,#fff,#e6eaf0); box-shadow: 0 5px 12px rgba(15,23,42,.12),inset 0 1px 0 #fff; }
.lg-ai-mascot-stage .lg-ai-bot-ear { position: absolute; top: 14px; width: 5px; height: 13px; border-radius: 4px; background: #0f2d52; }
.lg-ai-mascot-stage .lg-ai-bot-ear--left { left: -5px; }
.lg-ai-mascot-stage .lg-ai-bot-ear--right { right: -5px; }
.lg-ai-mascot-stage .lg-ai-bot-visor {
    display: flex;
    width: 34px;
    height: 16px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-top: 1px;
    border-radius: 7px;
    background: #243247;
}
/* Толстые круглые дуги ∩∩ как у 3D */
.lg-ai-mascot-stage .lg-ai-bot-visor i {
    display: block;
    box-sizing: border-box;
    width: 8px;
    height: 5px;
    margin: 0 0 1px;
    padding: 0;
    border: 3px solid #34d399;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: transparent;
    box-shadow: 0 0 5px rgba(52, 211, 153, 0.55);
    transform-origin: center bottom;
    animation: hv2-ai-arc-blink 4.8s ease-in-out infinite;
}
.lg-ai-mascot-stage .lg-ai-bot-visor i+i { animation-delay: .1s; }
.lg-ai-mascot-stage .lg-ai-bot-mouth {
    width: 10px;
    height: 5px;
    margin-top: 3px;
    border: 0;
    border-bottom: 2px solid #9aa5b3;
    border-radius: 0 0 50% 50%;
    background: transparent;
}
.lg-ai-mascot-stage--welcome { width: 96px; height: 100px; flex: 0 0 96px; }
.lg-ai-mascot-stage--fab { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%; background: transparent; }
.lg-ai-mascot-stage--fab::before { display: none; }
.lg-ai-mascot-stage--fab .lg-ai-bot { transform: scale(.65); }
.lg-ai-fab { width: 52px; height: 52px; min-width: 52px; border: 0; border-radius: 50%; background: transparent; box-shadow: none; }
.lg-ai-fab:hover,.lg-ai-fab:active { background: transparent; border-color: transparent; box-shadow: none; }
.lg-ai-fab-ico { width: 52px; height: 52px; }
.lg-ai-header-icon .lg-ai-mascot-stage { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 0; background: transparent; }
.lg-ai-header-icon .lg-ai-mascot-stage::before { display: none; }
.lg-ai-header-icon .lg-ai-bot { transform: scale(.43); }
.lg-ai-welcome.is-speaking .lg-ai-mascot-stage::before { border-color: rgba(5,150,105,.55); box-shadow: 0 0 12px rgba(5,150,105,.18); }
@keyframes hv2-ai-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes hv2-ai-pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(5,150,105,.14); } 50% { box-shadow: 0 0 0 5px rgba(5,150,105,.24); } }
@keyframes hv2-ai-blink { 0%,45%,49%,100% { transform: scaleY(1); } 47% { transform: scaleY(.12); } }
@keyframes hv2-ai-arc-blink {
    0%, 42%, 52%, 100% { transform: scaleY(1); opacity: 1; }
    46%, 48% { transform: scaleY(0.15); opacity: 0.85; }
}
html[data-theme="dark"] .lg-ai-mascot-stage .lg-ai-bot-head,
html:not([data-theme="light"]) .lg-ai-mascot-stage .lg-ai-bot-head { border-color: #536176; background: linear-gradient(145deg,#45536a,#2b374a); box-shadow: 0 5px 12px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.12); }
html[data-theme="dark"] .lg-ai-mascot-stage .lg-ai-bot-antenna,
html:not([data-theme="light"]) .lg-ai-mascot-stage .lg-ai-bot-antenna { background: #9aa8bd; }
html[data-theme="dark"] .lg-ai-mascot-stage--fab,
html:not([data-theme="light"]) .lg-ai-mascot-stage--fab { background: transparent; }
html[data-theme="dark"] .lg-ai-header-icon .lg-ai-mascot-stage,
html:not([data-theme="light"]) .lg-ai-header-icon .lg-ai-mascot-stage { background: transparent; }
html[data-theme="dark"] .lg-ai-panel .lg-ai-welcome-text,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-welcome-text { color: #f3f4f6; }
html[data-theme="dark"] .lg-ai-panel .lg-ai-welcome-play,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-welcome-play {
    color: #fff;
    background: #059669;
    border-color: #059669;
}
html[data-theme="dark"] .lg-ai-panel .lg-ai-welcome-options,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-welcome-options {
    color: #a7f3d0;
    background: rgba(5, 150, 105, 0.18);
    border-color: rgba(52, 211, 153, 0.35);
}
html[data-theme="dark"] .lg-ai-panel .lg-ai-welcome-play.is-speaking,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-welcome-play.is-speaking {
    background: #047857;
    border-color: #047857;
}
@media (prefers-reduced-motion: reduce) {
    .lg-ai-mascot-stage .lg-ai-bot,
    .lg-ai-mascot-stage .lg-ai-bot-antenna i,
    .lg-ai-mascot-stage .lg-ai-bot-visor i { animation: none; }
}

/* Keep the header spacing intact; reduce only the inner content inset. */
.lg-ai-body { padding-top: 10px; }
@media (min-width: 640px) {
    .lg-ai-body { padding-top: 12px; }
}
@media (max-width: 639px) {
    .lg-ai-panel { padding-top: 0; }
    .lg-ai-handle { display: none; }
    .lg-ai-header {
        padding-top: 4px;
    }
}
@media (min-width: 860px) {
    .lg-ai-header {
        padding-top: 10px;
    }
}

/* Center the welcome with the robot above it; keep both actions level. */
.lg-ai-welcome {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    text-align: center;
}
.lg-ai-welcome-copy {
    width: min(100%, 460px);
    flex: 0 1 auto;
}
.lg-ai-panel .lg-ai-welcome-text { text-align: center; }
.lg-ai-welcome-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 340px);
    margin: 18px auto 0;
}
.lg-ai-welcome-actions .lg-ai-welcome-play,
.lg-ai-welcome-actions .lg-ai-welcome-options {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Let the FAB show the whole animated robot without a circular mask. */
.lg-ai-fab {
    width: 68px;
    height: 68px;
    min-width: 68px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.lg-ai-fab:hover,
.lg-ai-fab:active,
[data-theme="light"] .lg-ai-fab,
[data-theme="dark"] .lg-ai-fab,
html:not([data-theme="light"]) .lg-ai-fab,
[data-theme="light"] .lg-ai-fab:hover,
[data-theme="dark"] .lg-ai-fab:hover,
html:not([data-theme="light"]) .lg-ai-fab:hover {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.lg-ai-fab-ico,
.lg-ai-mascot-stage--fab {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    filter: none;
}
html[data-theme="dark"] .lg-ai-mascot-stage--fab,
html:not([data-theme="light"]) .lg-ai-mascot-stage--fab { background: transparent; }
.lg-ai-mascot-stage--fab .lg-ai-bot { animation: lg-ai-fab-bob 3.2s ease-in-out infinite; }
@keyframes lg-ai-fab-bob {
    0%, 100% { transform: scale(.72) translateY(0); }
    50% { transform: scale(.72) translateY(-4px); }
}

/* Welcome choices replace the greeting once its audio finishes. */
.lg-ai-welcome-choices[hidden],
.lg-ai-wizard[hidden] { display: none !important; }
.lg-ai-welcome-choices {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(100%, 360px);
    margin: 16px auto 0;
    animation: sai-choice-enter .42s cubic-bezier(.2,.8,.2,1) both;
}
.lg-ai-welcome-choice-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}
.lg-ai-welcome-choice,
.lg-ai-welcome-choice-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #d4b36e;
    border-radius: 16px;
    background: #ead9ad;
    color: #302a1d;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.lg-ai-welcome-choice:hover,
.lg-ai-welcome-choice-secondary:hover { transform: translateY(-1px); background: #f0e4c8; }
.lg-ai-welcome-choice-secondary {
    min-height: 36px;
    border-color: #d7d9dc;
    border-radius: 999px;
    background: transparent;
    color: #626a73;
    font-size: 12px;
    font-weight: 550;
}
.lg-ai-intro.is-greeting-finished .lg-ai-welcome-text {
    max-height: 0;
    margin: 0;
    opacity: 0;
    transform: translateY(-8px);
    overflow: hidden;
    transition: opacity .24s ease, transform .32s ease, max-height .32s ease, margin .32s ease;
}
.lg-ai-intro.is-greeting-finished .lg-ai-welcome-actions {
    display: none;
}
.lg-ai-intro.is-guided .lg-ai-welcome-text {
    max-height: 5em;
    margin: 0;
    opacity: 1;
    transform: none;
    overflow: visible;
}
.lg-ai-intro.is-guided .lg-ai-welcome-choices { display: none; }
.lg-ai-intro.is-guided .lg-ai-welcome { gap: 4px; padding-bottom: 4px; }
.lg-ai-intro.is-guided .lg-ai-wizard { animation: sai-choice-enter .38s cubic-bezier(.2,.8,.2,1) both; }
.lg-ai-wizard-options > .lg-ai-wizard-option { animation: sai-choice-enter .32s ease both; }
.lg-ai-wizard-options > .lg-ai-wizard-option:nth-child(2) { animation-delay: .025s; }
.lg-ai-wizard-options > .lg-ai-wizard-option:nth-child(3) { animation-delay: .05s; }
.lg-ai-wizard-options > .lg-ai-wizard-option:nth-child(4) { animation-delay: .075s; }
@keyframes sai-choice-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .lg-ai-welcome-choice,
html:not([data-theme="light"]) .lg-ai-welcome-choice { color: #f2ede1; background: #51462e; border-color: #887245; }
[data-theme="dark"] .lg-ai-welcome-choice-secondary,
html:not([data-theme="light"]) .lg-ai-welcome-choice-secondary { color: #c5c9ce; border-color: #45494f; background: transparent; }
@media (prefers-reduced-motion: reduce) {
    .lg-ai-welcome-choices,
    .lg-ai-intro.is-guided .lg-ai-wizard,
    .lg-ai-wizard-options > .lg-ai-wizard-option { animation: none; }
}

/* Header bot stays full-sized in silhouette with no circular badge. */
.lg-ai-header-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.lg-ai-header-icon .lg-ai-mascot-stage {
    width: 36px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    overflow: visible;
    border-radius: 0;
    background: transparent;
}
.lg-ai-header-icon .lg-ai-mascot-stage::before { display: none; }
.lg-ai-header-icon .lg-ai-bot { scale: .62; }

/* Dark wizard icons need a light foreground against their blue-gray tiles. */
[data-theme="dark"] .lg-ai-panel .lg-ai-wizard-option-ico,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-wizard-option-ico,
[data-theme="dark"] .lg-ai-panel .lg-ai-wizard-option-ico.has-img,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-wizard-option-ico.has-img {
    color: #f1f4f7;
    background: #293b54;
    border-color: #465d79;
}
[data-theme="dark"] .lg-ai-panel .lg-ai-wizard-option-ico .lg-ai-wizard-type-img,
html:not([data-theme="light"]) .lg-ai-panel .lg-ai-wizard-option-ico .lg-ai-wizard-type-img {
    filter: brightness(0) invert(.9);
}

/* Welcome choices (STRELA parity) + FAQ */
.lg-ai-welcome-choices[hidden],
.lg-ai-faq[hidden] { display: none !important; }
.lg-ai-welcome-choices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(100%, 360px);
  margin: 16px auto 0;
  animation: lg-ai-choice-enter .42s cubic-bezier(.2,.8,.2,1) both;
}
.lg-ai-welcome-choice-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.lg-ai-welcome-choice,
.lg-ai-welcome-choice-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(5, 150, 105, .35);
  border-radius: 16px;
  background: rgba(5, 150, 105, .12);
  color: #0f2d52;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.lg-ai-welcome-choice:hover,
.lg-ai-welcome-choice-secondary:hover {
  transform: translateY(-1px);
  background: rgba(5, 150, 105, .18);
}
.lg-ai-welcome-choice-secondary {
  min-height: 36px;
  width: 100%;
  border-color: rgba(15, 45, 82, .14);
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 45, 82, .62);
  font-size: 12px;
  font-weight: 550;
}
.lg-ai-faq {
  display: grid;
  gap: 8px;
  width: min(100%, 360px);
  margin: 12px auto 0;
  animation: lg-ai-choice-enter .38s cubic-bezier(.2,.8,.2,1) both;
}
.lg-ai-faq-back {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #059669;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.lg-ai-faq-list {
  display: grid;
  gap: 8px;
}
.lg-ai-faq-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 45, 82, .12);
  border-radius: 14px;
  background: #fff;
  color: #0f2d52;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.lg-ai-faq-btn strong { font-size: 14px; }
.lg-ai-faq-btn small { color: rgba(15,45,82,.55); font-size: 12px; }
.lg-ai-faq-btn:hover { border-color: #059669; transform: translateY(-1px); }
.lg-ai-intro.is-faq .lg-ai-welcome-choices { display: none; }
.lg-ai-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 12px 0;
}
.lg-ai-msg--user { align-items: flex-end; }
.lg-ai-msg--assistant {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}
.lg-ai-msg-ava {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #eef1f4, #dce1e7);
  box-shadow: 0 1px 3px rgba(15, 45, 82, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}
.lg-ai-msg-ava .lg-ai-mascot-stage--msg {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.lg-ai-msg-ava .lg-ai-mascot-stage--msg::before { display: none; }
.lg-ai-msg-ava .lg-ai-bot {
  transform: scale(0.38);
  animation: none;
}
.lg-ai-msg-ava .lg-ai-bot-visor i {
  animation-duration: 4.6s;
}
.lg-ai-msg__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.lg-ai-bubble {
  max-width: min(92%, 420px);
  width: fit-content;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(15,45,82,.06);
  color: #0f2d52;
  font-size: 14px;
  line-height: 1.45;
}
.lg-ai-msg--user .lg-ai-bubble {
  background: #0f2d52;
  color: #fff;
  border-bottom-right-radius: 6px;
}
.lg-ai-msg--assistant .lg-ai-bubble {
  border-bottom-left-radius: 6px;
}
.lg-ai-msg--assistant .lg-ai-msg__body .lg-ai-bubble {
  max-width: min(100%, 400px);
}
.lg-ai-msg-tools {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding-left: 2px;
}
.lg-ai-overlay.lg-ai-tts-publisher .lg-ai-msg--assistant .lg-ai-msg-tools {
    display: inline-flex;
}
.lg-ai-pick .lg-ai-msg-tools {
    margin-bottom: 4px;
}
.lg-ai-msg--history .lg-ai-msg-ava {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}
.lg-ai-msg--history .lg-ai-msg-ava .lg-ai-mascot-stage--msg {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}
.lg-ai-msg--history .lg-ai-msg-ava .lg-ai-bot {
    transform: scale(0.32);
}
html[data-theme="dark"] .lg-ai-msg-ava,
html:not([data-theme="light"]) .lg-ai-msg-ava {
    background: linear-gradient(145deg, #2b3748, #202d3e);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.lg-ai-overlay.lg-ai-tts-publisher .lg-ai-speak-btn {
    display: inline-flex;
}
.lg-ai-publish-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 1.5px solid rgba(5, 150, 105, 0.35);
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.92;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-ai-publish-btn svg {
    width: 15px;
    height: 15px;
    display: block;
    pointer-events: none;
}
.lg-ai-publish-btn:hover,
.lg-ai-publish-btn:focus-visible {
    background: #059669;
    border-color: #059669;
    color: #fff;
    outline: none;
}
.lg-ai-publish-btn:active {
    transform: scale(0.94);
}
.lg-ai-publish-btn.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.lg-ai-publish-btn.is-published {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
.lg-ai-cards { display: grid; gap: 8px; margin-top: 2px; width: 100%; }
.lg-ai-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(15,45,82,.1);
  background: #fff;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .18s ease, box-shadow .22s ease, transform .18s ease;
}
.lg-ai-card:hover {
  border-color: #059669;
}
.lg-ai-card--top {
  border-color: rgba(184, 150, 46, .55);
  background:
    linear-gradient(180deg, rgba(255, 244, 214, .55), #fff 42%),
    #fff;
  box-shadow:
    0 0 0 1px rgba(184, 150, 46, .18),
    0 8px 22px rgba(184, 150, 46, .14);
  overflow: hidden;
}
.lg-ai-card--top::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 236, 179, .55) 50%,
    transparent 62%,
    transparent 100%
  );
  transform: translateX(-120%);
  animation: sai-top-shine 2.8s ease-in-out infinite;
}
.lg-ai-card--top:hover {
  border-color: rgba(184, 150, 46, .78);
  box-shadow:
    0 0 0 1px rgba(184, 150, 46, .28),
    0 10px 26px rgba(184, 150, 46, .2);
  transform: translateY(-1px);
}
.lg-ai-card-ava {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}
.lg-ai-card-ava--top .lg-ai-card-photo {
  box-shadow: 0 0 0 2px rgba(184, 150, 46, .55);
}
.lg-ai-actions,
.lg-ai-action {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  cursor: pointer;
}
.lg-ai-card-photo {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(15,45,82,.08);
}
.lg-ai-card-photo--empty {
  background:
    radial-gradient(circle at 40% 35%, rgba(15,45,82,.08), rgba(15,45,82,.16));
}
.lg-top-mark--ai {
  top: auto;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-width: 1px;
  box-shadow: 0 1px 3px rgba(15, 45, 82, .12);
}
.lg-top-mark--ai .lg-top-mark__logo {
  width: 10px;
  height: 10px;
}
.lg-ai-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-ai-card-body strong {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  color: #0f2d52;
}
.lg-ai-card-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lg-ai-card-top-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4af37, #b8962e);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(184, 150, 46, .35);
}
.lg-ai-card-body small { font-size: 12px; color: rgba(15,45,82,.55); }
@keyframes sai-top-shine {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .lg-ai-card--top::before {
    animation: none;
    display: none;
  }
}
.lg-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
}
.lg-ai-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #059669;
  color: #fff !important;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.lg-ai-action {
  appearance: none;
  -webkit-appearance: none;
}
.lg-ai-action:hover {
  filter: brightness(1.05);
}
.lg-ai-btn, .lg-ai-btn-primary {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #0f2d52;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.lg-ai-btn-block { width: 100%; }
body.lg-ai-open { overflow: hidden; }

/* Greeting → action buttons reveal (STRELA parity) */
.lg-ai-intro.is-greeting-finished .lg-ai-welcome-text {
  max-height: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(-8px);
  overflow: hidden;
  transition: opacity .24s ease, transform .32s ease, max-height .32s ease, margin .32s ease;
}
.lg-ai-intro.is-greeting-finished .lg-ai-welcome-actions { display: none; }
.lg-ai-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.lg-ai-welcome-options {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(15,45,82,.14);
  border-radius: 14px;
  background: rgba(15,45,82,.04);
  color: #0f2d52;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
@keyframes lg-ai-choice-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Fullscreen mobile (браузер): flush to top. */
@media (max-width: 639px) {
  .lg-ai-panel {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin-top: 0;
    padding-top: 0 !important;
  }
  .lg-ai-handle {
    display: none;
    margin: 0;
  }
}

/*
 * APK + браузер: одинаковый верх.
 * --lg-app-inset-top игнор (старые APK раздувают). Safe-area только в шапке.
 */
html.lg-native-app .lg-ai-overlay {
  align-items: flex-end;
  padding-top: 8px;
  box-sizing: border-box;
}
html.lg-native-app .lg-ai-panel {
  height: calc(100dvh - 14px) !important;
  max-height: calc(100dvh - 14px) !important;
  min-height: 75dvh !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-radius: 22px 22px 0 0 !important;
  border-top: 1px solid rgba(15, 45, 82, 0.1);
  overflow: hidden;
}
html.lg-native-app .lg-ai-handle {
  display: block !important;
  margin: 10px auto 4px;
}
html.lg-native-app .lg-ai-header {
  padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
}
@media (max-width: 639px) {
  .lg-ai-header {
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
  }
}


/* ── ПК финал: боковой док справа, крупнее ── */
@media (min-width: 860px) {
    .lg-ai-overlay {
        align-items: stretch;
        justify-content: flex-end;
        padding: 14px 14px 14px 0;
    }
    .lg-ai-panel {
        width: min(560px, calc(100vw - 28px));
        height: calc(100dvh - 28px);
        max-height: calc(100dvh - 28px);
        margin: 0;
        border-radius: 22px;
        transform: translate3d(28px, 0, 0);
    }
    .lg-ai-overlay.is-open .lg-ai-panel {
        transform: none;
    }
}
@media (min-width: 1200px) {
    .lg-ai-panel {
        width: min(640px, calc(100vw - 40px));
    }
}
@media (min-width: 1440px) {
    .lg-ai-panel {
        width: min(700px, 46vw);
    }
}
