.chat-card {
  position: relative;
  overflow: hidden;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-head-actions > button {
  border: 1px solid var(--line);
  background: #f8faf9;
  color: #52605a;
  border-radius: 9px;
  padding: 7px 9px;
  font: 10px inherit;
  cursor: pointer;
}

.chat-head-actions > button:hover {
  border-color: var(--green);
  color: var(--deep);
}

#historyCount {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--soft);
  color: #258156;
  font-size: 8px;
}

.history-panel {
  position: absolute;
  z-index: 5;
  top: 78px;
  right: 0;
  bottom: 0;
  width: min(360px, 88%);
  background: #fbfdfc;
  border-left: 1px solid var(--line);
  box-shadow: -12px 16px 34px #173d2e1c;
  transition: transform .2s ease, opacity .2s ease;
}

.history-panel.hidden {
  display: block;
  transform: translateX(102%);
  opacity: 0;
  pointer-events: none;
}

.history-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.history-panel-head b,
.history-panel-head small,
.conversation-item b,
.conversation-item span,
.conversation-item small {
  display: block;
}

.history-panel-head b { font-size: 13px; }
.history-panel-head small { margin-top: 4px; font-size: 9px; color: var(--muted); }
.history-panel-head button { border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.conversation-list { height: calc(100% - 66px); overflow: auto; padding: 10px; }
.conversation-item { display: block; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 11px; padding: 11px; text-align: left; font-family: inherit; cursor: pointer; }
.conversation-item:hover,
.conversation-item.active { background: white; border-color: var(--line); box-shadow: 0 3px 14px #243a300d; }
.conversation-item b { font-size: 11px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item span { margin: 4px 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item small { font-size: 8px; color: #96a19b; }

@media (max-width: 600px) {
  .chat-card .card-head { align-items: flex-start; gap: 10px; }
  .chat-head-actions { flex-wrap: wrap; justify-content: flex-end; }
  .chat-head-actions .live { display: none; }
  .history-panel { top: 96px; width: 94%; }
}
