/* ZF jChat WP Messenger */
.zf-jchat-btn,
.zf-jchat-inbox-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 9px 14px !important;
    background: #0f172a !important;
    color: #fff !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.zf-jchat-unread-count,
.zf-jchat-thread-unread {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
}

.zf-jchat-online-dot,
.zf-jchat-offline-dot {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex: 0 0 auto !important;
}

.zf-jchat-online-dot {
    background: #22c55e !important;
    box-shadow: 0 0 0 2px rgba(34,197,94,.22) !important;
}

.zf-jchat-offline-dot {
    background: #94a3b8 !important;
}

.zf-jchat-debug {
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
}

.zf-jchat-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(15,23,42,.62);
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}

.zf-jchat-modal.active {
    display: flex;
}

.zf-jchat-window {
    width: 860px;
    max-width: 96vw;
    height: 620px;
    max-height: 88vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
}

.zf-jchat-header {
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.zf-jchat-header-user {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
}

.zf-jchat-header-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.zf-jchat-close {
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.zf-jchat-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.zf-jchat-sidebar {
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    background: #f8fafc;
}

.zf-jchat-sidebar-title {
    padding: 12px;
    font-weight: 800;
    border-bottom: 1px solid #e2e8f0;
}

.zf-jchat-threads {
    padding: 8px;
}

.zf-jchat-thread {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.zf-jchat-thread:hover {
    background: #e2e8f0;
}

.zf-jchat-thread-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.zf-jchat-thread-avatar-wrap img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.zf-jchat-thread-avatar-wrap .zf-jchat-online-dot,
.zf-jchat-thread-avatar-wrap .zf-jchat-offline-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    border: 2px solid #fff;
}

.zf-jchat-thread-info {
    min-width: 0;
    flex: 1;
}

.zf-jchat-thread-info strong,
.zf-jchat-thread-info small {
    display: block;
}

.zf-jchat-thread-info small {
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zf-jchat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.zf-jchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f1f5f9;
}

.zf-jchat-message-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.zf-jchat-message-list li {
    display: flex;
    margin: 0 0 10px;
}

.zf-jchat-message-list li.mine {
    justify-content: flex-end;
}

.zf-jchat-message-list li.theirs {
    justify-content: flex-start;
}

.zf-jchat-bubble {
    max-width: 78%;
    padding: 9px 11px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.zf-jchat-message-list li.mine .zf-jchat-bubble {
    background: #dbeafe;
}

.zf-jchat-message-text p {
    margin: 0 0 6px;
}

.zf-jchat-bubble small {
    display: block;
    color: #64748b;
    font-size: 11px;
}

.zf-jchat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.zf-jchat-form textarea {
    flex: 1;
    min-height: 46px;
    max-height: 100px;
    resize: vertical;
    padding: 9px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-sizing: border-box;
}

.zf-jchat-form button {
    border: 0;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-weight: 800;
    padding: 0 16px;
    cursor: pointer;
}

@media (max-width: 700px) {
    .zf-jchat-window {
        width: 100vw;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
    }

    .zf-jchat-body {
        grid-template-columns: 120px 1fr;
    }

    .zf-jchat-sidebar-title {
        font-size: 12px;
        padding: 8px;
    }

    .zf-jchat-thread {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        padding: 7px 4px;
    }

    .zf-jchat-thread-info small {
        display: none;
    }

    .zf-jchat-thread-info strong {
        font-size: 12px;
    }

    .zf-jchat-bubble {
        max-width: 92%;
    }
}


/* Replace BuddyPress directory message button with ZF jChat */
.zf-jchat-bp-button-wrap {
    display: inline-flex !important;
    align-items: center !important;
    margin: 4px 4px 4px 0 !important;
}

.zf-hide-bp-message-button,
.bp-send-message-button,
#buddypress .send-message,
#buddypress a.send-message,
#buddypress .generic-button a[href*="/messages/compose"],
#buddypress .generic-button a[href*="/messages/"] {
    display: none !important;
}

.zf-jchat-bp-button-wrap .zf-jchat-btn,
#buddypress .zf-jchat-bp-button-wrap .zf-jchat-btn {
    display: inline-flex !important;
}


/* ZF jChat embedded page shortcode */
.zf-jchat-embed {
    width: 100%;
    box-sizing: border-box;
    margin: 15px 0;
}

.zf-jchat-embed .zf-jchat-window {
    width: 100% !important;
    max-width: 100% !important;
    height: var(--zf-jchat-embed-height, 620px) !important;
    max-height: none !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.12) !important;
    border: 1px solid #e2e8f0 !important;
}

.zf-jchat-embed .zf-jchat-close {
    display: none !important;
}

@media (max-width: 700px) {
    .zf-jchat-embed .zf-jchat-window {
        height: 78vh !important;
        border-radius: 12px !important;
    }
}


/* ZF jChat fullscreen page/embed fix
   Makes [zf_jchat_embed] break out of narrow theme content/sidebar layouts. */
