/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f7768e, #ff9e64);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(247, 118, 142, 0.3);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .nick {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-text {
  font-size: 0.6875rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  flex-shrink: 0;
}

/* ─── Channel list ───────────────────────────────────────────── */
.sidebar-channels {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.network-group { margin-bottom: 1rem; }

.network-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-height: var(--touch-target);
}
.network-label:active { background: var(--bg-surface-hover); }
.network-label-active { background: rgba(122, 162, 247, 0.08); }
.network-label-active .network-name { color: var(--accent); }

.network-icon {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #73daca, #7aa2f7);
}
.network-name {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.network-chevron {
  color: var(--text-faint);
  font-size: 0.625rem;
  flex-shrink: 0;
}

.channel-list { padding-left: 0.25rem; margin-top: 0.25rem; }

.channel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem 0.375rem 1.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  min-height: var(--touch-target);
}
.channel:active { background: var(--bg-surface-hover); }
.channel.active {
  background: var(--bg-surface-active);
  border-color: var(--border-active);
}
.channel.active .ch-name { color: var(--accent); font-weight: 500; }

.ch-hash {
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.channel.active .ch-hash { color: rgba(122, 162, 247, 0.5); }

.ch-name {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 1.125rem;
  text-align: center;
  flex-shrink: 0;
}
.ch-unread .ch-name { color: var(--text-primary); font-weight: 500; }

.ch-close {
  color: var(--text-faint);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  opacity: 0;
  flex-shrink: 0;
  border: none;
  background: none;
}
.channel:hover .ch-close { opacity: 1; }
.ch-close:active { color: var(--red); background: rgba(247, 118, 142, 0.1); }

/* ─── Sidebar footer ─────────────────────────────────────────── */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.sidebar-footer-btn {
  flex: 1;
  padding: 0.375rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-ui);
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-footer-btn:active { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }

/* ─── Touch: hide close buttons on mobile ────────────────────── */
@media (max-width: 639px) {
  .ch-close { display: none; }
}
