/* ============================================================
 * 12-chat-search.css
 * Panel tìm kiếm trong đoạn chat (thanh tìm kiếm, danh sách kết quả, highlight từ khoá).
 * ============================================================ */
/* ===== Search in conversation ===== */
.chat-search-panel {
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    border-bottom: 1px solid var(--hairline);
    background: var(--canvas);
    max-height: 42vh;
}
.chat-search-panel.is-open { display: flex; }
.chat-search-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 6px;
}
.chat-search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--elevated);
    border-radius: 999px;
    padding: 0 12px;
    height: 40px;
    border: 1px solid var(--transparent-border);
}
.chat-search-ico {
    width: 16px;
    height: 16px;
    color: var(--muted);
    flex-shrink: 0;
}
#chatSearchInput {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    height: 100%;
    /* Ẩn nút X native của trình duyệt */
    -webkit-appearance: none;
    appearance: none;
}
#chatSearchInput::-webkit-search-cancel-button,
#chatSearchInput::-webkit-clear-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
#chatSearchInput::placeholder { color: var(--faint); }
.chat-search-close {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1b98e0;
    padding: 6px 4px;
}
.chat-search-status {
    padding: 4px 16px 8px;
    font-size: 12px;
    color: var(--muted);
}
.chat-search-results {
    overflow-y: auto;
    padding: 0 8px 10px;
    max-height: 28vh;
}
.chat-search-item {
    width: 100%;
    text-align: left;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: transparent;
    transition: background .12s ease;
    cursor: pointer;
}
.chat-search-item:hover,
.chat-search-item.is-active { background: var(--elevated); }
.chat-search-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}
.chat-search-item-who {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
}
.chat-search-item-time {
    font-size: 11px;
    color: var(--faint);
    flex-shrink: 0;
}
.chat-search-item-text {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-search-item-text mark {
    background: rgba(27, 152, 224, 0.35);
    color: var(--ink);
    border-radius: 3px;
    padding: 0 2px;
}
.msg-search-hit {
    outline: 2px solid #1b98e0;
    outline-offset: 2px;
    border-radius: 16px;
}