/* Two independent columns avoid the blank staircase created by one shared
   CSS grid. Desktop checkout fits into one compact dialog; one scrollbar is
   kept only as a safe fallback for short screens and expanded optional fields. */
#checkout-dialog {
  width: min(1080px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
#checkout-dialog > form {
  max-height: calc(100dvh - 24px);
  padding: 26px 26px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
#checkout-dialog .checkout-product-heading,
#checkout-dialog .checkout-payment-heading { padding: 0 0 5px; min-height: 59px; }
#checkout-dialog .checkout-payment-heading { padding-right: 38px; }
#checkout-dialog .checkout-product-heading .eyebrow,
#checkout-dialog .checkout-payment-heading .eyebrow { margin: 0 0 7px; font-size: 10px; letter-spacing: .16em; color: var(--muted); }
#checkout-dialog .checkout-product-heading h2,
#checkout-dialog .checkout-payment-heading h2 { margin: 0; font-size: 25px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
#checkout-dialog .dialog-close { top: 20px; right: 22px; width: 32px; height: 32px; background: var(--panel-2); border-color: var(--line); border-radius: 50%; font-size: 21px; }
#checkout-dialog .checkout-description {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
#checkout-dialog .checkout-description::before {
  content: attr(data-text-heading);
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}
#checkout-dialog .checkout-workspace {
  display: grid;
  grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr);
  gap: 28px;
  align-items: start;
  margin-top: 0;
}
#checkout-dialog .checkout-column { display: grid; gap: 12px; min-width: 0; align-content: start; }
#checkout-dialog .checkout-column > * { min-width: 0; margin-top: 0; margin-bottom: 0; }
#checkout-dialog .checkout-column-payment { padding-left: 22px; border-left: 1px solid var(--line); }
#checkout-dialog .checkout-contents { padding: 10px 12px; }
#checkout-dialog .checkout-contents > strong { margin-bottom: 6px; }
#checkout-dialog .checkout-contents > div { gap: 6px; }
#checkout-dialog .checkout-contents span { min-height: 40px; padding: 5px 8px; }
#checkout-dialog .cash-gateway-panel { padding: 11px 13px; }
#checkout-dialog .cash-gateway-panel label { gap: 5px; margin: 7px 0; font-size: 12px; }
#checkout-dialog .cash-gateway-panel input,
#checkout-dialog .cash-gateway-panel select { padding: 9px 10px; }
#checkout-dialog .cash-gateway-panel p { margin-top: 7px; font-size: 10px; line-height: 1.35; }
#checkout-dialog .payment-method-section { margin: 0; }
#checkout-dialog .payment-caption { display: none; }
#checkout-dialog .payment-method-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
#checkout-dialog .payment-method-grid > .payment-method:not(.hidden):only-child,
#checkout-dialog .payment-method-grid:not(:has(> .payment-method:not(.hidden) ~ .payment-method:not(.hidden))) > .payment-method:not(.hidden) { grid-column: 1 / -1; }
#checkout-dialog .payment-method { min-height: 68px; grid-template-columns: 34px minmax(0,1fr); gap: 12px; padding: 12px 14px; margin: 0; }
#checkout-dialog .payment-symbol { width: 34px; height: 34px; }
#checkout-dialog .switch-line { min-height: 43px; padding: 9px 11px; font-size: 12px; }
#checkout-dialog .admin-free-switch { margin: 0; }
#checkout-dialog .field { gap: 5px; margin: 8px 0; }
#checkout-dialog .field input,
#checkout-dialog .field select,
#checkout-dialog .field textarea { padding: 9px 11px; }
#checkout-dialog .field textarea { min-height: 58px; }
#checkout-dialog #recipient-section { display: grid; gap: 7px; }
#checkout-dialog #recipient-section > .field { margin: 0; }
#checkout-dialog .quantity { padding: 8px 0; }
#checkout-dialog .donation-note { padding: 10px; margin: 0; }
#checkout-dialog .eligibility-panel { min-height: 56px; margin: 0; padding: 9px 11px; }
#checkout-dialog .checkout-promo { margin: 0; padding: 10px 12px; }
#checkout-dialog .checkout-promo > label { margin-bottom: 5px; }
#checkout-dialog .promo-status { margin-top: 6px; font-size: 9px; line-height: 1.35; }
#checkout-dialog #checkout-error { min-height: 0; margin: 7px 0 0; }
#checkout-dialog #checkout-error:empty { display: none; }
#checkout-dialog .checkout-total { margin-top: 16px; padding: 14px 0 10px; }
#checkout-dialog .checkout-total strong { font-size: 21px; }
#checkout-dialog #checkout-submit { padding: 11px 18px; }
#checkout-dialog .fineprint { margin: 6px 0 0; font-size: 9px; line-height: 1.35; }
/* Media products use the otherwise empty payment column for the recipient
   and purchase summary. Regular products retain their full-width footer. */
