/* ChildrenHeroes – FundraiseUp Donate Form
   Visual spec from Figma node 10315:218 ("checkout form"). */

.ch-fu-card,
.ch-fu-card * {
  box-sizing: border-box;
}

/* ===================================================================== *
 * Theme isolation — stop the host theme's global img/svg rules (often
 * !important, e.g. `img{max-width:100%;height:auto}`) from distorting the
 * form's graphics. Scoped to our roots; explicit sizes are forced.
 * ===================================================================== */
.ch-fu-card img,
.ch-fu-card svg,
.ch-fu-modal img,
.ch-fu-modal svg,
.ch-fu-heart-float svg {
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0; /* logo's intentional margin survives via a more specific rule */
}

/* Margins/paddings the theme adds to text/block elements. Our own padded
   elements (figure quote, badges, buttons) keep their styles by specificity. */
.ch-fu-card p,
.ch-fu-card h1,
.ch-fu-card h2,
.ch-fu-card h3,
.ch-fu-card h4,
.ch-fu-card blockquote,
.ch-fu-card figcaption,
.ch-fu-modal p,
.ch-fu-modal blockquote {
  margin: 0 !important;
  padding: 0 !important;
}

.ch-fu-left__photo     { width: 100% !important; height: 100% !important; }
.ch-fu-left__logo      { width: 168px !important; height: auto !important; }
.ch-fu-widget__logo    { height: auto !important; }
.ch-fu-quote__mark     { width: 55px !important; height: 55px !important; }
.ch-fu-quote__rule     { width: 63px !important; height: 2px !important; }
.ch-fu-badges img      { width: auto !important; height: 50px !important; }
.ch-fu-toggle__heart   { width: 26px !important; height: 24px !important; }
.ch-fu-ccy__chev       { width: 10px !important; height: 6px !important; }
.ch-fu-heart-float svg { width: 100% !important; height: 100% !important; }
.ch-fu-glow--a         { width: 1080px !important; height: 1080px !important; }
.ch-fu-glow--b         { width: 1120px !important; height: 860px !important; }

/* Form controls: neutralise theme button/input styling (borders, shadows,
   uppercase, spacing, min-heights). Visuals come from our own classes. */
.ch-fu-card button,
.ch-fu-card input,
.ch-fu-card textarea,
.ch-fu-card select,
.ch-fu-card a,
.ch-fu-trigger,
.ch-fu-modal button,
.ch-fu-modal input,
.ch-fu-ccy__menu input {
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  margin: 0 !important;
  min-height: 0 !important;
  text-shadow: none !important;
}

/* Reset inherited text tweaks themes apply at the body/* level. */
.ch-fu-card,
.ch-fu-modal {
  letter-spacing: normal;
  word-spacing: normal;
}

:root {
  --ch-fu-blue: #1f88c9;
  --ch-fu-blue-photo: #247ce0;
  --ch-fu-yellow: #ffe100;
  --ch-fu-yellow-light: #fffbda;
  --ch-fu-grey: #9fadbd;
  --ch-fu-text: #1e1e1e;
  --ch-fu-text-muted: #717c89;
  --ch-fu-grey-dark: #3b4856;
  --ch-fu-blue-light: #a2cbef;
  --ch-fu-right-bg: #f2f8ff;
  --ch-fu-quote-bg: rgba(19, 58, 82, 0.7);
}

/* ---------- Card shell ---------- */
.ch-fu-card {
  display: flex;
  align-items: stretch;
  width: 100%;
  /* Figma: photo column 536 + widget 737 (preset row 657 + padding 80). */
  max-width: 1440px;
  margin: 0 auto;
  /*background: #fff;*/
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ch-fu-text);
}

/* ---------- Left column ---------- */
.ch-fu-left {
  position: relative;
  /* Photo column 536/1273 ≈ 42% (Figma node 10385:9748). */
  flex: 0 0 42%;
  min-height: 640px;
  padding: 24px;
  background: var(--ch-fu-blue-photo);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ch-fu-left__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 1; /* desktop crop (10385:9748) is already tinted */
  pointer-events: none;
}

