:root {
  --bg: #f7f5f0;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #5d636b;
  --line: #d9d5cc;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --error: #a33a2b;
  --ok: #2f6b3f;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --panel: #212429;
    --text: #e8e6e1;
    --muted: #a3a8ae;
    --line: #3a3e44;
    --accent: #7fb7a4;
    --accent-text: #10221c;
    --error: #f08a7a;
    --ok: #8fd19e;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 40rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.lead, section > p { color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 1.5rem 0 1rem; border-bottom: 1px solid var(--line); }
nav button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  padding: 0.5rem 0.75rem; font: inherit; cursor: pointer;
}
nav button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
form { display: grid; gap: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-top: 1rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; }
small { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%; font: inherit; padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; resize: vertical; }
button[type="submit"], .button {
  justify-self: start; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 6px;
  padding: 0.6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button:disabled { opacity: 0.6; cursor: progress; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: 0.5rem; }
.choices { display: grid; gap: 0.5rem; }
.choices label { font-weight: 400; display: flex; gap: 0.5rem; align-items: baseline; }
.choices input { width: auto; }
#result { margin-top: 1.5rem; }
#result .error { color: var(--error); }
#result .ok { color: var(--ok); font-weight: 600; }
#result textarea { margin: 0.5rem 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
