/* Chat page — conversation list + input bar */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height, 52px) - var(--nav-height, 56px) - 16px);
}

.chat-header-actions {
  padding: 4px 0 8px;
  display: flex;
  gap: 8px;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

/* Conversation card */
.chat-conversation {
  cursor: pointer;
  padding: 12px;
  transition: transform 0.1s;
}
.chat-conversation:active { transform: scale(0.98); }

.chat-conv-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.chat-conv-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.chat-conv-time {
  font-size: 11px;
  color: var(--hint);
  flex-shrink: 0;
}

.chat-conv-preview {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--hint);
  line-height: 1.4;
}
.chat-preview-role {
  flex-shrink: 0;
  font-size: 14px;
}
.chat-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-conv-meta {
  margin-top: 4px;
}
.chat-conv-meta .tg-badge {
  font-size: 10px;
  padding: 2px 6px;
}

/* Input bar fixed at bottom */
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--section-separator-color, #e0e0e0);
  padding-top: 10px;
  margin-top: auto;
}
.chat-input-bar .tg-input {
  flex: 1;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  border: 1px solid var(--section-separator-color, #ddd);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--button-color, var(--primary));
  color: var(--button-text-color, #fff);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.chat-send-btn:not(:disabled):active {
  opacity: 0.8;
}
