.topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;

    z-index: 20;
    background: var(--bgh);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 1px 4px;
}

.left {
    display: flex;
    align-items: center;
    gap: 35px;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    min-width: 0;
}

.brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 30px;
}

.logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: radial-gradient(90% 100% at 70% 10%, #9cc1ff 0%, #4f83ff 45%, #2e49ff 100%);
}

.logo img {
    width: 20px;
    height: 20px;
}

.menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 1px solid var(--bth);
    border-radius: 10px;
    background: var(--bth);
    color: var(--text);
    cursor: pointer;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border: 1px solid var(--bth);
    border-radius: 10px;
    background: var(--bth);
    color: var(--text);
    cursor: pointer;
}

.menu-toggle:hover,
.icon-btn:hover {
    filter: brightness(1.06)
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Badges & dropdowns */
.badge {
    position: absolute;
    top: -6px;
    right: -18px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    line-height: 16px;
    font-size: 11px;
    text-align: center;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    border: 1px solid #0004;
}

.dd {
    position: relative;
}

.mail .icon-btn,
.bell .icon-btn {
    position: relative;
}

.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 280px;
    max-width: min(92vw, 360px);
    max-height: 60vh;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
}

.dropdown.is-open {
    display: block;
}

.dropdown h4 {
    margin: 6px 8px 8px;
    font-size: 13px;
    align-items: center;

    color: var(--muted);
}

.dropdown .list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown .list li {
    margin: 0;
    padding: 0;
}

.dropdown .item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border-color: var(--bd);
    color: var(--text);
}

.dropdown .item2 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px var(--bd);
    color: var(--text);
}

.dropdown .item:hover {
    border-color: var(--bd);
    background: rgba(255, 255, 255, .02);
    border-radius: 10px;
    border: 1px var(--bd);


}



/* User card */
.avatar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 4px 4px;
    border: 1px solid var(--bth);
    border-radius: 12px;
    background: var(--bth);
    cursor: pointer;
}

.avatar img {
    width: 38px;
    height: 38px;
    gap: 18px;
    border-radius: 999px;
    display: block;
}

.u-name {
    font-size: 13px;
    color: var(--muted);
}

.user-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 4px 0 10px;
    border-bottom: 1px dashed var(--bd);
    margin-bottom: 8px;
}

.user-card .pfp {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    object-fit: cover;
}

.user-card .name {
    font-weight: 600;
}

/* Language */
.lang .avatar {
    padding: 4px 10px;
}

.flag-icon {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

/* Mobile tweaks */
/* Tablet/phone: compact labels, tighter padding */
@media (max-width: 800px) {

    .brand-text,
    .u-name {
        display: none
    }

    /* hide text on smaller screens */
    .topbar-inner {
        padding: 8px 10px;
    }

    /*.dropdown {
        max-width: 94vw;
        position: fixed;
        right: 10;
    }*/
    .dropdown {
        position: absolute;

        min-width: 280px;
        max-width: min(92vw, 360px);
        max-height: 60vh;
        overflow: auto;
        background: var(--card);
        border: 1px solid var(--bd);
        border-radius: 12px;
        box-shadow: var(--shadow);
        padding: 8px;
        display: none;
    }

    .mess {
        position: absolute;
        left: -98px;
        top: calc(100% + 6px);

    }

    .not {
        position: absolute;
        left: -128px;
        top: calc(100% + 6px);

    }

    .u-name {
        display: none
    }

    .lang {
        color: var(--text);

    }

    .menu-toggle {

        width: 38px;
        height: 38px;
        min-width: 38px;

    }

}

/* Phone: slightly larger tap targets only on small screens */
@media (max-width: 600px) {

    .icon-btn,
    .avatar {
        height: 44px;
        /* comfortable tap size */
        min-width: 44px;
    }


}

.icon {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;

    cursor: pointer;
}

.icon_image {
    width: var(--w, 36px);
    height: var(--h, 30px);
    display: inline-block;
    object-fit: contain;
}