/* 1. Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. Body Setup */
body, html {
    height: 100dvh; 
    width: 100%;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 3. Main Container */
.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    background: #ffffff;
}

@media (min-width: 768px) {
    .chat-container {
        width: 450px;
        height: 85vh;
        border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
        border: 1px solid #eee;
    }
}

.chat-header {
    flex-shrink: 0;
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
}

.subtitle {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
}
.message {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 15px;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background-color: #f0f2f5;
    color: #1c1e21;
    border-bottom-left-radius: 2px;
}

.user-message {
    align-self: flex-end;
    background-color: #ff7675;
    color: white;
    border-bottom-right-radius: 2px;
}

.loading-message {
    font-style: italic;
    font-size: 0.8rem;
    color: #ff7675;
    margin-bottom: 10px;
}

.input-area {
    flex-shrink: 0;
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));
}

#user-input {
    flex: 1;
    height: 45px;
    padding: 0 20px;
    border: 1px solid #e4e6eb;
    border-radius: 25px;
    outline: none;
    font-size: 16px;
    background: #f0f2f5;
    transition: all 0.2s;
}

#user-input:focus {
    background: #fff;
    border-color: #ff7675;
}

#send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background-color: #ff7675;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

#send-btn:hover {
    background-color: #e66767;
}

#send-btn svg {
    pointer-events: none;
}