.chat-widget {
    --teal: #10a0a5;
    --bubble: #fff;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    position: fixed;
    right: 42px;
    bottom: 125px;
    z-index: 9999;
    font: 600 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Noto Sans", Arial, sans-serif;
}

/* main button */
.chat-widget img {
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 50%;
    display: block;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* helper bubble */
.chat-bubble {
    position: absolute;
    right: 56px;
    bottom: 6px;
    background: var(--bubble);
    border-radius: 6px;
    box-shadow: var(--shadow);
    color: var(--e-global-color-text);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-bubble span {
    display: block;
    padding: 12px 28px 12px 12px;
    white-space: nowrap;
}

.chat-bubble::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 14px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--bubble);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

/* close button inside bubble */
.chat-bubble .bubble-close,
.chat-bubble .bubble-close:hover {
    padding: 0;
    background-color: transparent;
    border: none;
    color: #ccc;
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: transparent;
    font: 700 14px/1 system-ui, sans-serif;
    color: #7a8b8c;
    cursor: pointer;
    line-height: 1;
}

/* expanded menu */
.prt_menu {
    position: absolute;
    right: 0;
    bottom: 65px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    pointer-events: none;
}

.prt_menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.prt_menu-label {
    width: 160px;
    background: var(--bubble);
    border-radius: 6px;
    box-shadow: var(--shadow);
    color: #0a4f52;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px;
    white-space: nowrap;
    position: relative;
}

.prt_menu-label > a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.prt_menu-label::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--bubble);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

.prt_menu-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.prt_menu-btn img {
    display: block;
}

/* OPEN STATE */
.chat-widget.open .prt_menu {
    pointer-events: auto;
}

.chat-widget.open .prt_menu-item {
    transform: none;
    opacity: 1;
}

.chat-widget.open .chat-bubble {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

/* HIDDEN STATE for bubble */
.chat-bubble.hidden {
    display: none;
}
