/* ==UserStyle==
@name           Cinny misc
@namespace      bkil.hu
@version        2025.6.1
@description    Fixes to UX
@author         bkil
==/UserStyle== */
@-moz-document domain("cinny.envs.net"),
domain("app.cinny.in") {
    /* make dialogs full width */
    .raw-modal {
        --small-modal-width: initial;
        --medium-modal-width: initial;
        --large-modal-width: initial;
    }

    /* place checkbox close to the text */
    .raw-modal .room-selector__content {
        flex: initial;
    }

    /* make italic font work */
    i,
    em {
        font-family: emoji, sans-serif;
    }

    /* highlight message which actions will influence */
    header + div div[style="position: relative;"] div[style^="min-height: 100%; padding: var(--"] [data-message-item] > div:first-child:hover + div,
    .room-view__scrollable [data-message-item] > div:first-child:hover + div {
        outline: auto
    }

    /* make bold text more prominent */
    b {
        font-weight: bold;
    }

    /* eliminate scrollbar */
    pre {
        overflow-wrap: anywhere;
        word-break: break-all;
        white-space: pre-wrap;
    }

    /* protect against Rickroll */
    #root a[target="_blank"]:not([href^="https://matrix.to/"])::after {
      font: initial;
      font-style: italic;
      content: " " attr(href);
    }

    /* show whole image in thumbnail */
    [data-message-item] img[alt][title][tabindex="0"][loading="lazy"] {
      object-fit: contain;
    }

    /* hide invite avatars */
    header ~ div div > span > img[draggable="false"][data-image-loaded][src^="https://"][alt]:not([alt=""]) {
        display: none;
    }

    /* hide incoming invite count */
    #root > div:nth-child(3) > div:first-child > div:first-child > div:nth-child(2) > div:nth-child(2) > div:nth-child(3) > button:first-child + div {
        display: none;
    }

    /* indent threaded replies */
    [data-message-item][data-message-id] > div > div:nth-child(2) > div[style="max-width: 100%;"] > div:first-child + div:not([style]) {
        margin-left: 2em;
    }

    /* suffix bridged nicks */
    div > button[data-user-id^="@_bifrost_"]::after {
        content: " (xmpp)";
        /* disable other usercss */
        --fonty: initial;
    }
    div > button[data-user-id^="@_oftc_"]::after {
        content: " (oftc)";
        /* disable other usercss */
        --fonty: initial;
    }

    /* deemphasize display name changes */
    [data-message-item] {
        padding-top: 0;
        padding-bottom: 0;
    }

    [data-message-item]:not(:hover) > div:not([class]) {
        opacity: 0.3;
    }
}
