:root {
  --bg: #0b0d14;
  --panel: #141824;
  --panel-border: #242a3a;
  --text: #e7e9f0;
  --muted: #9aa1b5;
  --accent: #7c6bff;
  --accent-2: #4f8cff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, #1b1030 0%, var(--bg) 45%);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  margin-top: 8px;
  font-size: 1.05rem;
}

.intro {
  color: var(--muted);
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.intro-helper {
  color: var(--muted);
  margin: 8px auto 0;
  max-width: 560px;
  font-size: 0.82rem;
  opacity: 0.75;
}

.categories {
  margin: 22px auto 0;
  max-width: 700px;
  text-align: center;
}

.categories h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.categories .pill-row {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

textarea, input[type="text"] {
  width: 100%;
  background: #0f1220;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  margin-top: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: default; }

.answer, .status {
  margin-top: 18px;
  padding: 16px;
  border-radius: 10px;
  background: #0f1220;
  border: 1px solid var(--panel-border);
  min-height: 20px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.answer:empty, .status:empty { display: none; }

.answer a, .status a {
  color: var(--accent-2);
  text-decoration: underline;
  word-break: break-all;
}

.status.success { border-color: #2e7d5b; color: #8ff0c4; }
.status.error { border-color: #7d2e2e; color: #f08f8f; }

.spinner {
  color: var(--muted);
  font-style: italic;
}

.pills:empty { display: none; }

.pill-row {
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 2;
}

.pill-label {
  color: var(--muted);
  margin-right: 4px;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 3px 2px 0;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--panel-border);
}

.pill-category {
  background: rgba(124, 107, 255, 0.15);
  color: #c9c1ff;
  border-color: rgba(124, 107, 255, 0.35);
}

.pill-tag {
  background: rgba(79, 140, 255, 0.12);
  color: #b9d3ff;
  border-color: rgba(79, 140, 255, 0.3);
}
