/* The host must never be transformed: Donorbox positions its own tab and popup. */
dbox-widget#sff-donate-popup {
  display: block;
  position: static;
  width: 0;
  height: 0;
  min-width: 0;
  min-inline-size: 0;
  max-inline-size: none;
  visibility: hidden;
}
dbox-widget#sff-donate-popup[data-ready="true"] { visibility: visible; }
.sff-donate-fallback {
  position: fixed;
  z-index: 9999;
  top: 50%;
  right: 22px;
  transform: translate(50%, -50%) rotate(-90deg);
  padding: 11px 26px;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 12px 12px 0 0;
  background: #dc1f25;
  color: #fff;
  font: 600 16px/22px "Instrument Sans", sans-serif;
  text-decoration: none;
  box-shadow: 0 -5px 24px rgba(39,56,126,.18), inset 0 1px rgba(255,255,255,.22);
}
.sff-donate-fallback:hover, .sff-donate-fallback:focus-visible { color: #fff; background: #27387e; }
.sff-donate-fallback[hidden] { display: none; }
.sff-donate-fallback:focus-visible { outline: 3px solid #9fd0f0; outline-offset: 3px; }
html.sff-donation-open, html.sff-donation-open body { overflow: hidden; }

/* This same stylesheet is loaded inside the provider's open shadow root.
   These guarded selectors affect only the outer SFF popup, not payment fields. */
:host(#sff-donate-popup) #donate_button {
  min-height: 44px;
  font-family: "Instrument Sans", sans-serif;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -5px 24px rgba(39,56,126,.18), inset 0 1px rgba(255,255,255,.22);
  transition: box-shadow .2s ease, filter .2s ease;
  animation: none;
}
:host(#sff-donate-popup) #donate_button.sticky.right { right: 22px; }
:host(#sff-donate-popup) #donate_button img { animation: none; }
:host(#sff-donate-popup) #donate_button::after { display: none; animation: none; }
:host(#sff-donate-popup) #donate_button:hover { filter: brightness(.93); box-shadow: 0 -6px 28px rgba(39,56,126,.3); }
:host(#sff-donate-popup) #donate_button:focus-visible,
:host(#sff-donate-popup) #close_button:focus-visible { outline: 3px solid #9fd0f0; outline-offset: 4px; }
:host(#sff-donate-popup) #dialog-backdrop {
  background: rgba(17,28,65,.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
:host(#sff-donate-popup) #dialog {
  box-sizing: border-box;
  padding: 32px 24px max(32px, env(safe-area-inset-bottom));
  max-height: 100dvh;
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  overscroll-behavior: contain;
}
:host(#sff-donate-popup) .sff-donation-brand {
  display: block;
  width: 216px;
  max-width: 65vw;
  height: auto;
  margin: 0 auto 22px;
}
:host(#sff-donate-popup) #dialog-title {
  max-width: 425px;
  margin: 0 auto 24px;
  color: #fff;
  font-family: "Phudu", sans-serif;
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
:host(#sff-donate-popup) #dialog-card {
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0,0,0,.26);
}
:host(#sff-donate-popup) #form-wrapper {
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 8px 0 rgba(159,208,240,.1);
}
:host(#sff-donate-popup) #close_form {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
:host(#sff-donate-popup) #close_button {
  width: 44px;
  height: 44px;
  padding: 10px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: #27387e;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
:host(#sff-donate-popup) #close_button path { stroke: currentColor; }
:host(#sff-donate-popup) #dialog-footer { margin: 24px 0 0; padding-bottom: 12px; }
@media (max-width: 600px) {
  :host(#sff-donate-popup) #dialog {
    width: 100%;
    max-width: 100%;
    padding: max(68px, calc(env(safe-area-inset-top) + 56px)) 12px max(24px, env(safe-area-inset-bottom));
  }
  :host(#sff-donate-popup) .sff-donation-brand { width: 184px; margin-bottom: 18px; }
  :host(#sff-donate-popup) #dialog-title { max-width: 340px; font-size: 25px; margin-bottom: 22px; }
}
@media (max-width: 343px) {
  :host(#sff-donate-popup) #dialog { padding-left: 0; padding-right: 0; }
  :host(#sff-donate-popup) #dialog-title { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  :host(#sff-donate-popup) #donate_button { transition: none; }
}
