:root {
  --ink: #1c1f1d;
  --muted: #5c645e;
  --paper: #f6f3ec;
  --card: #fffcf6;
  --line: #d8d2c4;
  --nih: #1f4e79;
  --nsf: #8a3b12;
  --accent: #1e4d3a;
  --shadow: 0 10px 30px rgba(28, 31, 29, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  line-height: 1.5;
}
.page { max-width: 880px; margin: 0 auto; padding: 40px 28px 64px; }
.mast { margin-bottom: 28px; }
.brand {
  font-size: 28px;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.tag { color: var(--muted); margin: 8px 0 0; max-width: 62ch; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.label { display: block; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
textarea {
  width: 100%;
  resize: vertical;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: 16px/1.45 "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #fff;
  color: var(--ink);
}
.row { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.grow { flex: 1; }
.btn {
  font: 600 15px/1 "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-radius: 8px;
  border: 1px solid var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  background: #fff;
}
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: 15px/1.4 "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.error { color: #8a1f1f; margin: 12px 0 0; }
.meta { color: var(--muted); font: 14px/1.4 "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif; }
.results-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 16px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px 14px;
  margin: 0 0 14px;
}
.card .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.badge {
  font: 700 11px/1 "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
}
.badge.nih { background: var(--nih); }
.badge.nsf { background: var(--nsf); }
.card h2 { font-size: 19px; margin: 10px 0 8px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; margin: 0 0 10px; font-family: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; }
.facts span { color: var(--muted); display: block; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.why { margin: 0; color: #333; }
.card a { color: var(--accent); font-family: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif; }

.gated { position: relative; margin-top: 8px; }
.gated.locked .gated-body {
  filter: blur(5px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
  max-height: 420px;
  overflow: hidden;
}
.gate {
  display: none;
  position: absolute;
  inset: 12px 0 0;
  align-items: flex-start;
  justify-content: center;
}
.gated.locked .gate { display: flex; }
.gate-card {
  margin-top: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 26px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 360px;
}
.price { font-size: 36px; font-weight: 700; }
.gate-copy { color: var(--muted); font-size: 14px; }

.memo {
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px dashed var(--line);
  background: #fff;
}
.memo h3 { margin: 0 0 8px; }
.memo table { width: 100%; border-collapse: collapse; font-family: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; }
.memo th, .memo td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.memo .actions { margin-top: 14px; }

.foot { margin-top: 36px; color: var(--muted); font-size: 13px; max-width: 72ch; }
.foot a { color: var(--accent); }


.card.slot {
  min-height: 92px;
  background: #f3efe6;
}
.slot-bar {
  height: 10px;
  background: var(--line);
  border-radius: 4px;
  margin: 10px 0;
  width: 86%;
}
.slot-bar.short { width: 54%; }

.gate-honest { font-size: 15px; margin: 10px 0 12px; text-align: left; }
.gate-card form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  text-align: left;
}
.gate-card input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: 15px/1.4 "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #fff;
  color: var(--ink);
}

@media print {
  .mast .tag, #home, .results-head, .gate, #lead-card, #rest-cards, .foot, .memo .actions { display: none !important; }
  .gated.locked .gated-body { filter: none; opacity: 1; max-height: none; }
  .page { padding: 0; }
  .panel { box-shadow: none; border: 0; }
  .memo { display: block !important; border: 0; }
}
