.checkout {
  --checkout-cream: var(--color-cream, var(--cream, #f5f4ec));
  --checkout-ink: var(--color-ink, var(--ink, #171c14));
  --checkout-moss: var(--color-moss, var(--moss, #344a32));
  --checkout-acid: var(--color-acid, var(--acid, #dbf67b));
  --checkout-border: var(--color-border, var(--border, #d8d9ca));
  --checkout-muted: color-mix(in srgb, var(--checkout-ink) 64%, transparent);
  width: min(46rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(52rem, calc(100dvh - 2rem));
  padding: 0;
  color: var(--checkout-ink);
  background: var(--checkout-cream);
  border: 1px solid var(--checkout-ink);
  border-radius: 1.25rem;
  box-shadow: 0 2.25rem 6rem rgb(23 28 20 / 24%);
  font: inherit;
  overflow: hidden;
}

html:has(.checkout[open]) {
  overflow: hidden;
}

.checkout::backdrop {
  background: rgb(23 28 20 / 68%);
  backdrop-filter: blur(0.35rem);
}

.checkout[open] {
  animation: checkout-enter 220ms ease-out both;
}

.checkout__frame {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  max-height: inherit;
}

.checkout__header,
.checkout__footer,
.checkout__product,
.checkout__payment-card,
.checkout__receipt-topline,
.checkout__receipt-name,
.checkout__fulfillment-heading {
  display: flex;
  align-items: center;
}

.checkout__header {
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem 1rem;
  border-bottom: 1px solid var(--checkout-border);
}

.checkout__eyebrow,
.checkout__product-kicker,
.checkout__price span,
.checkout__receipt-topline,
.checkout__fulfillment-heading {
  margin: 0;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.checkout__eyebrow {
  margin-bottom: 0.3rem;
  color: var(--checkout-moss);
}

.checkout__title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.checkout__icon-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--checkout-ink);
  background: transparent;
  border: 1px solid var(--checkout-border);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.checkout__icon-button span {
  margin-top: -0.15rem;
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
}

.checkout__demo-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.35rem;
  color: var(--checkout-ink);
  background: var(--checkout-acid);
  border-bottom: 1px solid var(--checkout-ink);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.35;
}

.checkout__demo-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  background: var(--checkout-ink);
  border-radius: 50%;
}

.checkout__progress {
  padding: 0 1.35rem;
  border-bottom: 1px solid var(--checkout-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.checkout__progress::-webkit-scrollbar {
  display: none;
}

.checkout__progress ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.checkout__progress li {
  position: relative;
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 0.45rem 0.75rem;
  color: var(--checkout-muted);
  border-bottom: 0.18rem solid transparent;
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
}

.checkout__progress li:first-child {
  padding-left: 0;
}

.checkout__progress li span {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.72rem;
}

.checkout__progress li.is-active {
  color: var(--checkout-ink);
  border-bottom-color: var(--checkout-moss);
}

.checkout__progress li.is-complete {
  color: var(--checkout-moss);
}

.checkout__body {
  min-height: 0;
  padding: clamp(1.35rem, 4vw, 2.4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.checkout__panel h3 {
  max-width: 22ch;
  margin: 0.55rem 0 0;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.checkout__panel h3:focus {
  outline: none;
}

.checkout__lede {
  max-width: 37rem;
  margin: 0.85rem 0 1.5rem;
  color: var(--checkout-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.checkout__model-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 0.9rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.checkout__model-field select {
  min-height: 2.75rem;
  padding: 0.4rem 0.65rem;
  color: var(--checkout-ink);
  background: var(--checkout-cream);
  border: 1px solid var(--checkout-moss);
  border-radius: 0.45rem;
  font: inherit;
}

.checkout__product {
  align-items: stretch;
  gap: 1rem;
  padding: 1rem;
  background: rgb(255 255 255 / 42%);
  border: 1px solid var(--checkout-border);
  border-radius: 0.9rem;
}

.checkout__product-mark {
  width: 4.4rem;
  height: 4.4rem;
  flex: 0 0 auto;
  background: var(--checkout-moss);
  border-radius: 0.65rem;
  overflow: hidden;
}

.checkout__product-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout__product-copy {
  align-self: center;
  min-width: 0;
  margin-right: auto;
}

.checkout__product-kicker {
  color: var(--checkout-muted);
}

.checkout__product h4,
.checkout__payment-card h4 {
  margin: 0.25rem 0 0.3rem;
  font-size: 1.05rem;
  line-height: 1.25;
}

.checkout__product-copy > p:last-child {
  margin: 0;
  color: var(--checkout-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.checkout__price {
  align-self: center;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.checkout__price span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--checkout-muted);
}

.checkout__ledger,
.checkout__receipt dl,
.checkout__fulfillment dl {
  margin: 1rem 0 0;
}

.checkout__ledger > div,
.checkout__receipt dl > div,
.checkout__fulfillment dl > div {
  display: grid;
  grid-template-columns: minmax(6rem, 0.7fr) minmax(0, 1.3fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--checkout-border);
}

.checkout dt,
.checkout dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
}

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

.checkout dd {
  font-weight: 650;
  text-align: right;
}

.checkout__payment-card {
  gap: 1rem;
  padding: 1rem;
  color: var(--checkout-cream);
  background: var(--checkout-moss);
  border-radius: 0.9rem;
}

.checkout__eth-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--checkout-ink);
  background: var(--checkout-acid);
  border-radius: 50%;
  font-size: 1.5rem;
}

.checkout__payment-card .checkout__product-kicker {
  color: rgb(245 244 236 / 66%);
}

.checkout__payment-card h4 {
  margin-bottom: 0;
}

.checkout__status {
  margin-left: auto;
  padding: 0.45rem 0.65rem;
  color: var(--checkout-ink);
  background: var(--checkout-acid);
  border-radius: 999px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkout__ledger-total {
  border-bottom-color: var(--checkout-ink) !important;
}

.checkout__ledger-total dt,
.checkout__ledger-total dd {
  color: var(--checkout-ink);
  font-size: 1rem;
  font-weight: 750;
}

.checkout__amount {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.checkout__quote-status {
  margin: 0.8rem 0;
  color: var(--checkout-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.checkout__notice {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  color: var(--checkout-muted);
  background: color-mix(in srgb, var(--checkout-acid) 32%, transparent);
  border-left: 0.2rem solid var(--checkout-moss);
  font-size: 0.875rem;
  line-height: 1.5;
}

.checkout__notice strong {
  color: var(--checkout-ink);
}

.checkout__receipt,
.checkout__fulfillment {
  padding: 1rem 1.1rem;
  background: rgb(255 255 255 / 42%);
  border: 1px solid var(--checkout-ink);
  border-radius: 0.45rem;
}

.checkout__receipt-topline,
.checkout__fulfillment-heading {
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  color: var(--checkout-muted);
  border-bottom: 1px dashed var(--checkout-border);
}

.checkout__receipt-topline span:last-child,
.checkout__fulfillment-heading span {
  color: var(--checkout-moss);
}

.checkout__receipt-name {
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0;
}

.checkout__receipt-name p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.checkout__receipt-name span {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.875rem;
}

.checkout__fulfillment address {
  margin: 1rem 0;
  color: var(--checkout-ink);
  font-size: 1rem;
  font-style: normal;
  line-height: 1.55;
}

.checkout__panel--complete {
  padding: 0.5rem 0;
  text-align: center;
}

.checkout__panel--complete h3,
.checkout__panel--complete .checkout__lede {
  margin-right: auto;
  margin-left: auto;
}

.checkout__complete-mark {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.1rem;
  place-items: center;
  color: var(--checkout-ink);
  background: var(--checkout-acid);
  border: 1px solid var(--checkout-ink);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 750;
}

.checkout__footer {
  min-height: 4.9rem;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.9rem 1.35rem;
  background: var(--checkout-cream);
  border-top: 1px solid var(--checkout-border);
}

.checkout__button {
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--checkout-ink);
  border-radius: 999px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.checkout__button--secondary {
  margin-right: auto;
  color: var(--checkout-ink);
  background: transparent;
}

.checkout__button--primary {
  color: var(--checkout-cream);
  background: var(--checkout-ink);
}

.checkout__icon-button:hover,
.checkout__button--secondary:hover {
  background: rgb(23 28 20 / 7%);
}

.checkout__button--primary:hover:not(:disabled) {
  color: var(--checkout-ink);
  background: var(--checkout-acid);
}

.checkout__button:disabled {
  opacity: 0.55;
  cursor: default;
}

.checkout :is(button, select, [tabindex="-1"]):focus-visible {
  outline: 2px solid var(--checkout-moss);
  outline-offset: 0.18rem;
}

@keyframes checkout-enter {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.985);
  }
}

@media (max-width: 40rem) {
  .checkout {
    width: 100vw;
    max-height: 100dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 1.2rem 1.2rem 0 0;
  }

  .checkout__frame {
    height: min(100dvh, 48rem);
  }

  .checkout__header,
  .checkout__demo-strip,
  .checkout__progress,
  .checkout__footer {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .checkout__body {
    padding: 1.35rem 1rem;
  }

  .checkout__product {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .checkout__price {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--checkout-border);
    text-align: left;
  }

  .checkout__price span {
    margin: 0;
  }

  .checkout__progress li { justify-content: center; padding-inline: 0.1rem; }
  .checkout__progress li span { display: none; }

  .checkout__button--primary {
    flex: 1;
  }
}

@media (max-width: 25rem) {
  .checkout__product-mark {
    width: 3.75rem;
    height: 3.75rem;
  }

  .checkout__payment-card {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .checkout__status {
    grid-column: 1 / -1;
    width: fit-content;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkout[open] {
    animation: none;
  }
}
