:root {
  --bg: #0b0f16;
  --panel: #141b26;
  --line: #243247;
  --text: #ebf1ff;
  --muted: #9eb0ce;
  --accent: #75b1ff;
  --accent-2: #a7ffd3;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Manrope, system-ui, sans-serif;
  background: radial-gradient(circle at top left, #1b2740, #0b0f16 50%);
  color: var(--text);
}

.layout {
  width: min(1200px, calc(100% - 24px));
  margin: 18px auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.panel {
  background: rgba(20, 27, 38, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.roles p { color: var(--muted); }
.role-list { display: grid; gap: 8px; margin-bottom: 12px; }
.role {
  border: 1px solid var(--line);
  background: #111826;
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}
.role.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #081221;
  border-color: transparent;
}

label { display: block; margin: 8px 0 5px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d1522;
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
#status { color: #ffbf80; }

.messages {
  min-height: 460px;
  max-height: 66vh;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.bubble {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  white-space: pre-wrap;
}
.bubble.user { background: #132238; }
.bubble.ai { background: #172432; }
.bubble small { display: block; color: var(--muted); margin-bottom: 6px; }

.composer {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
button[type='submit'] {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #071a2c;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
}
