.models_list {
    position: fixed; /* Changed from absolute to fixed */
    display: none;
    z-index: 9999; /* Increased z-index to ensure it stays on top */
    white-space: nowrap;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid #ccc;
    overflow: auto;
    max-width: calc(100vw - 40px); /* Added more margin */
    min-width: 200px;
    left: 0; /* Lock to left edge of container */
    margin-top: 2px;
}

.models_list div {
    padding: 2px;
    overflow: visible; /* Changed from auto to ensure proper rendering */
    max-height: 400px; /* Limit maximum height */
}

.models_list > div > ul {
    padding: 0;
    margin: 0 0 7px 3px;
}

.models_list > div > ul ul {
    padding: 0;
    margin: 0 0 0 30px;
}

.models_list li {
    margin: 0;
    padding: 1px 30px 1px 0;
    font-size: 11px;
    list-style-type: none;
}

.models_list span {
    display: inline-block;
    width: 3px;
    padding: 0 4px;
}

.models_list .tg {
    border: solid 1px #999;
    width: 9px;
    height: 9px;
    color: #777;
    text-align: center;
    line-height: 7px;
    padding: 0;
    cursor: pointer;
}

.models_list a[href="#"].sel, .models_list a[href="#"].sel:hover {
    font-weight: bold;
    color: #fff;
    background-color: #007;
}

.models_list a[href="#"] {
    color: #000;
    display: inline-block;
    padding: 2px 5px;
    margin: -1px 3px;
}

.models_list a:hover {
    color: #000;
    background-color: #bdf;
    border: none;
}