.ch-fu-left__logo {
  position: relative;
  z-index: 1;
  width: 168px;
  height: auto;
}

.ch-fu-left__bottom {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Testimonial quote ---------- */
.ch-fu-quote {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  padding: 10px 30px 10px 15px;
  background: var(--ch-fu-quote-bg);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border-radius: 20px;
  /* Bleed to the RIGHT edge of the photo column (toward the widget seam):
     rounded-left corners, square-right. */
  margin-right: -24px !important;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.ch-fu-quote__mark {
  flex: 0 0 auto;
  width: 55px;
  height: 55px;
}

.ch-fu-quote__body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ch-fu-quote__text {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  color: var(--ch-fu-yellow-light);
}

.ch-fu-quote__author {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: left;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  color: var(--ch-fu-yellow-light);
}

.ch-fu-quote__rule {
  flex: 0 0 auto;
  display: block;
  width: 63px;
  height: 2px;
}


/* ---------- Proof badges ---------- */
.ch-fu-badges {
  display: flex;
  align-items: flex-end;
  gap: 15px;
}

.ch-fu-badges img {
  height: 50px;
  width: auto;
  opacity: 0.85;
}

/* ---------- Right column ---------- */
.ch-fu-right {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 40px;
  background-color: var(--ch-fu-right-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Decorative blurred #247CE0 glows (Figma Ellipse 4 + Ellipse 5) over the
   #f2f8ff base. Reproduced from the original SVG assets so colour, blur and
   placement match the design exactly. */
.ch-fu-right__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ch-fu-glow {
  position: absolute;
  display: block;
  max-width: none;
}

/* Ellipse 4 — large glow off the left edge, vertically centred */
.ch-fu-glow--a {
  width: 1080px;
  height: 1080px;
  left: -14%;
  top: 40%;
  transform: translate(-50%, -50%);
}

/* Ellipse 5 — glow across the bottom, right of centre */
.ch-fu-glow--b {
  width: 1120px;
  height: 860px;
  left: 58%;
  top: 108%;
  transform: translate(-50%, -50%);
}

.ch-fu-widget {
  position: relative;
  z-index: 1;
}

.ch-fu-widget {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
}

/* Mobile logo lives at the top of the widget; hidden on desktop. */
.ch-fu-widget__logo {
  display: none;
}

.ch-fu-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ch-fu-text);
}

/* ---------- Frequency toggle ---------- */
.ch-fu-toggle {
  display: flex;
  gap: 20px;
}

.ch-fu-toggle__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 60px;
  padding: 10px 24px;
  border: 1px solid var(--ch-fu-grey);
  border-radius: 20px;
  background: #fff;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
  color: var(--ch-fu-text);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ch-fu-toggle__btn.is-active {
  background: var(--ch-fu-yellow);
}

.ch-fu-toggle__heart {
  width: 26px;
  height: 24px;
}

.ch-fu-subtitle {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  color: var(--ch-fu-text);
}

/* ---------- Preset rows ---------- */
.ch-fu-presets {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* `display:flex` above would otherwise override the browser's [hidden] rule. */
.ch-fu-presets[hidden] {
  display: none;
}

.ch-fu-preset {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 60px;
  padding: 10px 15px;
  border: 1px solid var(--ch-fu-grey);
  border-radius: 20px;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ch-fu-preset.is-selected {
  background: var(--ch-fu-yellow-light);
  border: 2px solid var(--ch-fu-blue);
}

.ch-fu-preset__main {
  display: flex;
  align-items: center;
  gap: 3px; /* Figma node 10385:9797 (amount→desc gap) */
  min-width: 0;
}

.ch-fu-preset__amount {
  flex: 0 0 auto;
  min-width: 56px;
  font-family: "Inter", "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ch-fu-blue);
}

.ch-fu-preset__desc {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  color: var(--ch-fu-text);
}

.ch-fu-preset__badge {
  flex: 0 0 auto;
  display: flex;
  width: 138px;
  padding: 5px 10px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 50px;
  background: var(--ch-fu-grey);
  color: #fff;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
}

.ch-fu-preset.is-selected .ch-fu-preset__badge {
  background: var(--ch-fu-blue);
}

/* The "Most popular" badge is light blue even when its preset is not selected
   (other badges stay grey). When selected, the is-selected rule above wins. */
.ch-fu-preset__badge--popular {
  background: var(--ch-fu-blue-light);
}

@property --ch-fu-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* The SELECTED preset gets the emphasis + a bright comet of light tracing its
   border. This follows the donor's choice — it starts on the "Most popular"
   preset (selected by default) and moves to whichever preset is clicked. */
.ch-fu-preset.is-selected::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 3px; /* ring thickness — thicker so the light reads clearly */
  background: conic-gradient(
    from var(--ch-fu-angle),
    rgba(124, 199, 255, 0) 0deg,
    rgba(124, 199, 255, 0) 200deg,
    rgba(124, 199, 255, 0.5) 250deg,
    rgba(160, 220, 255, 1) 300deg,
    #ffffff 330deg,
    rgba(160, 220, 255, 1) 350deg,
    rgba(124, 199, 255, 0.5) 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(124, 199, 255, 0.9));
  animation: ch-fu-trace 2.2s linear infinite;
}

@keyframes ch-fu-trace {
  to {
    --ch-fu-angle: 360deg;
  }
}

/* ---------- Pop feedback when a preset becomes selected ---------- */
@keyframes ch-fu-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.ch-fu-preset.ch-fu-pop {
  animation: ch-fu-pop 0.35s ease;
}

/* ---------- Attention bounce (invalid / missing amount) ---------- */
@keyframes ch-fu-bounce {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-12px); }
  60%  { transform: translateY(0); }
  80%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.ch-fu-bounce {
  animation: ch-fu-bounce 0.55s ease;
}

@media (prefers-reduced-motion: reduce) {
  .ch-fu-preset.is-selected::before {
    animation: none;
  }
  .ch-fu-preset.ch-fu-pop {
    animation: none;
  }
  .ch-fu-bounce {
    animation: none;
  }
}

/* ---------- Bottom: custom amount + donate ---------- */
.ch-fu-bottom {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.ch-fu-amount {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 15px; /* Figma node 10329:236: 15px (vertical centring via fixed height) */
  border: 1px solid var(--ch-fu-grey);
  border-radius: 20px;
  background: #fff;
}

/* ---------- Currency dropdown (ported from the donor cabinet) ---------- */
.ch-fu-ccy {
  position: relative;
  flex: 0 0 auto;
}

/* Inline selector from Figma node 10329:236: chevron + symbol, no border/pill. */
.ch-fu-ccy__trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 18px;
  color: var(--ch-fu-text);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ch-fu-ccy__trigger:hover {
  opacity: 0.7;
}

.ch-fu-ccy__trigger .ch-fu-ccy__sym {
  color: var(--ch-fu-text);
  font-size: 18px;
}

.ch-fu-ccy__chev {
  flex: 0 0 auto;
}

/* Vertical divider between the currency selector and the amount input. */
.ch-fu-amount__divider {
  flex: 0 0 auto;
  width: 1px;
  height: 34px;
  background: var(--ch-fu-grey);
}

.ch-fu-ccy__menu {
  position: fixed;
  z-index: 100000; /* above the modal (99999) */
  width: 220px;
  max-height: 260px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--ch-fu-grey);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.ch-fu-ccy__menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ch-fu-ccy__search {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 6px 12px;
}

.ch-fu-ccy__search input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px !important;
  margin: 0 !important;
  font-family: inherit;
  font-size: 13px;
  line-height: normal;
  color: var(--ch-fu-text);
  border: 1px solid var(--ch-fu-grey) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
  height: auto !important;
  min-height: 0 !important;
}

.ch-fu-ccy__search input:focus {
  border-color: var(--ch-fu-blue);
}

.ch-fu-ccy__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ch-fu-text);
  cursor: pointer;
}

