:root {
  --ink: #1c1915;
  --muted: #5f584e;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e3dacb;
  --pine: #1d6b4f;
  --pine-dark: #114833;
  --brass: #8a5524;
  --danger: #8d2f2f;
  --shadow: 0 18px 50px rgba(48, 36, 18, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(29, 107, 79, 0.08), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
}

a { color: var(--pine-dark); }

.shell { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.nav { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.nav a, .nav button.linkish { color: var(--ink); text-decoration: none; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.hero { padding: 4.5rem 0 3rem; max-width: 40rem; }
.hero h1 { font-family: var(--serif); font-size: clamp(3rem, 7vw, 5.4rem); line-height: 0.95; margin: 0 0 1rem; font-weight: 560; }
.lede { font-size: 1.25rem; color: var(--muted); }
.placeholder-note { margin-top: 2rem; color: var(--muted); font-size: 0.95rem; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.button, button, input[type="submit"] {
  appearance: none;
  border: 0;
  background: var(--pine);
  color: white;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.button.secondary, button.secondary, a.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.danger { background: var(--danger); }

label { display: block; font-size: 0.92rem; margin-bottom: 0.35rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  margin-bottom: 0.9rem;
}
textarea { min-height: 7rem; }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: 1.4fr 0.8fr; }
.recipient-row { display: grid; grid-template-columns: 1.2fr 1.4fr 0.8fr 0.5fr auto; gap: 0.6rem; align-items: end; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.table th, .table td { padding: 0.75rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }

.pill { border-radius: 999px; padding: 0.15rem 0.55rem; background: #efe8db; font-size: 0.85rem; text-transform: capitalize; }
.pill-sent, .pill-viewed, .pill-consented { background: #e5f2eb; }
.pill-completed, .pill-signed { background: #d9efe4; }
.pill-declined, .pill-voided, .pill-expired { background: #f8e4e4; }

.flash { margin: 0 0 1rem; padding: 0.8rem 1rem; border-radius: 12px; background: #efe8db; }
.flash.alert { background: #f8e4e4; }
.muted { color: var(--muted); }
.hash { font-family: ui-monospace, monospace; font-size: 0.85rem; word-break: break-all; }
.secret { background: #17261f; color: #f4f1ea; padding: 0.9rem 1rem; border-radius: 12px; overflow-wrap: anywhere; }
.disclosure { background: #f7f3eb; border-radius: 12px; padding: 1rem; max-height: 24rem; overflow: auto; }
.pdf-pages { display: grid; gap: 1rem; }
.pdf-page { position: relative; width: min(100%, 720px); }
.pdf-page canvas { width: 100%; height: auto; display: block; background: white; }
.field-box { position: absolute; border: 2px solid #1d6b4f; background: rgba(29, 107, 79, 0.12); color: #114833; font-size: 0.75rem; overflow: hidden; }
.pad { width: 100%; max-width: 480px; height: auto; background: white; border: 1px solid var(--line); border-radius: 12px; touch-action: none; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { width: auto; margin-top: 0.35rem; }
.stack { display: grid; gap: 1rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin: 0.5rem 0 1rem; }
h1, h2 { font-family: var(--serif); font-weight: 560; }

@media (max-width: 800px) {
  .grid.two, .recipient-row { grid-template-columns: 1fr; }
  .hero { padding-top: 2rem; }
}
