/* DealKraft UI – warm, document-inspired */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --border: #e8e4de;
  --text: #1c1917;
  --text-muted: #78716c;
  --accent: #0f766e;
  --accent-hover: #0d5c56;
  --accent-muted: #ccfbf1;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.input-json {
  width: 100%;
  min-height: 180px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}

.input-json::placeholder {
  color: var(--text-muted);
}

.input-json:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.input-text {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}

.input-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hint code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.1em 0.35em;
  background: var(--bg);
  border-radius: 4px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--bg);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

.btn-icon {
  font-size: 1rem;
}

.status {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  min-height: 1.25em;
}

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

.status.loading {
  color: var(--accent);
}

/* Output panel */
.panel-output .output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.panel-output .output-header h2 {
  margin: 0;
}

.output-content {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fefefe;
  padding: 1rem;
  max-height: 70vh;
  overflow: auto;
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-content.reports {
  white-space: normal;
}

.report-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.report-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.report-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
}

.report-block .report-body {
  margin: 0;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 4px;
}
