:root {
  --bg: #f3f1ea;
  --paper: #fffdf6;
  --ink: #141414;
  --accent: #d6521e;
  --accent-2: #1f6feb;
  --muted: #646464;
  --border: #171717;
  --ok: #157347;
  --err: #b42318;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", "Avenir Next", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--display);
  color: var(--ink);
  background: radial-gradient(circle at 8% 8%, #ffd9a8 0, #f3f1ea 40%),
    radial-gradient(circle at 92% 2%, #c8dbff 0, transparent 35%),
    linear-gradient(120deg, #f3f1ea 0%, #ece9e2 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: linear-gradient(to right, #000 1px, transparent 1px),
    linear-gradient(to bottom, #000 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.shell {
  width: min(1100px, 92vw);
  margin: 42px auto;
  display: grid;
  gap: 18px;
}

.hero {
  animation: rise 400ms ease-out both;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.subtitle {
  margin: 0;
  color: #3f3f3f;
  max-width: 78ch;
}

.panel {
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: var(--paper);
  box-shadow: 6px 6px 0 #00000024;
  animation: rise 500ms ease both;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font: 500 14px var(--mono);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab,
button {
  border: 2px solid #000;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--display);
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  transition: transform 130ms ease, background-color 130ms ease, color 130ms ease;
}

.tab:hover,
button:hover {
  transform: translateY(-1px);
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.form {
  display: grid;
  gap: 12px;
}

.fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sendBtn {
  background: var(--accent-2);
  color: #fff;
}

.ghost {
  background: #fff;
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badge {
  border: 2px solid #000;
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.idle {
  background: #efefef;
}

.badge.loading {
  background: #ffe082;
}

.badge.success {
  background: #b7f1cc;
  color: #073b19;
}

.badge.error {
  background: #ffd6d6;
  color: #6b0f0f;
}

.visual-result {
  border: 2px solid #000;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffef8 0%, #f6f3eb 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.visual-result.empty {
  color: var(--muted);
  font-weight: 600;
}

.result-title {
  margin: 0;
  font-size: 1rem;
}

.kv-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kv-item {
  border: 2px solid #000;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.kv-key {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.kv-value {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-word;
}

.list-card {
  border: 2px solid #000;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.list-title {
  margin: 0;
  font-size: 15px;
}

.list-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.tag {
  display: inline-block;
  border: 2px solid #000;
  border-radius: 100px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag.ok {
  background: #daf6e6;
}

.tag.err {
  background: #ffe1e1;
}

.note {
  margin: 0;
  font-size: 13px;
  color: #4a4a4a;
}

.error-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 5px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .shell {
    margin: 20px auto;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    border-radius: 14px;
    padding: 14px;
  }

  .tabs {
    gap: 6px;
  }

  .tab,
  button {
    width: 100%;
  }
}
