/* Subscription state and purchase recovery layer — bundle v785. */
.paywall-access-card {
  display: grid;
  gap: 0.42rem;
  margin: 0.85rem 0 1rem;
  padding: 1rem;
  color: #f8fafc;
  background: #10151d;
  border: 1px solid #64748b;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 28%);
}

.paywall-access-card:focus-visible {
  outline: 3px solid #f8fafc;
  outline-offset: 3px;
}

.paywall-access-card > span {
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.paywall-access-card > strong {
  color: #fff;
  font-size: clamp(1rem, 3.8vw, 1.22rem);
  line-height: 1.25;
}

.paywall-access-card > p {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.5;
}

#paywallRefreshSubscriptionButton {
  width: 100%;
  min-height: 44px;
  margin-top: 0.12rem;
}

.paywall-access-card[data-state="active"] {
  background: #052e24;
  border-color: #34d399;
}

.paywall-access-card[data-state="active"] > span,
.paywall-access-card[data-state="active"] > p {
  color: #d1fae5;
}

.paywall-access-card[data-state="checking"] {
  background: #172554;
  border-color: #93c5fd;
}

.paywall-access-card[data-state="checking"] > span,
.paywall-access-card[data-state="checking"] > p {
  color: #dbeafe;
}

.paywall-access-card[data-state="warning"] {
  background: #422006;
  border-color: #fbbf24;
}

.paywall-access-card[data-state="warning"] > span,
.paywall-access-card[data-state="warning"] > p {
  color: #fef3c7;
}

.paywall-access-card[data-state="error"] {
  background: #450a0a;
  border-color: #fca5a5;
}

.paywall-access-card[data-state="error"] > span,
.paywall-access-card[data-state="error"] > p {
  color: #fee2e2;
}

#paywallContinueButton {
  width: 100%;
  min-height: 46px;
  margin-top: 0.35rem;
  color: #052e24 !important;
  background: #a7f3d0 !important;
  border-color: #d1fae5 !important;
  font-weight: 900 !important;
}

.paywall-access-card + .paywall-actions {
  margin: -0.35rem 0 0.85rem;
}

.paywall-access-card[data-state="error"] + .paywall-actions #restorePurchasesButton {
  color: #450a0a !important;
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  font-weight: 900 !important;
}

.paywall-product.is-current {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 2px rgb(52 211 153 / 32%), 0 18px 38px rgb(0 0 0 / 28%) !important;
}

.paywall-product.is-current .paywall-plan-cta {
  color: #052e24 !important;
  background: #a7f3d0 !important;
  border-color: #d1fae5 !important;
}

body[data-theme] .paywall-product.is-included:disabled,
html.native-layout-guard body[data-theme] .paywall-product.is-included:disabled,
.paywall-product.is-included:disabled {
  opacity: 1 !important;
  cursor: default;
}

.paywall-product.is-included:not(.is-current):disabled {
  border-color: #64748b !important;
}

.paywall-product.is-included:not(.is-current):disabled .paywall-plan-cta {
  color: #f8fafc !important;
  background: #334155 !important;
  border-color: #64748b !important;
}

.paywall-store-status[data-tone="error"] {
  color: #fee2e2 !important;
  background: #450a0a !important;
  border-color: #fca5a5 !important;
}

.paywall-store-status[aria-busy="true"]::before,
#restorePurchasesButton[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.48rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: stylebrain-entitlement-spin 0.8s linear infinite;
}

.app-toast[data-tone="success"] {
  color: #052e24 !important;
  background: #a7f3d0 !important;
  border-color: #34d399 !important;
}

.app-toast[data-tone="warning"] {
  color: #422006 !important;
  background: #fde68a !important;
  border-color: #f59e0b !important;
}

.app-toast[data-tone="error"] {
  color: #450a0a !important;
  background: #fecaca !important;
  border-color: #ef4444 !important;
}

.paywall-close {
  min-width: 48px !important;
  min-height: 48px !important;
}

.paywall-actions button,
.paywall-legal a {
  min-height: 44px !important;
}

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

@media (max-width: 900px) {
  body[data-subscription-decision="checking"] #subscriptionButton,
  body[data-subscription-decision="error"] #subscriptionButton,
  body[data-subscription="active"] #subscriptionButton,
  body[data-subscription-persistence="dirty"] #subscriptionButton,
  body.native-layout-guard[data-subscription-decision="checking"] #subscriptionButton,
  body.native-layout-guard[data-subscription-decision="error"] #subscriptionButton,
  body.native-layout-guard[data-subscription="active"] #subscriptionButton,
  body.native-layout-guard[data-subscription-persistence="dirty"] #subscriptionButton {
    position: fixed !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    right: 10px !important;
    z-index: 260 !important;
    display: flex !important;
    min-height: 44px !important;
    max-width: min(52vw, 190px) !important;
    color: #f8fafc !important;
    background: #0f172a !important;
    border: 1px solid #94a3b8 !important;
    box-shadow: 0 10px 28px rgb(0 0 0 / 38%) !important;
  }

  body[data-subscription="active"] #subscriptionButton {
    color: #d1fae5 !important;
    background: #052e24 !important;
    border-color: #34d399 !important;
  }

  body[data-subscription-decision="error"] #subscriptionButton,
  body[data-subscription-persistence="dirty"] #subscriptionButton {
    color: #fee2e2 !important;
    background: #450a0a !important;
    border-color: #fca5a5 !important;
  }

  .paywall-product li,
  .paywall-product b,
  .paywall-product em i,
  .paywall-plan-cta {
    font-size: max(0.72rem, 11px) !important;
  }

  .paywall-plan-cta {
    min-height: 36px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .paywall-store-status[aria-busy="true"]::before,
  #restorePurchasesButton[aria-busy="true"]::before {
    animation-duration: 1.8s;
  }
}
