:root {
  color-scheme: light;
  --ink: #202525;
  --muted: #626b68;
  --line: #d9dfdc;
  --surface: #ffffff;
  --page: #f3f5f4;
  --accent: #0d766e;
  --accent-dark: #095b55;
  --accent-soft: #e6f4f1;
  --warning: #8a5900;
  --warning-soft: #fff4d6;
  --danger: #a3332c;
  --discount: #9b4c14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", Arial, sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(13, 118, 110, 0.22);
  outline-offset: 2px;
}

.plain-link {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-bar {
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 8px;
}

.brand span {
  display: grid;
  line-height: 1.2;
}

.brand strong {
  font-size: 16px;
}

.brand small,
.field-note,
.field-status,
.checkout-status,
.summary-actions small {
  color: var(--muted);
}

.brand small {
  margin-top: 4px;
  font-size: 12px;
}

.payment-label {
  padding: 5px 9px;
  border: 1px solid #e5c779;
  border-radius: 6px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
}

.utility-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.utility-links a {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1160px, calc(100% - 48px));
  margin: 38px auto 56px;
}

.purchase-surface {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.purchase-form-column {
  padding: 36px 40px 40px;
}

.purchase-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.summary-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 22px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.purchase-heading > p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
}

#purchase-form {
  display: grid;
  gap: 24px;
  padding-top: 28px;
}

.field-group {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group > label,
.field-group legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field-group > label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.segmented {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.segmented label {
  min-width: 0;
  display: grid;
  cursor: pointer;
}

.segmented label + label {
  border-left: 1px solid var(--line);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow-wrap: anywhere;
}

.segmented input:checked + span {
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 700;
}

.segmented span small {
  margin-left: 5px;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
}

.segmented .is-unavailable {
  cursor: not-allowed;
}

.segmented .is-unavailable span {
  background: #f0f2f1;
  color: #8a9290;
}

.field-note.is-warning {
  color: var(--warning);
}

.segmented .is-disabled {
  cursor: not-allowed;
}

.segmented .is-disabled span {
  background: #f7f8f7;
  color: #8a918f;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #bbc5c1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

input[type="email"]:focus,
input[type="text"]:focus {
  border-color: var(--accent);
}

.field-note,
.field-status {
  min-height: 20px;
  margin: 0;
  font-size: 12px;
}

.field-status.is-valid {
  color: var(--accent-dark);
}

.field-status.is-error {
  color: var(--danger);
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.invite-row button {
  height: 44px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
}

.invite-row button:hover:not(:disabled) {
  background: var(--accent-soft);
}

.invite-row button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.consent-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.consent-row a {
  color: var(--accent-dark);
  font-weight: 700;
}

.consent-row input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.order-summary {
  min-height: 100%;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  background: #fafbfa;
  border-left: 1px solid var(--line);
}

.order-summary dl {
  margin: 0;
}

.order-summary dl > div {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.order-summary dt {
  color: var(--muted);
}

.order-summary dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

#discount-line dd {
  color: var(--discount);
  font-weight: 700;
}

.order-summary .summary-total {
  min-height: 76px;
  border-bottom: 0;
  align-items: end;
}

.summary-total dt {
  color: var(--ink);
  font-weight: 700;
}

.summary-total dd {
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
}

.summary-actions {
  display: grid;
  gap: 10px;
}

.checkout-status {
  min-height: 21px;
  margin: 0;
  font-size: 13px;
}

#pay-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

#pay-button:disabled {
  border-color: #a9b4b0;
  background: #a9b4b0;
  cursor: not-allowed;
}

.result-main {
  width: min(720px, calc(100% - 48px));
}

.result-card {
  padding: 44px 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 27px;
  font-weight: 800;
}

.result-icon.is-waiting {
  background: var(--warning-soft);
  color: var(--warning);
}

.result-icon.is-success {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.result-icon.is-error {
  background: #fbe9e7;
  color: var(--danger);
}

.result-message {
  color: var(--muted);
}

.result-details {
  margin: 30px 0;
  border-top: 1px solid var(--line);
}

.result-details > div {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.result-details dt {
  color: var(--muted);
}

.result-details dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-actions button,
.result-actions a {
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.result-actions .secondary-button,
.result-actions a {
  background: #fff;
  color: var(--accent-dark);
}

.result-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.result-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-help a {
  color: var(--accent-dark);
}

.summary-actions small {
  line-height: 1.5;
}

.delivery-band {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delivery-band div {
  min-width: 0;
  padding: 18px 20px;
  display: grid;
  gap: 4px;
}

.delivery-band div + div {
  border-left: 1px solid var(--line);
}

.delivery-band strong {
  font-size: 14px;
}

.delivery-band span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-footer {
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-footer a {
  color: var(--accent-dark);
}

.policy-main,
.download-main {
  width: min(920px, calc(100% - 48px));
  margin: 38px auto 56px;
}

.policy-card,
.download-card {
  padding: clamp(28px, 5vw, 54px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.policy-card h1,
.download-card h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(30px, 5vw, 46px);
}

.policy-lede,
.download-lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.policy-meta {
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 12px;
}

.policy-section {
  padding: 25px 0;
  border-top: 1px solid var(--line);
}

.policy-section h2 {
  margin-bottom: 12px;
}

.policy-section h3 {
  margin: 20px 0 8px;
  font-size: 16px;
}

.policy-section p,
.policy-section li {
  color: #4d5653;
}

.policy-section ul,
.policy-section ol {
  margin: 12px 0 0;
  padding-left: 22px;
}

.policy-section li + li {
  margin-top: 7px;
}

.policy-callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.download-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.download-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.download-warning {
  grid-column: 1 / -1;
}

.download-panel h2 {
  margin-bottom: 10px;
}

.download-panel p,
.download-panel li {
  color: var(--muted);
}

.download-panel ul,
.download-panel ol {
  padding-left: 21px;
}

.download-button {
  width: 100%;
  min-height: 50px;
  margin: 18px 0 10px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.hash-box {
  margin-top: 16px;
  padding: 13px;
  border-radius: 6px;
  background: #eef1f0;
  color: #3f4946;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-chip {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.warning-chip {
  background: var(--warning-soft);
  color: var(--warning);
}

@media (max-width: 850px) {
  main {
    width: min(680px, calc(100% - 32px));
    margin-top: 24px;
  }

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

  .order-summary {
    min-height: 390px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .delivery-band {
    grid-template-columns: 1fr;
  }

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

  .delivery-band div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .site-bar {
    padding: 10px 16px;
  }

  .payment-label {
    display: none;
  }

  .utility-links {
    gap: 10px;
  }

  main {
    width: calc(100% - 20px);
    margin: 10px auto 28px;
  }

  .purchase-form-column,
  .order-summary,
  .result-card,
  .policy-card,
  .download-card {
    padding: 24px 18px;
  }

  h1 {
    font-size: 25px;
  }

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

  .segmented label + label {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .invite-row {
    grid-template-columns: minmax(0, 1fr) 68px;
  }
}
