* {
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}

body {
  margin: 0;
  background: #0f1117;
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 100vh;
}

.app {
  width: 100%;
  max-width: 420px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #1f2937;
}

.header h1 {
  margin: 0;
  font-size: 20px;
}

.header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.header button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
}

/* Chat */
.chat-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.message {
  max-width: 75%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  line-height: 1.4;
  font-size: 14px;
  overflow-wrap: break-word;
}

.message.user {
  background: #2563eb;
  margin-left: auto;
  color: white;
}

.message.bot {
  background: #1f2937;
}

.message.system {
  background: #111827;
  color: #9ca3af;
  text-align: center;
  max-width: 100%;
}

/* Input bar */
.input-bar {
  display: flex;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #1f2937;
  gap: 8px;
}

.input-bar input {
  flex: 1;
  background: #111827;
  border: 1px solid #1f2937;
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
  min-width: 0;
}

.input-bar button {
  background: #2563eb;
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.upload-btn {
  background: #111827;
  border: 1px solid #1f2937;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* Info */
.info {
  font-size: 12px;
  text-align: center;
  padding: 6px;
  color: #9ca3af;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #1f2937;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.citations {
  margin: 6px 0 16px 0;
  padding-left: 10px;
  border-left: 2px solid #1f2937;
}

.citations-title {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.citation-item {
  font-size: 12px;
  color: #d1d5db;
  margin-bottom: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