.ch-fu-ccy__opt:hover,
.ch-fu-ccy__opt.is-focused {
  background: #f4f8fb;
}

.ch-fu-ccy__opt.is-active {
  background: #e7f5fc;
  color: var(--ch-fu-blue);
  font-weight: 600;
}

.ch-fu-ccy__opt .ch-fu-ccy__sym {
  margin-left: 10px;
  font-size: 12px;
  color: #6b7b8d;
}

.ch-fu-ccy__opt.is-active .ch-fu-ccy__sym {
  color: var(--ch-fu-blue);
}

.ch-fu-amount__field {
  flex: 1 1 0;
  min-width: 0;
  /* !important: the host theme styles <input> globally (border, bg, shadow). */
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  font-family: inherit;
  font-size: 18px;
  line-height: normal;
  color: var(--ch-fu-text);
}

.ch-fu-amount__field::placeholder {
  color: var(--ch-fu-text-muted);
}

/* hide number spinners */
.ch-fu-amount__field::-webkit-outer-spin-button,
.ch-fu-amount__field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ch-fu-amount__field {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ch-fu-donate {
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  height: 60px;
  padding: 10px 50px;
  justify-content: center;
  align-items: center;
  gap: 15px;
  align-self: stretch;
  border: 0;
  border-radius: 50px;
  background: var(--ch-fu-yellow);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  color: var(--ch-fu-text);
  cursor: pointer;
  filter: drop-shadow(0 0 7.5px rgba(0, 0, 0, 0.15));
  transition: transform 0.1s ease, filter 0.15s ease;
}

.ch-fu-donate:hover {
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.25));
}

