/* v1.2.4.110 Delivery Tracker Chat, mobile quick-send, notification sound, and chat ping */
.smnncn-dtchat,
.smnncn-dtchat * { box-sizing: border-box; }

.smnncn-dtchat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100000;
    font-family: Inter, Arial, Helvetica, sans-serif;
}

.smnncn-dtchat-toggle {
    min-height: 56px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #071a33, #123a6a);
    color: #ffffff;
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 18px 42px rgba(7, 26, 51, .28);
    cursor: pointer;
    font-weight: 950;
}

.smnncn-dtchat-toggle span {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.14);
}

.smnncn-dtchat-toggle b {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    border: 2px solid #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.smnncn-dtchat.has-unread .smnncn-dtchat-toggle {
    animation: smnncnDtChatBlink 1s infinite alternate;
}

@keyframes smnncnDtChatBlink {
    from { background: linear-gradient(135deg, #071a33, #123a6a); box-shadow: 0 18px 42px rgba(7, 26, 51, .28); }
    to { background: linear-gradient(135deg, #991b1b, #dc2626); box-shadow: 0 18px 48px rgba(220, 38, 38, .38), 0 0 0 7px rgba(220,38,38,.12); }
}

.smnncn-dtchat-window {
    display: none;
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(820px, calc(100vw - 36px));
    height: min(660px, calc(100vh - 116px));
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 28px 82px rgba(2, 8, 23, .30);
}

.smnncn-dtchat.is-open .smnncn-dtchat-window { display: flex; flex-direction: column; }

.smnncn-dtchat-window > header {
    min-height: 68px;
    padding: 14px 17px;
    background: linear-gradient(135deg, #071a33, #123a6a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.smnncn-dtchat-window > header strong,
.smnncn-dtchat-window > header small { display: block; }
.smnncn-dtchat-window > header strong { font-size: 16px; font-weight: 950; }
.smnncn-dtchat-window > header small { margin-top: 2px; color: rgba(255,255,255,.78); font-weight: 750; }
.smnncn-dtchat-window > header button {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.smnncn-dtchat-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}

.smnncn-dtchat-shell aside {
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    align-content: start;
    gap: 8px;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.smnncn-dtchat-shell main,
.smnncn-dtchat-mobile .smnncn-dtchat-window main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    background: #eef4fb;
}

.smnncn-dtchat-contact {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    padding: 9px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
}

.smnncn-dtchat-contact:hover,
.smnncn-dtchat-contact.is-active {
    background: #ffffff;
    border-color: #bfdbfe;
    box-shadow: 0 9px 22px rgba(15, 23, 42, .07);
}

.smnncn-dtchat-avatar-wrap { position: relative; display: inline-flex; }
.smnncn-dtchat-avatar-wrap img,
.smnncn-dtchat-avatar-wrap .avatar {
    width: 38px !important;
    height: 38px !important;
    border-radius: 999px;
    object-fit: cover;
}
.smnncn-dtchat-avatar-wrap i {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #94a3b8;
}
.smnncn-dtchat-avatar-wrap i.is-live { background: #22c55e; }

.smnncn-dtchat-contact-copy { min-width: 0; }
.smnncn-dtchat-contact-copy strong,
.smnncn-dtchat-contact-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smnncn-dtchat-contact-copy strong { color: #0f172a; font-size: 13px; font-weight: 950; }
.smnncn-dtchat-contact-copy small { color: #64748b; font-size: 11px; margin-top: 2px; }
.smnncn-dtchat-contact b {
    min-width: 21px;
    height: 21px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.smnncn-dtchat-thread-head {
    padding: 11px 14px;
    background: rgba(255,255,255,.86);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.smnncn-dtchat-thread-head strong { color: #0f172a; font-weight: 950; }
.smnncn-dtchat-thread-head span { color: #64748b; font-size: 12px; font-weight: 800; }

.smnncn-dtchat-messages {
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.smnncn-dtchat-message {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 86%;
}
.smnncn-dtchat-message.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.smnncn-dtchat-msg-avatar img,
.smnncn-dtchat-msg-avatar .avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 999px;
}
.smnncn-dtchat-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px 18px 18px 6px;
    padding: 9px 11px;
    color: #0f172a;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .07);
}
.smnncn-dtchat-message.is-mine .smnncn-dtchat-bubble {
    border-radius: 18px 18px 6px 18px;
    background: #dbeafe;
    border-color: #bfdbfe;
}
.smnncn-dtchat-bubble div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.smnncn-dtchat-bubble strong { font-size: 12px; color: #0f172a; }
.smnncn-dtchat-bubble small { font-size: 10px; color: #64748b; white-space: nowrap; }
.smnncn-dtchat-bubble p { margin: 0; font-size: 13px; line-height: 1.45; }

.smnncn-dtchat-empty {
    margin: auto;
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background: rgba(255,255,255,.74);
    color: #64748b;
    text-align: center;
    font-weight: 800;
}
.smnncn-dtchat-empty.small { margin: 8px; font-size: 12px; }

.smnncn-dtchat-quick {
    padding: 10px 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #eef4fb;
}
.smnncn-dtchat-quick button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}
.smnncn-dtchat-quick button:hover { border-color: #93c5fd; background: #f8fafc; }

.smnncn-dtchat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #eef4fb;
}
.smnncn-dtchat-form textarea {
    resize: none;
    width: 100%;
    min-height: 44px;
    max-height: 110px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 10px 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.35;
}
.smnncn-dtchat-form button {
    border: 0;
    border-radius: 16px;
    padding: 0 16px;
    background: #0ea5e9;
    color: #ffffff;
    font-weight: 950;
    cursor: pointer;
}
.smnncn-dtchat-form button:disabled { opacity: .68; cursor: wait; }

.smnncn-dtchat-form button {
    min-width: 64px;
}
.smnncn-dtchat-form .smnncn-dtchat-ping-button {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(185, 28, 28, .18);
}
.smnncn-dtchat-message.is-urgent .smnncn-dtchat-bubble {
    background: #fff1f2;
    border-color: #fecdd3;
    box-shadow: 0 8px 22px rgba(225, 29, 72, .12);
}
.smnncn-dtchat-message.is-urgent .smnncn-dtchat-bubble strong::before {
    content: "URGENT · ";
    color: #be123c;
    font-weight: 950;
}
.smnncn-dtchat-message.is-urgent:not(.is-mine) .smnncn-dtchat-bubble {
    animation: smnncnDtChatUrgentPulse 1.2s infinite alternate;
}
@keyframes smnncnDtChatUrgentPulse {
    from { box-shadow: 0 8px 22px rgba(225, 29, 72, .12); }
    to { box-shadow: 0 8px 26px rgba(225, 29, 72, .32), 0 0 0 5px rgba(225, 29, 72, .09); }
}

.smnncn-dtchat-mobile .smnncn-dtchat-window {
    width: min(440px, calc(100vw - 24px));
    height: min(640px, calc(100vh - 106px));
}
.smnncn-dtchat-mobile .smnncn-dtchat-window main { flex: 1 1 auto; }

.smnncn-mobile-sound-panel { margin: 12px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.smnncn-delivery-live-team-card.has-chat-unread {
    border-color: #bfdbfe;
    box-shadow: 0 14px 34px rgba(37, 99, 235, .13);
}

@media (max-width: 760px) {
    .smnncn-dtchat { right: 12px; bottom: 12px; }
    .smnncn-dtchat-toggle { min-height: 54px; padding: 9px 12px; }
    .smnncn-dtchat-toggle strong { display: none; }
    .smnncn-dtchat-window,
    .smnncn-dtchat-mobile .smnncn-dtchat-window {
        right: -4px;
        bottom: 66px;
        width: calc(100vw - 16px);
        height: min(690px, calc(100vh - 92px));
        border-radius: 18px;
    }
    .smnncn-dtchat-shell { grid-template-columns: 1fr; }
    .smnncn-dtchat-shell aside {
        max-height: 124px;
        overflow-x: auto;
        overflow-y: hidden;
        grid-auto-flow: column;
        grid-auto-columns: 210px;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }
    .smnncn-dtchat-message { max-width: 94%; }
    .smnncn-dtchat-quick {
        max-height: 76px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        padding: 9px 10px 6px;
        -webkit-overflow-scrolling: touch;
    }
    .smnncn-dtchat-quick button {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 7px 11px;
    }
    .smnncn-dtchat-form {
        grid-template-columns: minmax(0, 1fr) 66px 66px;
        gap: 7px;
        padding: 9px 10px 10px;
    }
    .smnncn-dtchat-form textarea {
        min-height: 46px;
        max-height: 84px;
        border-radius: 15px;
    }
    .smnncn-dtchat-form button {
        min-width: 0;
        padding: 0 10px;
        border-radius: 15px;
        font-size: 13px;
    }
}

/* v1.2.4.112 gentle mobile chat polish: keep v110 layout, hide the quick-reply scrollbar only */
@media (max-width: 760px) {
    .smnncn-dtchat-quick {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .smnncn-dtchat-quick::-webkit-scrollbar {
        display: none;
    }
}
