.ai-chat-page__intro {
    text-align: center;
    margin-bottom: 2rem;
}

.ai-chat-page__intro h1 {
    margin-bottom: 0.75rem;
}

.ai-chat-page__intro p {
    margin: 0 auto;
    max-width: 40rem;
    opacity: 0.88;
}

.ai-chat-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #eef3f8 0%, #e7edf4 100%);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    min-height: 520px;
}

.ai-chat-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.ai-chat-card__head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
}

.ai-chat-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: rgba(11, 224, 98, 0.16);
    color: #009b3f;
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-chat-reset {
    border: 0;
    background: rgba(20, 33, 61, 0.08);
    color: inherit;
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.ai-chat-demo-hint {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.ai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-height: 280px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.ai-chat-message {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 92%;
}

.ai-chat-message--user {
    align-self: flex-end;
    text-align: right;
}

.ai-chat-message--assistant {
    align-self: flex-start;
}

.ai-chat-message__author {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.65;
}

.ai-chat-message__bubble {
    padding: 0.875rem 1rem;
    border-radius: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-chat-message--assistant .ai-chat-message__bubble {
    background: #fff;
    color: #14213d;
    box-shadow: inset 0 0 0 1px rgba(20, 33, 61, 0.06);
}

.ai-chat-message--user .ai-chat-message__bubble {
    background: linear-gradient(180deg, #0be062 0%, #009b3f 100%);
    color: #fff;
}

.ai-chat-message--typing .ai-chat-message__bubble {
    opacity: 0.7;
    font-style: italic;
}

.ai-chat-suggestions__label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
}

.ai-chat-suggestions__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.ai-chat-suggestion {
    border: 0;
    border-radius: 999px;
    padding: 0.625rem 0.875rem;
    background: #fff;
    color: #14213d;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(20, 33, 61, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-chat-suggestion:hover,
.ai-chat-suggestion:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(20, 33, 61, 0.08);
    outline: none;
}

.ai-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

.ai-chat-form textarea {
    width: 100%;
    min-height: 56px;
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    font: inherit;
    line-height: 1.45;
    resize: vertical;
    box-shadow: inset 0 0 0 1px rgba(20, 33, 61, 0.08);
}

.ai-chat-form textarea:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(11, 224, 98, 0.45);
}

.ai-chat-form button {
    min-width: 120px;
    height: 48px;
}

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

[data-theme="dark"] .ai-chat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
}

[data-theme="dark"] .ai-chat-messages,
[data-theme="dark"] .ai-chat-form textarea,
[data-theme="dark"] .ai-chat-suggestion {
    background: rgba(255, 255, 255, 0.06);
    color: #e5eaf2;
}

[data-theme="dark"] .ai-chat-message--assistant .ai-chat-message__bubble {
    background: rgba(255, 255, 255, 0.08);
    color: #e5eaf2;
}

[data-theme="dark"] .ai-chat-reset {
    background: rgba(255, 255, 255, 0.08);
    color: #e5eaf2;
}

@media (max-width: 767px) {
    .ai-chat-card {
        padding: 1rem;
        min-height: auto;
    }

    .ai-chat-form {
        grid-template-columns: 1fr;
    }

    .ai-chat-form button {
        width: 100%;
    }

    .ai-chat-messages {
        max-height: 360px;
    }
}
