:root {
    --uchw-button-color: #16a34a;
    --uchw-button-text: #ffffff;
    --uchw-panel-bg: #ffffff;
    --uchw-panel-text: #111827;
    --uchw-z-index: 99999;
    --uchw-launcher-size: 58px;
    --uchw-panel-width: 320px;
}

.uchw {
    position: fixed;
    bottom: 20px;
    z-index: var(--uchw-z-index);
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.uchw--right {
    right: 20px;
}

.uchw--left {
    left: 20px;
}

.uchw__launcher {
    min-height: var(--uchw-launcher-size);
    min-width: var(--uchw-launcher-size);
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--uchw-button-color), #0f7e38);
    color: var(--uchw-button-text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.uchw--square .uchw__launcher {
    border-radius: 14px;
}

.uchw__launcher-label {
    display: inline-block;
}

.uchw__panel {
    width: min(var(--uchw-panel-width), calc(100vw - 40px));
    margin-top: 10px;
    background: var(--uchw-panel-bg);
    color: var(--uchw-panel-text);
    border-radius: 18px;
    box-shadow: 0 20px 46px rgba(17, 24, 39, 0.2);
    border: 1px solid rgba(17, 24, 39, 0.08);
    overflow: hidden;
}

.uchw--square .uchw__panel {
    border-radius: 10px;
}

.uchw__header {
    padding: 16px 16px 10px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.uchw__heading {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.uchw__subheading {
    margin: 5px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

.uchw__live-chat {
    padding: 10px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    background: #f8fafc;
}

.uchw__live-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.uchw__live-welcome {
    margin: 4px 0 8px;
    font-size: 12px;
    opacity: 0.8;
}

.uchw__chat-start,
.uchw__chat-send {
    display: grid;
    gap: 8px;
}

.uchw__chat-start input,
.uchw__chat-start textarea,
.uchw__chat-send input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 13px;
    background: #fff;
}

.uchw__chat-start textarea {
    resize: vertical;
}

.uchw__chat-start-btn,
.uchw__chat-send button {
    border: 0;
    border-radius: 10px;
    background: var(--uchw-button-color);
    color: var(--uchw-button-text);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.uchw__chat-status {
    margin: 0;
    min-height: 16px;
    font-size: 12px;
    opacity: 0.9;
}

.uchw__chat-status--error {
    color: #b91c1c;
}

.uchw__chat-thread {
    display: grid;
    gap: 8px;
}

.uchw__chat-messages {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 0;
}

.uchw__chat-msg {
    max-width: 86%;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.uchw__chat-msg--visitor {
    margin-left: auto;
    background: #dcfce7;
    color: #14532d;
}

.uchw__chat-msg--admin {
    margin-right: auto;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

.uchw__chat-msg-text {
    margin: 0;
    white-space: pre-wrap;
}

.uchw__chat-msg-time {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    opacity: 0.65;
}

.uchw__channels {
    margin: 0;
    padding: 10px;
    list-style: none;
    display: grid;
    gap: 8px;
    max-height: 290px;
    overflow: auto;
}

.uchw__channel-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(17, 24, 39, 0.1);
    transition: all 0.2s ease;
}

.uchw__channel-link:hover,
.uchw__channel-link:focus {
    transform: translateY(-1px);
    border-color: rgba(22, 163, 74, 0.4);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.15);
    outline: none;
}

.uchw__icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.1);
    color: #0f7e38;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

.uchw__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.uchw__type {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.7;
}

.uchw__offline-toggle {
    width: calc(100% - 20px);
    margin: 0 10px 10px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: #f8fafc;
    color: #0f172a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.uchw__offline-form {
    padding: 0 10px 12px;
    display: grid;
    gap: 8px;
}

.uchw__offline-form input,
.uchw__offline-form textarea {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
}

.uchw__offline-form textarea {
    resize: vertical;
}

.uchw__send {
    border: 0;
    border-radius: 10px;
    background: var(--uchw-button-color);
    color: var(--uchw-button-text);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.uchw__offline-status {
    margin: 0;
    min-height: 16px;
    font-size: 12px;
    opacity: 0.85;
}

.uchw__branding {
    margin: 0;
    padding: 0 10px 12px;
    text-align: center;
    font-size: 11px;
    opacity: 0.65;
}

.uchw__hp {
    position: absolute !important;
    left: -9999px !important;
}

@media (max-width: 767px) {
    .uchw {
        bottom: 14px;
    }

    .uchw--right {
        right: 12px;
    }

    .uchw--left {
        left: 12px;
    }

    .uchw__launcher {
        min-width: 52px;
        min-height: 52px;
        padding: 0 14px;
    }
}
