:root {
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #5b6472;
  --line: #e4e7ec;
  --card: #f7f8fa;
  --accent: #3b5bdb;
  --accent-fg: #ffffff;
  --ok-bg: #e9f7ef; --ok-line: #86d3a6;
  --err-bg: #fdecec; --err-line: #eda3a3;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116; --fg: #e6e8ec; --muted: #9aa4b2; --line: #262b34;
    --card: #171a21; --accent: #5c7cfa; --ok-bg: #12251b; --ok-line: #2f6b46;
    --err-bg: #2a1416; --err-line: #7a3238;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
header.site, footer.site {
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
footer.site { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: 14px; }
.brand { font-weight: 700; font-size: 18px; color: var(--fg); text-decoration: none; }
.tag { color: var(--muted); font-size: 14px; }
main { max-width: 860px; margin: 0 auto; padding: 28px 24px 48px; }
h1 { font-size: 26px; margin: 8px 0 4px; }
h2 { font-size: 19px; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 4px 0 24px; }
a.back { color: var(--accent); text-decoration: none; font-size: 14px; }

.hero { margin: 6px 0 30px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
.intro { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 640px; margin: 0; }
.apis { margin-top: 8px; }
.apis h2 { font-size: 18px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: block; padding: 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--fg); transition: border-color .15s, transform .05s;
}
.card:hover { border-color: var(--accent); }
.card:active { transform: translateY(1px); }
.card h3 { margin: 10px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted);
}
.badge.free-trial { background: var(--ok-bg); color: inherit; border: 1px solid var(--ok-line); }

section.fn {
  margin: 26px 0; padding: 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Checkbox rows: label on the left, box spaced over to the right and aligned
   with every other checkbox on the form. */
.field.check { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.field.check label { margin: 0; }
.field.check input[type=checkbox] { width: 18px; height: 18px; margin-right: 4px; }

/* Swap button injected by app.js between the From and To selects. */
.swap {
  align-self: flex-start;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 32px; margin: -4px 0 12px; padding: 0;
  font-size: 17px; line-height: 1;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.swap:hover { border-color: var(--accent); color: var(--accent); }
select, input[type=text], textarea {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.upload { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
button {
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--accent-fg); background: var(--accent); border: 0; border-radius: 8px;
}
button:hover { filter: brightness(1.06); }

.result { margin-top: 16px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); }
.result.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.result.error { background: var(--err-bg); border-color: var(--err-line); }
.result h4 { margin: 0 0 8px; font-size: 14px; }
.result pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
