:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5b6577;
  --line: #d9dfeb;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #059669;
  --orange: #d97706;
  --shadow: 0 10px 30px rgba(20, 32, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 40px 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.status-pill,
.risk {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.4fr);
  gap: 20px;
  padding: 12px 40px 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel,
.json-panel {
  padding: 20px;
}

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

textarea {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.6;
}

textarea:focus {
  border-color: var(--blue);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) {
  background: var(--blue-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

button.secondary:hover {
  background: #f8fafc;
}

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

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

.result-grid article,
.reply-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
}

dl {
  display: grid;
  grid-template-columns: minmax(96px, 0.6fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin: 0;
  font-size: 14px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  word-break: break-word;
}

ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.reply-card {
  margin-top: 14px;
}

.reply-card h4 {
  margin-bottom: 8px;
}

.reply-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.json-panel {
  margin: 0 40px 40px;
}

pre {
  overflow: auto;
  min-height: 180px;
  max-height: 360px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #0f172a;
  color: #dbeafe;
  line-height: 1.5;
}

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

.warn {
  color: var(--orange);
}

@media (max-width: 920px) {
  .app-header,
  .workspace,
  .json-panel {
    margin: 0;
    padding-left: 18px;
    padding-right: 18px;
  }

  .workspace,
  .result-grid {
    grid-template-columns: 1fr;
  }

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

