/* ──────────────────────────────────────────────────────────────
   Список чатов: шапка, поиск, кнопка создания, список, профиль.
   ────────────────────────────────────────────────────────────── */

.sb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  min-height: 56px;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.sb-brand .brand { font-size: 1.28rem; }

/* индикатор синхронизации — тихий, без технотекста */
/* ── поиск ───────────────────────────────────────────────────── */
.sb-search {
  position: relative;
  margin: 0 12px 8px;
}
.sb-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}
.sb-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid transparent;
  color: var(--text);
  font-size: .92em;
}
.sb-search input::placeholder { color: var(--text-3); }
.sb-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel-3);
}

/* ── кнопка «Новый чат» ──────────────────────────────────────── */
.sb-new {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: .95em;
  text-align: left;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sb-new:hover { background: var(--panel-3); border-color: var(--line-2); }
.sb-new:active { transform: scale(.99); }
.sb-new__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  flex: none;
}
.sb-new__plus svg { width: 13px; height: 13px; }
.sb-new__icon { color: var(--accent); display: flex; }
.sb-new__icon svg { width: 18px; height: 18px; }

/* ── список ──────────────────────────────────────────────────── */
.sb-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 8px 12px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.sb-group {
  padding: 12px 10px 6px;
  font-size: .74em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.chat-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  text-align: left;
  color: var(--text);
  transition: background var(--dur) var(--ease);
  -webkit-user-select: none;
  user-select: none;
}
.chat-item:hover { background: var(--panel-2); }
.chat-item:active { background: var(--panel-3); }

.chat-item[aria-current="true"] {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.chat-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--panel-3);
  border: 1px solid var(--line);
  flex: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chat-item[aria-current="true"] .chat-item__avatar {
  background: var(--panel);
}
.chat-item__avatar svg { width: 20px; height: auto; }

.chat-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 44px;
}

.chat-item__title {
  flex: 1;
  min-width: 0;
  font-size: .95em;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.chat-item[aria-current="true"] .chat-item__title { color: var(--text); }

.chat-item__time {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: .74em;
  line-height: 1;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.chat-item__preview {
  display: block;
  font-size: .84em;
  line-height: 1.35;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item__preview b { font-weight: 600; color: var(--text-2); margin-right: 4px; }

.sb-empty,
.sb-hint {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: .86em;
  line-height: 1.5;
}

/* ── профиль ─────────────────────────────────────────────────── */
.sb-foot {
  flex: none;
  padding: 8px 10px calc(8px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 8px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background var(--dur) var(--ease);
}
.profile-btn:hover { background: var(--panel-2); }
.profile-btn:active { background: var(--panel-3); }
.profile-btn:focus-visible { outline-offset: -3px; outline-width: 1.5px; }

.profile-btn__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .88em;
  color: var(--text);
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  flex: none;
  text-transform: uppercase;
}

.profile-btn__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-btn__name {
  font-size: .92em;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-btn__sub {
  font-size: .78em;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-btn__gear { color: var(--text-3); flex: none; }
.profile-btn__gear svg { width: 18px; height: 18px; }
.profile-btn:hover .profile-btn__gear { color: var(--text-2); }

/* на широком экране список чуть плотнее по краям */
@media (min-width: 861px) {
  .sb-list { padding-left: 8px; padding-right: 8px; }
}