.ch-fu-donate:active {
  transform: translateY(1px);
}

.ch-fu-donate[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* (2) Periodic light sweep across the Donate button. */
.ch-fu-donate::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  animation: ch-fu-shine 4.5s ease-in-out infinite;
}

@keyframes ch-fu-shine {
  0%   { left: -75%; }
  16%  { left: 135%; }
  100% { left: 135%; }
}

/* (3) Hearts that float up from the button on hover / click. */
.ch-fu-heart-float {
  position: fixed;
  z-index: 100001;
  pointer-events: none;
  will-change: transform, opacity;
  animation: ch-fu-heart-rise 1.1s ease-out forwards;
}

@keyframes ch-fu-heart-rise {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, -120px)) scale(1.15); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-fu-donate::after { animation: none; opacity: 0; }
  .ch-fu-heart-float { display: none; }
}

.ch-fu-error {
  margin: 0;
  color: #c0392b;
  font-size: 15px;
  font-weight: 500;
}

/* "Flexible support" note — clickable, shown only for the monthly plan. */
.ch-fu-flex-note {
  display: block;
  text-decoration: none;
  cursor: pointer;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  color: var(--ch-fu-grey-dark);
}

/* For the one-time plan the note is hidden but its space is reserved
   (visibility:hidden, not display:none) so the form doesn't jump on toggle. */
.ch-fu-card[data-plan="once"] .ch-fu-flex-note {
  visibility: hidden;
}

/* "your account." — blue underlined with a golden shimmer wave running through
   the characters (ported from the donor cabinet's ShimmerLink). */
.ch-fu-shimmer {
  color: var(--ch-fu-blue);
  white-space: nowrap; /* keep "your account." together (no mid-word break) */
}

.ch-fu-shimmer__ch {
  position: relative;
  display: inline-block;
  white-space: pre;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ch-fu-shimmer__clone {
  position: absolute;
  top: 0;
  left: 0;
  color: #ffe100;
  text-shadow: 0 0 8px rgba(255, 225, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  animation: ch-fu-shimmer-wave 1400ms cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
}

@keyframes ch-fu-shimmer-wave {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-fu-shimmer__clone { animation: none; }
}

/* ---------- Trigger button (modal mode) ---------- */
.ch-fu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 10px 40px;
  border: 0;
  border-radius: 50px;
  background: var(--ch-fu-yellow);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ch-fu-text);
  cursor: pointer;
  filter: drop-shadow(0 0 7.5px rgba(0, 0, 0, 0.15));
}

