:root {
  color-scheme: light dark;
  --fg: #1a1d21;
  --muted: #5c6470;
  --bg: #ffffff;
  --surface: #f4f6f8;
  --border: #d8dee6;
  --accent: #0b57d0;
  --error: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e9ee;
    --muted: #9aa3af;
    --bg: #101418;
    --surface: #1a2026;
    --border: #2c343d;
    --accent: #8ab4f8;
    --error: #f2b8b5;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; text-decoration: none; color: var(--fg); }
nav a { margin-left: 1rem; color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }
main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: 1.6rem; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.15rem; margin-top: 1.75rem; }
a { color: var(--accent); }
.tool-list { list-style: none; padding: 0; }
.tool-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.tool-list li p { margin: 0.15rem 0 0; color: var(--muted); }
.tool-list a { font-weight: 600; text-decoration: none; }
.privacy-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
}
.tool-form .field { margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.3rem; }
.tool-form textarea, .tool-form select {
  width: 100%;
  padding: 0.5rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.tool-form .field:has(input[type="checkbox"]) { flex-direction: row; align-items: center; }
button.run {
  margin-top: 0.5rem;
  padding: 0.5rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
button.run:hover { filter: brightness(1.1); }
.result { margin-top: 1.5rem; }
.result-field h3 { margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--muted); }
.result pre, .tool-form textarea {
  white-space: pre-wrap;
  word-break: break-word;
}
.result pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
}
.result.error h2 { color: var(--error); }
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); }
