* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #020617;
  color: #e5e7eb;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 12px 20px;
  border-bottom: 1px solid #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #020617;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
}

.title {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 16px;
}

.chat-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-inner {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: flex;
  gap: 8px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.msg-user .msg-avatar {
  background: #111827;
  color: #9ca3af;
}

.msg-content {
  flex: 1;
}

.msg-bubble {
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg-user .msg-bubble {
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 16px;
  padding: 10px 14px;
}

.msg-ai .msg-bubble {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
}

.msg-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid #374151;
}

.msg-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  padding: 0 4px;
}

.file-items {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
  padding: 0 4px;
}

.file-item {
  display: inline-block;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 2px 6px;
  margin-right: 4px;
  margin-bottom: 4px;
}

.download-btn {
  margin-top: 8px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 150ms ease;
}

.download-btn:hover {
  background: #2d3748;
  border-color: #4b5563;
}

.input-bar {
  border-top: 1px solid #111827;
  padding: 12px 16px;
  background: #020617;
}

.file-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto 8px;
}

.file-pill {
  font-size: 12px;
  color: #9ca3af;
  background: #111827;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-pill-close {
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
}

.file-pill-close:hover {
  color: #9ca3af;
}

.input-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #020617;
  border: 1px solid #374151;
  border-radius: 999px;
  padding: 8px 12px;
  transition: all 150ms ease;
}

.input-inner:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.chat-input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.5;
  max-height: 160px;
  min-height: 20px;
  font-family: inherit;
}

.chat-input::placeholder {
  color: #6b7280;
}

.attach-btn,
.send-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: all 150ms ease;
  font-size: 16px;
}

.attach-btn:hover {
  color: #e5e7eb;
  background: #1f2937;
}

.send-btn {
  background: #2563eb;
  color: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
}

.send-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.file-input {
  display: none;
}

/* Scrollbar styling */
.chat-container::-webkit-scrollbar {
  width: 8px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* DXF Viewer Styles */
.dxf-viewer-container {
  width: 100%;
  height: 400px;
  background: #0a0f1a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.dxf-viewer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.viewer-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6b7280;
  font-size: 13px;
}

