/* Server-authoritative payment catalog and confirmation surface. */
#paywall-page {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal, 200) + 70);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  color: #fff;
}

#paywall-page.hidden,
.pw-review[hidden],
.pw-review-backdrop[hidden],
.pw-renewal-banner[hidden] {
  display: none;
}

.pw-nav {
  position: relative;
  z-index: 2;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height, 48px);
  padding: 0 16px;
}

.pw-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
}

.pw-nav-title {
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.pw-nav-spacer {
  width: 44px;
}

.pw-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}

.pw-body::-webkit-scrollbar {
  display: none;
}

.pw-status {
  min-height: 24px;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.pw-status--error,
.pw-review-status.pw-status--error {
  color: #ff8a80;
}

.pw-renewal-banner {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 200, 91, 0.42);
  border-radius: 14px;
  color: #fff4cf;
  background: rgba(245, 200, 91, 0.12);
  font-size: 14px;
  line-height: 1.45;
}

.pw-renewal-banner strong {
  display: block;
  margin-bottom: 4px;
  color: #ffd45d;
  font-size: 15px;
}

.pw-renewal-banner p {
  margin: 0;
}

.pw-renewal-banner time {
  font-weight: 700;
}

.pw-retry-btn {
  min-height: 44px;
  margin-left: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font: inherit;
  cursor: pointer;
}

.pw-section {
  margin-bottom: 28px;
}

.pw-section-header,
.pw-coins-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pw-crown-icon,
.pw-coin-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.pw-section-title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.pw-section-desc,
.pw-empty {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.45;
}

.plan-list {
  display: grid;
  gap: 12px;
}

.coins-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coins-grid .pw-empty {
  grid-column: 1 / -1;
}

.pw-product-card {
  min-width: 0;
  min-height: 112px;
  padding: 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  color: #fff;
  background: #2b2d3c;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pw-product-card:active {
  transform: scale(0.98);
}

.pw-product-card--selected {
  border-color: #f5c85b;
}

.pw-product-card:focus-visible,
.pw-retry-btn:focus-visible,
.pw-confirm-btn:focus-visible,
.pw-review-close:focus-visible,
.pw-legal-links a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pw-product-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pw-product-name {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 16px;
  font-weight: 650;
}

.pw-product-price {
  flex-shrink: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 750;
}

.pw-product-quantity {
  display: block;
  margin-top: 8px;
  color: #ffd45d;
  font-size: 15px;
  font-weight: 650;
}

.pw-product-description {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.4;
}

.pw-review {
  margin-top: 4px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #171820;
}

.pw-review-backdrop,
.pw-review-close {
  display: none;
}

.pw-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pw-review-heading {
  margin: 0 0 14px;
  font-size: 19px;
}

.pw-review-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pw-review-name,
.pw-review-description,
.pw-review-price,
.pw-review-status {
  margin: 0;
}

.pw-review-name {
  font-size: 16px;
  font-weight: 700;
}

.pw-review-description {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.45;
}

.pw-review-price {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 750;
}

.pw-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0;
}

.pw-legal-links a {
  color: #8bbcff;
  font-size: 14px;
  text-decoration: underline;
}

.pw-legal-links .pw-legal-link--invalid {
  color: rgba(255, 255, 255, 0.38);
  cursor: not-allowed;
}

.pw-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.pw-consent-label input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-primary, #e4486b);
}

.pw-review-status {
  min-height: 20px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.4;
}

.pw-confirm-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 0;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--color-primary, #e4486b);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.pw-review-actions {
  margin-top: 10px;
}

.pw-confirm-btn:disabled {
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.12);
  cursor: not-allowed;
}

@media (max-width: 360px) {
  .pw-body {
    padding-right: 12px;
    padding-left: 12px;
  }

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

  .pw-review-summary,
  .pw-product-heading {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 767px) {
  body.pw-review-open {
    overscroll-behavior: none;
  }

  body.pw-review-open .pw-body {
    overflow: hidden;
  }

  .pw-review-backdrop {
    position: fixed;
    z-index: 3;
    inset: 0;
    display: block;
    background: rgba(0, 0, 0, 0.68);
  }

  .pw-review {
    position: fixed;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 88vh;
    max-height: min(88dvh, 720px);
    margin: 0;
    padding: 20px 18px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.45);
  }

  .pw-review-close {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -10px -10px 0 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
  }

  .pw-review-actions {
    position: sticky;
    bottom: 0;
    margin: 10px -18px 0;
    padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #171820;
  }
}

@media (min-width: 768px) {
  .pw-body {
    width: 100%;
    max-width: 1120px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 24px;
    padding-left: 24px;
  }

  .plan-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coins-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
