:root {
  --bg: #071114;
  --bg-alt: #0d1a20;
  --card: rgba(14, 28, 34, 0.82);
  --card-border: rgba(131, 203, 184, 0.25);
  --text: #d8eee7;
  --muted: #99b7af;
  --accent: #8be9c4;
  --accent-strong: #3ce2a0;
  --danger: #ff7d7d;
  --ok: #65f5bf;
  --neutral: #c1d8d1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% -10%, #123338, transparent 45%),
    radial-gradient(circle at 95% 0%, #1d5544, transparent 35%),
    linear-gradient(160deg, var(--bg), var(--bg-alt));
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.32;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, 100% - 2rem);
  margin: 1.2rem auto 2rem;
}

.app-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  margin-bottom: 0.35rem;
}

.subtitle {
  color: var(--muted);
  margin-top: 0.35rem;
}

.quick-links {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.quick-links a {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid rgba(139, 233, 196, 0.35);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.88rem;
}

.quick-links a:hover {
  background: rgba(139, 233, 196, 0.12);
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  padding: 1rem;
}

.connection-bar {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr 1fr auto;
  margin-bottom: 1rem;
}

.card-head {
  margin-bottom: 0.9rem;
}

.card-head p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.card-head .hint {
  margin-top: 0.45rem;
  font-size: 0.8rem;
}

.card-head .hint.ok {
  color: var(--ok);
}

.card-head .hint.error {
  color: var(--danger);
}

label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

label.toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.35rem;
  color: var(--text);
}

input,
select,
textarea,
button {
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid rgba(153, 183, 175, 0.28);
  background: rgba(8, 18, 22, 0.8);
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem 0.72rem;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.field-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.field {
  margin: 0;
}

.meta-line {
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-size: 0.86rem;
}

.button-row {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.btn {
  width: auto;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent-strong), #50d7ff);
  color: #082012;
  border-color: transparent;
  font-weight: 600;
}

.btn.ghost {
  border-color: rgba(139, 233, 196, 0.45);
}

.btn:hover {
  filter: brightness(1.06);
}

.response-wrap {
  margin-top: 0.7rem;
}

.status-pill {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}

.status-pill.neutral {
  color: var(--neutral);
  border-color: rgba(193, 216, 209, 0.35);
}

.status-pill.ok {
  color: var(--ok);
  border-color: rgba(101, 245, 191, 0.45);
}

.status-pill.error {
  color: var(--danger);
  border-color: rgba(255, 125, 125, 0.5);
}

.response-box {
  margin: 0;
  border: 1px solid rgba(139, 233, 196, 0.18);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(7, 14, 18, 0.88);
  max-height: 420px;
  overflow: auto;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none;
}

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

  .connection-bar {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
  }
}
