:root {
  --bg0: #e8efe9;
  --bg1: #f4f7f4;
  --ink: #14201a;
  --muted: #5a6b61;
  --line: #c5d2c8;
  --accent: #0f6b4c;
  --accent-2: #c45c26;
  --surface: rgba(255, 255, 255, 0.72);
  --shadow: 0 1px 0 rgba(20, 32, 26, 0.06);
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Newsreader", "Georgia", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d7e8dc 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e2d4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #eef3ef);
  min-height: 100vh;
  line-height: 1.45;
}

a { color: var(--accent); }
code {
  font-size: 0.9em;
  background: #e2ebe4;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.live-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  margin: 0;
  padding: 0.55rem clamp(1rem, 3vw, 2rem);
  font-size: 0.88rem;
  color: var(--muted);
  background: rgba(15, 107, 76, 0.08);
  border-bottom: 1px solid var(--line);
}
.live-strip strong { color: var(--accent); letter-spacing: 0.02em; }
.live-strip .live-err { color: var(--accent-2); }

.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.55), transparent);
}
.brand-mark {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.brand h1 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
}
.sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-start;
  padding-top: 0.4rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--accent); color: var(--accent); }

main { padding: 0.5rem clamp(1rem, 4vw, 2.5rem) 3rem; max-width: 1200px; }

.section {
  margin-top: 2.25rem;
  padding-top: 0.5rem;
  animation: rise 0.45s ease both;
}
.section:nth-of-type(2) { animation-delay: 0.05s; }
.section:nth-of-type(3) { animation-delay: 0.1s; }
.section:nth-of-type(4) { animation-delay: 0.15s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section h2 {
  font-family: var(--display);
  font-size: 1.65rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.section h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}
.lede { margin: 0 0 1rem; color: var(--muted); max-width: 62ch; }

.section-outreach {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1.5rem;
  background:
    linear-gradient(135deg, rgba(196, 92, 38, 0.07), transparent 40%),
    var(--surface);
  box-shadow: var(--shadow);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.metric {
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.metric .label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.metric .value {
  display: block;
  font-family: var(--display);
  font-size: 1.85rem;
  margin-top: 0.2rem;
  font-weight: 600;
}
.metric .hint { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

.outcomes .pill-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}
.outcomes .pill-row li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(20, 32, 26, 0.03);
}
tr:last-child td { border-bottom: 0; }
.wrap { max-width: 220px; }
.wrap.small { max-width: 280px; font-size: 0.82rem; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.empty { color: var(--muted); padding: 1rem; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e2ebe4;
  color: var(--ink);
  text-transform: lowercase;
}
.badge.outcome { background: #efe4d8; margin-left: 0.25rem; }
.status-draft { background: #e8ece9; }
.status-approved { background: #efe4d8; color: #7a4a12; }
.status-needs_manual { background: #f3e0d8; color: #8a3a12; }
.status-sent { background: #d9e4f2; color: #1a3d6e; }
.status-replied { background: #e5f0d4; color: #3a5a12; }
.status-skipped, .status-queued { background: #eee7e0; }

.fit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 88px;
}
.fit-bar {
  width: 48px;
  height: 6px;
  border-radius: 99px;
  background: #d5ddd7;
  position: relative;
  overflow: hidden;
}
.fit-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct);
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.4s ease;
}

select {
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.25rem 0.35rem;
  background: #fff;
  max-width: 110px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-left: 2px solid var(--line);
  padding-left: 1rem;
  margin-top: 0.75rem;
}
.log-item {
  display: grid;
  grid-template-columns: 11rem 7.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.88rem;
}
.log-item time { color: var(--muted); font-variant-numeric: tabular-nums; }
.replies { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.replies li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.section-questions {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem 1.25rem;
  background:
    linear-gradient(135deg, rgba(15, 107, 76, 0.06), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow);
  margin-top: 1.25rem;
}
.lead-q-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.lead-q {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
}
.lead-q header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.lead-q .question {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}
.lead-q textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  resize: vertical;
  background: #fff;
}
.lead-q button {
  margin-top: 0.45rem;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.lead-q button:hover { filter: brightness(1.05); }

.lead-q-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0.75rem 0 1.25rem;
}
.lead-q {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.lead-q header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.lead-q .question {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 1.05rem;
}
.lead-q textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  background: #fff;
  resize: vertical;
  min-height: 4.5rem;
}
.lead-q button,
.lead-send button {
  margin-top: 0.5rem;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.lead-q button:hover,
.lead-send button:hover { filter: brightness(1.05); }
.lead-send { margin: 0.25rem 0 0.75rem; }

.foot {
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .log-item { grid-template-columns: 1fr; gap: 0.15rem; }
  .wrap, .wrap.small { max-width: 160px; }
}
