* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #262b36;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #6d9bff;
  --user-bg: #1d2b4a;
}

html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--text); }
.auki-name { font-size: 24px; font-weight: 700; letter-spacing: -0.5px;
  background: linear-gradient(90deg, #6d9bff, #b48cff);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.by { font-size: 12px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-right select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font-size: 13px;
}
.topbar-right button {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.topbar-right button:hover { color: var(--text); border-color: var(--accent); }
#account-slot a {
  font-size: 13px; color: var(--accent); text-decoration: none;
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px;
}

/* Chat */
.chat { flex: 1; overflow-y: auto; }
.messages { max-width: 820px; margin: 0 auto; padding: 24px 20px 40px; }

.empty { text-align: center; padding: 12vh 0 0; }
.empty-logo {
  font-size: 56px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(90deg, #6d9bff, #b48cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.empty p { color: var(--muted); margin-bottom: 28px; font-size: 16px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.suggestion {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 20px; padding: 10px 18px; font-size: 14px; cursor: pointer;
}
.suggestion:hover { border-color: var(--accent); }

.msg { display: flex; gap: 14px; margin-bottom: 28px; }
.msg .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.msg.assistant .avatar { background: linear-gradient(135deg, #6d9bff, #b48cff); color: #0f1115; }
.msg.user .avatar { background: var(--user-bg); color: var(--accent); }
.msg .body { flex: 1; min-width: 0; }
.msg .name { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.msg .content { font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-wrap: break-word; }
.msg .content code {
  background: #0d1017; border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; font-family: 'Cascadia Code', Consolas, monospace; font-size: 13px;
}
.msg .content pre {
  background: #0d1017; border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; overflow-x: auto; margin: 10px 0;
}
.msg .content pre code { background: none; border: none; padding: 0; }
.cursor::after {
  content: '▍'; color: var(--accent); animation: blink 0.8s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Composer */
.composer-wrap { padding: 12px 20px 20px; background: linear-gradient(transparent, var(--bg) 30%); }
.composer {
  max-width: 820px; margin: 0 auto;
  display: flex; gap: 10px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1; background: none; border: none; outline: none; resize: none;
  color: var(--text); font-size: 15px; font-family: inherit; max-height: 200px;
}
.composer button {
  width: 40px; height: 40px; border-radius: 10px; border: none;
  background: var(--accent); color: #0f1115; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.composer button:disabled { opacity: 0.4; cursor: default; }
.disclaimer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 8px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 36px; width: min(400px, 90vw); text-align: center;
}
.modal-card h2 { font-size: 22px; margin-bottom: 10px; }
.modal-card p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.modal-btn {
  display: block; background: var(--accent); color: #0f1115; font-weight: 600;
  text-decoration: none; border-radius: 8px; padding: 12px; margin-bottom: 10px;
}
.modal-btn.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); }

@media (max-width: 600px) {
  .topbar { padding: 10px 14px; }
  .by { display: none; }
  .messages { padding: 16px 12px 32px; }
}
