.bw-chat {
    --bw-bg: #0c0f14;
    --bw-surface: #141924;
    --bw-border: #1f2838;
    --bw-accent: #b8162b;
    --bw-accent-2: #e74c3c;
    --bw-text: #dde3ec;
    --bw-muted: #7d8699;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 2147483000;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.bw-chat__toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bw-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(231, 76, 60, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
.bw-chat__toggle:hover {
    background: var(--bw-accent-2);
    transform: translateY(-2px);
}
.bw-chat__toggle svg { width: 26px; height: 26px; }

.bw-chat__panel {
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 2.5rem);
    background: var(--bw-surface);
    border: 1px solid var(--bw-border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bw-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--bw-bg);
    border-bottom: 1px solid var(--bw-border);
}
.bw-chat__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}
.bw-chat__title-accent { color: var(--bw-accent); }
.bw-chat__close {
    background: transparent;
    border: none;
    color: var(--bw-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 0;
    border-radius: 4px;
}
.bw-chat__close:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.bw-chat__close svg { width: 18px; height: 18px; }

.bw-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--bw-border) transparent;
}
.bw-chat__messages::-webkit-scrollbar { width: 6px; }
.bw-chat__messages::-webkit-scrollbar-thumb { background: var(--bw-border); border-radius: 3px; }

.bw-chat__msg {
    max-width: 82%;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.bw-chat__msg--user {
    align-self: flex-end;
    background: var(--bw-accent);
    color: #fff;
    border-bottom-right-radius: 3px;
}
.bw-chat__msg--bot {
    align-self: flex-start;
    background: var(--bw-bg);
    color: var(--bw-text);
    border: 1px solid var(--bw-border);
    border-bottom-left-radius: 3px;
}
.bw-chat__msg--typing {
    align-self: flex-start;
    color: var(--bw-muted);
    font-style: italic;
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
}

.bw-chat__input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--bw-border);
    background: var(--bw-bg);
}
.bw-chat__input {
    flex: 1;
    background: var(--bw-surface);
    border: 1px solid var(--bw-border);
    color: var(--bw-text);
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.bw-chat__input:focus { border-color: var(--bw-accent-2); }
.bw-chat__input::placeholder { color: #49526a; }

.bw-chat__send {
    background: var(--bw-accent);
    color: #fff;
    border: none;
    width: 38px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.bw-chat__send:hover:not(:disabled) { background: var(--bw-accent-2); }
.bw-chat__send:disabled { opacity: 0.4; cursor: not-allowed; }
.bw-chat__send svg { width: 16px; height: 16px; }

.bw-chat--hidden { display: none; }

@media (max-width: 480px) {
    .bw-chat { bottom: 0.75rem; right: 0.75rem; left: 0.75rem; }
    .bw-chat__panel { width: auto; height: 80vh; }
}
