/**
 * /charts/ chats: compact peer search (login/nick) + keep search visible on wide PC.
 * custom.min.css is missing .cotinder-messages__new-search* (added after last minify),
 * so unstyled avatars/list expand like full cards and the PC nowrap head can clip search.
 * Scoped to #cotinder-charts-page only. Cache-bust: chartschatsearch20260811a
 */
#cotinder-charts-page .cotinder-messages__new-search {
    position: relative;
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 320px;
    box-sizing: border-box;
}

#cotinder-charts-page .cotinder-messages__new-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font: inherit;
}

#cotinder-charts-page .cotinder-messages__new-search-results {
    position: absolute;
    z-index: 60;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#cotinder-charts-page .cotinder-messages__new-search-results > li {
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
    max-width: 100%;
}

#cotinder-charts-page .cotinder-messages__new-search-empty {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.3;
}

#cotinder-charts-page .cotinder-messages__new-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

#cotinder-charts-page .cotinder-messages__new-search-item:hover,
#cotinder-charts-page .cotinder-messages__new-search-item:focus {
    background: #f5f5f5;
    outline: none;
}

#cotinder-charts-page .cotinder-messages__new-search-item > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cotinder-charts-page .cotinder-messages__new-search-avatar {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

/* Kill any leaked .card / .user-slide chrome if markup ever includes it inside search */
#cotinder-charts-page .cotinder-messages__new-search-results .card,
#cotinder-charts-page .cotinder-messages__new-search-results .user-slide,
#cotinder-charts-page .cotinder-messages__new-search-results .profiles-flex,
#cotinder-charts-page .cotinder-messages__new-search-results .profiles-flex__item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

#cotinder-charts-page .cotinder-messages__new-search-results .card img,
#cotinder-charts-page .cotinder-messages__new-search-results .user-slide img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

/* Phone / tablet: full-width compact search under new-chat controls */
@media (max-width: 1199.98px) {
    #cotinder-charts-page .cotinder-messages--split .cotinder-messages__new-search {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: 1 1 auto;
    }

    #cotinder-charts-page .cotinder-messages__new-search-results {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
    }
}

/*
 * PC ≥1200: title on its own row so .cotinder-messages__new keeps full width.
 * Prevents nowrap label+select+search+btn from clipping search at ~1900px
 * when title and controls share one head row.
 */
@media (min-width: 1200px) {
    #cotinder-charts-page .cotinder-messages--split .cotinder-messages__head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    #cotinder-charts-page .cotinder-messages--split .cotinder-messages__title {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    #cotinder-charts-page .cotinder-messages--split .cotinder-messages__new {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    #cotinder-charts-page .cotinder-messages--split .cotinder-messages__new-search {
        display: block;
        visibility: visible;
        opacity: 1;
        flex: 1 1 200px;
        min-width: 180px;
        max-width: 280px;
        overflow: visible;
    }

    #cotinder-charts-page .cotinder-messages--split .cotinder-messages__new-search-input {
        display: block;
        visibility: visible;
        width: 100%;
        min-width: 0;
    }
}
