:root {
  --paper: #f4f1e8;
  --ink: #171512;
  --muted: #676056;
  --rail: #d8d0bf;
  --green: #00a86b;
  --blue: #175bd8;
  --red: #c52d2f;
  --shadow: rgba(23, 21, 18, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 21, 18, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(23, 21, 18, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, monospace;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  width: min(1240px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.shell > * {
  min-width: 0;
}

.workbench,
.ledger {
  border: 1px solid var(--ink);
  background: rgba(244, 241, 232, 0.94);
  box-shadow: 8px 8px 0 var(--ink);
}

.workbench {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(22px, 4vw, 44px);
}

.headline {
  max-width: 760px;
}

.kicker,
.stamp {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 10ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 9vw, 100px);
  line-height: 0.9;
  letter-spacing: 0;
}

.dek {
  max-width: 700px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.45;
}

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

.problem div {
  border-top: 1px solid var(--ink);
  padding-top: 14px;
}

.problem p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.offers article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 208px;
  border: 1px solid var(--ink);
  background: #fffdf7;
  padding: 16px;
}

.starter-offer {
  background: #ecfff7;
}

.starter-offer .price {
  background: var(--green);
}

.price {
  width: fit-content;
  border: 1px solid var(--ink);
  background: var(--blue);
  color: #ffffff;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.offers p,
.section-copy,
.side-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.checker {
  display: grid;
  gap: 10px;
  max-width: 840px;
}

.section-label,
label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-label {
  margin: 0 0 6px;
  color: var(--blue);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
}

input,
button,
select,
textarea {
  min-height: 48px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0 14px;
  background: #fffdf7;
}

select {
  appearance: none;
}

textarea {
  min-height: 230px;
  padding: 14px;
  resize: vertical;
  line-height: 1.45;
}

button {
  cursor: pointer;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.result {
  border: 1px solid var(--ink);
  background: #12110f;
  color: #e9f8ef;
  min-height: 280px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #a9f4c4;
}

.status-line.error {
  color: #ffd4d4;
}

.status-line.error .status-dot {
  background: var(--red);
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
}

pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.55;
}

.ledger {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 24px;
}

.order-link {
  display: block;
  min-height: 48px;
  border: 1px solid var(--ink);
  background: var(--green);
  color: #ffffff;
  padding: 14px 16px;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
}

.compact-link {
  display: grid;
  align-items: center;
}

.order-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.secondary-link,
.secondary-button {
  background: var(--blue);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signing-shell {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.signing-shell h1 {
  max-width: none;
  font-size: 86px;
}

.signer-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.signer-form {
  max-width: none;
}

.signer-result {
  min-height: 100%;
}

.dm-result {
  min-height: 150px;
}

.wallet-address {
  overflow-wrap: anywhere;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--red);
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
}

.stats div {
  display: grid;
  gap: 4px;
  min-height: 98px;
  padding: 12px;
  border-right: 1px solid var(--ink);
  background: #fffdf7;
}

.stats div:last-child {
  border-right: 0;
}

.stats span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
}

.stats small {
  color: var(--muted);
  line-height: 1.25;
}

.receipt {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--rail);
  padding-top: 18px;
}

.receipt p {
  margin: 0;
  color: var(--blue);
  font-weight: 900;
}

.receipt span {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .offers {
    grid-template-columns: 1fr;
  }

  .problem {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .button-row,
  .signer-grid {
    grid-template-columns: 1fr;
  }

  .signing-shell h1 {
    font-size: 42px;
    line-height: 0.95;
  }

  .signing-shell .dek {
    max-width: 100%;
    font-size: 16px;
  }
}

@media (min-width: 861px) and (max-width: 1120px) {
  .offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signing-shell,
  .signer-grid {
    grid-template-columns: 1fr;
  }
}
