:root {
  --bg: #f4efe6;
  --surface: rgba(255, 252, 247, 0.92);
  --surface-strong: #fffaf1;
  --text: #1d2b28;
  --muted: #5e6d67;
  --border: rgba(29, 43, 40, 0.12);
  --accent: #1f6a52;
  --accent-strong: #0e4a38;
  --warn: #8f3c2d;
  --shadow: 0 20px 50px rgba(44, 48, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(31, 106, 82, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(143, 60, 45, 0.08), transparent 24%),
    linear-gradient(180deg, #f7f1e7 0%, #efe8dc 100%);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: var(--accent-strong);
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(31, 106, 82, 0.08);
  font-family: "Courier New", monospace;
  font-size: 0.95em;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero,
.grid {
  display: grid;
  gap: 1.25rem;
}

.hero {
  grid-template-columns: 1.4fr 1fr;
  align-items: stretch;
  padding-top: 1rem;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-copy,
.hero-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 2.5rem;
}

.hero-panel,
.panel {
  padding: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 0.9rem;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.button-primary {
  color: #fffaf1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.compact-list,
.link-list,
.pipeline-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.7;
}

.page-header {
  margin-bottom: 1.25rem;
}

.patient-card h2 {
  margin-bottom: 1.2rem;
}

.meta-grid,
.audit-list {
  display: grid;
  gap: 0.9rem;
}

.meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-grid dt,
.audit-list dt {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-grid dd,
.audit-list dd {
  margin: 0;
  word-break: break-word;
}

.callout {
  margin: 1.25rem 0 0;
  padding: 0.95rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0.8rem;
  background: rgba(31, 106, 82, 0.08);
}

.stat-card {
  text-align: center;
}

.stat-label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
}

.stat-value {
  font-size: 2rem;
}

.stat-value.ok {
  color: var(--accent-strong);
}

.stat-value.fail {
  color: var(--warn);
}

.report-layout {
  align-items: start;
}

.report-body {
  background: var(--surface-strong);
}

.report-body p,
.report-body li {
  line-height: 1.7;
}

.safety-banner {
  margin-bottom: 1.25rem;
  border: 1px solid rgba(143, 60, 45, 0.2);
  background: linear-gradient(180deg, rgba(143, 60, 45, 0.08), rgba(255, 252, 247, 0.92));
}

.pill-list,
.record-list {
  margin: 0;
  padding-left: 1.2rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-left: 0;
  list-style: none;
}

.pill-list li {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(143, 60, 45, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.88);
  font-size: 0.95rem;
}

.subpanel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 250, 241, 0.88);
}

.group-block + .group-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.record-list li + li {
  margin-top: 0.85rem;
}

.record-label,
.record-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.record-note {
  margin: 0.2rem 0;
  line-height: 1.6;
}

.trace-summary-grid {
  margin: 1rem 0 1.25rem;
}

.trace-summary-value {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.1;
}

.trace-table-wrap {
  overflow-x: auto;
}

.trace-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 250, 241, 0.82);
}

.trace-table th,
.trace-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.trace-table th {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .hero,
  .two-up,
  .three-up {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 2rem;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }
}
