:root {
  --bg: #ffffff; --fg: #14181f; --muted: #5b6472;
  --line: #e3e7ec; --accent: #2563eb; --soft: #f5f7fa;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f1216; --fg:#e8ebef; --muted:#9aa4b2; --line:#242a33; --accent:#6ea0ff; --soft:#161b22; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 56px 20px 80px; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.25; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 21px; margin: 32px 0 10px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 20px 0 6px; }
.sub { color: var(--muted); margin: 0 0 24px; }
p, li { color: var(--muted); }
a { color: var(--accent); }
label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
textarea, input[type=text], input[type=url], select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--soft); color: var(--fg); font-size: 15px; font-family: inherit;
}
textarea { min-height: 180px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.5; }
input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--soft); color: var(--fg); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 220px; }
button {
  padding: 12px 20px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); font-weight: 500; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
#status { min-height: 24px; color: var(--muted); margin: 12px 0 0; }
#status.err { color: #d1453b; }
pre {
  margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--soft); white-space: pre-wrap; word-wrap: break-word;
  max-height: 50vh; overflow: auto; font-size: 14px; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.content { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 24px; }
.content h2 { font-size: 20px; }
.content h3 { font-size: 16px; }
nav.site { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin-top: 36px; }
nav.site a { text-decoration: none; }
footer { margin-top: 40px; color: var(--muted); font-size: 14px; }

/* Tool directory page */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 14px 0 8px; }
.tool-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--soft); }
.tool-card h3 { margin: 0 0 6px; font-size: 17px; }
.tool-card h3 a { text-decoration: none; }
.tool-card p { margin: 0; font-size: 14px; }
table.limits { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
table.limits th, table.limits td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
table.limits th { background: var(--soft); }
