.membership-checkout-dialog {
  position: fixed;
  inset: 0;
  width: min(94vw, 860px);
  max-height: min(90vh, 760px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  overflow: auto;
}

.membership-checkout-dialog::backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(4px);
}

.membership-checkout-dialog .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.membership-checkout-card {
  box-sizing: border-box;
  width: 100%;
  padding: 28px;
  border: 1px solid var(--sf-line);
  border-radius: 22px;
  background: var(--sf-surface);
  color: var(--sf-ink);
}

.membership-checkout-heading h2 {
  margin: 8px 0 22px;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.membership-checkout-form,
.membership-checkout-step,
.membership-coupon {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.membership-checkout-step {
  padding: 18px;
  border: 1px solid var(--sf-line);
  border-radius: 16px;
  background: var(--sf-panel-soft);
}

.membership-checkout-step[hidden],
[data-membership-coupon-breakdown][hidden] {
  display: none;
}

.membership-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.membership-step-title > span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--sf-accent);
  color: #fff;
  font-weight: 850;
}

.membership-step-title h3 {
  margin: 0;
  font-size: 1rem;
}

.membership-payment-methods {
  display: grid;
  gap: 12px;
  width: min(100%, 640px);
  min-width: 0;
  margin: 0 auto;
  padding: 0;
  border: 0;
}

.membership-payment-methods[data-method-count="1"] {
  width: min(100%, 520px);
}

.membership-payment-method-option {
  display: flex;
  min-width: 0;
  min-height: 76px;
  cursor: pointer;
}

.membership-payment-method-option > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.membership-payment-method-option > span {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--sf-line);
  border-radius: 13px;
  background: var(--sf-surface);
}

.membership-payment-method-option .membership-payment-method-logo-frame {
  display: flex;
  box-sizing: border-box;
  flex: 0 0 72px;
  width: 72px;
  height: 36px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border-radius: 6px;
  background: #fff;
}

.membership-payment-method-logo {
  display: block;
  flex: none;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 34px;
  object-fit: contain;
  object-position: center;
  overflow: visible;
}

.membership-payment-method-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.membership-payment-method-copy strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: .98rem;
  font-weight: 800;
}

.membership-payment-method-copy strong em {
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #b45309;
  font-size: .68rem;
  font-style: normal;
  text-transform: uppercase;
}

.membership-payment-method-option.is-maintenance > span {
  border-style: dashed;
}

.membership-payment-method-message {
  min-height: 1.4em;
  margin: 0;
  color: #b45309;
  font-size: .86rem;
}

.membership-payment-method-option small {
  color: var(--sf-muted);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.membership-payment-method-option > input:checked + span {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sf-accent) 22%, transparent);
}

.membership-payment-method-option > input:focus-visible + span {
  outline: 2px solid var(--sf-accent);
  outline-offset: 2px;
}

.membership-plan-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  min-width: 0;
}

.membership-plan-summary > span:first-child {
  grid-column: 1 / -1;
  color: var(--sf-muted);
  font-size: .78rem;
}

.membership-plan-summary strong,
.membership-plan-summary [data-confirm-price-output] {
  overflow-wrap: anywhere;
}

.membership-coupon .auth-field,
.membership-coupon .auth-field input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.membership-coupon-actions,
.membership-checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.membership-coupon-actions .storefront-button,
.membership-checkout-actions .storefront-button {
  width: auto;
  min-width: 120px;
}

.membership-checkout-actions {
  justify-content: flex-end;
}

.membership-coupon [data-membership-coupon-message] {
  min-height: 1.4em;
  margin: 0;
  color: var(--sf-muted);
}

.membership-coupon dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.membership-coupon dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.membership-coupon dd {
  margin: 0;
  text-align: right;
}

.pricing-grid {
  align-items: stretch;
}

.pricing-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (min-width: 901px) {
  .pricing-card-featured {
    padding-block: 29px;
  }
}

.pricing-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 76px;
  margin: 0;
}