/* ---------- Modal ---------- */
.ch-fu-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ch-fu-modal[hidden] {
  display: none;
}

.ch-fu-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.ch-fu-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  max-height: 92vh;
  overflow: auto;
}

.ch-fu-modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 26px;
  line-height: 1;
  color: var(--ch-fu-text);
  cursor: pointer;
}

body.ch-fu-modal-open {
  overflow: hidden;
}

/* ============================================================= *
 * Tablet (701–1024px) — covers all iPad portrait widths.
 * The desktop two-column needs ~1000px+ to breathe; below that the
 * widget column gets too narrow and the preset rows overflow their
 * fixed height. Stack into a single comfortable column so the widget
 * regains roughly its desktop content width. Phones (<=700px) keep
 * their own layout and desktop (>=1025px) is untouched.
 * ============================================================= */
@media (min-width: 701px) and (max-width: 1024px) {
  .ch-fu-card {
    flex-direction: column;
    /* Stacked widget gets ~desktop content width, so presets fit one line. */
    max-width: 720px;
  }
  .ch-fu-card .ch-fu-left {
    flex: 0 0 auto; /* banner height, not a full tall column (desktop sets flex:0 0 42%) */
    min-height: 520px; /* tall enough to keep the boy's face in frame */
  }
  .ch-fu-card .ch-fu-right {
    flex: 0 0 auto; /* size to content (desktop sets flex:1) */
    padding: 28px;
  }
  /* On the narrowest tablets the description can wrap to two lines; let the
     preset grow instead of clipping against the fixed desktop height. */
  .ch-fu-card .ch-fu-preset {
    height: auto;
    min-height: 60px;
  }
}

/* ============================================================= *
 * Mobile — Variant 1 (Figma 10318:235)
 * Widget on top, photo + quote + badges as a banner at the bottom.
 * Phones only (<=700px); 701–1024px is handled by the tablet band above.
 * ============================================================= */
