:root {
  --bg: #f5efe4;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf8;
  --text: #1e1b18;
  --muted: #6c6257;
  --line: rgba(47, 37, 26, 0.12);
  --accent: #b8502c;
  --accent-dark: #7e3219;
  --success: #245c48;
  --danger: #8a2135;
  --shadow: 0 24px 60px rgba(62, 43, 19, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(184, 80, 44, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(36, 92, 72, 0.16), transparent 26%),
    linear-gradient(180deg, #f9f5ec 0%, #f0e7d8 100%);
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

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

.hero {
  padding: 30px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -70px auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(184, 80, 44, 0.22), transparent 65%);
  pointer-events: none;
}

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

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

.hero h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
  max-width: 760px;
}

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

.badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(184, 80, 44, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(184, 80, 44, 0.15);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-actions,
.form-actions,
.response-meta,
.panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 20px;
  justify-content: flex-start;
}

.panel {
  padding: 24px;
  margin-bottom: 20px;
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.toolbar-group {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

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

.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reference-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.reference-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reference-list p + p {
  margin-top: 10px;
}

.chip-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
}

.chip-button.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border-color: transparent;
}

.challenge-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.challenge-card p:last-child {
  margin-bottom: 0;
}

.checklist {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.checklist code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.95em;
}

.request-form,
.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 600;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.panel-copy {
  margin-bottom: 18px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(47, 37, 26, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface-strong);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

textarea {
  min-height: 210px;
  resize: vertical;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(184, 80, 44, 0.58);
  box-shadow: 0 0 0 5px rgba(184, 80, 44, 0.12);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border: 1px solid var(--line);
}

.small-button {
  padding: 10px 14px;
}

.response-panel,
.history-panel {
  animation: riseIn 0.5s ease both;
}

.status-pill,
.time-pill,
.history-method {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.status-pill,
.time-pill {
  background: rgba(47, 37, 26, 0.08);
}

.status-pill.is-filled {
  background: rgba(36, 92, 72, 0.12);
  color: var(--success);
}

.response-block + .response-block {
  margin-top: 18px;
}

.code-block {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: #1f2328;
  color: #f0f6fc;
  min-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.error-box {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(138, 33, 53, 0.1);
  color: var(--danger);
  border: 1px solid rgba(138, 33, 53, 0.18);
}

.hidden {
  display: none;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.history-method {
  background: rgba(184, 80, 44, 0.12);
  color: var(--accent-dark);
}

.history-url,
.empty-state {
  margin: 8px 0 0;
  color: var(--muted);
  word-break: break-all;
}

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

@media (max-width: 860px) {
  .layout {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 20px;
  }

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

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

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

  .hero h1 {
    font-size: 30px;
  }
}
