:root {
  --accent: #b3541e;
  --accent-dark: #8a3f15;
  --bg: #faf8f5;
  --panel-bg: #ffffff;
  --border: #ddd6cc;
  --text: #2b2622;
  --text-muted: #6b6259;
  --radius: 8px;
}

* { box-sizing: border-box; }

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

header {
  padding: 1.5rem 1.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

header p {
  color: var(--text-muted);
  margin: 0;
  max-width: 70ch;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

#loading-banner {
  background: #fff3e6;
  border: 1px solid #f0d9bd;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

#loading-banner.hidden,
#app.hidden {
  display: none;
}

#app {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.field {
  margin-bottom: 0.7rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}

.field input:disabled,
.field select:disabled {
  background: #f2efe9;
  color: #999;
}

.radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.radio-row label {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.subfields {
  padding-left: 1.4rem;
  border-left: 2px solid var(--border);
  margin-bottom: 0.75rem;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

button#run-btn {
  background: var(--accent);
  color: #fff;
  width: 100%;
  font-weight: 600;
}

button#run-btn:hover:not(:disabled) { background: var(--accent-dark); }

button#run-btn:disabled {
  background: #cbb8a6;
  cursor: not-allowed;
}

button.secondary {
  background: #efe9e0;
  color: var(--text);
}

button.secondary:hover:not(:disabled) { background: #e3dccf; }

button.secondary:disabled {
  color: #aaa;
  cursor: not-allowed;
}

#report-text {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.82rem;
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

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

.plot {
  flex: 1 1 220px;
  min-width: 220px;
  height: 320px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.status-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.file-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
