:root {
  --primary: #5b4bdb;
  --secondary: #7c3aed;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
}

* { 
  box-sizing: border-box; 
  font-family: 'Inter', system-ui, sans-serif; 
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  height: 100vh;
}

/* CHAT STYLES */
.chat {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.chat-box {
  flex: 1;
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  overflow-y: auto;
  margin-bottom: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.msg {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.5;
}

.msg.ai {
  background: #eef2ff;
  border-left: 4px solid var(--primary);
}

.msg.user {
  background: #e5e7eb;
  border-right: 4px solid var(--secondary);
  text-align: right;
}

.input-area {
  display: flex;
  gap: 8px;
  align-items: center;
}

input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  transition: border 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
}

button.send {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

button.send:hover {
  background: var(--secondary);
}

/* PREVIEW STYLES */
.preview {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.preview-header strong {
  font-size: 18px;
}

.preview-header button {
  padding: 6px 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview iframe {
  width: 100%;
  height: calc(100% - 40px);
  border-radius: 10px;
  border: 1px solid #ddd;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 260px 1fr;
  }
  .preview {
    display: none;
  }
}