:root {
  --paper: #f7f4ee;
  --paper-raise: #faf6f1;
  --card: #ffffff;
  --ink: #14110d;
  --ink-muted: #6e6656;
  --ink-3: #766e60;
  --ink-4: #a8a091;
  --border: #e9e3d7;
  --line-2: #d6cec0;
  --ember: #e63e12;
  --ember-deep: #c7320d;
  --verified: #2e7a4d;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.5 "Instrument Sans",
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.invite {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}
.invite-card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 36px 32px;
  box-shadow: 0 18px 50px rgba(20, 17, 13, 0.07);
}
.sender {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-weight: 600;
}
.sender b {
  display: block;
  font-weight: 600;
  font-size: 15px;
}
.sender span {
  color: var(--ink-muted);
  font-size: 15px;
}
.invite h1 {
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 28px 0 22px;
}
.quote {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  color: var(--ink-muted);
  white-space: pre-line;
  margin-bottom: 22px;
}
.docs {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 15px;
}
.docs li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.docs svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-3);
}
.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 0 22px;
}
.invite-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}
.invite-foot .muted {
  margin-right: auto;
}
.footnote {
  margin-top: 28px;
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-dark {
  background: var(--ink);
  color: var(--paper);
}
.btn-dark:hover {
  background: #2a241d;
}
.btn-dark:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 10px 6px;
  font-weight: 500;
}
.btn-ghost:hover {
  text-decoration: underline;
}
.btn-line {
  background: var(--card);
  border-color: var(--line-2);
  color: var(--ink);
}
.muted {
  color: var(--ink-muted);
  font-size: 15px;
}

.status {
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--paper-raise);
  border: 1px solid var(--border);
}
.status b {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.status p {
  margin: 0;
}
.status.done b {
  color: var(--verified);
}
.status + .status-actions {
  margin-top: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark svg {
  width: 22px;
  height: 22px;
}
.crumb {
  padding-left: 18px;
  border-left: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .spacer {
  flex: 1;
}
.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 15px;
  white-space: nowrap;
}
.bar {
  width: 160px;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 99px;
  transition: width 0.2s ease;
}

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 32px 96px 120px;
}
.sheet {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px rgba(20, 17, 13, 0.06);
  padding: 72px 96px 80px;
}
.sheet h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 46px;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 24px;
}
.exhibit {
  color: var(--ink-3);
  margin: 0 0 28px;
}
.terms {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin-bottom: 40px;
}
.terms th,
.terms td {
  text-align: left;
  vertical-align: top;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.terms tr:first-child th,
.terms tr:first-child td {
  border-top: 0;
}
.terms th {
  width: 30%;
  font-weight: 600;
}
.terms td {
  white-space: pre-line;
}
.sheet h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.field {
  display: block;
  margin-bottom: 18px;
}
.field span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card);
}
.field textarea {
  min-height: 84px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--ember);
  outline-offset: 1px;
  border-color: transparent;
}
.signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin: 34px 0 0;
}
.signatures .who {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.sig-line {
  height: 64px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
  color: var(--ink-4);
  font-size: 14px;
}
.sig-slot {
  height: 64px;
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
  padding: 0 12px;
}
.sig-note {
  color: var(--ink-4);
  font-size: 14px;
  margin-top: 8px;
}
.paid {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.error {
  color: var(--ember-deep);
  font-weight: 600;
  margin: 0 0 20px;
}

.shelf h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0 0 12px;
}
.thumb {
  display: block;
  width: 168px;
  aspect-ratio: 0.78;
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 18px 16px;
  text-decoration: none;
}
.thumb i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-bottom: 9px;
}
.thumb i:nth-child(3n) {
  width: 55%;
}
.shelf p {
  margin: 8px 0 0;
  font-weight: 600;
  font-size: 15px;
}

.next {
  position: fixed;
  left: 24px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ember-deep);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(199, 50, 13, 0.25);
  cursor: pointer;
}
.next[hidden] {
  display: none;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  width: min(520px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(20, 17, 13, 0.18);
}
dialog::backdrop {
  background: rgba(20, 17, 13, 0.35);
}
dialog h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
dialog .row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 960px) {
  .desk {
    grid-template-columns: 1fr;
    padding: 24px 16px 64px;
  }
  .shelf,
  .next,
  .progress .bar,
  .crumb {
    display: none;
  }
  .sheet {
    padding: 36px 22px 44px;
  }
  .sheet h1 {
    font-size: 36px;
  }
  .signatures {
    grid-template-columns: 1fr;
  }
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }
  .invite-card {
    padding: 26px 22px;
  }
}
.signatures-title {
  margin-top: 34px;
}
