* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f7f8;
  color: #182033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

button,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.app-surface {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: 24px;
  align-items: stretch;
}

.summary,
.preview {
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(20, 32, 46, 0.10);
}

.summary {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.kicker span {
  border: 1px solid #c7d2dc;
  border-radius: 999px;
  padding: 5px 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

h1,
p,
dl {
  margin: 0;
}

h1 {
  max-width: 10ch;
  color: #121826;
  font-size: 48px;
  line-height: 1.02;
  font-weight: 800;
}

.lede {
  max-width: 36ch;
  margin-top: 16px;
  color: #536171;
  font-size: 16px;
  line-height: 1.55;
}

.facts {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.facts div {
  min-width: 0;
  border-top: 1px solid #e5ebf0;
  padding-top: 12px;
}

dt {
  color: #687586;
  font-size: 12px;
  font-weight: 750;
}

dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 14px;
  font-weight: 760;
}

.checkout {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.wallet-label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.wallet-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: #111827;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-button {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.primary-button {
  border: 1px solid transparent;
  background: #0e7490;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(14, 116, 144, 0.24);
}

.primary-button:hover:not(:disabled) {
  background: #155e75;
  transform: translateY(-1px);
}

.primary-button:disabled,
.wallet-select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.status {
  overflow-wrap: anywhere;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.preview {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(14, 116, 144, 0.14), transparent 34%),
    linear-gradient(42deg, rgba(180, 83, 9, 0.17), transparent 42%),
    #edf2f6;
}

.preview.is-active {
  height: min(680px, calc(100vh - 84px));
  min-height: 560px;
  background: #ffffff;
}

.preview-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(24, 32, 51, 0.10);
  background: rgba(255, 255, 255, 0.72);
}

.window-controls {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 44px;
}

.window-controls span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
}

.window-controls span:nth-child(1) {
  background: #b45309;
}

.window-controls span:nth-child(2) {
  background: #0e7490;
}

.window-controls span:nth-child(3) {
  background: #475569;
}

.viewer-title {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-reset {
  min-width: 44px;
  border: 0;
  background: transparent;
  color: #0e7490;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.viewer-reset[hidden] {
  display: block;
  visibility: hidden;
}

.preview-body {
  position: absolute;
  inset: 42px 0 0;
  display: grid;
  place-items: center;
  gap: 18px;
  align-content: center;
  padding: 28px;
  text-align: center;
}

.preview-body::before {
  position: absolute;
  inset: 36px;
  content: "";
  border: 1px dashed rgba(71, 85, 105, 0.28);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0 10px, transparent 10px 20px),
    rgba(255, 255, 255, 0.32);
}

.lock-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 8px;
  background: #121826;
  color: #f8fafc;
  font-size: 30px;
  font-weight: 850;
}

.preview-body > div:last-child {
  position: relative;
  z-index: 1;
}

.preview-label {
  color: #0e7490;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-title {
  margin-top: 8px;
  color: #182033;
  font-size: 22px;
  font-weight: 800;
}

.preview-body[hidden],
.payment-frame[hidden] {
  display: none;
}

.payment-frame {
  position: absolute;
  inset: 42px 0 0;
  display: block;
  width: 100%;
  height: calc(100% - 42px);
  border: 0;
  background: #f8fafc;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 640px);
    padding: 18px 0;
  }

  .app-surface {
    grid-template-columns: 1fr;
  }

  .summary,
  .preview {
    min-height: auto;
  }

  h1 {
    max-width: none;
    font-size: 36px;
  }

  .preview {
    height: 360px;
  }

  .preview.is-active {
    height: min(660px, calc(100vh - 36px));
    min-height: 560px;
  }
}

@media (max-width: 520px) {
  .summary {
    padding: 20px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button {
    width: 100%;
  }

  .preview {
    height: 310px;
  }

  .preview.is-active {
    height: min(620px, calc(100vh - 28px));
    min-height: 520px;
  }

  .preview-body::before {
    inset: 18px;
  }
}
