:root {
  --ink: #132033;
  --muted: #5a6b7d;
  --line: rgba(19, 32, 51, 0.12);
  --accent: #0b6e4f;
  --accent-2: #148f66;
  --surface: rgba(255, 252, 247, 0.88);
  --danger: #9b2c2c;
  --ok: #0b6e4f;
  --shadow: 0 24px 60px rgba(19, 32, 51, 0.12);
  --font: "DM Sans", sans-serif;
  --display: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e8efe9;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, #c8e6d8 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, #f3e2c8 0%, transparent 50%),
    linear-gradient(160deg, #f7faf7 0%, #e4ece7 45%, #d9e5df 100%);
}

.shell {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

.brand { margin-bottom: 2.25rem; animation: rise 0.7s ease both; }
.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.brand h1 span { color: var(--accent); font-style: italic; }
.lead {
  margin: 1rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.nav-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  animation: rise 0.75s ease 0.04s both;
}
.nav-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  padding: 0.65rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.panel { animation: rise 0.8s ease 0.08s both; }
.panel .form h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.hint code {
  font-size: 0.85rem;
  background: rgba(19, 32, 51, 0.06);
  padding: 0.1rem 0.35rem;
}
.muted { color: var(--muted); font-size: 0.8rem; }
.msg { margin: 0.85rem 0 0; font-weight: 600; font-size: 0.92rem; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.cta.secondary {
  margin-top: 0.75rem;
  background: var(--ink);
}

.workspace {
  display: grid;
  gap: 1.25rem;
}

.form, .result {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.1rem; }
.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.field { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.field span { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15);
}

.cta {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.95rem 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.cta:disabled { opacity: 0.65; cursor: wait; transform: none; }

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.result-head h2 { margin: 0; font-size: 1.05rem; }
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border: 1px solid currentColor;
}
.badge.ok { color: var(--ok); }
.badge.err { color: var(--danger); }

pre {
  margin: 0;
  overflow: auto;
  background: #102033;
  color: #e8f0ea;
  padding: 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  min-height: 8rem;
}

.endpoints {
  margin-top: 2rem;
  animation: rise 0.9s ease 0.14s both;
}
.endpoints h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.endpoints code {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 820px) {
  .workspace { grid-template-columns: 1fr 1.1fr; align-items: start; }
}
