/* ph_chatboxpro v2 — widget front office */

#eph-chatbox-root {
    --eph-chat-color: #3f51b5;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.eph-chat-bubble {
    position: relative;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--eph-chat-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}

.eph-chat-bubble:hover {
    transform: scale(1.06);
}

.eph-chat-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.eph-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 330px;
    max-width: calc(100vw - 32px);
    height: 440px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.eph-chat-header {
    background: var(--eph-chat-color);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.eph-chat-title {
    font-weight: 700;
}

.eph-chat-status {
    font-size: 12px;
    opacity: .85;
}

.eph-chat-status-online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
    background: #4caf50;
}

.eph-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f6f7fb;
}

.eph-chat-msg {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.eph-chat-msg-mine {
    align-items: flex-end;
}

.eph-chat-msg-theirs {
    align-items: flex-start;
}

.eph-chat-msg-author {
    font-size: 11px;
    color: #888;
    margin: 0 4px 2px;
}

.eph-chat-msg-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.eph-chat-msg-mine .eph-chat-msg-bubble {
    background: var(--eph-chat-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.eph-chat-msg-theirs .eph-chat-msg-bubble {
    background: #fff;
    color: #222;
    border: 1px solid #e3e5ee;
    border-bottom-left-radius: 4px;
}

.eph-chat-msg-system {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 8px 0;
}

.eph-chat-msg-file {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.eph-chat-msg-img {
    display: block;
    max-width: 190px;
    max-height: 190px;
    border-radius: 8px;
}

.eph-chat-msg-fileicon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.eph-chat-msg-filename {
    text-decoration: underline;
    word-break: break-all;
}

.eph-chat-typing {
    padding: 2px 14px 6px;
    font-size: 12px;
    color: #999;
    font-style: italic;
    background: #f6f7fb;
}

.eph-chat-agentchooser {
    padding: 8px 10px;
    background: #f0f4ff;
    border-top: 1px solid #dde4f5;
}

.eph-chat-agentchooser-title {
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
}

.eph-chat-agentbtn {
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 5px 10px;
    border: 1px solid #c9d4ee;
    border-radius: 14px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    color: #333;
}

.eph-chat-agentbtn-active {
    background: var(--eph-chat-color);
    border-color: var(--eph-chat-color);
    color: #fff;
}

.eph-chat-nameprompt {
    padding: 6px 10px;
    background: #fffbe6;
    border-top: 1px solid #f0e6b8;
}

.eph-chat-nameinput {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    box-sizing: border-box;
}

.eph-chat-inputrow {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid #e6e8f0;
    background: #fff;
}

.eph-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    max-height: 90px;
    box-sizing: border-box;
}

.eph-chat-input:focus {
    outline: none;
    border-color: var(--eph-chat-color);
}

.eph-chat-emojibtn {
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
}

.eph-chat-emojipicker {
    position: absolute;
    right: 8px;
    bottom: 62px;
    width: 264px;
    max-height: 190px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    z-index: 5;
}

.eph-chat-emoji {
    border: none;
    background: none;
    font-size: 19px;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 6px;
    padding: 2px 0;
}

.eph-chat-emoji:hover {
    background: #eef1f8;
}

.eph-chat-filebtn {
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    color: #666;
}

.eph-chat-sendbtn {
    border: none;
    background: var(--eph-chat-color);
    color: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.eph-chat-sendbtn:hover {
    filter: brightness(1.1);
}

@media (max-width: 480px) {

    #eph-chatbox-root {
        right: 12px;
        bottom: 12px;
    }

    .eph-chat-panel {
        width: calc(100vw - 24px);
        height: 70vh;
    }

}