@media (max-width: 700px) {
  .ch-fu-card {
    flex-direction: column;
    /* Figma frame is 360; the browser renders Montserrat ~28px narrower than
       Figma, so the preset descriptions wouldn't wrap at 360. Cap a touch
       narrower so "can cover health insurance" wraps to two lines as designed. */
    max-width: 330px;
  }

  /* Variant 1: widget on top, photo banner at the bottom.
     Variant 2: photo banner on top, widget at the bottom. */
  .ch-fu-v1 .ch-fu-right { order: 1; }
  .ch-fu-v1 .ch-fu-left { order: 2; }
  .ch-fu-v2 .ch-fu-right { order: 2; }
  .ch-fu-v2 .ch-fu-left { order: 1; }

  /* ---- Widget section ---- */
  .ch-fu-card .ch-fu-right {
    flex: 0 0 auto; /* size to content in the column (desktop sets flex:1) */
    padding: 15px 15px 20px; /* pt/px 15, plus 20px f2f8ff below Donate (Figma gap-20) */
    align-items: stretch;
    /* Exact Figma mobile bg (node 10318:437): blue top, light mid, blue bottom. */
    background-image: url(../img/mobile-bg.jpg);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% 100%;
  }
  /* The desktop vector glows are replaced by the bg image on mobile. */
  .ch-fu-card .ch-fu-right__bg { display: none; }
  /* Widget block uses gap-15; logo→h1 and h1→toggle are 20 (margins below). */
  .ch-fu-card .ch-fu-widget { gap: 15px; }

  /* v1: logo at the top of the widget. */
  .ch-fu-v1 .ch-fu-widget__logo {
    display: block;
    width: 123px !important;
    height: auto !important;
    margin-bottom: 5px; /* logo→h1 = 15 (gap) + 5 = 20 */
  }
  .ch-fu-v1 .ch-fu-left__logo { display: none; }

  /* v2: logo sits on the photo (top), like desktop. */
  .ch-fu-v2 .ch-fu-widget__logo { display: none; }
  .ch-fu-v2 .ch-fu-left__logo { display: block; width: 123px !important; }

  .ch-fu-card .ch-fu-title {
    font-size: 26px;
    line-height: normal;
    margin-bottom: 5px !important; /* h1→toggle = 15 (gap) + 5 = 20 */
  }

  /* Toggle: no heart, shorter, smaller radius */
  .ch-fu-card .ch-fu-toggle { gap: 5px; }
  .ch-fu-card .ch-fu-toggle__btn {
    min-width: 0; /* let both buttons shrink to equal halves (Figma min-w-px) */
    height: 50px;
    padding: 10px 10px;
    border-radius: 15px;
    font-size: 18px;
  }
  .ch-fu-card .ch-fu-toggle__heart { display: none; }

  .ch-fu-card .ch-fu-subtitle { font-size: 16px; }
  .ch-fu-card .ch-fu-flex-note { font-size: 16px; }
  /* The forced break after "in" is desktop-only; mobile wraps naturally. */
  .ch-fu-card .ch-fu-note-break { display: none; }

  /* Presets: badge on top-right, then amount + description below */
  .ch-fu-card .ch-fu-presets { gap: 15px; }
  .ch-fu-card .ch-fu-preset {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    height: auto;
    padding: 10px 15px;
  }
  .ch-fu-card .ch-fu-preset__badge {
    order: -1;
    align-self: flex-end;
    width: 124px;
    font-size: 16px;
  }
  .ch-fu-card .ch-fu-preset__main {
    width: 100%;
    gap: 5px;
    align-items: flex-start;
  }
  .ch-fu-card .ch-fu-preset__amount {
    min-width: 0;
    font-size: 20px;
  }
  .ch-fu-card .ch-fu-preset__desc { font-size: 16px; }

  /* Amount + Donate: stacked, shorter, smaller radius */
  .ch-fu-card .ch-fu-bottom {
    flex-direction: column;
    gap: 15px;
  }
  .ch-fu-card .ch-fu-amount {
    flex: 0 0 auto; /* desktop sets flex:1 (basis 0) which would override height */
    height: 50px;
    border-radius: 15px;
  }
  .ch-fu-card .ch-fu-donate {
    flex: 0 0 auto;
    height: 50px;
    font-size: 18px;
  }

  /* ---- Photo banner (bottom) ---- */
  .ch-fu-card .ch-fu-left {
    flex: 0 0 auto;
    width: 100%;
    min-height: 380px;
    padding: 0 15px 20px 15px;
    /* Exact Figma mobile crop (node 10318:449), pre-tinted. */
    background-image: url(../img/photo-child-mobile.jpg);
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
  }
  /* The desktop landscape photo is replaced by the mobile crop above. */
  .ch-fu-card .ch-fu-left__photo { display: none; }
  .ch-fu-card .ch-fu-left__bottom { gap: 15px; }

  /* v2: the logo sits at the top of the photo block — give it room. */
  .ch-fu-v2 .ch-fu-left { padding-top: 15px; }

  /* Quote: inset-left + rounded-left, bleeds right; smaller type */
  .ch-fu-card .ch-fu-quote {
    margin-left: 0 !important;
    margin-right: -15px !important;
    padding: 10px 15px 10px 10px;
    border-radius: 20px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .ch-fu-card .ch-fu-quote__mark {
    width: 25px !important;
    height: 25px !important;
  }
  .ch-fu-card .ch-fu-quote__body { gap: 5px; }
  .ch-fu-card .ch-fu-quote__text { font-size: 16px; }
  .ch-fu-card .ch-fu-quote__author { font-size: 16px; }
  .ch-fu-card .ch-fu-quote__rule { width: 39px !important; }
  .ch-fu-card .ch-fu-badges { gap: 20px; }
  .ch-fu-card .ch-fu-badges img { height: 40px !important; }
}
