.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;      /* не пускаем дочерним элементам «наружу» */
}
.search-wrap {
  flex: 0 0 auto;         /* фиксируем высоту поисковой строки */
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.search{height:40px;background:#223140;border-radius:10px;color:var(--muted);display:flex;align-items:center;gap:10px;padding:0 12px}
.search input{background:none;border:none;outline:none;color:var(--text);width:100%}
.chat-list {
  flex: 1 1 auto;          /* ← ключевое: забирает всё оставшееся место */
  min-height: 0;           /* иначе flex + overflow глючит */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
}
.chat-item{display:grid;grid-template-columns:48px 1fr auto;gap:10px;padding:10px;border-radius:12px;cursor:pointer;align-items:center}
.chat-item:hover{background:#203040}
.chat-item.active{background:#2b5278}
.chat-avatar{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#3e77aa,#77b2ff);font-weight:700;overflow:hidden}
.chat-avatar img{width:100%;height:100%;object-fit:cover}
.chat-meta{min-width:0}
.chat-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-last,.chat-time{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.unread{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#4ea4f6;color:#fff;font-size:12px;display:grid;place-items:center}
.typing{color:#69b7ff}
