/* ============ ЧАТ ПОДДЕРЖКИ (автономный) ============ */
.nova-support-chat {
    position: fixed;
    bottom: 24px;
    z-index: 9998;
    font-family: inherit;
}
.nova-support-chat--right { right: 24px; }
.nova-support-chat--left  { left: 24px; }

/* FAB */
.nova-support-chat__fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px 0 8px;
    height: 60px;
    background: linear-gradient(135deg, #4C6EF5 0%, #7048E8 100%);
    color: #fff;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(76, 110, 245, 0.4);
    transition: transform 0.25s, box-shadow 0.25s;
}
.nova-support-chat__fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(76, 110, 245, 0.5);
}
.nova-support-chat__fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    flex-shrink: 0;
}
.nova-support-chat__fab-icon svg { width: 22px; height: 22px; }
.nova-support-chat__fab-custom-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
    display: block;
}
.nova-support-chat__fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #4C6EF5, #7048E8);
    animation: novaChatPulse 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}
@keyframes novaChatPulse {
    0%   { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.5); }
}

/* Точка непрочитанного */
.nova-support-chat__fab-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: novaDotPulse 1.2s ease-in-out infinite;
}
@keyframes novaDotPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.25); }
}

/* Подсказка */
.nova-support-chat.is-hint .nova-support-chat__fab::before {
    content: 'Задать вопрос 👋';
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    white-space: nowrap;
    animation: novaHintFade 5s ease forwards;
}
@keyframes novaHintFade {
    0%, 70% { opacity: 1; }
    100%    { opacity: 0; }
}

.nova-support-chat.is-open .nova-support-chat__fab {
    opacity: 0;
    pointer-events: none;
}

/* ПАНЕЛЬ */
.nova-support-chat__panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}
.nova-support-chat--left .nova-support-chat__panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}
.nova-support-chat.is-open .nova-support-chat__panel {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* ШАПКА */
.nova-support-chat__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #4C6EF5 0%, #7048E8 50%, #845EF7 100%);
    color: #fff;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.nova-support-chat__header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
    border-radius: 50%;
}
.nova-support-chat__header-content {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}
.nova-support-chat__logo {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nova-support-chat__logo svg { width: 24px; height: 24px; }
.nova-support-chat__title { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.nova-support-chat__subtitle {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nova-support-chat__online-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: novaDotPulse 1.5s infinite;
}
.nova-support-chat__close {
    background: rgba(255,255,255,0.2);
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.2s;
    position: relative;
    z-index: 1;
}
.nova-support-chat__close:hover { background: rgba(255,255,255,0.35); transform: rotate(90deg); }

/* ЛЕНТА СООБЩЕНИЙ */
.nova-support-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nova-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: novaMsgIn 0.25s ease;
}
@keyframes novaMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.nova-chat-msg--admin  { align-self: flex-start; }
.nova-chat-msg--user   { align-self: flex-end; }

.nova-chat-msg__bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.nova-chat-msg--admin .nova-chat-msg__bubble {
    background: #fff;
    color: #0f172a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.nova-chat-msg--user .nova-chat-msg__bubble {
    background: linear-gradient(135deg, #4C6EF5, #7048E8);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.nova-chat-msg__time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}
.nova-chat-msg--user .nova-chat-msg__time { text-align: right; }

/* БЫСТРЫЕ ВОПРОСЫ */
.nova-support-chat__quick {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
    overflow-x: auto;
    flex-shrink: 0;
}
.nova-support-chat__chip {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s;
}
.nova-support-chat__chip:hover {
    border-color: #7048E8;
    color: #7048E8;
}

/* ФОРМА */
.nova-support-chat__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.nova-support-chat__form input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}
.nova-support-chat__form input:focus { border-color: #7048E8; }
.nova-support-chat__send {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #4C6EF5, #7048E8);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.nova-support-chat__send:hover { transform: scale(1.05); }
.nova-support-chat__send:disabled { opacity: 0.5; cursor: wait; }

/* ФУТЕР С MAX */
.nova-support-chat__footer {
    padding: 0 12px 14px;
    background: #fff;
    flex-shrink: 0;
}
.nova-support-chat__divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 10px;
}
.nova-support-chat__divider::before,
.nova-support-chat__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.nova-support-chat__max-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 93%;
    padding: 12px;
    border: 2px solid #7048E8;
    color: #7048E8 !important;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}
.nova-support-chat__max-btn:hover {
    background: #7048E8;
    color: #fff !important;
}

/* МОБИЛЬНЫЕ */
@media (max-width: 640px) {
    .nova-support-chat { bottom: 90px; }
    .nova-support-chat--right { right: 10px; }
    .nova-support-chat--left  { left: 16px; }
    .nova-support-chat__panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
    }
    .nova-support-chat__fab-label { display: none; }
    .nova-support-chat__fab { padding: 0; width: 60px; justify-content: center; }
    .nova-support-chat.is-hint .nova-support-chat__fab::before { display: none; }
}



/* ============ ЧАТ: ПЛАВНОСТЬ И ВЫРАВНИВАНИЕ (v2) ============ */
.nova-support-chat__panel {
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(15, 23, 42, 0.08);
}
.nova-support-chat__fab {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.nova-support-chat__fab:hover { transform: translateY(-3px) scale(1.03); }
.nova-support-chat__fab:active { transform: translateY(-1px) scale(0.98); }

.nova-support-chat__fab-pulse { animation: novaChatPulse 2.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.nova-chat-msg__bubble {
    animation: novaMsgIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.nova-chat-msg--user .nova-chat-msg__bubble {
    box-shadow: 0 4px 12px rgba(76, 110, 245, 0.25);
}

/* Аккуратный скроллбар в чате */
.nova-support-chat__messages::-webkit-scrollbar { width: 6px; }
.nova-support-chat__messages::-webkit-scrollbar-track { background: transparent; }
.nova-support-chat__messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.nova-support-chat__messages::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Плавные чипы и кнопки */
.nova-support-chat__chip {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nova-support-chat__chip:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08); }

.nova-support-chat__send {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}
.nova-support-chat__send:hover { transform: scale(1.06); box-shadow: 0 6px 16px rgba(76, 110, 245, 0.35); }
.nova-support-chat__send:active { transform: scale(0.96); }

.nova-support-chat__close { transition: background 0.2s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }

.nova-support-chat__form input {
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.nova-support-chat__form input:focus {
    border-color: #7048E8;
    box-shadow: 0 0 0 4px rgba(112, 72, 232, 0.12);
}

/* Выравнивание панели относительно FAB */
.nova-support-chat--right .nova-support-chat__panel { right: 0; }
.nova-support-chat--left  .nova-support-chat__panel { left: 0; }