.zf-jchat-embed {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.zf-jchat-embed,
.zf-jchat-embed * {
    box-sizing: border-box !important;
}

.zf-jchat-embed .zf-jchat-window,
.zf-jchat-embed-window {
    width: 100vw !important;
    max-width: 100vw !important;
    height: var(--zf-jchat-embed-height, calc(100dvh - 0px)) !important;
    min-height: 520px !important;
    max-height: none !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    box-shadow: none !important;
}

.zf-jchat-embed .zf-jchat-body {
    height: 100% !important;
    min-height: 0 !important;
    grid-template-columns: minmax(230px, 28vw) minmax(0, 1fr) !important;
}

.zf-jchat-embed .zf-jchat-main,
.zf-jchat-embed .zf-jchat-messages,
.zf-jchat-embed .zf-jchat-form {
    min-width: 0 !important;
}

.zf-jchat-embed .zf-jchat-messages {
    min-height: 0 !important;
}

.zf-jchat-embed .zf-jchat-form {
    flex: 0 0 auto !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
}

.zf-jchat-embed .zf-jchat-form textarea {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.zf-jchat-embed .zf-jchat-form button {
    flex: 0 0 auto !important;
    min-width: 88px !important;
    min-height: 52px !important;
}

@media (max-width: 782px) {
    .zf-jchat-embed .zf-jchat-window,
    .zf-jchat-embed-window {
        height: calc(100dvh - 0px) !important;
        min-height: 100dvh !important;
    }

    .zf-jchat-embed .zf-jchat-body {
        grid-template-columns: 118px minmax(0, 1fr) !important;
    }

    .zf-jchat-embed .zf-jchat-form {
        gap: 7px !important;
        padding: 8px !important;
    }

    .zf-jchat-embed .zf-jchat-form textarea {
        min-height: 48px !important;
        max-height: 90px !important;
    }

    .zf-jchat-embed .zf-jchat-form button {
        min-width: 68px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 480px) {
    .zf-jchat-embed .zf-jchat-body {
        grid-template-columns: 96px minmax(0, 1fr) !important;
    }

    .zf-jchat-embed .zf-jchat-sidebar-title {
        font-size: 11px !important;
        padding: 7px 5px !important;
    }

    .zf-jchat-embed .zf-jchat-thread-avatar-wrap img {
        width: 34px !important;
        height: 34px !important;
    }

    .zf-jchat-embed .zf-jchat-thread-info strong {
        font-size: 11px !important;
    }
}


/* ZF modern embedded messenger layout */
.zf-jchat-embed{width:100%;min-height:70vh;box-sizing:border-box;margin:0}
.zf-jchat-embed .zf-jchat-window{width:100%!important;max-width:100%!important;height:var(--zf-jchat-embed-height,calc(100dvh - 120px))!important;max-height:none!important;border-radius:16px!important;box-shadow:0 8px 28px rgba(15,23,42,.12)!important;border:1px solid #e2e8f0!important}
.zf-jchat-embed .zf-jchat-header{position:sticky;top:0;z-index:3;background:#fff}
.zf-jchat-mobile-back{display:none}
.zf-jchat-embed .zf-jchat-thread.active{background:#dbeafe!important}
.zf-jchat-embed-page .zf-mobile-bottom-bar,.zf-jchat-embed-page .zf-floating-add-post,.zf-jchat-embed-page #zf-notify-bell,.zf-jchat-embed-page .zf-notify-bell,.zf-jchat-embed-page .zf-site-home-overlay,body.zf-jchat-open .zf-mobile-bottom-bar,body.zf-jchat-open .zf-floating-add-post,body.zf-jchat-open #zf-notify-bell,body.zf-jchat-open .zf-notify-bell,body.zf-jchat-open .zf-site-home-overlay{display:none!important}
@media (max-width:700px){
.zf-jchat-embed{margin:0!important;min-height:100dvh!important}
.zf-jchat-embed .zf-jchat-window{height:100dvh!important;width:100vw!important;max-width:100vw!important;margin-left:calc(50% - 50vw)!important;border-radius:0!important;border-left:0!important;border-right:0!important}
.zf-jchat-embed .zf-jchat-body{display:block!important;height:calc(100dvh - 58px)!important;min-height:0!important}
.zf-jchat-embed .zf-jchat-sidebar{width:100%!important;height:calc(100dvh - 58px)!important;border-right:0!important;display:block!important;overflow-y:auto!important}
.zf-jchat-embed .zf-jchat-main{display:none!important}
.zf-jchat-embed.zf-chat-open .zf-jchat-sidebar{display:none!important}
.zf-jchat-embed.zf-chat-open .zf-jchat-main{display:flex!important;height:calc(100dvh - 58px)!important}
.zf-jchat-embed.zf-chat-open .zf-jchat-mobile-back{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:38px!important;height:38px!important;margin-right:8px!important;border:0!important;border-radius:50%!important;background:#f1f5f9!important;color:#0f172a!important;font-size:22px!important;font-weight:800!important;cursor:pointer!important}
.zf-jchat-embed:not(.zf-chat-open) .zf-jchat-mobile-back{display:none!important}
.zf-jchat-embed .zf-jchat-thread{flex-direction:row!important;text-align:left!important;gap:12px!important;padding:13px 12px!important;border-bottom:1px solid #e2e8f0!important;border-radius:0!important}
.zf-jchat-embed .zf-jchat-thread-avatar-wrap img{width:48px!important;height:48px!important}
.zf-jchat-embed .zf-jchat-thread-info strong{font-size:15px!important;line-height:1.2!important}
.zf-jchat-embed .zf-jchat-thread-info small{display:block!important;font-size:12px!important;margin-top:3px!important}
.zf-jchat-embed .zf-jchat-messages{height:auto!important;padding:12px!important}
.zf-jchat-embed .zf-jchat-form{position:sticky!important;bottom:0!important;z-index:4!important;padding:8px!important}
.zf-jchat-embed .zf-jchat-form textarea{min-height:42px!important;max-height:84px!important}
.zf-jchat-embed .zf-jchat-form button{padding:0 13px!important}
}


/* ZF jChat desktop dock navigation */
.zf-jchat-desktop-dock{display:none}
@media (min-width:701px){
.zf-jchat-embed .zf-jchat-desktop-dock{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;width:100%!important;background:#fff!important;border:1px solid #e2e8f0!important;border-top:0!important;border-radius:0 0 16px 16px!important;box-shadow:0 8px 28px rgba(15,23,42,.08)!important;overflow:hidden!important}
.zf-jchat-embed .zf-jchat-window{border-radius:16px 16px 0 0!important}
.zf-jchat-dock-link{min-height:58px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;color:#0f172a!important;text-decoration:none!important;font-size:13px!important;font-weight:800!important;border-right:1px solid #e2e8f0!important;background:#fff!important}
.zf-jchat-dock-link:last-child{border-right:0!important}
.zf-jchat-dock-link:hover{background:#f1f5f9!important;color:#16a34a!important}
.zf-jchat-dock-icon{font-size:19px!important;line-height:1!important}
.zf-jchat-dock-profile img{width:24px!important;height:24px!important;border-radius:50%!important;object-fit:cover!important;display:inline-block!important}
}
@media (max-width:700px){.zf-jchat-desktop-dock{display:none!important}}

/* ZF dedicated mobile messenger + navy desktop dock */
.zf-jchat-mobile-app{display:none!important}.zf-jchat-desktop-app{display:block!important}
.zf-jchat-embed-page .zf-mobile-bottom-bar,.zf-jchat-embed-page .zf-floating-add-post,.zf-jchat-embed-page #zf-notify-bell,.zf-jchat-embed-page .zf-notify-bell,.zf-jchat-embed-page .zf-site-home-overlay{display:none!important}
@media (min-width:701px){.zf-jchat-embed .zf-jchat-desktop-dock{background:#0b1f4d!important;border-color:#0b1f4d!important}.zf-jchat-embed .zf-jchat-dock-link{background:#0b1f4d!important;color:#fff!important;border-right:1px solid rgba(255,255,255,.18)!important}.zf-jchat-embed .zf-jchat-dock-link:hover{background:#12306d!important;color:#fff!important}.zf-jchat-embed .zf-jchat-dock-profile img{border:2px solid #fff!important}}
@media (max-width:700px){
html body .zf-jchat-embed .zf-jchat-desktop-app{display:none!important}
html body .zf-jchat-embed .zf-jchat-mobile-app{display:block!important;width:100vw!important;height:100dvh!important;margin-left:calc(50% - 50vw)!important;background:#fff!important;overflow:hidden!important}
.zf-jchat-mobile-list-screen,.zf-jchat-mobile-chat-screen{width:100%!important;height:100dvh!important;background:#fff!important}
.zf-jchat-mobile-chat-screen{display:none!important}
.zf-jchat-embed.zf-chat-open .zf-jchat-mobile-list-screen{display:none!important}
.zf-jchat-embed.zf-chat-open .zf-jchat-mobile-chat-screen{display:flex!important;flex-direction:column!important}
.zf-jchat-mobile-topbar,.zf-jchat-mobile-chat-header{height:58px!important;min-height:58px!important;display:flex!important;align-items:center!important;gap:10px!important;padding:0 12px!important;border-bottom:1px solid #e2e8f0!important;background:#fff!important;box-sizing:border-box!important}
.zf-jchat-mobile-topbar strong{font-size:20px!important;color:#0f172a!important}
.zf-jchat-mobile-threads{height:calc(100dvh - 58px)!important;overflow-y:auto!important;background:#f8fafc!important}
.zf-jchat-mobile-thread{width:100%!important;display:flex!important;flex-direction:row!important;align-items:center!important;text-align:left!important;gap:12px!important;padding:14px 12px!important;border:0!important;border-bottom:1px solid #e2e8f0!important;border-radius:0!important;background:#fff!important;box-sizing:border-box!important}
.zf-jchat-mobile-thread .zf-jchat-thread-avatar-wrap img{width:50px!important;height:50px!important}
.zf-jchat-mobile-thread .zf-jchat-thread-info strong{font-size:16px!important;color:#0f172a!important;line-height:1.2!important}
.zf-jchat-mobile-thread .zf-jchat-thread-info small{display:block!important;font-size:13px!important;color:#64748b!important;margin-top:4px!important;max-width:calc(100vw - 120px)!important}
.zf-jchat-mobile-back{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:38px!important;height:38px!important;border:0!important;border-radius:50%!important;background:#f1f5f9!important;color:#0f172a!important;font-size:22px!important;font-weight:800!important;cursor:pointer!important}
.zf-jchat-mobile-chat-header .zf-jchat-header-avatar img{width:36px!important;height:36px!important;border-radius:50%!important;object-fit:cover!important;display:block!important}
.zf-jchat-mobile-chat-header .zf-jchat-header-name{font-size:16px!important;font-weight:800!important;color:#0f172a!important}
.zf-jchat-mobile-messages{flex:1!important;overflow-y:auto!important;padding:12px!important;background:#f1f5f9!important;height:auto!important}
.zf-jchat-mobile-form{height:auto!important;min-height:58px!important;display:flex!important;gap:8px!important;padding:8px!important;border-top:1px solid #e2e8f0!important;background:#fff!important;box-sizing:border-box!important}
.zf-jchat-mobile-form textarea{flex:1!important;min-height:42px!important;max-height:84px!important;resize:none!important}
.zf-jchat-mobile-form button{min-width:68px!important;padding:0 12px!important}
.zf-jchat-desktop-dock{display:none!important}
}


/* ZF FIX: prevent duplicate desktop/mobile messenger boxes */
html body .zf-jchat-embed > .zf-jchat-mobile-app {
    display: none !important;
}

html body .zf-jchat-embed > .zf-jchat-desktop-app {
    display: block !important;
}

@media (min-width: 701px) {
    html body .zf-jchat-embed > .zf-jchat-mobile-app,
    html body .zf-jchat-embed .zf-jchat-mobile-app,
    html body .zf-jchat-mobile-list-screen,
    html body .zf-jchat-mobile-chat-screen,
    html body .zf-jchat-mobile-form,
    html body .zf-jchat-mobile-messages,
    html body .zf-jchat-mobile-topbar,
    html body .zf-jchat-mobile-chat-header {
        display: none !important;
    }

    html body .zf-jchat-embed > .zf-jchat-desktop-app,
    html body .zf-jchat-embed .zf-jchat-desktop-app {
        display: block !important;
    }

    html body .zf-jchat-embed .zf-jchat-desktop-app .zf-jchat-window {
        display: flex !important;
    }

    html body .zf-jchat-embed .zf-jchat-desktop-app .zf-jchat-body {
        display: grid !important;
    }

    html body .zf-jchat-embed .zf-jchat-desktop-app .zf-jchat-main {
        display: flex !important;
    }

    html body .zf-jchat-embed .zf-jchat-desktop-app .zf-jchat-sidebar {
        display: block !important;
    }
}

@media (max-width: 700px) {
    html body .zf-jchat-embed > .zf-jchat-desktop-app,
    html body .zf-jchat-embed .zf-jchat-desktop-app,
    html body .zf-jchat-embed .zf-jchat-desktop-dock {
        display: none !important;
    }

    html body .zf-jchat-embed > .zf-jchat-mobile-app,
    html body .zf-jchat-embed .zf-jchat-mobile-app {
        display: block !important;
    }
}

/* ZF hard fix: only render one messenger mode */
html body .zf-jchat-server-desktop > .zf-jchat-mobile-app {
    display: none !important;
}

html body .zf-jchat-server-desktop > .zf-jchat-desktop-app {
    display: block !important;
}

html body .zf-jchat-server-mobile > .zf-jchat-desktop-app {
    display: none !important;
}

html body .zf-jchat-server-mobile > .zf-jchat-mobile-app {
    display: block !important;
}

/* Navy dock */
@media (min-width:701px) {
    html body .zf-jchat-server-desktop .zf-jchat-desktop-dock {
        background: #0b1f4d !important;
        border-color: #0b1f4d !important;
    }

    html body .zf-jchat-server-desktop .zf-jchat-dock-link {
        background: #0b1f4d !important;
        color: #fff !important;
        border-right: 1px solid rgba(255,255,255,.18) !important;
    }

    html body .zf-jchat-server-desktop .zf-jchat-dock-link:hover {
        background: #12306d !important;
        color: #fff !important;
    }

    html body .zf-jchat-server-desktop .zf-jchat-dock-profile img {
        border: 2px solid #fff !important;
    }
}

/* Mobile layout, only when server sends mobile markup */
@media (max-width:700px) {
    html body .zf-jchat-server-mobile {
        width: 100vw !important;
        height: 100dvh !important;
        margin-left: calc(50% - 50vw) !important;
        background: #fff !important;
        overflow: hidden !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-list-screen,
    html body .zf-jchat-server-mobile .zf-jchat-mobile-chat-screen {
        width: 100% !important;
        height: 100dvh !important;
        background: #fff !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-chat-screen {
        display: none !important;
    }

    html body .zf-jchat-server-mobile.zf-chat-open .zf-jchat-mobile-list-screen {
        display: none !important;
    }

    html body .zf-jchat-server-mobile.zf-chat-open .zf-jchat-mobile-chat-screen {
        display: flex !important;
        flex-direction: column !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-topbar,
    html body .zf-jchat-server-mobile .zf-jchat-mobile-chat-header {
        height: 58px !important;
        min-height: 58px !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 0 12px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-threads {
        height: calc(100dvh - 58px) !important;
        overflow-y: auto !important;
        background: #f8fafc !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-thread {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 12px !important;
        padding: 14px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-messages {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 12px !important;
        background: #f1f5f9 !important;
        height: auto !important;
    }

    html body .zf-jchat-server-mobile .zf-jchat-mobile-form {
        height: auto !important;
        min-height: 58px !important;
        display: flex !important;
        gap: 8px !important;
        padding: 8px !important;
        border-top: 1px solid #e2e8f0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }
}


/* ZF jChat alerts popup */
.zf-jchat-alerts-panel{display:none;position:fixed;right:24px;bottom:82px;width:320px;max-width:calc(100vw - 24px);z-index:1000002;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 15px 45px rgba(15,23,42,.22);overflow:hidden}
.zf-jchat-alerts-panel.active{display:block!important}
.zf-jchat-alerts-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#0b1f4d;color:#fff}
.zf-jchat-alerts-close{border:0;background:transparent;color:#fff;font-size:22px;line-height:1;cursor:pointer}
.zf-jchat-alerts-list{max-height:320px;overflow-y:auto;padding:8px}
.zf-jchat-alert-empty{margin:8px;color:#64748b}
.zf-jchat-alert-item{width:100%;display:flex;align-items:center;gap:9px;padding:9px;border:0;border-radius:10px;background:#fff;cursor:pointer;text-align:left}
.zf-jchat-alert-item:hover{background:#f1f5f9}
.zf-jchat-alert-item img{width:34px;height:34px;border-radius:50%}
.zf-jchat-alert-item span,.zf-jchat-alert-item strong,.zf-jchat-alert-item small{display:block}
.zf-jchat-alert-item small{color:#64748b;font-size:12px}
@media (max-width:700px){.zf-jchat-alerts-panel{left:12px;right:12px;bottom:14px;width:auto}}


/* ZF HARD MOBILE FIX: collapse any embedded messenger to one screen */
@media (max-width: 900px) {
    html body .zf-jchat-embed {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin-left: calc(50% - 50vw) !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    html body .zf-jchat-embed .zf-jchat-window,
    html body .zf-jchat-embed .zf-jchat-embed-window {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    html body .zf-jchat-embed .zf-jchat-body {
        display: block !important;
        height: calc(100dvh - 58px) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    html body .zf-jchat-embed .zf-jchat-sidebar {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100dvh - 58px) !important;
        border-right: 0 !important;
        overflow-y: auto !important;
        background: #f8fafc !important;
    }

    html body .zf-jchat-embed .zf-jchat-main {
        display: none !important;
        width: 100% !important;
        height: calc(100dvh - 58px) !important;
        min-height: 0 !important;
    }

    html body .zf-jchat-embed.zf-chat-open .zf-jchat-sidebar {
        display: none !important;
    }

    html body .zf-jchat-embed.zf-chat-open .zf-jchat-main {
        display: flex !important;
        flex-direction: column !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 14px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-info strong {
        display: block !important;
        font-size: 16px !important;
        color: #0f172a !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-info small {
        display: block !important;
        font-size: 13px !important;
        color: #64748b !important;
        max-width: calc(100vw - 125px) !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-avatar-wrap img {
        width: 50px !important;
        height: 50px !important;
    }

    html body .zf-jchat-embed .zf-jchat-messages {
        flex: 1 !important;
        height: auto !important;
        overflow-y: auto !important;
        padding: 12px !important;
        background: #f1f5f9 !important;
    }

    html body .zf-jchat-embed .zf-jchat-form {
        display: flex !important;
        min-height: 58px !important;
        padding: 8px !important;
        gap: 8px !important;
        border-top: 1px solid #e2e8f0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-embed .zf-jchat-form textarea {
        flex: 1 !important;
        min-height: 42px !important;
        max-height: 84px !important;
        resize: none !important;
    }

    html body .zf-jchat-embed .zf-jchat-mobile-back,
    html body .zf-jchat-embed.zf-chat-open .zf-jchat-mobile-back {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        margin-right: 8px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        color: #0f172a !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        cursor: pointer !important;
    }

    html body .zf-jchat-embed:not(.zf-chat-open) .zf-jchat-mobile-back {
        display: none !important;
    }

    html body .zf-jchat-embed .zf-jchat-desktop-dock {
        display: none !important;
    }
}


/* ZF FINAL MOBILE FIX: no split screen on phones */
@media only screen and (max-width: 900px) {
    html body .zf-jchat-embed,
    html body .zf-jchat-embed .zf-jchat-desktop-app,
    html body .zf-jchat-embed .zf-jchat-window,
    html body .zf-jchat-embed .zf-jchat-embed-window {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        margin-left: calc(50% - 50vw) !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
    }

    html body .zf-jchat-embed .zf-jchat-body {
        display: block !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100dvh - 58px) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        grid-template-columns: none !important;
    }

    html body .zf-jchat-embed:not(.zf-chat-open) .zf-jchat-sidebar {
        display: block !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        height: calc(100dvh - 58px) !important;
        max-height: calc(100dvh - 58px) !important;
        overflow-y: auto !important;
        border: 0 !important;
        background: #f8fafc !important;
        float: none !important;
        position: relative !important;
    }

    html body .zf-jchat-embed:not(.zf-chat-open) .zf-jchat-main {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    html body .zf-jchat-embed.zf-chat-open .zf-jchat-sidebar {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    html body .zf-jchat-embed.zf-chat-open .zf-jchat-main {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        height: calc(100dvh - 58px) !important;
        max-height: calc(100dvh - 58px) !important;
        overflow: hidden !important;
        visibility: visible !important;
        background: #fff !important;
    }

    html body .zf-jchat-embed .zf-jchat-sidebar-title {
        display: block !important;
        padding: 14px 16px !important;
        font-size: 20px !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        background: #fff !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 14px 12px !important;
        text-align: left !important;
        border: 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-info {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        display: block !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-info strong {
        display: block !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
        color: #0f172a !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-info small {
        display: block !important;
        margin-top: 4px !important;
        font-size: 13px !important;
        color: #64748b !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    html body .zf-jchat-embed .zf-jchat-thread-avatar-wrap img {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }

    html body .zf-jchat-embed .zf-jchat-messages {
        flex: 1 1 auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 12px !important;
        background: #f1f5f9 !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-embed .zf-jchat-form {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-height: 58px !important;
        display: flex !important;
        gap: 8px !important;
        padding: 8px !important;
        border-top: 1px solid #e2e8f0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-embed .zf-jchat-form textarea {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        min-height: 42px !important;
        max-height: 84px !important;
        resize: none !important;
        box-sizing: border-box !important;
    }

    html body .zf-jchat-embed .zf-jchat-form button {
        flex: 0 0 68px !important;
        min-width: 68px !important;
        padding: 0 12px !important;
    }

    html body .zf-jchat-embed .zf-jchat-mobile-back {
        display: none !important;
    }

    html body .zf-jchat-embed.zf-chat-open .zf-jchat-mobile-back {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        margin-right: 8px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        color: #0f172a !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        cursor: pointer !important;
    }

    html body .zf-jchat-embed .zf-jchat-desktop-dock {
        display: none !important;
    }
}

/* ZF member-directory message popup: full screen on mobile */
@media only screen and (max-width: 900px) {
    html body #zfJChatModal.active {
        display: flex !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 1000005 !important;
        background: #fff !important;
    }

    html body #zfJChatModal.active .zf-jchat-window {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    html body #zfJChatModal.active .zf-jchat-body {
        display: block !important;
        height: calc(100dvh - 58px) !important;
        overflow: hidden !important;
        grid-template-columns: none !important;
    }

    html body #zfJChatModal.active.zf-jchat-direct .zf-jchat-sidebar {
        display: none !important;
    }

    html body #zfJChatModal.active.zf-jchat-direct .zf-jchat-main {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: calc(100dvh - 58px) !important;
    }

    html body #zfJChatModal.active .zf-jchat-messages {
        flex: 1 !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    html body #zfJChatModal.active .zf-jchat-form {
        flex: 0 0 auto !important;
        display: flex !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    html body #zfJChatModal.active .zf-jchat-form textarea {
        flex: 1 !important;
        min-width: 0 !important;
        min-height: 42px !important;
        max-height: 84px !important;
    }

    html body #zfJChatModal.active .zf-jchat-form button {
        flex: 0 0 68px !important;
        min-width: 68px !important;
    }
}

@media only screen and (max-width:900px){
html body #zfJChatModal.active{display:flex!important;position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;padding:0!important;margin:0!important;z-index:2147483647!important;background:#fff!important}
html body #zfJChatModal.active .zf-jchat-window{width:100vw!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;border-radius:0!important;box-shadow:none!important;display:flex!important;flex-direction:column!important}
html body #zfJChatModal.active .zf-jchat-body{display:block!important;height:calc(100dvh - 58px)!important;overflow:hidden!important;grid-template-columns:none!important}
html body #zfJChatModal.active .zf-jchat-sidebar{display:none!important}
html body #zfJChatModal.active .zf-jchat-main{display:flex!important;flex-direction:column!important;width:100vw!important;height:calc(100dvh - 58px)!important}
html body #zfJChatModal.active .zf-jchat-messages{flex:1!important;height:auto!important;min-height:0!important;overflow-y:auto!important}
html body #zfJChatModal.active .zf-jchat-form{flex:0 0 auto!important;display:flex!important;gap:8px!important;padding:8px!important;background:#fff!important}
html body #zfJChatModal.active .zf-jchat-form textarea{flex:1!important;min-width:0!important;min-height:42px!important;max-height:84px!important}
html body #zfJChatModal.active .zf-jchat-form button{flex:0 0 68px!important;min-width:68px!important}
}

/* ZF clean fullscreen-only messenger */
#zfJChatModal{display:none!important;visibility:hidden!important;pointer-events:none!important}
.zf-jchat-fullpage-only{width:100%!important;max-width:100%!important}
.zf-jchat-fullpage-only .zf-jchat-window{width:100%!important;max-width:100%!important;height:calc(100dvh - 80px)!important;max-height:none!important;border-radius:16px!important}
.zf-jchat-mobile-fullscreen-dock{display:none}
@media only screen and (max-width:1200px){
html body .zf-jchat-fullpage-only{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin-left:calc(50% - 50vw)!important;padding-bottom:58px!important;background:#fff!important;overflow:hidden!important;box-sizing:border-box!important}
html body .zf-jchat-fullpage-only .zf-jchat-window{width:100vw!important;max-width:100vw!important;height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;border-radius:0!important;border:0!important;box-shadow:none!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-body{display:block!important;grid-template-columns:none!important;width:100vw!important;height:calc(100dvh - 116px)!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only:not(.zf-chat-open) .zf-jchat-sidebar{display:block!important;width:100vw!important;height:calc(100dvh - 116px)!important;overflow-y:auto!important;border:0!important;background:#f8fafc!important}
html body .zf-jchat-fullpage-only:not(.zf-chat-open) .zf-jchat-main{display:none!important}
html body .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-sidebar{display:none!important}
html body .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-main{display:flex!important;flex-direction:column!important;width:100vw!important;height:calc(100dvh - 116px)!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-thread{width:100%!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:12px!important;padding:14px 12px!important;border:0!important;border-bottom:1px solid #e2e8f0!important;border-radius:0!important;background:#fff!important;text-align:left!important;box-sizing:border-box!important}
html body .zf-jchat-fullpage-only .zf-jchat-thread-info{min-width:0!important;flex:1 1 auto!important}
html body .zf-jchat-fullpage-only .zf-jchat-thread-info strong,html body .zf-jchat-fullpage-only .zf-jchat-thread-info small{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html body .zf-jchat-fullpage-only .zf-jchat-messages{flex:1 1 auto!important;height:auto!important;min-height:0!important;overflow-y:auto!important;padding:12px!important;background:#f1f5f9!important}
html body .zf-jchat-fullpage-only .zf-jchat-form{flex:0 0 auto!important;display:flex!important;gap:8px!important;padding:8px!important;border-top:1px solid #e2e8f0!important;background:#fff!important;box-sizing:border-box!important}
html body .zf-jchat-fullpage-only .zf-jchat-form textarea{flex:1 1 auto!important;min-width:0!important;min-height:42px!important;max-height:84px!important;resize:none!important}
html body .zf-jchat-fullpage-only .zf-jchat-form button{flex:0 0 74px!important;min-width:74px!important}
html body .zf-jchat-fullpage-only .zf-jchat-mobile-back{display:none!important}
html body .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-mobile-back{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:38px!important;height:38px!important;margin-right:8px!important;border:0!important;border-radius:50%!important;background:#f1f5f9!important;color:#0f172a!important;font-size:22px!important;font-weight:800!important;cursor:pointer!important}
html body .zf-jchat-mobile-fullscreen-dock{position:fixed!important;left:0!important;right:0!important;bottom:0!important;height:58px!important;display:grid!important;grid-template-columns:repeat(4,1fr)!important;background:#0b1f4d!important;z-index:2147483647!important}
html body .zf-jchat-mobile-fullscreen-dock a{color:#fff!important;text-decoration:none!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;font-size:16px!important;font-weight:800!important}
html body .zf-jchat-mobile-fullscreen-dock a span{color:#fff!important;font-size:10px!important;line-height:1!important}
}

/* ZF mobile header navigation buttons */
.zf-jchat-header-actions{margin-left:auto;display:inline-flex;align-items:center;gap:8px}
.zf-jchat-header-action{width:34px;height:34px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#f1f5f9;color:#0f172a!important;text-decoration:none!important;font-size:16px;line-height:1;font-weight:800}
.zf-jchat-header-action:hover{background:#e2e8f0}
.zf-jchat-alerts-panel{display:none;position:fixed;right:14px;top:70px;width:320px;max-width:calc(100vw - 28px);z-index:2147483647;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 15px 45px rgba(15,23,42,.22);overflow:hidden}
.zf-jchat-alerts-panel.active{display:block!important}
.zf-jchat-alerts-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#0b1f4d;color:#fff}
.zf-jchat-alerts-close{border:0;background:transparent;color:#fff;font-size:22px;line-height:1;cursor:pointer}
.zf-jchat-alerts-list{max-height:320px;overflow-y:auto;padding:8px}
.zf-jchat-alert-empty{margin:8px;color:#64748b}
@media only screen and (max-width:1200px){
html body .zf-jchat-fullpage-only .zf-jchat-header{gap:8px!important}
html body .zf-jchat-fullpage-only .zf-jchat-header-user{min-width:0!important;flex:1 1 auto!important}
html body .zf-jchat-fullpage-only .zf-jchat-header-name{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html body .zf-jchat-header-actions{flex:0 0 auto!important;display:inline-flex!important}
html body .zf-jchat-mobile-fullscreen-dock{display:none!important}
}


/* ZF messenger fullscreen/footer stability */
@media (max-width: 900px) {
    .zf-jchat-fullpage-only,
    .zf-jchat-embed {
        padding-bottom: 0 !important;
    }

    .zf-jchat-fullpage-only .zf-jchat-window,
    .zf-jchat-embed .zf-jchat-window {
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-main,
    .zf-jchat-embed.zf-chat-open .zf-jchat-main {
        height: calc(100dvh - 58px) !important;
        max-height: calc(100dvh - 58px) !important;
        padding-bottom: 0 !important;
    }

    .zf-jchat-fullpage-only .zf-jchat-form,
    .zf-jchat-embed .zf-jchat-form {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 20 !important;
        background: #fff !important;
    }

    .zf-jchat-mobile-fullscreen-dock {
        display: none !important;
    }
}



/* ZF FINAL: mobile messenger input stability + remove header alert */
@media (max-width:1200px){
html body .zf-jchat-fullpage-only,html body .zf-jchat-embed{width:100vw!important;height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;padding-bottom:0!important}
html body .zf-jchat-fullpage-only .zf-jchat-window,html body .zf-jchat-embed .zf-jchat-window{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-header,html body .zf-jchat-embed .zf-jchat-header{flex:0 0 58px!important;min-height:58px!important;max-height:58px!important}
html body .zf-jchat-fullpage-only .zf-jchat-body,html body .zf-jchat-embed .zf-jchat-body{height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-main,html body .zf-jchat-embed.zf-chat-open .zf-jchat-main{height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding-bottom:0!important}
html body .zf-jchat-fullpage-only .zf-jchat-messages,html body .zf-jchat-embed .zf-jchat-messages{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;padding-bottom:10px!important}
html body .zf-jchat-fullpage-only .zf-jchat-form,html body .zf-jchat-embed .zf-jchat-form{position:static!important;flex:0 0 auto!important;width:100%!important;min-height:74px!important;display:flex!important;align-items:stretch!important;gap:8px!important;padding:8px!important;box-sizing:border-box!important;background:#fff!important;border-top:1px solid #e2e8f0!important;z-index:50!important}
html body .zf-jchat-fullpage-only .zf-jchat-form textarea,html body .zf-jchat-embed .zf-jchat-form textarea{flex:1 1 auto!important;min-width:0!important;width:auto!important;min-height:54px!important;max-height:74px!important;resize:none!important}
html body .zf-jchat-fullpage-only .zf-jchat-form button,html body .zf-jchat-embed .zf-jchat-form button{flex:0 0 74px!important;min-width:74px!important;height:auto!important}
html body .zf-jchat-mobile-fullscreen-dock,html body .zf-jchat-header-alerts,html body .zf-jchat-header-action[aria-label="Notifications"]{display:none!important;visibility:hidden!important;pointer-events:none!important}
}

/* ZF 5-column bottom nav + no input overlap */
@media(max-width:900px){
html body .zf-jchat-fullpage-only,html body .zf-jchat-embed{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;padding-bottom:58px!important;box-sizing:border-box!important}
html body .zf-jchat-fullpage-only .zf-jchat-window,html body .zf-jchat-embed .zf-jchat-window{height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-body,html body .zf-jchat-embed .zf-jchat-body{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-main,html body .zf-jchat-embed.zf-chat-open .zf-jchat-main{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-messages,html body .zf-jchat-embed .zf-jchat-messages{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;padding-bottom:8px!important}
html body .zf-jchat-fullpage-only .zf-jchat-form,html body .zf-jchat-embed .zf-jchat-form{position:relative!important;bottom:auto!important;flex:0 0 76px!important;min-height:76px!important;max-height:76px!important;z-index:60!important;background:#fff!important}
html body .zf-jchat-mobile-back{background:transparent!important;box-shadow:none!important;border:0!important}
html body .zf-jchat-mobile-fullscreen-dock{position:fixed!important;left:0!important;right:0!important;bottom:0!important;height:58px!important;display:grid!important;grid-template-columns:repeat(5,1fr)!important;background:#0b1f4d!important;z-index:2147483647!important}
html body .zf-jchat-mobile-fullscreen-dock a{color:#fff!important;text-decoration:none!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;font-size:16px!important;font-weight:800!important}
html body .zf-jchat-mobile-fullscreen-dock a span{color:#fff!important;font-size:10px!important;line-height:1!important}
}

/* ZF jChat uses zf-social-system bottom nav */
@media(max-width:900px){
html body .zf-jchat-mobile-fullscreen-dock{display:none!important;visibility:hidden!important;pointer-events:none!important}
html body .zf-jchat-fullpage-only,html body .zf-jchat-embed{height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;padding-bottom:0!important;overflow:hidden!important;box-sizing:border-box!important}
html body .zf-jchat-fullpage-only .zf-jchat-window,html body .zf-jchat-embed .zf-jchat-window{height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-header,html body .zf-jchat-embed .zf-jchat-header{flex:0 0 58px!important;min-height:58px!important;max-height:58px!important}
html body .zf-jchat-fullpage-only .zf-jchat-body,html body .zf-jchat-embed .zf-jchat-body{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only.zf-chat-open .zf-jchat-main,html body .zf-jchat-embed.zf-chat-open .zf-jchat-main{display:flex!important;flex-direction:column!important;flex:1 1 auto!important;min-height:0!important;height:100%!important;overflow:hidden!important}
html body .zf-jchat-fullpage-only .zf-jchat-messages,html body .zf-jchat-embed .zf-jchat-messages{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;padding-bottom:8px!important}
html body .zf-jchat-fullpage-only .zf-jchat-form,html body .zf-jchat-embed .zf-jchat-form{position:relative!important;flex:0 0 76px!important;min-height:76px!important;max-height:76px!important;bottom:auto!important;z-index:40!important;background:#fff!important;box-sizing:border-box!important}
html body .zf-jchat-fullpage-only .zf-jchat-mobile-back,html body .zf-jchat-embed .zf-jchat-mobile-back{background:transparent!important;box-shadow:none!important;border:0!important}
}

/* ZF FINAL: jChat page height and scrollbar control */
html.zf-jchat-page-active,body.zf-jchat-page-active{height:100%!important;min-height:100%!important;overflow:hidden!important}
body.zf-jchat-page-active.custom-background{background-image:none!important;background-color:#fff!important}
body.zf-jchat-page-active #page,body.zf-jchat-page-active .site,body.zf-jchat-page-active .site-content,body.zf-jchat-page-active .content-area,body.zf-jchat-page-active .wrapper,body.zf-jchat-page-active .entry-content,body.zf-jchat-page-active main{min-height:100vh!important;height:100vh!important;min-height:100dvh!important;height:100dvh!important;overflow:hidden!important;background-image:none!important;background-color:#fff!important}
@media(min-width:901px){
body.zf-jchat-page-active{padding-bottom:0!important}
body.zf-jchat-page-active .zf-jchat-fullpage-only,body.zf-jchat-page-active .zf-jchat-embed{height:100vh!important;height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;padding-bottom:0!important;box-sizing:border-box!important}
body.zf-jchat-page-active .zf-jchat-window{height:100vh!important;height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-body,body.zf-jchat-page-active .zf-jchat-main{min-height:0!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-messages{overflow-y:auto!important}
}
@media(max-width:900px){
body.zf-jchat-page-active{padding-bottom:58px!important}
body.zf-jchat-page-active #page,body.zf-jchat-page-active .site,body.zf-jchat-page-active .site-content,body.zf-jchat-page-active .content-area,body.zf-jchat-page-active .wrapper,body.zf-jchat-page-active .entry-content,body.zf-jchat-page-active main{height:calc(100vh - 58px)!important;height:calc(100dvh - 58px)!important;min-height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-fullpage-only,body.zf-jchat-page-active .zf-jchat-embed{height:calc(100vh - 58px)!important;height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;overflow:hidden!important;padding-bottom:0!important;box-sizing:border-box!important}
body.zf-jchat-page-active .zf-jchat-window{height:calc(100vh - 58px)!important;height:calc(100dvh - 58px)!important;max-height:calc(100dvh - 58px)!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-body,body.zf-jchat-page-active .zf-jchat-main{min-height:0!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-messages{overflow-y:auto!important;min-height:0!important}
}

/* ZF jChat stage 1: mobile header cleanup + simple upload */
@media(max-width:900px){
.zf-jchat-header-actions,.zf-jchat-header-menu,.zf-jchat-header-more,.zf-jchat-header-alerts,.zf-jchat-header-action,.zf-jchat-header .zf-notification-bell{display:none!important;visibility:hidden!important;pointer-events:none!important}
.zf-jchat-header{justify-content:flex-start!important}
}
.zf-jchat-upload-link{flex:0 0 auto!important;border:0!important;background:transparent!important;color:#0b1f4d!important;font-weight:900!important;font-size:18px!important;padding:0 5px!important;cursor:pointer!important;line-height:1!important}
.zf-jchat-upload-link.is-uploading{opacity:.45!important;pointer-events:none!important}

/* ZF jChat Stage 1.1: flex layout above social nav */
:root{--zf-social-nav-height:58px;--zf-jchat-composer-height:76px;--zf-jchat-header-height:58px}
body.zf-jchat-page-active{overflow:hidden!important}
.zf-jchat-fullpage-only,.zf-jchat-embed{box-sizing:border-box!important;overflow:hidden!important}
.zf-jchat-fullpage-only .zf-jchat-window,.zf-jchat-embed .zf-jchat-window{display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box!important}
.zf-jchat-fullpage-only .zf-jchat-header,.zf-jchat-embed .zf-jchat-header{flex:0 0 var(--zf-jchat-header-height)!important;min-height:var(--zf-jchat-header-height)!important;max-height:var(--zf-jchat-header-height)!important;box-sizing:border-box!important}
.zf-jchat-fullpage-only .zf-jchat-body,.zf-jchat-embed .zf-jchat-body{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;display:flex!important}
.zf-jchat-fullpage-only .zf-jchat-main,.zf-jchat-embed .zf-jchat-main{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
.zf-jchat-fullpage-only .zf-jchat-messages,.zf-jchat-embed .zf-jchat-messages{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;padding-bottom:10px!important}
.zf-jchat-fullpage-only .zf-jchat-form,.zf-jchat-embed .zf-jchat-form{flex:0 0 var(--zf-jchat-composer-height)!important;min-height:var(--zf-jchat-composer-height)!important;max-height:var(--zf-jchat-composer-height)!important;position:relative!important;bottom:auto!important;left:auto!important;right:auto!important;width:100%!important;box-sizing:border-box!important;display:flex!important;align-items:stretch!important;gap:8px!important;padding:8px!important;background:#fff!important;border-top:1px solid #e2e8f0!important;z-index:30!important;margin-bottom:0!important}
.zf-jchat-fullpage-only .zf-jchat-form textarea,.zf-jchat-embed .zf-jchat-form textarea{flex:1 1 auto!important;min-width:0!important;width:auto!important;min-height:54px!important;max-height:60px!important;resize:none!important;box-sizing:border-box!important}
.zf-jchat-fullpage-only .zf-jchat-form button[type="submit"],.zf-jchat-embed .zf-jchat-form button[type="submit"]{flex:0 0 72px!important;min-width:72px!important}
@media(min-width:901px){
body.zf-jchat-page-active #page,body.zf-jchat-page-active .site,body.zf-jchat-page-active .site-content,body.zf-jchat-page-active .content-area,body.zf-jchat-page-active .wrapper,body.zf-jchat-page-active .entry-content,body.zf-jchat-page-active main{height:100vh!important;height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-fullpage-only,body.zf-jchat-page-active .zf-jchat-embed,body.zf-jchat-page-active .zf-jchat-window{height:100vh!important;height:100dvh!important;max-height:100dvh!important}
}
@media(max-width:900px){
body.zf-jchat-page-active{padding-bottom:var(--zf-social-nav-height)!important}
body.zf-jchat-page-active #page,body.zf-jchat-page-active .site,body.zf-jchat-page-active .site-content,body.zf-jchat-page-active .content-area,body.zf-jchat-page-active .wrapper,body.zf-jchat-page-active .entry-content,body.zf-jchat-page-active main{height:calc(100vh - var(--zf-social-nav-height))!important;height:calc(100dvh - var(--zf-social-nav-height))!important;max-height:calc(100dvh - var(--zf-social-nav-height))!important;overflow:hidden!important}
body.zf-jchat-page-active .zf-jchat-fullpage-only,body.zf-jchat-page-active .zf-jchat-embed,body.zf-jchat-page-active .zf-jchat-window{height:calc(100vh - var(--zf-social-nav-height))!important;height:calc(100dvh - var(--zf-social-nav-height))!important;max-height:calc(100dvh - var(--zf-social-nav-height))!important}
}
.zf-jchat-upload-preview{position:absolute;left:8px;right:8px;bottom:calc(var(--zf-jchat-composer-height) + 6px);background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:8px;box-shadow:0 8px 24px rgba(15,23,42,.12);z-index:35;display:none;align-items:center;gap:8px;font-size:13px;color:#0f172a}
.zf-jchat-upload-preview.active{display:flex}
.zf-jchat-upload-preview img{width:42px;height:42px;object-fit:cover;border-radius:8px}
.zf-jchat-upload-preview .zf-upload-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800}
.zf-jchat-upload-preview .zf-upload-cancel{border:0;background:#fee2e2;color:#991b1b;border-radius:999px;font-weight:900;padding:4px 8px;cursor:pointer}
.zf-jchat-upload-progress{position:absolute;left:8px;right:8px;bottom:calc(var(--zf-jchat-composer-height) + 2px);height:3px;background:#e2e8f0;border-radius:999px;overflow:hidden;display:none}
.zf-jchat-upload-progress.active{display:block}
.zf-jchat-upload-progress span{display:block;height:100%;width:40%;background:#0b1f4d;animation:zfUploadPulse 1s infinite ease-in-out}
@keyframes zfUploadPulse{0%{transform:translateX(-100%)}100%{transform:translateX(260%)}}

/* ZF jChat Stage 1.2 mobile upload status */
.zf-jchat-upload-preview.active{display:flex!important}
.zf-jchat-upload-preview .zf-upload-status{font-size:12px;color:#64748b;font-weight:700;margin-left:auto}
.zf-jchat-upload-link{min-width:32px!important}

/* ZF jChat cleanup: do not control/hide social bottom nav.
   zf-social-system owns the mobile 5-column nav. */
@media (max-width: 900px) {
    body.zf-messenger-open .zf-jchat-fullpage-only,
    body.zf-messenger-open .zf-jchat-embed,
    body.zf-messenger-open .zf-jchat-window {
        max-height: calc(100dvh - 58px) !important;
    }
}
