:root {
  --bg: #f5efe4;
  --bg-accent: #efe1cb;
  --surface: rgba(255, 250, 241, 0.88);
  --surface-strong: #fff9ef;
  --border: rgba(85, 58, 31, 0.14);
  --text: #2b2017;
  --muted: #715c49;
  --accent: #c7672f;
  --accent-dark: #93451d;
  --success: #2f6b45;
  --error: #9f2e2e;
  --shadow: 0 18px 45px rgba(96, 58, 20, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 210, 158, 0.75), transparent 34%),
    radial-gradient(circle at right center, rgba(209, 128, 74, 0.2), transparent 26%),
    linear-gradient(160deg, #f9f4ea 0%, #f3ebde 45%, #ecdfcb 100%);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.hero h1,
.panel-head h2 {
  margin: 0;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-card,
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-card {
  min-width: 260px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.1rem;
}

.hero-card strong span {
  display: inline;
  color: var(--accent);
}

.workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 22px;
}

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

.panel-head h2 {
  font-size: 1.5rem;
}

.form-sections {
  display: grid;
  gap: 16px;
}

.form-section {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.46);
}

.form-section h3,
.nested-card h4,
.array-card h4 {
  margin: 0 0 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field-input,
.array-input,
textarea {
  width: 100%;
  border: 1px solid rgba(85, 58, 31, 0.18);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field-input,
.array-input {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  min-height: 220px;
  padding: 14px;
  resize: vertical;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
}

.field-input:focus,
.array-input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(199, 103, 47, 0.7);
  box-shadow: 0 0 0 4px rgba(199, 103, 47, 0.12);
  transform: translateY(-1px);
}

textarea[readonly] {
  background: rgba(243, 235, 222, 0.9);
}

.nested-card,
.array-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(244, 231, 213, 0.58);
  border: 1px dashed rgba(113, 92, 73, 0.22);
}

.array-input {
  min-height: 120px;
  resize: vertical;
  font-family: "IBM Plex Mono", monospace;
}

.selection-card,
.gateway-card {
  grid-column: 1 / -1;
}

.checkbox-grid,
.gateway-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(85, 58, 31, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 249, 239, 0.88);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.gateway-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(113, 92, 73, 0.22);
}

.gateway-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar-secondary {
  margin-top: 14px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  color: #fff8f2;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 12px 24px rgba(147, 69, 29, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(147, 69, 29, 0.22);
}

button:active {
  transform: translateY(0);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 248, 239, 0.82);
  border: 1px solid var(--border);
  box-shadow: none;
}

.editor-block {
  display: block;
  margin-top: 8px;
}

.editor-block span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 800;
}

.status-bar {
  margin-top: 16px;
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.status-bar.success {
  color: var(--success);
}

.status-bar.error {
  color: var(--error);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .hero,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel {
    padding: 18px;
  }

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

  .toolbar button,
  .ghost-button {
    width: 100%;
  }
}