#checkout-dialog.checkout-with-media .checkout-column { gap: 10px; }
#checkout-dialog.checkout-with-media .checkout-description { padding: 11px 14px; line-height: 1.55; }
#checkout-dialog.checkout-with-media #checkout-video { padding: 10px; }
#checkout-dialog.checkout-with-media #checkout-video h3 { font-size: 12px; margin-bottom: 8px; }
#checkout-dialog.checkout-with-media #recipient-section { padding-top: 10px; border-top: 1px solid var(--line); }
#checkout-dialog.checkout-with-media .checkout-total { margin: 0; padding: 10px 0; gap: 12px; }
#checkout-dialog.checkout-with-media .checkout-total strong { white-space: nowrap; }
#checkout-dialog.checkout-with-media .purchase-support-hint { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 8px 10px; padding: 12px; margin: 0 0 10px; border-radius: 12px; }
#checkout-dialog.checkout-with-media .psh-icon { width: 30px; height: 30px; font-size: 19px; }
#checkout-dialog.checkout-with-media .psh-copy { gap: 4px; }
#checkout-dialog.checkout-with-media .psh-title { font-size: 15px; }
#checkout-dialog.checkout-with-media .psh-details,
#checkout-dialog.checkout-with-media .psh-note { font-size: 11px; line-height: 1.35; }
#checkout-dialog.checkout-with-media .psh-action { grid-column: 1 / -1; min-width: 0; width: 100%; min-height: 40px; padding: 8px 10px; flex-direction: row; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
@media (min-width: 821px) and (max-height: 820px) {
  #checkout-dialog.checkout-with-media > form { padding-top: 18px; padding-bottom: 16px; }
  #checkout-dialog.checkout-with-media .checkout-column { gap: 6px; }
  #checkout-dialog.checkout-with-media .checkout-product-heading,
  #checkout-dialog.checkout-with-media .checkout-payment-heading { min-height: 50px; }
  #checkout-dialog.checkout-with-media .payment-method { min-height: 58px; padding: 8px 12px; }
  #checkout-dialog.checkout-with-media .switch-line { min-height: 36px; padding: 7px 10px; }
  #checkout-dialog.checkout-with-media .checkout-promo { padding: 8px 10px; }
  #checkout-dialog.checkout-with-media .promo-input-row input,
  #checkout-dialog.checkout-with-media .promo-input-row button { padding: 8px 10px; }
  #checkout-dialog.checkout-with-media #recipient-section { padding-top: 8px; }
  #checkout-dialog.checkout-with-media .quantity { padding: 4px 0; }
  #checkout-dialog.checkout-with-media .checkout-total { padding: 6px 0; }
  #checkout-dialog.checkout-with-media .field input { padding-top: 7px; padding-bottom: 7px; }
  #checkout-dialog.checkout-with-media .purchase-support-hint { padding: 10px; gap: 6px 8px; }
  #checkout-dialog.checkout-with-media .product-video-frame { max-height: 200px; }
}
@media (max-width: 820px) {
  #checkout-dialog { width: min(570px, calc(100vw - 18px)); max-height: calc(100dvh - 16px); }
  #checkout-dialog > form { max-height: calc(100dvh - 16px); padding: 20px 16px 16px; scrollbar-gutter: auto; }
  #checkout-dialog .checkout-workspace { grid-template-columns: 1fr; gap: 10px; }
  #checkout-dialog .checkout-product-heading { padding-right: 36px; }
  #checkout-dialog .checkout-column-payment { margin-top: 6px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  #checkout-dialog .checkout-payment-heading { min-height: 0; padding: 0 0 2px; }
  #checkout-dialog .checkout-payment-heading .eyebrow { display: none; }
  #checkout-dialog .checkout-payment-heading h2 { font-size: 20px; }
  #checkout-dialog .dialog-close { top: 16px; right: 14px; }
  #checkout-dialog .payment-method-grid { grid-template-columns: 1fr; }
}
