.w4i-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    z-index: 9999;
}

.w4i-chat__launcher {
    align-items: center;
    background: var(--w4i-chat-accent, #0f766e);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    gap: 10px;
    padding: 12px 18px;
}

.w4i-chat__launcher-dot {
    background: #fff;
    border-radius: 50%;
    display: block;
    height: 10px;
    width: 10px;
}

.w4i-chat__panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    bottom: calc(100% + 12px);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
    display: none;
    overflow: hidden;
    position: absolute;
    right: 0;
    width: min(360px, calc(100vw - 24px));
}

.w4i-chat.is-open .w4i-chat__panel {
    display: block;
}

.w4i-chat__header {
    align-items: start;
    background: linear-gradient(135deg, var(--w4i-chat-accent, #0f766e), #134e4a);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 18px;
}

.w4i-chat__header h3,
.w4i-chat__header p {
    margin: 0;
}

.w4i-chat__header p {
    font-size: 13px;
    margin-top: 4px;
    opacity: 0.85;
}

.w4i-chat__close,
.w4i-chat__submit {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
}

.w4i-chat__messages {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 18px;
}

.w4i-chat__message {
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 90%;
    padding: 10px 12px;
}

.w4i-chat__message--bot,
.w4i-chat__message--meta {
    background: #fff;
    color: #0f172a;
}

.w4i-chat__message--user {
    align-self: flex-end;
    background: var(--w4i-chat-accent, #0f766e);
    color: #fff;
}

.w4i-chat__message--support {
    background: #dbeafe;
    color: #0f172a;
}

.w4i-chat__message--meta {
    border: 1px dashed rgba(15, 23, 42, 0.1);
    font-size: 12px;
}

.w4i-chat__author {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.w4i-chat__form {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 12px;
    padding: 16px;
}

.w4i-chat__identity {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.w4i-chat__identity-copy {
    color: #334155;
    font-size: 13px;
    margin: 0;
}

.w4i-chat__identity-grid {
    display: grid;
    gap: 10px;
}

.w4i-chat__consent {
    align-items: start;
    color: #334155;
    display: flex;
    font-size: 12px;
    gap: 8px;
    line-height: 1.5;
}

.w4i-chat__consent input {
    margin-top: 2px;
}

.w4i-chat__identity-input {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
}

.w4i-chat__input {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    min-height: 88px;
    padding: 10px 12px;
    resize: vertical;
}

.w4i-chat__submit {
    background: var(--w4i-chat-accent, #0f766e);
    border-radius: 12px;
    color: #fff;
    padding: 10px 14px;
}

.w4i-chat-block-placeholder {
    background: #ecfeff;
    border: 1px dashed #0f766e;
    border-radius: 12px;
    padding: 20px;
}

@media (max-width: 640px) {
    .w4i-chat {
        bottom: 16px;
        right: 16px;
        width: auto;
    }

    .w4i-chat__launcher {
        justify-content: center;
        width: auto;
    }

    .w4i-chat__panel {
        width: min(100%, calc(100vw - 24px));
    }
}