:root {
  --bg: #0b1021;
  --card: #0f172a;
  --accent: #7ce7ff;
  --muted: #cdd6f4;
  --text: #f7fbff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(124, 231, 255, 0.12), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.08), transparent 30%),
              var(--bg);
  color: var(--text);
  padding: 32px;
}

.page { max-width: 1100px; margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.hero h1 { margin: 4px 0 8px; font-size: 32px; letter-spacing: -0.5px; }
.hero .lede { color: var(--muted); max-width: 540px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: var(--accent); margin: 0; }
.pill { background: rgba(124, 231, 255, 0.12); border: 1px solid var(--border); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea, button { font-family: inherit; }
input, textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
button {
  background: linear-gradient(120deg, #7ce7ff, #6fd3ff);
  color: #0b1021;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
button:disabled, form.loading button { opacity: 0.6; cursor: wait; }

.instruction-list { margin-top: 16px; display: grid; gap: 12px; max-height: 260px; overflow-y: auto; }
.instruction-list article { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(255, 255, 255, 0.02); position: relative; }
.instruction-list .prompt { margin: 0 0 6px; font-weight: 600; }
.instruction-list .answer { margin: 0; color: var(--muted); font-size: 14px; }
.instruction-list .id { position: absolute; top: 10px; right: 12px; font-size: 12px; color: var(--accent); }

.chat { display: flex; flex-direction: column; gap: 12px; }
.history { flex: 1; min-height: 320px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.bubble { max-width: 80%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.bubble span { font-size: 12px; color: var(--accent); }
.bubble p { margin: 4px 0 0; }
.bubble.user { margin-left: auto; background: rgba(255, 255, 255, 0.04); }
.bubble.bot { background: rgba(124, 231, 255, 0.06); }

.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; }
.chat-form button { min-width: 110px; }

.hint { color: var(--muted); font-size: 13px; margin: 0 4px; }

@media (max-width: 640px) {
  body { padding: 18px; }
  .hero { flex-direction: column; }
  .history { max-height: 320px; }
}
