.help-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Lato', sans-serif;
}

.help-chat-widget--hidden {
    display: none;
}

.help-chat-launcher {
    border: none;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    width: 56px;
    height: 56px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.25);
    position: relative;
}

.help-chat-launcher__icon {
    display: block;
    width: 28px;
    height: 28px;
}

.help-chat-launcher__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #B9F040;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: 12px;
}

.help-chat-launcher__badge[hidden] {
    display: none;
}

.help-chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(380px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.help-chat-widget.is-open .help-chat-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.help-chat-panel__header {
    padding: 18px 18px 14px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.help-chat-panel__header h2 {
    font-size: 17px;
    margin: 0 0 4px;
    color: #111827;
}

.help-chat-panel__header p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.help-chat-panel__close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.help-chat-panel__status {
    margin: 12px 18px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
}

.help-chat-panel__messages {
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    padding: 18px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-chat-empty-state {
    margin: auto 0;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.help-chat-message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.help-chat-message--visitor,
.help-chat-message--user {
    align-self: flex-end;
    background: #111827;
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.help-chat-message--operator {
    align-self: flex-start;
    background: #ffffff;
    color: #111827;
    border-bottom-left-radius: 6px;
}

.help-chat-message__meta {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.help-chat-message__body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.help-chat-panel__composer {
    border-top: 1px solid #e2e8f0;
    padding: 16px 18px 18px;
    background: #ffffff;
}

.help-chat-panel__composer-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.help-chat-panel__input {
    width: 100%;
    resize: vertical;
    min-height: 84px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 12px 14px;
    font: inherit;
    color: #111827;
}

.help-chat-panel__input:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

.help-chat-panel__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.help-chat-panel__send {
    border: none;
    border-radius: 999px;
    background: #B9F040;
    color: #111827;
    font: inherit;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
}

.help-chat-panel__send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .help-chat-widget {
        right: 16px;
        bottom: 16px;
        align-items: stretch;
    }

    .help-chat-launcher {
        width: 56px;
        align-self: flex-end;
    }

    .help-chat-panel {
        right: 0;
        bottom: calc(100% + 12px);
        width: 100%;
        max-height: min(70vh, 560px);
    }
}
