.ltp-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.ltp-widget.ltp-pos-right { right: 20px; }
.ltp-widget.ltp-pos-left  { left: 20px; }

.ltp-bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ltp-color, #25d366);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.ltp-bubble svg { width: 26px; height: 26px; }
.ltp-bubble .ltp-dot {
    position: absolute;
    top: 3px; right: 3px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #9aa0a6;
    border: 2px solid #fff;
}
.ltp-bubble.ltp-online .ltp-dot { background: #2ecc71; }
.ltp-bubble .ltp-badge {
    position: absolute;
    top: -4px; left: -4px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    font-weight: 600;
}

.ltp-panel {
    position: absolute;
    bottom: 74px;
    width: 320px;
    max-width: calc(100vw - 40px);
    height: 440px;
    max-height: 70vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.ltp-widget.ltp-pos-right .ltp-panel { right: 0; }
.ltp-widget.ltp-pos-left  .ltp-panel { left: 0; }
.ltp-panel.ltp-open { display: flex; }

.ltp-header {
    background: var(--ltp-color, #25d366);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ltp-header-title { font-weight: 600; font-size: 15px; }
.ltp-header-status { font-size: 12px; opacity: .9; margin-top: 2px; }
.ltp-close {
    background: transparent; border: none; color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer; opacity: .85;
}

.ltp-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f4f6f8;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ltp-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.ltp-msg.ltp-from-visitor {
    align-self: flex-end;
    background: var(--ltp-color, #25d366);
    color: #fff;
    border-bottom-right-radius: 3px;
}
.ltp-msg.ltp-from-admin {
    align-self: flex-start;
    background: #fff;
    color: #222;
    border: 1px solid #e3e6ea;
    border-bottom-left-radius: 3px;
}
.ltp-msg.ltp-from-ai {
    align-self: flex-start;
    background: #f3edff;
    color: #3d2d6b;
    border: 1px solid #e0d3ff;
    border-bottom-left-radius: 3px;
}

.ltp-precontact {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
}
.ltp-precontact input {
    padding: 9px 10px;
    border: 1px solid #d7dce1;
    border-radius: 8px;
    font-size: 13.5px;
}
.ltp-precontact button,
.ltp-input-row button {
    background: var(--ltp-color, #25d366);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.ltp-precontact .ltp-hint { font-size: 12px; color: #667; }

.ltp-wa-row {
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #eceff1;
}
.ltp-wa-btn {
    display: block;
    text-align: center;
    background: #25d366;
    color: #fff !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px;
    border-radius: 8px;
}

.ltp-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #eceff1;
}
.ltp-chip {
    background: #f0f6fc;
    border: 1px solid #d7e6f5;
    color: var(--ltp-color, #25d366);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
}
.ltp-chip:hover { background: #e4f0fb; }

.ltp-emoji-toggle {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 4px;
}
.ltp-emoji-panel {
    display: none;
    position: absolute;
    bottom: 58px;
    left: 10px;
    right: 10px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    padding: 8px;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    z-index: 2;
}
.ltp-emoji-panel.ltp-show { display: grid; }
.ltp-emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1.6;
    cursor: pointer;
    border-radius: 6px;
}
.ltp-emoji-btn:hover { background: #f0f2f4; }

.ltp-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e6e9ec;
    background: #fff;
}
.ltp-input-row textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d7dce1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13.5px;
    font-family: inherit;
    max-height: 70px;
}

.ltp-greet-popup {
    position: absolute;
    bottom: 74px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    padding: 12px 14px;
    width: 240px;
    font-size: 13.5px;
    color: #222;
    display: none;
}
.ltp-widget.ltp-pos-right .ltp-greet-popup { right: 0; }
.ltp-widget.ltp-pos-left  .ltp-greet-popup { left: 0; }
.ltp-greet-popup.ltp-show { display: block; }
.ltp-greet-popup .ltp-greet-close {
    position: absolute; top: 4px; right: 6px;
    background: none; border: none; cursor: pointer; color: #999; font-size: 14px;
}

@media (max-width: 480px) {
    .ltp-panel { width: calc(100vw - 24px); height: 65vh; }
}

/* ---------- Gambar / screenshot ---------- */
.ltp-msg .ltp-msg-img {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    cursor: zoom-in;
}
.ltp-msg.ltp-from-sys {
    align-self: center;
    max-width: 92%;
    background: transparent;
    color: #8a929a;
    font-size: 12px;
    text-align: center;
    padding: 2px 6px;
}
.ltp-attach-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 0;
    background: #fff;
    border-top: 1px solid #e6e9ec;
    font-size: 12px;
    color: #667;
}
.ltp-attach-preview img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e3e6ea;
}
.ltp-attach-x {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}
.ltp-input-row button:disabled { opacity: .6; cursor: default; }
