:root {
  --bg: #f3f0e8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: rgba(77, 63, 45, 0.06);
  --text: #1e1b16;
  --muted: #6d655b;
  --border: rgba(77, 63, 45, 0.14);
  --accent: #0b5d4b;
  --accent-strong: #084436;
  --accent-soft: rgba(11, 93, 75, 0.1);
  --danger: #a63d40;
  --shadow: 0 24px 60px rgba(41, 30, 18, 0.10);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(160deg, #ece6da 0%, #f7f4ed 45%, #ebe4d8 100%);
}

body {
  padding: 28px;
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
}

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

.is-hidden {
  display: none !important;
}

.hero h1,
.result-header h2 {
  margin: 6px 0 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.04em;
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(420px, 1fr);
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.form-panel,
.result-panel {
  padding: 24px;
}

.field-group + .field-group {
  margin-top: 22px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

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

.text-input {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 16px 18px;
  font: inherit;
  line-height: 1.55;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.text-input:focus,
.dropzone:hover,
.dropzone.is-dragover {
  border-color: rgba(11, 93, 75, 0.42);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  border: 1px dashed rgba(11, 93, 75, 0.28);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 245, 240, 0.84)),
    repeating-linear-gradient(
      135deg,
      rgba(11, 93, 75, 0.03),
      rgba(11, 93, 75, 0.03) 14px,
      transparent 14px,
      transparent 28px
    );
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dropzone input {
  display: none;
}

.dropzone-title {
  font-weight: 700;
}

.dropzone-note {
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid rgba(77, 63, 45, 0.1);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.primary-button,
.secondary-button,
.ghost-button,
.status {
  border-radius: 999px;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.status:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.primary-button {
  flex: 1;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-weight: 700;
}

.secondary-button,
.ghost-button,
.status {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
}

.secondary-button {
  padding: 14px 18px;
}

.ghost-button {
  padding: 8px 12px;
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c7b8a0;
  box-shadow: 0 0 0 6px rgba(199, 184, 160, 0.16);
}

.status.is-ok .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(11, 93, 75, 0.16);
}

.status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(166, 61, 64, 0.14);
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid rgba(77, 63, 45, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.meta-chip.is-success {
  background: rgba(11, 93, 75, 0.1);
  color: var(--accent-strong);
}

.meta-chip.is-error {
  background: rgba(166, 61, 64, 0.1);
  color: var(--danger);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 241, 233, 0.9));
  border: 1px solid rgba(77, 63, 45, 0.1);
}

.summary-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-value {
  font-size: 15px;
  line-height: 1.45;
}

.response-view {
  margin: 0;
  min-height: 420px;
  overflow: auto;
  border-radius: var(--radius-md);
  background: #171512;
  color: #f8f2e8;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 18px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  body {
    padding: 16px;
  }

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

  .result-header,
  .hero {
    flex-direction: column;
  }

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