* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    text-align: center;
    padding: 40px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
}

p {
    color: #666;
    margin-bottom: 20px;
}

/* ===== ВИДЖЕТ ===== */
.ai-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: Arial, sans-serif;
}

.ai-widget-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 2rem;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 6px 24px rgba(74, 111, 165, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: pulse-ai 2.4s ease-in-out infinite;
}

.ai-widget-toggle:hover {
    background: #3a5a8a;
    transform: scale(1.03);
}

@keyframes pulse-ai {
    0%   { box-shadow: 0 0 0 0 rgba(74, 111, 165, 0.5); }
    70%  { box-shadow: 0 0 0 16px rgba(74, 111, 165, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 111, 165, 0); }
}

.ai-widget-chat {
    display: none;
    width: 700px;
    max-width: 92vw;
    height: 620px;
    max-height: 75vh;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.13);
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.ai-widget--open .ai-widget-chat {
    display: flex;
}

.ai-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #4a6fa5;
    color: #fff;
}

.ai-widget-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-widget-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ai-widget-close:hover {
    opacity: 1;
}

.ai-widget-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8f9fa;
}

.ai-widget-message {
    max-width: 88%;
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    font-size: 1.1rem;
    line-height: 1.7;
    word-wrap: break-word;
}

.ai-widget-message--user {
    align-self: flex-end;
    background: #4a6fa5;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-widget-message--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #ddd;
    border-bottom-left-radius: 4px;
}

.ai-widget-message--typing {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-bottom-left-radius: 4px;
    padding: 0.6rem 1rem;
}

.ai-widget-message--typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: dot-bounce 1.4s infinite ease-in-out both;
}

.ai-widget-message--typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-widget-message--typing span:nth-child(2) { animation-delay: -0.16s; }
.ai-widget-message--typing span:nth-child(3) { animation-delay: 0; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ai-widget-input-wrap {
    display: flex;
    padding: 0.75rem;
    gap: 0.5rem;
    border-top: 1px solid #ddd;
    background: #fff;
}

.ai-widget-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 40px;
    font-size: 1.1rem;
    outline: none;
}

.ai-widget-input:focus {
    border-color: #4a6fa5;
}

.ai-widget-send {
    padding: 0.5rem 1.2rem;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-widget-send:hover {
    background: #3a5a8a;
}

@media (max-width: 576px) {
    .ai-widget {
        bottom: 0.5rem;
        right: 0.5rem;
    }
    .ai-widget-chat {
        width: 100vw;
        height: 80vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        margin-bottom: 0;
    }
}

.ai-widget-message--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #ddd;
    border-bottom-left-radius: 4px;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #1a1a1a;
}

/* ===== ИКОНКИ ===== */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke-width: 0;
    stroke: currentColor;
    fill: none;
    vertical-align: middle;
}

.ai-widget-toggle .icon {
    width: 1.2em;
    height: 1.2em;
}

.ai-widget-send .icon {
    width: 1.2em;
    height: 1.2em;
}

.ai-widget-close .icon {
    width: 1.2em;
    height: 1.2em;
}

.ai-widget-title .icon {
    width: 1.2em;
    height: 1.2em;
}