:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #5c6a62;
  --line: #d8e2dc;
  --surface: #f7faf8;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-ink: #074f49;
  --warm: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 248, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  font-weight: 800;
}

.brand-subtitle,
.eyebrow,
.lead-meta,
.query {
  color: var(--muted);
}

nav {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

main {
  min-height: 100vh;
}

.hero,
.page-title,
.section {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

.hero {
  padding: clamp(56px, 9vw, 110px) 0 48px;
}

.page-title {
  padding: 56px 0 24px;
}

.section {
  padding: 28px 0 52px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.1;
}

h3 {
  margin: 4px 0 8px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.lede,
.page-title p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metrics div,
.condition-card,
.lead {
  background: var(--panel);
}

.metrics div {
  padding: 18px;
}

.metrics strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.metrics span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.condition-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.condition-card {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.condition-card span {
  font-weight: 700;
}

.condition-card strong {
  color: var(--accent-ink);
  font-size: 1.55rem;
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lead p {
  margin: 0;
  color: var(--muted);
}

.lead h3 a {
  text-decoration-color: rgba(15, 118, 110, 0.35);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.source-link {
  align-self: start;
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: none;
}

.empty {
  color: var(--muted);
}

.query {
  margin-top: 10px !important;
  font-size: 0.92rem;
}

.run-summary {
  max-height: 420px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111c18;
  color: #d8f3e9;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .condition-grid,
  .lead {
    grid-template-columns: 1fr;
  }

  .hero,
  .page-title,
  .section {
    width: min(100vw - 28px, 1120px);
  }
}
