:root {
  color: #111114;
  background: #d8d8de;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --sheet: rgba(244, 244, 248, 0.985);
  --line: rgba(17, 17, 20, 0.12);
  --muted: rgba(17, 17, 20, 0.48);
  --blue: #007aff;
  --green: #28a745;
  --red: #d92d20;
  --orange: #a85b00;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 280px;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.48), transparent 32%),
    linear-gradient(160deg, #c7c7ce, #e3e3e8 54%, #cfcfd6);
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.32);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.checkout-shell {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100vh;
  min-height: -webkit-fill-available;
  background: rgba(0, 0, 0, 0.24);
}

@supports (height: 100svh) {
  .checkout-shell {
    height: 100svh;
  }
}

.checkout-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--sheet);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.18);
  -webkit-overflow-scrolling: touch;
}

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(58px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 20px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 244, 248, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

.checkout-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.header-action {
  min-width: 44px;
  min-height: 44px;
  margin-right: -8px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 16px;
  cursor: pointer;
}

.screen {
  animation: screen-in 220ms ease-out both;
}

.product-row {
  display: flex;
  align-items: center;
  min-height: 98px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.app-mark,
.skeleton-logo {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, #17181d, #313440);
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.1);
  font-size: 25px;
  font-weight: 700;
}

.app-mark img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-copy,
.loading-lines {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  margin-left: 15px;
}

.meal-name {
  overflow: hidden;
  font-size: 17px;
  font-weight: 590;
  letter-spacing: -0.012em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.product-meta span:not(.dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  flex: 0 0 auto;
  width: 3px;
  height: 3px;
  margin: 0 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.68;
}

.purchase-summary {
  margin: 0;
  padding: 0 20px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.summary-row dt {
  color: var(--muted);
  font-size: 14px;
}

.summary-row dd {
  display: flex;
  align-items: baseline;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.currency {
  margin-right: 6px;
  color: rgba(17, 17, 20, 0.62);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.amount {
  font-size: 28px;
  font-weight: 690;
}

.recurring-row {
  display: flex;
  align-items: flex-start;
  padding: 13px 0 15px;
  color: rgba(17, 17, 20, 0.56);
  font-size: 12px;
  line-height: 1.55;
}

.recurring-row svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 1px 10px 0 0;
  fill: currentColor;
}

.notice {
  margin: 16px 20px 0;
  padding: 12px 14px;
  border: 1px solid rgba(217, 45, 32, 0.16);
  border-radius: 12px;
  background: rgba(217, 45, 32, 0.07);
  color: #a4261b;
  font-size: 13px;
  line-height: 1.55;
}

.notice.info {
  border-color: rgba(0, 122, 255, 0.17);
  background: rgba(0, 122, 255, 0.07);
  color: #075fab;
}

.payment-area {
  padding: 26px 20px 0;
}

.wallet-loading,
.loading-payment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 12px;
  background: #111114;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.wallet-loading .spinner,
.loading-payment .spinner {
  margin-right: 9px;
}

.wallet-container {
  width: 100%;
  min-height: 50px;
}

.wallet-container.is-processing {
  pointer-events: none;
  opacity: 0.56;
}

.apple-pay-native {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #000;
  color: transparent;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-type: buy;
  -apple-pay-button-style: black;
}

.google-pay-container {
  overflow: hidden;
  border-radius: 12px;
}

.google-pay-container > div,
.google-pay-container button {
  width: 100% !important;
  min-width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
}

.security-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 24px 22px;
  padding: 18px 24px max(22px, env(safe-area-inset-bottom, 0px));
  color: rgba(17, 17, 20, 0.42);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.security-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin: 1px 7px 0 0;
  fill: currentColor;
}

.loading-screen {
  min-height: 330px;
}

.loading-screen .summary-row {
  margin: 0 20px;
}

.loading-payment {
  margin: 26px 20px;
}

.skeleton {
  display: block;
  background: linear-gradient(100deg, #dedee4 24%, #ececf0 38%, #dedee4 52%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton-line {
  height: 13px;
  border-radius: 5px;
}

.skeleton-line-wide {
  width: 58%;
}

.skeleton-line-short {
  width: 37%;
  height: 10px;
  margin-top: 10px;
}

.skeleton-label {
  width: 60px;
  height: 12px;
  border-radius: 5px;
}

.skeleton-price {
  width: 92px;
  height: 24px;
  border-radius: 7px;
}

.spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner-light {
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
}

.result-screen {
  display: flex;
  min-height: calc(100% - 58px - env(safe-area-inset-top, 0px));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 28px 30px;
  padding: 44px 28px max(30px, env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(40, 167, 69, 0.11);
  color: var(--green);
}

.result-icon svg {
  width: 38px;
  height: 38px;
  fill: currentColor;
}

.result-error-icon {
  display: none;
}

.result-screen.is-error .result-icon {
  background: rgba(217, 45, 32, 0.09);
  color: var(--red);
}

.result-screen.is-error .result-success-icon {
  display: none;
}

.result-screen.is-error .result-error-icon {
  display: block;
}

.result-screen h2 {
  margin: 22px 0 0;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.result-screen > p:not(.order-number) {
  max-width: 320px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.order-number {
  display: flex;
  width: 100%;
  max-width: 340px;
  align-items: center;
  justify-content: space-between;
  margin: 25px 0 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(17, 17, 20, 0.045);
  color: var(--muted);
  font-size: 12px;
}

.order-number strong {
  overflow: hidden;
  max-width: 68%;
  color: rgba(17, 17, 20, 0.7);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  width: 100%;
  max-width: 340px;
  flex-direction: column;
  margin-top: 32px;
}

.result-actions > * + * {
  margin-top: 10px;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 590;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #111114;
  background: #111114;
  color: #fff;
}

.secondary-button {
  border: 1px solid rgba(17, 17, 20, 0.13);
  background: rgba(255, 255, 255, 0.62);
  color: #111114;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.noscript-message {
  margin: 20px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(217, 45, 32, 0.08);
  color: var(--red);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 600px) and (min-height: 620px) {
  .checkout-shell {
    align-items: center;
    padding: 24px;
  }

  .checkout-sheet {
    min-height: 560px;
    max-height: min(760px, calc(100% - 48px));
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  }
}

@media (max-height: 540px) {
  .product-row {
    min-height: 82px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .app-mark,
  .skeleton-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .summary-row {
    min-height: 62px;
  }

  .payment-area {
    padding-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

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

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