.pricing-price {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  max-width: 100%;
  font-size: clamp(1.65rem, 2.65vw, 2.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.pricing-price-primary,
.pricing-price-secondary {
  white-space: nowrap;
}

.pricing-price-secondary {
  color: var(--sf-text-secondary);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  margin-inline-start: .25em;
}

.pricing-old-price {
  max-width: 100%;
  color: var(--sf-text-muted);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.pricing-card .pricing-benefits {
  min-width: 0;
  flex: 1 1 auto;
}

.pricing-card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 13px;
  min-width: 0;
  margin-top: auto;
}

.pricing-card-actions .storefront-button {
  align-self: flex-end;
  width: auto;
  min-width: 156px;
}

.pricing-card-actions .pricing-login-link {
  margin-top: 0;
}

@media (max-width: 560px) {
  .membership-checkout-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .membership-checkout-card {
    padding: 18px;
    border-radius: 18px;
  }

  .membership-checkout-step {
    padding: 14px;
  }

  .membership-payment-methods[data-method-count] {
    width: 100%;
  }

  .membership-payment-method-option {
    min-height: 68px;
  }

  .membership-payment-method-option > span {
    gap: 12px;
    padding: 10px 12px;
  }

  .membership-payment-method-option .membership-payment-method-logo-frame {
    flex-basis: 60px;
    width: 60px;
    height: 32px;
  }

  .membership-payment-method-logo {
    max-height: 30px;
  }

  .membership-coupon-actions,
  .membership-checkout-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .membership-coupon-actions .storefront-button,
  .membership-checkout-actions .storefront-button {
    width: 100%;
    min-width: 0;
  }

  .pricing-prices {
    min-height: 0;
  }
}

.pricing-card-featured {
  border-color: var(--sf-accent);
  box-shadow: 0 16px 48px var(--sf-accent-glow, rgba(255, 104, 71, .25));
}

/* Keep the desktop row aligned without preserving an oversized minimum card. */
.pricing-grid {
  align-items: stretch;
}

.pricing-card {
  min-height: 0;
  height: 100%;
  gap: 0;
}

.pricing-card-heading {
  min-height: 46px;
}

.pricing-card-badge {
  position: absolute;
  top: 52px;
  left: 30px;
  right: auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--sf-accent) 32%, var(--sf-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--sf-accent) 10%, var(--sf-surface));
  color: var(--sf-accent);
  font-size: .68rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.pricing-card h2 {
  margin-top: 16px;
  margin-bottom: 10px;
}

.pricing-card .pricing-benefits {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.pricing-card .pricing-benefits li {
  margin-block: 10px;
}

.pricing-card-actions {
  margin-top: auto;
}

@media (max-width: 560px) {
  .pricing-card {
    height: auto;
  }

  .pricing-card-heading {
    min-height: 42px;
  }

  .pricing-card-badge {
    top: 44px;
    left: 20px;
  }

  .pricing-card-actions {
    margin-top: 0;
  }

  .pricing-card-actions .storefront-button {
    width: 100%;
    align-self: stretch;
  }
}

.pricing-decision-section,
.pricing-faq-section {
  padding: 0 0 72px;
}

.pricing-section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.pricing-section-heading h2 {
  margin: 0;
  color: var(--sf-ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -.025em;
}

.pricing-section-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--sf-muted);
  line-height: 1.55;
}

.pricing-comparison-scroll {
  overflow-x: auto;
  border: 1px solid var(--sf-line);
  border-radius: 16px;
  background: var(--sf-surface);
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.pricing-comparison-scroll:focus-visible {
  outline: 2px solid var(--sf-accent);
  outline-offset: 3px;
}

.pricing-comparison {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--sf-ink);
  font-size: .88rem;
  line-height: 1.45;
}

.pricing-comparison th,
.pricing-comparison td {
  min-width: 180px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--sf-line);
  text-align: left;
  vertical-align: top;
}

.pricing-comparison thead th {
  min-width: 180px;
  background: var(--sf-panel-soft);
  font-size: .82rem;
  font-weight: 800;
}

.pricing-comparison thead th:first-child,
.pricing-comparison tbody th {
  min-width: 138px;
  width: 138px;
}

.pricing-comparison tbody th {
  color: var(--sf-muted);
  font-size: .78rem;
  font-weight: 800;
}

.pricing-comparison tbody tr:last-child th,
.pricing-comparison tbody tr:last-child td {
  border-bottom: 0;
}

.pricing-comparison td ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.pricing-faq-list {
  display: grid;
  gap: 10px;
  max-width: 880px;
}

.pricing-faq-item {
  overflow: hidden;
  border: 1px solid var(--sf-line);
  border-radius: 14px;
  background: var(--sf-surface);
}

.pricing-faq-item summary {
  display: flex;
  min-height: 56px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  color: var(--sf-ink);
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.pricing-faq-item summary::-webkit-details-marker {
  display: none;
}

.pricing-faq-item summary span {
  flex: 0 0 auto;
  color: var(--sf-accent);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  transition: transform .18s ease;
}

.pricing-faq-item summary:hover {
  background: var(--sf-panel-soft);
}

.pricing-faq-item summary:focus-visible {
  outline: 2px solid var(--sf-accent);
  outline-offset: -3px;
}

.pricing-faq-item[open] summary span {
  transform: rotate(45deg);
}

.pricing-faq-answer {
  padding: 0 16px 16px;
  color: var(--sf-muted);
}

.pricing-faq-answer p {
  max-width: 760px;
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .pricing-decision-section,
  .pricing-faq-section {
    padding-bottom: 52px;
  }

  .pricing-comparison {
    min-width: 680px;
  }

  .pricing-comparison th,
  .pricing-comparison td {
    padding: 13px 12px;
  }

  .pricing-faq-item summary {
    min-height: 60px;
    padding: 14px;
  }

  .pricing-faq-answer {
    padding: 0 14px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-faq-item summary span {
    transition: none;
  }
}
