/* Let all localized labels fit without shrinking text or removing a step. */
@media (max-width: 740px) {
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-progress__item,
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-progress__label {
    min-inline-size: 0;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-progress__label {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-modal__title { overflow-wrap: anywhere; }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-modal__close { flex: none; }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-checkout-action .nx-bios-cta--ghost { min-inline-size: 44px; }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-checkout-action__consent-jump { min-block-size: 44px; }
}
@media (max-width: 360px) {
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-progress__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice .nx-bios-progress__number {
    flex: none;
  }
}

/* Keep the real DOM and radio order. Replace repeated frames with a single
   selection fill, and use two columns only when the first list needs room. */
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option {
  --nx-method-row-padding: 8px;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  min-inline-size: 0;
  min-block-size: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option > input[type="radio"] {
  position: static;
  inline-size: 16px;
  block-size: 16px;
  min-inline-size: 16px;
  min-block-size: 16px;
  clip-path: none;
  color-scheme: dark;
  accent-color: var(--nx-accent-soft);
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option .nx-bios-method-brand-heading > strong {
  font-size: max(14px, .875rem);
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option .nx-bios-payment-badge {
  --nx-method-mark-width: 36px;
  --nx-method-mark-height: 28px;
  --nx-method-mark-gap: 2px;
  --nx-method-mark-padding: 0px;
  --nx-method-mark-border: none;
  --nx-method-mark-background: transparent;
  justify-self: end;
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option .nx-bios-payment-badge > :is(img, svg) {
  max-inline-size: 100%;
  max-block-size: 22px;
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option .nx-bios-payment-badge:has(> img + img) {
  --nx-method-mark-width: 44px;
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option .nx-bios-payment-badge:has(> img + img) > img {
  max-inline-size: calc((100% - 2px) / 2);
}
/* PayPal's label already identifies the route visually. Preserve its full
   label text for assistive technology while keeping the row height even. */
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option:has(> input[value="paypal"]) .nx-bios-method-option__hint {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (hover: hover) {
  html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option:hover:not(:has(input:disabled)) { background: var(--nx-elevated); }
}
html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice > .nx-bios-method-option.is-selected {
  background: color-mix(in srgb, var(--nx-accent-soft) 14%, var(--nx-surface));
  box-shadow: none;
}
@media (min-width: 360px) and (max-width: 740px), (min-width: 1024px) {
  html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice:has(> .nx-bios-method-option:nth-of-type(7)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice:has(> .nx-bios-method-option:nth-of-type(7)) > :not(.nx-bios-method-option) { grid-column: 1 / -1; }
}
/* The long localized card label keeps its full width on narrow phones;
   wallet names retain two columns without breaking a word or shrinking text. */
@media (min-width: 360px) and (max-width: 379px) {
  html[data-nx-stripe-version="3"] .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-choice:has(> .nx-bios-method-option:nth-of-type(7)) > .nx-bios-method-option:has(> input[value="stripe"]) {
    grid-column: 1 / -1;
  }
}

/* At practical landscape heights, keep the ready choice's header and price
   outside its scroller. Editing and smaller viewports retain the existing
   whole-panel fallback so a keyboard cannot crowd out the fields. */
@media (min-width: 600px) and (min-height: 340px) and (max-height: 420px) and (orientation: landscape) {
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) {
    padding-block: 8px;
    padding-inline: max(8px, env(safe-area-inset-left), env(safe-area-inset-right));
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-modal__panel {
    max-height: calc(var(--bios-viewport-height, 100dvh) - 16px);
    overflow: hidden;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-modal__head {
    position: relative;
    padding: 4px 16px;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 16px 16px;
    scroll-padding-block: 8px;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-details-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(208px, 32%, 300px);
    gap: 16px;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-option {
    min-height: 60px;
    padding-block: 6px;
  }
  /* In the limited height, put each existing badge beside both lines of copy. */
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-option__copy:has(> .nx-bios-method-brand-heading:not([style]) > .nx-bios-payment-badge) {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: center;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-option__copy:has(> .nx-bios-method-brand-heading:not([style]) > .nx-bios-payment-badge) > .nx-bios-method-brand-heading { display: contents; }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-option__copy:has(> .nx-bios-method-brand-heading:not([style]) > .nx-bios-payment-badge) > .nx-bios-method-brand-heading > strong,
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-option__copy:has(> .nx-bios-method-brand-heading:not([style]) > .nx-bios-payment-badge) > .nx-bios-method-option__hint {
    grid-column: 1;
    overflow-wrap: anywhere;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-method-option__copy:has(> .nx-bios-method-brand-heading:not([style]) > .nx-bios-payment-badge) > .nx-bios-method-brand-heading > .nx-bios-payment-badge {
    grid-area: 1 / 2 / span 2;
    align-self: center;
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-checkout-action {
    padding: 4px 16px max(4px, env(safe-area-inset-bottom));
  }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-checkout-action .nx-bios-cta--ghost { min-inline-size: 44px; }
  .nx-bios-modal.paypal-modal.nx-checkout-compact.is-step-choice:has(.nx-bios-details-step[data-nx-prefilled-choice]) .nx-bios-checkout-action__consent-jump { min-block-size: 44px; }
}
