:root {
  color-scheme: dark;
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.4;
  font-weight: 400;
  background-color: #01030a;
  color: #f8fafc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #0f172a, #020617 60%);
  padding: 2.5rem clamp(1rem, 5vw, 4rem);
  position: relative;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.35), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(236, 72, 153, 0.25), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.2), transparent 50%);
  filter: blur(120px);
  opacity: 0.8;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7dd3fc;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
}

.masthead {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 1.25rem;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(15, 118, 110, 0.3);
  backdrop-filter: blur(12px);
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.4rem;
}

.brand p {
  margin: 0.1rem 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.glyph {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #01030a;
  font-weight: 700;
}

.app {
  max-width: 1200px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: space-between;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 25px 40px rgba(2, 6, 23, 0.6);
}

.hero-copy {
  flex: 1 1 320px;
}

.hero-copy h2 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.sub {
  color: #93c5fd;
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  flex: 1 1 280px;
}

.stat-card {
  border-radius: 1.1rem;
  padding: 1rem;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(15, 23, 42, 0.65);
}

.stat-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  margin-top: 0.35rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(260px, 1fr);
  gap: 1.5rem;
}

.panel {
  background: rgba(15, 23, 42, 0.78);
  border-radius: 1.25rem;
  padding: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 25px 40px rgba(2, 6, 23, 0.6);
}

.panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel header h3,
.panel header h4 {
  margin: 0;
}

#model-select {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: inherit;
  padding: 0.45rem 0.85rem;
  min-width: 180px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.message {
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(14, 116, 144, 0.25);
  border: 1px solid rgba(45, 212, 191, 0.35);
}

.message.ai {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(129, 140, 248, 0.5);
}

.message small {
  display: block;
  opacity: 0.7;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.message .md strong {
  color: #facc15;
}

.message .md h1,
.message .md h2,
.message .md h3 {
  margin: 0.35rem 0;
  font-weight: 600;
}

.message .md h1 {
  font-size: 1.25rem;
}

.message .md h2 {
  font-size: 1.1rem;
}

.message .md h3 {
  font-size: 1rem;
}

.message .md code {
  font-family: "JetBrains Mono", "Space Grotesk", monospace;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.85rem;
  color: #7dd3fc;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

textarea,
input {
  font: inherit;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(2, 6, 23, 0.8);
  color: inherit;
  padding: 0.95rem;
}

textarea {
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.temp-field input {
  padding: 0.4rem 0.7rem;
  text-align: center;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

button {
  font: inherit;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 420px;
  overflow: auto;
}

.history-list li {
  padding: 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.7);
  font-size: 0.9rem;
  color: #cbd5f5;
}

.history-list span {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.models-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  max-height: 360px;
  overflow: auto;
}

.model-pill {
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 0.8rem;
  background: rgba(15, 23, 42, 0.7);
}

.model-pill strong {
  display: block;
  font-size: 0.95rem;
}

.model-pill small {
  color: #94a3b8;
}

.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.endpoint-card {
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(12, 20, 38, 0.9);
}

.endpoint-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.endpoint-url {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  word-break: break-all;
  color: #7dd3fc;
}

.models.wide {
  max-height: none;
}

code {
  font-family: "JetBrains Mono", "Space Grotesk", monospace;
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 1.25rem;
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-log,
  .history-list {
    height: 320px;
  }
}

