.checkout-body {
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

html:has(.checkout-body) {
  overflow: hidden;
  height: 100%;
}

.checkout-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  animation: checkoutShellIn 0.4s var(--ease-out) both;
}

html:active-view-transition .checkout-shell {
  animation: none;
}

@keyframes checkoutShellIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: checkoutVtOut 0.16s ease both;
}

::view-transition-new(root) {
  animation: checkoutVtIn 0.18s ease both;
}

@keyframes checkoutVtOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes checkoutVtIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.checkout-top {
  padding-top: 6px;
}

.checkout-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checkout-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.checkout-back:hover {
  color: #fff;
}

.checkout-logo {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  text-decoration: none;
}

.checkout-logo .logo-img {
  width: auto;
  height: 30px;
  border-radius: 0;
}

.checkout-main {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding-top: 14px;
  padding-bottom: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.checkout-secure-row {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(239, 22, 41, 0.28);
  background: var(--accent-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.checkout-secure-row .icon,
.checkout-secure-row svg {
  color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.checkout-secure-row--pay {
  display: none;
}

.checkout-secure-row--pay .icon,
.checkout-secure-row--pay svg {
  color: #4ade80;
}

.checkout-product-card,
.checkout-panel,
.checkout-pay-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.checkout-product-card {
  padding: 16px 20px;
  margin-bottom: 12px;
}

.checkout-product-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.checkout-product-strip-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkout-product-name {
  display: block;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.25;
}

.checkout-product-meta {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}

.checkout-product-strip-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  line-height: 1.1;
}

.checkout-price {
  font-size: clamp(1.55rem, 2.8vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.checkout-price-old {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.checkout-panel {
  padding: 6px 0 14px;
  margin-bottom: 12px;
}

.checkout-progress {
  padding: 14px 20px 8px;
}

.checkout-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkout-progress-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.checkout-progress-title .icon {
  color: var(--accent);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.checkout-section-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.checkout-section-label .icon {
  color: var(--accent);
  flex-shrink: 0;
}

.checkout-email-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
}

.checkout-email-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.checkout-email-input {
  width: 100%;
  height: 52px;
  padding: 0 14px 0 42px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: #fff;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.checkout-email-input:focus {
  border-color: rgba(239, 22, 41, 0.55);
}

.checkout-coupon-row {
  display: none;
}

.checkout-section--coupon {
  grid-column: 1 / -1;
}

.checkout-coupon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
}

.checkout-coupon-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  width: 18px;
  height: 18px;
  z-index: 1;
}

.checkout-coupon-input {
  width: 100%;
  height: 52px;
  padding: 0 46px 0 42px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: #fff;
  font: inherit;
  font-size: 15px;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.checkout-coupon-input:focus {
  border-color: rgba(239, 22, 41, 0.55);
}

.checkout-coupon-wrap.is-ok .checkout-coupon-input {
  border-color: rgba(74, 222, 128, 0.45);
}

.checkout-coupon-wrap.is-err .checkout-coupon-input {
  border-color: rgba(248, 113, 113, 0.45);
}

.checkout-coupon-status {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.checkout-coupon-status[hidden] {
  display: none !important;
}

.checkout-coupon-status .icon,
.checkout-coupon-status svg {
  width: 20px;
  height: 20px;
  grid-area: 1 / 1;
}

.checkout-coupon-status-ok,
.checkout-coupon-status-err {
  display: none;
}

.checkout-coupon-wrap.is-ok .checkout-coupon-status-ok {
  display: block;
  color: #4ade80;
}

.checkout-coupon-wrap.is-err .checkout-coupon-status-err {
  display: block;
  color: #f87171;
}

.checkout-coupon-apply {
  display: none;
}

.checkout-coupon-msg {
  display: none !important;
}

.checkout-price-old.is-hidden,
.checkout-discount-line[hidden] {
  display: none !important;
}

.checkout-discount-line {
  margin: 4px 0 0;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
}

.checkout-continue {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}

.checkout-coin-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.checkout-coin-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: contain;
  display: block;
}

.checkout-coin-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.checkout-coin-btn strong {
  color: #fff;
  font-size: 16px;
}

.checkout-coin-btn .checkout-coin-copy > span {
  font-size: 13px;
  color: var(--text-dim);
}

.checkout-progress-pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.checkout-progress-bar {
  height: 5px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.checkout-progress-fill {
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.checkout-fields {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  padding: 10px 20px 0;
}

.checkout-section {
  padding: 12px 20px 0;
}

.checkout-fields .checkout-section {
  padding: 0;
}

.checkout-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  box-sizing: border-box;
}

.checkout-qty-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.checkout-qty-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.checkout-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.checkout-qty-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.checkout-qty-input::-webkit-outer-spin-button,
.checkout-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.checkout-qty-input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.checkout-unit-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
  text-align: left;
}

.checkout-choose-coin {
  margin: 0 0 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.checkout-actions {
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-inline-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.checkout-crypto-section[hidden] {
  display: none !important;
}

.checkout-legal {
  margin: 0;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
}

.checkout-continue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.checkout-body--paying {
  overflow: hidden;
  height: 100dvh;
}

.checkout-body--paying .checkout-shell {
  height: 100dvh;
  animation: none;
}

.checkout-body--paying .checkout-top {
  padding-top: 6px;
}

.checkout-body--paying .checkout-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.checkout-body--paying .checkout-back {
  justify-self: start;
}

.checkout-body--paying .checkout-logo {
  justify-self: end;
}

.checkout-body--paying .checkout-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 12px;
  padding-bottom: 12px;
  overflow: auto;
}

.checkout-body--paying .checkout-secure-row:not(.checkout-secure-row--pay),
.checkout-body--paying .checkout-product-card,
.checkout-body--paying .checkout-order,
.checkout-body--paying .checkout-legal {
  display: none !important;
}

.checkout-body--paying .checkout-secure-row--pay {
  display: inline-flex !important;
  justify-self: center;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.checkout-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: none;
}

.checkout-body--paying:has(#checkoutLoading:not([hidden])) .checkout-stage,
.checkout-body--paying:has(#checkoutError:not([hidden])) .checkout-stage,
.checkout-body--paying:has(#checkoutSuccess:not([hidden])) .checkout-stage {
  display: block;
  min-height: 240px;
}

.checkout-loading,
.checkout-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  text-align: center;
  background: var(--bg);
}

.checkout-loading p,
.checkout-error p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
}

.checkout-error strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
  color: #fff;
}

.checkout-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(239, 22, 41, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: checkout-spin 0.8s linear infinite;
}

@keyframes checkout-spin {
  to { transform: rotate(360deg); }
}

.checkout-legal a {
  color: var(--text-muted);
  text-decoration: none;
}

.checkout-legal a:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.checkout-coin-btn:hover {
  border-color: var(--border-strong);
}

.checkout-coin-btn.is-selected {
  border-color: rgba(239, 22, 41, 0.55);
  background: var(--accent-dim);
  color: #fff;
}

.checkout-pay {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 14px 16px 16px;
}

.checkout-pay-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  text-align: center;
}

.checkout-pay-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(1.3rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.checkout-pay-title .icon {
  color: #4ade80;
}

.checkout-pay-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.35);
  font-size: 13px;
  font-weight: 600;
  color: #4ade80;
}

.checkout-pay-status-icon {
  flex-shrink: 0;
  animation: checkout-spin 1s linear infinite;
}

.checkout-pay-status-text {
  display: inline-flex;
  align-items: baseline;
}

.checkout-status-dots {
  display: inline-flex;
  margin-left: 1px;
  min-width: 1.1em;
}

.checkout-status-dots span {
  opacity: 0.28;
  animation: checkout-dot 1.35s ease-in-out infinite;
}

.checkout-status-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.checkout-status-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes checkout-dot {
  0%,
  70%,
  100% {
    opacity: 0.28;
  }
  35% {
    opacity: 1;
  }
}

.checkout-pay-status.is-confirming {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.checkout-pay-status.is-confirming .checkout-pay-status-icon {
  animation: checkout-spin 1s linear infinite;
}

.checkout-pay-status.is-success {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.14);
  color: #4ade80;
}

.checkout-pay-status.is-success .checkout-pay-status-icon {
  animation: none;
}

.checkout-pay-status.is-warn {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.checkout-pay-status.is-warn .checkout-pay-status-icon {
  animation: none;
}

.checkout-pay-card {
  margin: 0;
  padding: 18px 18px 16px;
  text-align: center;
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.06), transparent 42%), var(--bg);
}

.checkout-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.checkout-qr {
  width: 190px;
  height: 190px;
  margin: 0;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.2);
}

.checkout-amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed rgba(74, 222, 128, 0.45);
  border-radius: var(--radius);
  background: rgba(74, 222, 128, 0.08);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.checkout-amount-btn:hover {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.7);
}

