:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --acc: #4f46e5;
  --acc-ink: #ffffff;
  --acc-soft: #eef2ff;
  --acc-border: #c7d2fe;
  --ok: #15803d;
  --bad: #b91c1c;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --max: 920px;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 17px/1.6 var(--serif);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--acc); }
a:hover { color: #3730a3; }

.site-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-top-inner,
header,
main,
footer,
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.15rem;
}

.site-top-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  font-size: 0.98rem;
}
.brand span { color: var(--acc); }

.nav {
  font-family: var(--sans);
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav a:hover { color: var(--ink); }

.hero {
  display: block;
  padding: 1.75rem 0 0.5rem;
  max-width: 40rem;
}

.kicker {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  line-height: 1.2;
  margin: 0.15rem 0 0.65rem;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.lede {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.muted { color: var(--muted); }

h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}

section { margin: 2rem 0; }

main > p,
main > ul {
  max-width: 42rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--acc-border); }
.card h2 {
  margin: 0.1rem 0 0.35rem;
  font-size: 1.15rem;
  font-family: var(--sans);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--sans);
}
.card a {
  text-decoration: none;
  color: var(--ink);
}
.card a:hover { color: var(--acc); }

.soon {
  opacity: 0.55;
  pointer-events: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.75rem;
  font-family: var(--sans);
}

button {
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
button.primary {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-ink);
  font-weight: 600;
}
button.primary:hover {
  background: #4338ca;
  border-color: #4338ca;
  color: var(--acc-ink);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

textarea,
pre.out,
input,
select {
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 13px/1.45 var(--mono);
}

textarea {
  width: 100%;
  min-height: 280px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
}
textarea:focus,
input:focus,
select:focus {
  outline: 2px solid var(--acc-border);
  outline-offset: 1px;
  border-color: var(--acc);
}

pre.out {
  width: 100%;
  min-height: 140px;
  padding: 0.9rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  box-shadow: var(--shadow);
}

input,
select {
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: 13px/1.4 var(--mono);
}

label.field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--sans);
}

.status {
  min-height: 1.4em;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.5rem 0 1.25rem;
  font-family: var(--sans);
}
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .cols { grid-template-columns: 1fr 1fr; }
}

.panel h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--sans);
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--sans);
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.8rem 1rem;
  margin: 0.5rem 0;
  font-family: var(--sans);
}
.faq details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}
.faq details p {
  color: var(--muted);
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.preview-wrap {
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  margin: 0 0 1.25rem;
}
table.preview {
  border-collapse: collapse;
  width: 100%;
  font: 12px/1.4 var(--mono);
}
table.preview th,
table.preview td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
  text-align: left;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.preview th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 600;
}
table.preview td { color: var(--muted); }

footer {
  max-width: var(--max);
  margin: 2.5rem auto 1.5rem;
  padding: 1.2rem 1.15rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
}
footer a {
  color: var(--muted);
  text-decoration: none;
}
footer a:hover { color: var(--ink); }
footer p {
  margin: 0.55rem 0 0;
}

@media (max-width: 640px) {
  .nav a:nth-child(n+3) { display: none; }
}
