:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #1d2420;
  --muted: #62716a;
  --line: #dce4dc;
  --accent: #176b5c;
  --accent-strong: #0f4f44;
  --warn: #8a4a16;
  --shadow: 0 18px 60px rgba(31, 47, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 107, 92, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(132, 81, 45, 0.1), transparent 34%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  min-height: calc(100vh - 64px);
  padding: 28px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 228, 220, 0.9);
  box-shadow: var(--shadow);
}

.masthead,
.report-toolbar,
.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.masthead {
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
}

h2 {
  font-size: 1rem;
}

.status-pill {
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.research-form {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

label {
  color: var(--muted);
  font-weight: 700;
}

.input-row {
  align-items: stretch;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(23, 107, 92, 0.2);
  border-color: var(--accent);
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

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

#copy-button {
  min-height: 36px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
}

#copy-button:hover:not(:disabled) {
  color: #fff;
}

.report-panel {
  border: 1px solid var(--line);
  background: #fbfcfa;
}

.report-toolbar {
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

pre {
  min-height: 420px;
  max-height: 68vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: #26312b;
}

.is-error {
  color: var(--warn);
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .masthead,
  .input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    text-align: left;
  }
}
