html { -webkit-font-smoothing: antialiased; }

.msg-content p { margin: 0.5rem 0; }
.msg-content p:first-child { margin-top: 0; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content ul, .msg-content ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.msg-content li { margin: 0.25rem 0; }
.msg-content code {
  background: rgba(0,0,0,0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.msg-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85em;
  margin: 0.5rem 0;
}
.msg-content pre code { background: none; padding: 0; color: inherit; }
.msg-content strong { font-weight: 600; }
.msg-content a { color: #4f46e5; text-decoration: underline; }
.msg-content h3 { font-size: 1rem; font-weight: 600; margin: 0.75rem 0 0.5rem; }

.tool-call {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.78em;
  color: #475569;
}
.tool-call strong { color: #0f172a; font-weight: 600; }

/* user-message: align text-left inside the bubble even when bubble is right-aligned */
.user-bubble { text-align: left; }

/* Subtle slide-up + fade on each new chat message and typing indicator. */
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-row { animation: msg-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* Three-dot typing indicator. */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #94a3b8;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

/* Pill-shaped chat composer. */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border: 1px solid rgb(226 232 240);
  border-radius: 22px;
  padding: 6px 6px 6px 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.composer:focus-within {
  border-color: rgb(99 102 241);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.composer-textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 8px 0;
  max-height: 200px;
  color: rgb(15 23 42);
}
.composer-textarea::placeholder { color: rgb(148 163 184); }
.composer-send {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgb(15 23 42);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 140ms ease, transform 100ms ease, opacity 140ms ease;
}
.composer-send:not(:disabled):hover { background: rgb(30 41 59); }
.composer-send:not(:disabled):active { transform: scale(0.94); }
.composer-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* Sidebar conversation row */
.conv-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 140ms ease;
}
.conv-item:hover { background: rgb(241 245 249); }
.conv-item.active { background: rgb(226 232 240); }
.conv-item .conv-title {
  font-size: 0.875rem;
  color: rgb(51 65 85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-item.active .conv-title { color: rgb(15 23 42); font-weight: 500; }
.conv-item .conv-time {
  font-size: 11px;
  color: rgb(148 163 184);
  margin-top: 1px;
}

/* Shimmer skeleton, used while messages / dashboard data are loading. */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background-color: rgb(241 245 249);
  background-image: linear-gradient(
    90deg,
    rgba(241, 245, 249, 0) 0%,
    rgba(226, 232, 240, 0.9) 50%,
    rgba(241, 245, 249, 0) 100%
  );
  background-size: 400px 100%;
  background-repeat: no-repeat;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 8px;
}
.skeleton-block { display: block; }
