:root {
  --bg: #0a0a0b;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f4efe7;
  --muted: #b7ad9f;
  --gold: #d7b46a;
  --gold-soft: rgba(215, 180, 106, 0.16);
  --green: #89d38f;
  --red: #f0887d;
  --neutral: #8b8b96;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(215, 180, 106, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(92, 82, 163, 0.18), transparent 22%),
    linear-gradient(135deg, #090909 0%, #111114 40%, #17141d 100%);
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
}

.hero-card,
.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  position: sticky;
  top: 24px;
  height: fit-content;
}

.hero-badge,
.eyebrow,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
}

.hero-card h1,
.panel-head h2 {
  margin: 10px 0 0;
  font-family: "Prata", serif;
  font-weight: 400;
}

.hero-card h1 { font-size: 42px; line-height: 1.1; }
.hero-copy {
  color: var(--muted);
  line-height: 1.7;
  margin: 18px 0 24px;
}

.hero-meta {
  display: grid;
  gap: 16px;
}

.hero-meta strong,
.meta-card strong { display: block; margin-top: 6px; color: var(--text); }

.workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.panel { padding: 22px; }
.ask-panel { grid-column: 1 / -1; }
.answer-panel { min-height: 320px; }
.citations-panel,
.retrieval-panel { min-height: 260px; }
.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-head.compact { margin-bottom: 14px; }
.input-label { display: block; margin: 16px 0 8px; color: var(--muted); font-size: 13px; }
.text-input,
.query-input,
.small-input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 16px;
  font: inherit;
}
.text-input,
.small-input { padding: 12px 14px; }
.query-input { min-height: 128px; padding: 16px; resize: vertical; line-height: 1.6; }
.text-input:focus,
.query-input:focus,
.small-input:focus { outline: 1px solid rgba(215,180,106,.55); border-color: rgba(215,180,106,.45); }

.controls {
  margin-top: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.topk-wrap { width: 112px; }
.primary-btn,
.ghost-btn,
.sample-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.primary-btn {
  padding: 14px 20px;
  border-radius: 16px;
  color: #111;
  background: linear-gradient(135deg, #f2d38c 0%, #d7b46a 100%);
  font-weight: 700;
}
.ghost-btn {
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
.sample-queries {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sample-chip {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

.status-row { display: flex; gap: 10px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.status-pill.neutral { background: rgba(139,139,150,.16); color: #d4d4da; }
.status-pill.high { background: rgba(137,211,143,.16); color: var(--green); }
.status-pill.medium { background: var(--gold-soft); color: var(--gold); }
.status-pill.low { background: rgba(240,136,125,.16); color: var(--red); }

.answer-body {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  min-height: 180px;
  white-space: pre-wrap;
  line-height: 1.72;
}
.answer-body.empty,
.empty-list { color: var(--muted); }

.meta-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.meta-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
}

.stack-list {
  display: grid;
  gap: 12px;
}
.list-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
}
.list-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.list-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.list-meta {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.code-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

@media (max-width: 1120px) {
  .shell { grid-template-columns: 1fr; }
  .hero-card { position: static; }
  .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 1440px); margin: 10px auto 24px; }
  .hero-card, .panel { border-radius: 20px; }
  .hero-card h1 { font-size: 34px; }
  .controls { flex-direction: column; align-items: stretch; }
  .topk-wrap { width: 100%; }
  .meta-grid { grid-template-columns: 1fr; }
}
