.gem-stripe-checkout-dialog::part(panel) {
  width: min(520px, calc(100vw - 24px));
  max-width: 520px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.gem-stripe-checkout-dialog::part(header) {
  min-height: 48px;
  padding: 12px 16px;
}

.gem-stripe-checkout-dialog::part(title) {
  font-size: var(--font_large);
  line-height: 20px;
}

.gem-stripe-checkout-dialog::part(body) {
  padding: 0 16px 14px;
  overflow: auto;
}

.gem-stripe-checkout-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.gem-stripe-checkout-status {
  color: var(--textSecondary);
  font-family: var(--fontInter);
  font-size: var(--font_main);
  line-height: 1.4;
  padding-bottom: 8px;
}

.gem-stripe-checkout-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding-bottom: 0;
}

.gem-stripe-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(123, 77, 255, 0.2);
  border-top-color: var(--Purple);
  border-radius: 50%;
  animation: plus-checkout-spin 0.8s linear infinite;
}

.gem-stripe-checkout-status:empty {
  display: none;
}

.gem-stripe-checkout-root {
  min-height: 0;
  display: flex;
  justify-content: center;
}

.gem-stripe-checkout-root > * {
  width: 100%;
  margin: 0 auto;
}

.gem-stripe-compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--textMain);
  font-family: var(--fontInter);
  font-size: var(--font_main);
  line-height: 18px;
  font-weight: var(--fontweight_500);
}

.gem-stripe-compact-summary > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gem-stripe-compact-summary > span strong {
  color: var(--textMain);
  font-size: var(--font_main);
  line-height: 18px;
  font-weight: var(--fontweight_heavy);
}

.gem-stripe-compact-summary small {
  color: var(--textSecondary);
  font-size: var(--font_second);
  line-height: 16px;
}

.gem-stripe-compact-summary > strong {
  font-size: var(--font_large);
  font-weight: var(--fontweight_heavy);
  white-space: nowrap;
}

.gem-stripe-saved-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gem-stripe-saved-method {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--menu);
  border-radius: 8px;
  background: var(--background);
  color: var(--textMain);
  font-family: var(--fontInter);
  font-size: var(--font_main);
  line-height: 18px;
  box-sizing: border-box;
}

.gem-stripe-saved-method input,
.gem-stripe-save-card input {
  accent-color: var(--Purple);
}

.gem-stripe-new-card-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--Purple);
  font-family: var(--fontInter);
  font-size: var(--font_second);
  font-weight: var(--fontweight_heavy);
  line-height: 18px;
  padding: 0;
}

.gem-stripe-payment-element-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gem-stripe-save-card {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--textSecondary);
  font-family: var(--fontInter);
  font-size: var(--font_second);
  line-height: 16px;
}

.gem-stripe-confirm-error {
  color: var(--red, #df1b41);
  font-family: var(--fontInter);
  font-size: var(--font_second);
  line-height: 16px;
}

.gem-stripe-confirm-error:empty {
  display: none;
}

.gem-stripe-pay-button {
  width: 100%;
}

.gem-stripe-compact-summary[hidden],
.gem-stripe-saved-methods[hidden],
.gem-stripe-payment-element-wrap[hidden],
.gem-stripe-pay-button[hidden] {
  display: none !important;
}

sl-drawer.gem-stripe-checkout-dialog::part(panel) {
  height: calc(100dvh - 8px);
  width:100%;
  max-height: calc(100dvh - 8px);
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
}

sl-drawer.gem-stripe-checkout-dialog::part(body) {
  padding: 0 10px 8px;
}

sl-drawer.gem-stripe-checkout-dialog .gem-stripe-checkout-loading {
  min-height: calc(100dvh - 180px);
}


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

/* Annual Ribblr+ checkout: "Billed yearly · Switch to monthly" */
.plus-checkout-period-switch {
  text-align: center;
  color: var(--textSecondary);
  font-family: var(--fontInter);
  font-size: var(--font_second);
}

.plus-checkout-period-switch button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--Purple);
  font: inherit;
  font-weight: var(--fontweight_600, 600);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
