:root {
  --bg: #f4f4ef;
  --panel: #fcfbf6;
  --panel-strong: #fffef9;
  --ink: #161614;
  --muted: #6a675e;
  --line: #d5d1c2;
  --accent: #e58b2a;
  --accent-ink: #2d1700;
  --ok: #2f8f4f;
  --err: #c7392b;
  --shadow: 0 12px 36px rgba(25, 21, 10, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: var(--bg);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% 0%, #ffe5bf 0%, transparent 60%),
    radial-gradient(700px 440px at 95% 12%, #d5f3dc 0%, transparent 55%),
    linear-gradient(160deg, #f4f4ef 0%, #ebe7dd 100%);
  z-index: -1;
}

.app-shell {
  max-width: 1220px;
  margin: 28px auto;
  padding: 0 16px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

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

h1 {
  margin: 3px 0;
  line-height: 1;
  font-size: clamp(22px, 3vw, 34px);
}

h3 {
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.status {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 36%, white);
}

.status.err {
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 36%, white);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel) 0%, #f8f5ee 100%);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel.full-width {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

h2 {
  margin: 0;
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

label {
  display: block;
  margin: 8px 0 6px;
  font-weight: 700;
  font-size: 12px;
  color: #464336;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input,
select,
.code-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus,
.code-box:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, #ffffff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.send-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 140px;
  gap: 8px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 12px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(0.96);
}

.btn-muted {
  background: var(--panel-strong);
  border-color: var(--line);
  color: #464336;
}

.btn-muted:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, white);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.code-box {
  min-height: 180px;
  resize: vertical;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.4;
}

.code-box.small {
  min-height: 110px;
}

.curl-box {
  min-height: 150px;
}

.code-box.invalid {
  border-color: color-mix(in srgb, var(--err) 55%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 18%, transparent);
}

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.field-head label {
  margin: 8px 0 6px;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 36px;
  height: 32px;
  background: var(--panel-strong);
  color: #595548;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, white);
}

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

.validation {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.validation.ok {
  color: var(--ok);
}

.validation.err {
  color: var(--err);
}

.examples {
  margin-top: 4px;
}

code {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 12px;
}

.preview {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf8;
  color: #232116;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.45;
  height: 230px;
  white-space: pre;
  padding: 11px;
  overflow-x: auto;
  overflow-y: auto;
}

.preview.response {
  height: 360px;
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel) 0%, #f8f5ee 100%);
  box-shadow: var(--shadow);
  padding: 14px;
}

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

.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 930px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .send-row {
    grid-template-columns: 1fr;
  }

  .preview,
  .preview.response {
    height: 300px;
  }
}

