:root {
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
}

body {
  max-width: 760px;
  padding: 0 1rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

textarea {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  box-sizing: border-box;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 87, 238, 0.1);
}

.button-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--primary-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-secondary:hover:not(:disabled) {
  background: var(--bg-muted);
}

.pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  background: var(--bg-muted);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.pill .pill-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  display: block;
  margin-bottom: 0.125rem;
}

.pill .pill-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pill.fired {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.pill.errored {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

pre.log {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
}

.log .ts {
  color: #94a3b8;
}

.log .ev-global {
  color: #fcd34d;
}

.log .ev-callback {
  color: #93c5fd;
}

.log .ev-data {
  color: #cbd5e1;
}

dl.reference {
  margin: 0;
}

dl.reference dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.5rem;
}

dl.reference dt:first-child {
  margin-top: 0;
}

dl.reference dd {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
