body {
  background-color: #f5f7fb;
}

.navbar-brand {
  font-weight: 600;
}

.note-card {
  min-height: 180px;
}

.markdown-preview {
  min-height: 200px;
  background: #fff;
}

.chat-layout {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.chat-history {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e6ef;
  padding: 1.5rem;
  height: 60vh;
  min-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-history::-webkit-scrollbar {
  width: 8px;
}

.chat-history::-webkit-scrollbar-thumb {
  background-color: rgba(13, 110, 253, 0.2);
  border-radius: 8px;
}

.chat-placeholder {
  text-align: center;
  font-size: 0.95rem;
}

.chat-message {
  display: flex;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.chat-message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.chat-message.assistant .avatar {
  background: #f1f3f9;
  color: #0d6efd;
}

.chat-bubble {
  background: #f8f9fb;
  border-radius: 18px;
  padding: 0.85rem 1.1rem;
  max-width: 75%;
  line-height: 1.5;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user .chat-bubble {
  background: #0d6efd;
  color: #fff;
  border-color: #0b5ed7;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-message.assistant .chat-bubble {
  background: #fff;
  border-color: #e5e9f2;
  color: #1f2a37;
}

.chat-bubble :is(p, ul, ol, pre, code) {
  margin-bottom: 0.5rem;
}

.chat-bubble pre {
  background: #f3f5f9;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  overflow-x: auto;
}

.chat-bubble code {
  background: rgba(15, 23, 42, 0.05);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.chat-bubble strong {
  color: inherit;
}

.chat-composer {
  display: flex;
  flex-direction: column;
}

.chat-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cad1e0;
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 80px;
  font-size: 0.95rem;
}

.chat-input:focus {
  border-color: #0d6efd;
  outline: none;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.1);
}

.chat-actions button {
  min-width: 120px;
}

.chat-message.assistant .chat-bubble.is-loading::after {
  content: '…';
  animation: dotBlink 1s infinite steps(3);
  display: inline-block;
  margin-left: 4px;
}

@keyframes dotBlink {
  0% {
    content: '·';
  }
  33% {
    content: '··';
  }
  66% {
    content: '···';
  }
}

body.htmx-loading {
  cursor: progress;
}
