:root {
  --bg: #0b1220;
  --surface: #111727;
  --surface-2: #141d32;
  --border: #1f2a44;
  --text: #e8edf7;
  --muted: #9aa8c6;
  --accent: #2466f2;
  --accent-hover: #1e55cb;
  --success: #6ab18b;
  --error: #ef6b73;
  --focus: #6d93ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #111b30 0%, var(--bg) 50%);
}

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 18px 48px;
}

.diagnostic-card {
  background: linear-gradient(180deg, rgba(20, 29, 50, 0.97), rgba(17, 23, 39, 0.98));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(1, 10, 24, 0.45);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
}

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

.status-pill {
  border: 1px solid rgba(106, 177, 139, 0.45);
  background: rgba(106, 177, 139, 0.12);
  color: #c8efd8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}

.field-group {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.helper {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1728;
  color: var(--text);
  padding: 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

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

input::placeholder,
textarea::placeholder {
  color: #73809d;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(109, 147, 255, 0.24);
}

button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #f5f9ff;
  background: linear-gradient(180deg, #2d73ff 0%, var(--accent) 90%);
  cursor: pointer;
  transition: transform 90ms ease, filter 120ms ease;
}

button:hover {
  background: linear-gradient(180deg, #2a6bf2 0%, var(--accent-hover) 90%);
  filter: brightness(1.04);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background: #374056;
  color: #9ba6c0;
  cursor: not-allowed;
  filter: none;
}

.output-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(13, 21, 37, 0.85);
  padding: 14px;
  transition: border-color 120ms ease, background 120ms ease;
}

.output-title {
  margin: 0 0 8px;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

#output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.89rem;
  line-height: 1.45;
  max-height: 48vh;
  overflow: auto;
}

.output-panel.is-loading {
  border-color: rgba(36, 102, 242, 0.55);
  background: rgba(11, 30, 65, 0.7);
}

.output-panel.is-success {
  border-color: rgba(106, 177, 139, 0.55);
}

.output-panel.is-error {
  border-color: rgba(239, 107, 115, 0.6);
  background: rgba(71, 24, 30, 0.3);
}

@media (max-width: 720px) {
  .diagnostic-card {
    padding: 18px;
    border-radius: 14px;
  }

  .card-header {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  h1 {
    font-size: 1.55rem;
  }
}
