body {
  margin: 0;
  font-family: sans-serif;
  background: linear-gradient(135deg, #2a002d, #160027);
  color: white;
  height: 100vh;
  overflow: hidden;
}

.main {
  display: flex;
  height: 100%;
}

.chat {
  width: 50%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #442;
}

.chat-header {
  padding: 12px;
  background: rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.message {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 6px;
  white-space: pre-wrap;
}

.message.user {
  background: #0047ff;
  margin-left: 40px;
}

.message.assistant {
  background: #333;
  margin-right: 40px;
}

.message.system {
  background: #444;
  text-align: center;
  font-size: 13px;
}

.chat-input {
  padding: 8px;
  display: flex;
  gap: 6px;
  background: rgba(0,0,0,0.4);
}

.chat-input input[type=text] {
  flex: 1;
  padding: 8px;
  background: #222;
  border: none;
  color: white;
}

.chat-input button {
  padding: 8px 12px;
  background: #333;
  border: none;
  color: white;
}

.hidden { display: none; }

/* Code panel */

.code-panel {
  width: 50%;
  display: flex;
  flex-direction: column;
}

#code-area {
  flex: 1;
  background: #111;
  color: #0f0;
  padding: 12px;
  border: none;
  resize: none;
}

#preview {
  flex: 1;
  background: white;
  border: none;
}

/* Settings modal */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-inner {
  background: #222;
  padding: 20px;
  width: 320px;
  border-radius: 8px;
}

.modal-inner input {
  width: 100%;
  padding: 6px;
  margin-bottom: 12px;
  background: #111;
  border: none;
  color: white;
}

.modal-inner button {
  width: 100%;
  padding: 8px;
  background: #0047ff;
  border: none;
  margin-bottom: 6px;
}

.close-btn {
  background: #444 !important;
  }
