.ai-page {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    padding: 40px 16px;
    background: #f4f4f5;
}

.ai-chat-shell {
    width: 100%;
    max-width: 900px;
    height: 75vh;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.ai-chat-header {
    padding: 22px 26px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.ai-chat-header h1 {
    margin: 0;
    font-size: 24px;
}

.ai-chat-header p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.ai-message.ai-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #111827;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.ai-user .ai-avatar {
    background: #2563eb;
}

.ai-bubble {
    padding: 13px 16px;
    border-radius: 16px;
    line-height: 1.55;
    font-size: 15px;
    background: #f3f4f6;
    color: #111827;
    white-space: pre-wrap;
}

.ai-user .ai-bubble {
    background: #2563eb;
    color: #ffffff;
    border-top-right-radius: 4px;
}

.ai-bot .ai-bubble {
    border-top-left-radius: 4px;
}

.ai-input-area {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    background: #ffffff;
}

#ai-input {
    flex: 1;
    min-height: 46px;
    max-height: 140px;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 15px;
    outline: none;
}

#ai-input:focus {
    border-color: #2563eb;
}

#ai-send {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 14px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
}

#ai-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-typing .ai-bubble {
    color: #6b7280;
    font-style: italic;
}

@media (max-width: 600px) {
    .ai-page {
        padding: 0;
    }

    .ai-chat-shell {
        height: 100vh;
        border-radius: 0;
    }

    .ai-message {
        max-width: 95%;
    }
}