:root {
  color-scheme: light dark;
  --bg: #f6f6f7;
  --panel: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #ddd;
  --accent: #2e7d32;
  --accent-off: #999;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --panel: #1e2023;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --border: #33363a;
    --accent: #4caf50;
    --accent-off: #555;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 2rem 1.25rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
}
main { width: 100%; max-width: 900px; }
h1 { font-size: 1.35rem; margin: 0 0 0.25rem; }
p.sub { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.9rem; }
p.sub a { color: inherit; }
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field { margin-bottom: 1rem; }
textarea, pre#output {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  resize: vertical;
}
#source { height: 220px; }
#stdin { height: 60px; }
.row { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
button {
  font: inherit;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--panel);
  color: var(--text);
}
#run { background: var(--accent); color: #fff; border-color: var(--accent); }
#run:disabled { background: var(--accent-off); border-color: var(--accent-off); cursor: default; }
#stop:disabled { opacity: 0.4; cursor: default; }
#status { font-size: 0.85rem; color: var(--muted); }
pre#output {
  min-height: 140px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
pre#output.error { color: #d32f2f; }
footer { margin-top: 1.5rem; font-size: 0.8rem; color: var(--muted); }
footer a { color: inherit; }
