:root {
  --bg: #0b1020;
  --panel: #121a31;
  --panel-2: #17213d;
  --line: #273357;
  --text: #edf2ff;
  --muted: #9db0e0;
  --accent: #6ea8fe;
  --accent-2: #4b8bff;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #09101f 0%, #0f1730 100%);
}
button, input, textarea {
  font: inherit;
}
button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}
button.primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #0d1530;
  color: var(--text);
}
textarea { min-height: 100px; resize: vertical; }
.hidden { display: none !important; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.box { background: #0d1530; padding: 12px; border-radius: 12px; }
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px;
  background: rgba(7, 12, 25, 0.65);
  backdrop-filter: blur(10px);
}
.brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.user-panel {
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 12px;
}
.session-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.session-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}
.session-item.active {
  outline: 2px solid var(--accent);
}
.main {
  padding: 20px;
}
.card {
  max-width: 520px;
  margin: 40px auto;
  border: 1px solid var(--line);
  background: rgba(18, 26, 49, .9);
  border-radius: 20px;
  padding: 20px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tab.active { background: var(--accent-2); }
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-section {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(100vh - 40px);
  gap: 14px;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 26, 49, .9);
}
.chat-title {
  font-size: 22px;
  font-weight: 700;
}
.messages {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(11, 16, 32, .75);
}
.msg {
  max-width: 900px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  line-height: 1.6;
}
.msg.user {
  margin-left: auto;
  background: #18305f;
}
.msg.model {
  background: var(--panel);
}
.composer {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(18, 26, 49, .9);
}
.composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-section { height: auto; }
}
