:root {
  --bg: #ffffff;
  --fg: #201f1e;
  --muted: #605e5c;
  --accent: #107c41;
  --accent-hover: #0b5e31;
  --border: #e1dfdd;
  --surface: #faf9f8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a19;
    --fg: #f3f2f1;
    --muted: #b3b0ad;
    --accent: #2ea86a;
    --accent-hover: #3fbf7d;
    --border: #3b3a39;
    --surface: #252423;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
}

header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}

section {
  margin-bottom: 20px;
}

button {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 12px;
  font: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

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

button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

input[type="text"] {
  width: 100%;
  padding: 8px;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

pre#output {
  margin: 0;
  padding: 8px;
  min-height: 60px;
  max-height: 200px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

pre#output.error {
  color: #a4262c;
  border-color: #a4262c;
}

#loading {
  padding: 12px;
  color: var(--muted);
}