.checkout-pay-amount {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 1.7rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.checkout-amount-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
}

.checkout-pay-usd {
  margin: 8px 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.checkout-pay-address-block {
  text-align: center;
}

.checkout-pay-address-block .checkout-section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  color: #fff;
}

.checkout-pay-address-block .checkout-section-label .icon {
  color: #4ade80;
}

.checkout-address-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.checkout-address {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-all;
  text-align: left;
  user-select: text;
}

.checkout-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 92px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius);
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.checkout-copy-btn:hover {
  background: #22c55e;
}

.checkout-network-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.checkout-network-hint .icon {
  flex-shrink: 0;
  margin: 0;
  animation: checkout-hint-icon 2.6s ease-in-out infinite;
}

.checkout-network-hint > span {
  animation: checkout-hint-text 2.6s ease-in-out infinite;
}

@keyframes checkout-hint-icon {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes checkout-hint-text {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

.checkout-order-id {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

.checkout-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  color: #fff;
}

.checkout-success .icon {
  color: #4ade80;
}

.checkout-success p {
  margin: 0;
  max-width: 36ch;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.checkout-pay .checkout-unit-hint {
  padding: 0 14px;
}

@media (max-width: 520px) {
  .checkout-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "back logo"
      "secure secure";
    gap: 8px;
  }

  .checkout-back {
    grid-area: back;
  }

  .checkout-logo {
    grid-area: logo;
  }

  .checkout-secure-row {
    grid-area: secure;
    justify-self: center;
    max-width: 100%;
  }

  .checkout-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .checkout-coin-grid {
    grid-template-columns: 1fr;
  }
}

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

  .checkout-spinner,
  .checkout-pay-status-icon,
  .checkout-status-dots span,
  .checkout-network-hint .icon,
  .checkout-network-hint > span {
    animation: none;
  }

  .checkout-status-dots span,
  .checkout-network-hint .icon,
  .checkout-network-hint > span {
    opacity: 1;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
