/* NABGOL V48 — version navigation, desktop and mobile */

/* appendMessage creates this node for every bubble; hide it by default. */
body:is(.desktop-chat,.mobile-chat) .version-controls{
    display:none!important;
}

/* Only a real assistant response with versions may show navigation. */
body:is(.desktop-chat,.mobile-chat)
.message.assistant[data-versions]
.version-controls.show{
    display:flex!important;
    direction:rtl!important;
    align-items:center!important;
    justify-content:center!important;
    width:max-content!important;
    max-width:100%!important;
    margin:6px auto 0!important;
    padding:0!important;
    gap:.3em!important;
}

/* Visual order: previous — version X of Y — next */
body:is(.desktop-chat,.mobile-chat)
.version-controls.show .prev-version{
    order:1!important;
}

body:is(.desktop-chat,.mobile-chat)
.version-controls.show .version-badge{
    order:2!important;
    flex:0 0 auto!important;
    white-space:nowrap!important;
    margin:0!important;
    padding:0!important;
}

body:is(.desktop-chat,.mobile-chat)
.version-controls.show .next-version{
    order:3!important;
}

body:is(.desktop-chat,.mobile-chat)
.version-controls.show button{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:2px!important;
    white-space:nowrap!important;
}

/* Never show navigation below user or single-version messages. */
body:is(.desktop-chat,.mobile-chat)
.message:not(.assistant[data-versions])
.version-controls{
    display:none!important;
}