:root {
  --bg: #f4f1ea;
  --ink: #1d1a16;
  --muted: #6b6459;
  --line: #d9d2c5;
  --card: #fbfaf6;
  --accent: #b4502e;
  --accent-soft: #e9d9cf;
  --pos: #3f7d4e;
  --mix: #b08327;
  --neg: #b03b3b;
  --shadow: 0 1px 2px rgba(29, 26, 22, 0.06), 0 8px 24px rgba(29, 26, 22, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* --- Masthead --- */
.masthead { margin-bottom: 36px; }
.eyebrow {
  font-family: ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.02;
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.lede {
  font-size: 20px;
  max-width: 60ch;
  margin: 0 0 18px;
  color: #38332c;
}
.access {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  background: var(--accent-soft);
  border: 1px solid #ddc6ba;
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 60ch;
  margin: 0;
}
.access a { color: var(--accent); }

/* --- Form panel --- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
form { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1 1 240px; }
.label {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.label em { color: var(--muted); font-weight: 400; font-style: normal; }

textarea, input, select {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 80, 46, 0.14);
}

button {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover { background: #9d4427; }
button:active { transform: translateY(1px); }
button:disabled { background: #b9b1a4; cursor: progress; }

.error {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--neg);
  margin: 0;
}

/* --- Results --- */
.results { margin-top: 40px; }
.status {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
}
.status::before { content: "● "; color: var(--accent); }

.aggregate { display: flex; gap: 16px; margin: 8px 0 24px; flex-wrap: wrap; }
.metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 160px;
}
.metric-value { display: block; font-size: 30px; font-weight: 600; }
.metric-label {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.persona {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.persona h3 { margin: 0 0 2px; font-size: 18px; }
.persona .who {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.persona .bio {
  font-size: 14px;
  color: #423d35;
  margin: 0 0 14px;
}

.reaction { border-top: 1px dashed var(--line); padding-top: 12px; }
.reaction.loading {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.gut {
  font-size: 15px;
  font-style: italic;
  margin: 0 0 10px;
}
.rline {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  margin: 4px 0;
}
.rline b { color: var(--muted); font-weight: 600; }

.meta { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.tag {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
}
.tag.positive { background: #dfeede; color: var(--pos); }
.tag.mixed { background: #f3e8c9; color: var(--mix); }
.tag.negative { background: #f3dada; color: var(--neg); }
.intent {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
}

/* --- Verdict --- */
.verdict {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}
.verdict h2 { margin: 0 0 10px; font-size: 24px; }
.verdict-text { font-size: 18px; margin: 0 0 18px; }
.cols { display: flex; gap: 28px; flex-wrap: wrap; }
.cols > div { flex: 1 1 240px; }
.verdict h3 {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 18px 0 8px;
}
.verdict ul { margin: 0; padding-left: 18px; }
.verdict li { font-size: 15px; margin: 6px 0; }
.confidence {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}

.credits {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}

.foot {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  max-width: 60ch;
}
