/* Chat Widget */
.chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-brown);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 1000;
    border: none;
}

.chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 320px;
    max-height: 520px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.chat-panel.open {
    display: flex;
}

.chat-header {
    background: var(--color-brown);
    color: var(--color-white);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header button {
    background: transparent;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    font-size: 1rem;
}

.chat-messages {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    background: var(--color-cream);
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    line-height: 1.4;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message a {
    color: inherit;
    text-decoration: underline;
}

.chat-message.user {
    background: var(--color-brown);
    color: var(--color-white);
    margin-left: auto;
}

.chat-message.assistant {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-gray-light);
}

.chat-typing {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.chat-input {
    display: flex;
    border-top: 1px solid var(--color-gray-light);
    background: var(--color-white);
}

.chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-size: 0.95rem;
}

.chat-input button {
    background: var(--color-brown);
    color: var(--color-white);
    border: none;
    padding: 0 1rem;
    cursor: pointer;
}

@media (max-width: 600px) {
    .chat-panel {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 86px;
    }

    .chat-toggle {
        right: 16px;
        bottom: 16px;
    }
}
