.text-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.icon-wrapper {
    width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.text-link .text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
}

@media (max-width: 576px) {
    body {
        padding-top: 110px;
    }
    body,
    html {
        overflow-x: hidden;
        width: 100%;
    }

    #header,
    #top-bar,
    .navmenu {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .navmenu ul {
        padding-left: 0;
    }

    .navmenu ul li {
        white-space: nowrap;
    }

    .topbar-flex-wrap {
        display: flex !important;
    }

    #top-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 9999;
        height: 50px;
    }

    #header {
        position: fixed;
        top: 10px;
        left: 0;
        width: 100%;
        z-index: 9998;
    }

    #header.logo-scroll {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        z-index: 1050;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        padding: 0;
    }

    #header.logo-scroll .logo img {
        height: 50px;
        width: auto;
        margin-bottom: 10px;
        object-fit: contain;
        display: block;
    }

    #top-bar,
    .navmenu {
        z-index: 720;
    }

    body.mobile-nav-active #top-bar {
        display: none !important;
    }
}

@media (max-width: 576px) {
    #chat .d-flex.flex-nowrap {
        flex-wrap: wrap !important; /* allow wrapping */
        justify-content: center !important; /* center buttons on small screens */
        gap: 6px !important;
        overflow: hidden !important; /* prevent horizontal scroll */
    }

    #chat .d-flex.flex-nowrap > a.btn {
        flex: 1 1 100%;
        max-width: 100%;
        font-size: 12px;
        padding-top: 6px;
        padding-bottom: 6px;
        white-space: nowrap;
        text-align: center;
    }

    #chat .d-flex.flex-nowrap > a.btn i {
        margin-right: 4px;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    #chat .d-flex.flex-nowrap {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    #chat .d-flex.flex-nowrap > a.btn {
        flex: 1 1 calc(33.33% - 8px); /* 3 buttons per row */
        max-width: calc(33.33% - 8px);
        font-size: 13px;
    }
}
