/* ============================================================
   Donate flow redesign (KAN-1)
   Implements "Donate Flow Redesign.dc.html" from Claude Design.
   Namespaced d2- to avoid collisions with the Webflow-era CSS.
   Brand values: #5798ff primary · #32356a navy · #222 ink ·
   #667 body · #f1f1f1 surface · teal #84cdb4 · green #9fd06c ·
   gold #f7b801 · hero circle #eff4ff
   ============================================================ */

.d2-page { background: #fff; letter-spacing: 0.1px; }
.d2-page *, .d2-page *::before, .d2-page *::after,
.d2-bar, .d2-bar *, .d2-sheet, .d2-sheet *, .d2-overlay { box-sizing: border-box; }
.d2-page h1, .d2-page h2, .d2-page h3, .d2-page h4, .d2-page p,
.d2-sheet h3, .d2-sheet p { margin: 0; }
.d2-bar, .d2-sheet { letter-spacing: 0.1px; }

.d2-btn {
  display: inline-block; background: #5798ff; color: #fff; border: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  padding: 9px 22px; border-radius: 4px; cursor: pointer; text-decoration: none;
  text-align: center; font-family: inherit;
  transition: background-color 250ms cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 180ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.d2-btn:hover { background: #3f82ef; }
.d2-btn:active { transform: scale(.97); }
.d2-btn[disabled] { opacity: .55; cursor: default; }

.d2-tag {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #fff; padding: 4px 9px; align-self: flex-start;
}
.d2-c-teal  { background: #84cdb4; }
.d2-c-green { background: #9fd06c; }
.d2-c-gold  { background: #f7b801; }
.d2-c-navy  { background: #32356a; }

.d2-circle { position: absolute; border-radius: 50%; background: #eff4ff; pointer-events: none; }

/* ---------- HERO ---------- */
/* top padding includes the site's 80px fixed navbar */
.d2-hero { position: relative; overflow: hidden; background: #fff; padding: 144px 60px 52px; }
.d2-circle-a { width: 620px; height: 620px; top: -300px; right: -160px; }
.d2-circle-b { width: 200px; height: 200px; bottom: -110px; left: -70px; }
.d2-hero-inner {
  position: relative; display: flex; gap: 56px; align-items: center;
  max-width: 1320px; margin: 0 auto;
}
.d2-hero-copy { flex: 1; max-width: 600px; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.d2-hero-copy h1 { font-size: 45px; line-height: 54px; font-weight: 700; color: #222; }
.d2-hero-copy p { font-size: 15px; line-height: 22px; color: #667; max-width: 480px; }
.d2-hero-photo { border-radius: 0 0 0 120px; overflow: hidden; flex: none; }
.d2-hero-photo img { width: 460px; height: 300px; object-fit: cover; display: block; }

/* ---------- ERRORS ---------- */
.d2-errors {
  max-width: 1320px; margin: 18px auto 0; padding: 15px 20px;
  background: #fdecec; border: 1px solid #f5c6c6; border-radius: 4px; color: #222;
}
.d2-errors h3 { font-size: 15px; margin-bottom: 6px; }
.d2-errors ul { margin: 0; padding-left: 18px; font-size: 13px; color: #667; }

/* ---------- FILTER BAR ---------- */
.d2-filterbar {
  padding: 16px 60px;
  background: #fff; border-top: 1px solid #eee; border-bottom: 1px solid #eee;
  scroll-margin-top: 92px; /* fixed 80px navbar + breathing room */
}
.d2-filterbar-inner {
  display: flex; align-items: center; gap: 28px;
  /* .d2-layout is 1320px including its 60px side paddings — match its
     inner content width so the edges line up */
  max-width: 1200px; margin: 0 auto;
}
.d2-filterbar h2 { font-size: 26px; line-height: 28px; font-weight: 700; color: #222; }
.d2-tabs { display: flex; align-items: center; gap: 22px; }
.d2-tab {
  background: none; border: 0; padding: 0 0 4px; font-family: inherit;
  font-size: 13px; font-weight: 700; color: #999; cursor: pointer;
  border-bottom: 3px solid transparent; letter-spacing: inherit;
  transition: color 200ms, border-color 200ms;
}
@media (hover: hover) {
  .d2-tab:not(.d2-tab-active):hover { color: #222; }
}
.d2-tab.d2-tab-active { color: #222; border-bottom-color: #5798ff; }
.d2-searchbox {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  border: 1px solid #ddd; border-radius: 4px; padding: 8px 14px; width: 340px;
  background: #fff; color: #a3a3a3; transition: border-color 200ms, box-shadow 200ms;
}
.d2-searchbox:focus-within { border-color: #5798ff; box-shadow: 0 0 0 3px rgba(87,152,255,.15); }
.d2-searchbox input {
  border: 0; outline: 0; flex: 1; font-size: 13px; font-family: inherit;
  color: #222; background: transparent; min-width: 0;
}
.d2-searchbox input::placeholder { color: #a3a3a3; font-style: italic; font-size: 12px; }
.d2-searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.d2-search-clear {
  width: 16px; height: 16px; border-radius: 50%; background: #c1c1c1;
  border: 0; padding: 0; margin: 0; flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 150ms, transform 150ms;
}
.d2-search-clear:hover { background: #a3a3a3; }
.d2-search-clear:active { transform: scale(.9); }
.d2-search-clear[hidden] { display: none; }

/* ---------- LAYOUT ---------- */
.d2-layout {
  max-width: 1320px; margin: 0 auto; padding: 32px 60px 48px;
  display: flex; gap: 36px; align-items: flex-start;
}
.d2-funds { flex: 1; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.d2-fund.d2-hidden { display: none; }
.d2-cat.d2-hidden, .d2-cat:has(> .d2-grid:empty) { display: none; }
.d2-cat { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid #eee; padding-top: 24px; }
.d2-cat-title { font-size: 19px; line-height: 24px; font-weight: 700; color: #5798ff; }
.d2-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.d2-nomatch { font-size: 14px; color: #667; padding: 8px 2px; }

/* ---------- FUND CARD (desktop) ---------- */
.d2-card {
  background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.1);
  border: 1px solid #eee; overflow: hidden; display: flex; flex-direction: column;
}
.d2-media { width: 100%; height: 145px; flex: none; overflow: hidden; }
.d2-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d2-rowhead { display: none; }
.d2-body { display: flex; flex: 1; min-width: 0; }
.d2-bodyinner { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.d2-body h3 { font-size: 16px; line-height: 20px; font-weight: 700; color: #222; }
.d2-body p { font-size: 12px; line-height: 17px; color: #667; }
/* Long fund descriptions clamp to 4 lines with a More/Less toggle
   (d2-clamped is applied by JS to texts past the length threshold). */
.d2-fund.d2-clamped .d2-bodyinner > p {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.d2-fund.d2-clamped.d2-desc-open .d2-bodyinner > p { -webkit-line-clamp: unset; }
.d2-more {
  background: none; border: 0; padding: 0; font-family: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #5798ff;
  cursor: pointer; text-align: left; align-self: flex-start;
}
.d2-more:hover { text-decoration: underline; }

.d2-actions {
  margin-top: auto; display: flex; flex-direction: column; gap: 9px;
  padding-top: 8px; border-top: 1px solid #f1f1f1;
}
.d2-monthly { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.d2-monthly input { position: absolute; opacity: 0; width: 0; height: 0; }
.d2-check {
  width: 15px; height: 15px; border: 1px solid #c1c1c1; border-radius: 3px;
  background: #fff; flex: none; margin-top: 1px; position: relative;
  transition: background-color 180ms, border-color 180ms;
}
.d2-monthly input:checked + .d2-check { background: #5798ff; border-color: #5798ff; }
.d2-monthly input:checked + .d2-check::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.d2-monthly input:focus-visible + .d2-check { box-shadow: 0 0 0 3px rgba(87,152,255,.3); }
.d2-mtext b { display: block; font-size: 12px; font-weight: 700; color: #222; }
.d2-mtext i { display: block; font-style: normal; font-size: 11px; line-height: 15px; color: #999; }
.d2-give { display: flex; gap: 8px; }
.d2-amountbox {
  display: flex; align-items: center; gap: 5px; border: 1px solid #ddd;
  border-radius: 4px; padding: 0 10px; flex: 1; background: #fff; min-width: 0;
  transition: border-color 200ms, box-shadow 200ms;
}
.d2-amountbox:focus-within { border-color: #5798ff; box-shadow: 0 0 0 3px rgba(87,152,255,.15); }
.d2-amountbox b { font-size: 12px; color: #222; }
.d2-amountbox input {
  border: 0; outline: 0; width: 100%; min-width: 0; padding: 8px 0;
  font-size: 12px; font-family: inherit; color: #222; background: transparent;
}
.d2-amountbox input::placeholder { color: #a3a3a3; }
.d2-amountbox.d2-shake { animation: d2shake 300ms; border-color: #e05252; }
@keyframes d2shake {
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}
.d2-add { white-space: nowrap; padding: 7px 13px; font-size: 11px; }
.d2-add.d2-added { background: #4aa96c; }

/* ---------- FEATURED CARD ---------- */
/* Featured emphasis per design 8c: hero-circle wash — pale-blue card with
   a translucent circle motif, blue-tinted field borders. */
.d2-featured {
  position: relative; display: flex; background: #eff4ff;
  border-radius: 4px; overflow: hidden;
}
.d2-featured-media, .d2-featured-body, .d2-featured-actions { position: relative; }
.d2-featured-body p { color: #556; }
.d2-featured .d2-amountbox { border-color: #cdd9ee; background: #fff; }
.d2-featured .d2-check { border-color: #b3c4e0; }
.d2-featured-media { width: 250px; flex: none; overflow: hidden; }
.d2-featured-media img { width: 100%; height: 100%; min-height: 180px; object-fit: cover; display: block; }
.d2-featured-body {
  flex: 1; padding: 22px 26px; display: flex; flex-direction: column;
  gap: 10px; justify-content: center;
}
.d2-featured-body .d2-tag { padding: 5px 10px; }
.d2-featured-body h3 { font-size: 20px; line-height: 24px; font-weight: 700; color: #222; }
.d2-featured-body p { font-size: 14px; line-height: 20px; color: #667; }
.d2-featured-actions {
  width: 240px; flex: none; border-left: 1px solid #dbe6f6; border-top: 0;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 11px;
  justify-content: center; margin-top: 0;
}
.d2-featured-actions .d2-amountbox { flex: none; }
.d2-featured-actions .d2-amountbox input { padding: 8px 0; font-size: 13px; }
.d2-featured-actions .d2-add { padding: 9px 16px; font-size: 12px; }

/* ---------- CUSTOM FUND ---------- */
.d2-custom {
  display: flex; background: #f9fafc; border: 1px dashed #c9d6ea;
  border-radius: 4px; overflow: hidden;
}
.d2-custom-body {
  flex: 1; padding: 22px 26px; display: flex; flex-direction: column;
  gap: 10px; justify-content: center;
}
.d2-custom-body .d2-tag { padding: 5px 10px; }
.d2-custom-body h3 { font-size: 17px; line-height: 20px; font-weight: 700; color: #222; }
.d2-custom-body p { font-size: 13px; line-height: 18px; color: #667; }
.d2-custom-name {
  border: 1px solid #ddd; border-radius: 4px; padding: 8px 12px; background: #fff;
  max-width: 340px; font-size: 13px; font-family: inherit; color: #222; outline: 0;
  transition: border-color 200ms, box-shadow 200ms;
}
.d2-custom-name:focus { border-color: #5798ff; box-shadow: 0 0 0 3px rgba(87,152,255,.15); }
.d2-custom-name::placeholder { color: #a3a3a3; font-style: italic; }
.d2-custom-actions {
  width: 240px; flex: none; border-left: 1px solid #e6ebf4; border-top: 0;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 11px;
  justify-content: center; margin-top: 0;
}
.d2-custom-actions .d2-amountbox { flex: none; }
.d2-custom-actions .d2-amountbox input { padding: 8px 0; font-size: 13px; }
.d2-custom-actions .d2-add { padding: 9px 16px; font-size: 12px; }

/* ---------- MY GIVING RAIL (desktop) ---------- */
.d2-rail {
  /* fixed 80px navbar + 24px gap */
  width: 340px; flex: none; position: sticky; top: 104px; background: #fff;
  border: 1px solid #eee; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.08);
  overflow: hidden;
}
.d2-rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid #eee; background: #fafafa;
}
.d2-rail-head h3 { font-size: 17px; font-weight: 700; color: #222; }
.d2-count { font-size: 11px; color: #667; }
.d2-items { padding: 2px 22px; }
.d2-item {
  display: flex; justify-content: space-between; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid #f1f1f1;
}
.d2-item:last-child { border-bottom: 0; }
.d2-item.d2-item-new { animation: d2itemin 400ms cubic-bezier(0.215, 0.61, 0.355, 1); }
@keyframes d2itemin {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.d2-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.d2-item-name { font-size: 13px; font-weight: 700; color: #222; overflow-wrap: anywhere; }
.d2-item-meta { font-size: 11px; color: #667; }
.d2-item-meta .d2-mo { color: #5798ff; font-weight: 700; }
.d2-remove {
  text-decoration: underline; color: #a3a3a3; cursor: pointer; background: none;
  border: 0; padding: 0; font: inherit; font-size: 11px;
}
.d2-remove:hover { color: #667; }
.d2-item-amt { font-size: 13px; font-weight: 700; color: #222; white-space: nowrap; }
.d2-item-amt i { font-size: 11px; color: #667; font-weight: 400; font-style: normal; }
.d2-empty {
  padding: 28px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.d2-empty p { font-size: 13px; line-height: 19px; color: #667; text-align: center; max-width: 230px; }
.d2-rail-foot, .d2-sheet-foot {
  padding: 14px 22px 18px; border-top: 1px solid #eee; display: flex;
  flex-direction: column; gap: 10px; background: #fafafa;
}
.d2-rail-foot[hidden], .d2-sheet-foot[hidden] { display: none; }
.d2-totrow { display: flex; justify-content: space-between; }
.d2-totrow span { font-size: 12px; color: #667; }
.d2-totrow b { font-size: 12px; font-weight: 700; color: #222; }
.d2-totrow b.d2-bump { animation: d2bump 350ms cubic-bezier(0.215, 0.61, 0.355, 1); }
@keyframes d2bump { 35% { transform: scale(1.22); color: #5798ff; } }
.d2-checkout { padding: 11px; font-size: 12px; }
.d2-secure { font-size: 11px; line-height: 15px; color: #999; text-align: center; }

/* ---------- FLYING DOT (add-to-giving animation) ---------- */
.d2-fly {
  position: fixed; z-index: 3000; width: 14px; height: 14px; border-radius: 50%;
  background: #5798ff; box-shadow: 0 2px 8px rgba(87,152,255,.5); pointer-events: none;
  transition: transform 550ms cubic-bezier(0.5, -0.1, 0.3, 1), opacity 550ms;
}

/* ---------- MOBILE BAR + SHEET ---------- */
.d2-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: #5798ff; display: flex; align-items: center; gap: 12px;
  padding: 19px 18px 14px; box-shadow: 0 -6px 18px rgba(87,152,255,.35);
  border-radius: 14px 14px 0 0; touch-action: none; cursor: pointer;
  transform: translateY(0); transition: transform 350ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.d2-bar-handle {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.45);
}
.d2-bar[hidden] { display: none; }
.d2-bar.d2-bar-enter { animation: d2barin 400ms cubic-bezier(0.215, 0.61, 0.355, 1); }
@keyframes d2barin { from { transform: translateY(100%); } to { transform: none; } }
.d2-bar-label { font-size: 14px; font-weight: 700; color: #fff; }
.d2-bar-total { font-size: 14px; color: rgba(255,255,255,.85); }
.d2-bar-view {
  margin-left: auto; background: #fff; color: #5798ff; border: 0; border-radius: 4px;
  padding: 9px 20px; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  font-family: inherit; cursor: pointer;
}
.d2-overlay {
  position: fixed; inset: 0; z-index: 950; background: rgba(34,34,34,.5);
  opacity: 0; transition: opacity 300ms;
}
.d2-overlay.d2-show { opacity: 1; }
.d2-overlay[hidden] { display: none; }
.d2-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: #fff; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 34px rgba(0,0,0,.3);
  overflow: hidden; transform: translateY(105%); visibility: hidden;
  transition: transform 380ms cubic-bezier(0.215, 0.61, 0.355, 1), visibility 0s 380ms;
  max-height: 86vh; display: flex; flex-direction: column;
}
.d2-sheet.d2-open { transform: none; visibility: visible; transition-delay: 0s; }
.d2-sheet.d2-full { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
.d2-sheet.d2-dragging { transition: none; }
.d2-sheet-head { background: #5798ff; padding: 0 18px 14px; flex: none; touch-action: none; }
.d2-sheet-handle {
  display: flex; justify-content: center; padding: 9px 0 8px; width: 100%;
  background: none; border: 0; cursor: pointer;
}
.d2-sheet-handle span { width: 38px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.45); }
.d2-sheet-title { display: flex; align-items: center; gap: 12px; }
.d2-sheet-title h3 { font-size: 16px; font-weight: 700; color: #fff; }
.d2-sheet-total { font-size: 14px; color: rgba(255,255,255,.85); }
.d2-sheet-collapse { margin-left: auto; background: none; border: 0; cursor: pointer; padding: 0; flex: none; }
.d2-sheet .d2-items { overflow-y: auto; flex: 1; }
.d2-sheet .d2-item { padding: 14px 0; }
.d2-sheet .d2-item-name { font-size: 14px; }
.d2-sheet .d2-item-amt { font-size: 14px; }
.d2-sheet-foot { padding: 16px 22px 26px; flex: none; }
.d2-sheet-foot .d2-totrow span, .d2-sheet-foot .d2-totrow b { font-size: 13px; }
.d2-sheet-foot .d2-checkout { padding: 13px; font-size: 13px; }
.d2-sheet .d2-empty { padding: 34px 22px; }

body.d2-locked { overflow: hidden; }

/* ============================================================
   CONFIRMATION PAGE
   ============================================================ */
.d2-confirm-hero { position: relative; overflow: hidden; background: #fff; padding: 152px 60px 56px; text-align: center; }
.d2-circle-c { width: 520px; height: 520px; top: -260px; left: -160px; }
.d2-circle-d { width: 300px; height: 300px; bottom: -170px; right: -90px; }
.d2-confirm-hero-inner {
  position: relative; max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
}
.d2-confirm-hero h1 { font-size: 45px; line-height: 54px; font-weight: 700; color: #222; }
.d2-confirm-hero p { font-size: 16px; line-height: 24px; color: #667; }

.d2-confirm-band { background: #f1f1f1; padding: 56px 60px; }
.d2-confirm-band-inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 48px; align-items: stretch; }
.d2-confirm-photo { flex: 1; border-radius: 0 0 0 120px; overflow: hidden; min-width: 0; }
.d2-confirm-photo img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; display: block; }
.d2-giftcard {
  width: 460px; flex: none; background: #fff; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 30px 34px;
  display: flex; flex-direction: column; gap: 4px;
}
.d2-giftcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.d2-giftcard-head h3 { font-size: 20px; font-weight: 700; color: #222; }
.d2-giftrow {
  display: flex; justify-content: space-between; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid #f1f1f1;
}
.d2-giftrow > div { display: flex; flex-direction: column; gap: 2px; }
.d2-giftname { font-size: 14px; font-weight: 700; color: #222; }
.d2-gifttype { font-size: 11px; color: #667; }
.d2-gifttype-monthly { color: #5798ff; font-weight: 700; }
.d2-giftrow b { font-size: 14px; font-weight: 700; color: #222; white-space: nowrap; }
.d2-giftrow b i { font-size: 11px; color: #667; font-weight: 400; font-style: normal; }
.d2-giftcard .d2-totrow { padding: 7px 0; }
.d2-giftcard .d2-totrow span { font-size: 13px; }
.d2-giftcard .d2-totrow b { font-size: 13px; }
.d2-receipt {
  display: flex; gap: 10px; align-items: flex-start; background: #eff4ff;
  border-radius: 4px; padding: 14px 16px; margin-top: 10px;
}
.d2-receipt svg { flex: none; margin-top: 1px; }
.d2-receipt p { font-size: 12px; line-height: 17px; color: #32356a; }

.d2-builds { background: #fff; padding: 60px 60px 68px; }
.d2-builds-inner { max-width: 1100px; margin: 0 auto; }
.d2-builds h2 { font-size: 26px; line-height: 28px; font-weight: 700; color: #222; margin-bottom: 8px; }
/* .d2-page p { margin: 0 } outranks a single class — scope up so the
   subtitle keeps its breathing room above the cards */
.d2-builds p.d2-builds-sub { font-size: 14px; color: #667; margin: 0 0 28px; }
.d2-builds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.d2-buildcard {
  background: #fff; border: 1px solid #eee; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); overflow: hidden;
  display: flex; flex-direction: column; text-decoration: none;
}
.d2-buildmedia { width: 100%; height: 160px; overflow: hidden; }
.d2-buildmedia img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d2-buildbody { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.d2-buildbody .d2-tag { padding: 5px 10px; }
.d2-buildbody h3 { font-size: 17px; line-height: 21px; font-weight: 700; color: #222; }
.d2-buildbody p { font-size: 13px; line-height: 18px; color: #667; }
.d2-ghostbtn {
  margin-top: auto; display: inline-block; align-self: flex-start;
  border: 1px solid #222; color: #222; font-size: 11px; font-weight: 700;
  letter-spacing: .5px; padding: 6px 14px;
  transition: background-color 200ms, color 200ms;
}
.d2-buildcard:hover .d2-ghostbtn { background: #222; color: #fff; }

/* ============================================================
   TABLET — 2-col grids
   ============================================================ */
@media (max-width: 1279px) {
  .d2-grid { grid-template-columns: repeat(2, 1fr); }
  .d2-builds-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .d2-layout { padding-left: 32px; padding-right: 32px; gap: 24px; }
  .d2-filterbar { padding-left: 32px; padding-right: 32px; }
  .d2-hero { padding-left: 32px; padding-right: 32px; }
  .d2-hero-photo img { width: 380px; height: 260px; }
  .d2-featured-media { width: 150px; }
  .d2-featured-actions { width: 210px; padding: 16px 16px; }
  .d2-featured-body { padding: 16px 18px; }
  .d2-searchbox { width: 260px; }
}

/* ============================================================
   COMPACT DESKTOP (768–1023px) — same layout, tightened
   ============================================================ */
@media (max-width: 1023px) and (min-width: 768px) {
  .d2-hero { padding: 120px 24px 40px; }
  .d2-hero-inner { gap: 32px; }
  .d2-hero-copy h1 { font-size: 34px; line-height: 42px; }
  .d2-hero-photo img { width: 280px; height: 200px; }
  .d2-filterbar { padding: 14px 24px; }
  .d2-filterbar h2 { font-size: 21px; }
  .d2-filterbar-inner { gap: 16px; flex-wrap: wrap; }
  .d2-searchbox { width: 100%; order: 3; }
  .d2-layout { padding: 24px 20px 40px; gap: 16px; }
  .d2-rail { width: 260px; }
  .d2-rail-head, .d2-items { padding-left: 16px; padding-right: 16px; }
  .d2-rail-foot { padding: 12px 16px 16px; }
  .d2-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .d2-bodyinner { padding: 12px 13px 13px; }
  .d2-media { height: 120px; }
  .d2-add { padding: 7px 10px; }

  /* featured + custom stack vertically in the narrow funds column */
  .d2-featured { flex-direction: column; }
  .d2-featured-media { width: 100%; }
  .d2-featured-media img { height: 150px; min-height: 0; }
  .d2-featured-actions { width: 100%; border-left: 0; border-top: 1px solid #dbe6f6; padding: 16px 22px; }
  .d2-custom { flex-direction: column; }
  .d2-custom-actions { width: 100%; border-left: 0; border-top: 1px solid #e6ebf4; padding: 16px 22px; }

  /* confirmation */
  .d2-confirm-hero { padding: 128px 24px 40px; }
  .d2-confirm-hero h1 { font-size: 34px; line-height: 42px; }
  .d2-confirm-band { padding: 36px 24px; }
  .d2-confirm-band-inner { flex-direction: column; gap: 24px; }
  .d2-confirm-photo img { min-height: 0; height: 260px; }
  .d2-giftcard { width: 100%; }
  .d2-builds { padding: 40px 24px 48px; }
  .d2-builds-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ============================================================
   MOBILE  (≤767px) — accordion rows + bottom bar/sheet
   ============================================================ */
@media (max-width: 767px) {
  .d2-rail { display: none; }

  .d2-hero { padding: 104px 10px 14px; }
  .d2-circle-a { width: 220px; height: 220px; top: -110px; right: -80px; }
  .d2-circle-b { display: none; }
  .d2-hero-inner { flex-direction: column; gap: 16px; align-items: stretch; }
  .d2-hero-copy { gap: 8px; max-width: none; }
  .d2-hero-copy h1 { font-size: 27px; line-height: 33px; }
  .d2-hero-copy p { font-size: 13px; line-height: 19px; }
  .d2-hero-copy .d2-btn { display: none; }
  .d2-hero-photo { border-radius: 0 0 0 60px; align-self: stretch; }
  .d2-hero-photo img { width: 100%; height: 170px; }

  .d2-filterbar { padding: 4px 10px 12px; border: 0; }
  .d2-filterbar-inner { flex-wrap: wrap; gap: 10px; }
  .d2-filterbar h2 { display: none; }
  .d2-searchbox { order: 1; width: 100%; margin-left: 0; padding: 9px 12px; }
  .d2-searchbox input { font-size: 16px; }  /* ≥16px prevents iOS zoom-on-focus */
  .d2-tabs { order: 2; gap: 8px; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .d2-tab {
    border: 1px solid #ddd; border-radius: 20px; color: #667;
    font-size: 11px; padding: 6px 13px; flex: none;
  }
  .d2-tab.d2-tab-active { background: #222; border-color: #222; color: #fff; }

  .d2-layout { padding: 0 10px 110px; display: block; }
  .d2-funds { gap: 8px; }
  .d2-cat { gap: 8px; padding-top: 16px; margin-top: 8px; }
  .d2-cat-title { font-size: 16px; line-height: 20px; }
  .d2-grid { display: flex; flex-direction: column; gap: 8px; }

  /* Featured card — always open, compact */
  /* image left of text + amount + monthly; Add gift stays full width */
  .d2-featured { display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; padding: 14px; }
  .d2-featured-media { display: block; grid-column: 1; grid-row: 1 / span 3; border-radius: 4px; overflow: hidden; width: 84px; }
  .d2-featured-media img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
  .d2-featured-body { padding: 0; grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 4px; justify-content: flex-start; }
  .d2-featured-body h3 { font-size: 14px; line-height: 18px; }
  .d2-featured-body p { font-size: 12px; line-height: 17px; margin: 0; }
  .d2-featured-actions { display: contents; }
  .d2-featured-actions .d2-amountbox { grid-column: 2; grid-row: 2; }
  .d2-featured-actions .d2-monthly { grid-column: 2; grid-row: 3; }
  .d2-featured-actions .d2-add { grid-column: 1 / -1; grid-row: 4; padding: 11px; }

  /* Fund cards → collapsed rows that expand */
  .d2-card { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; overflow: visible; }
  .d2-media {
    width: 40px; height: 40px; border-radius: 4px; flex: none; order: 1;
    cursor: pointer;
    transition: width 300ms cubic-bezier(0.215, 0.61, 0.355, 1),
                height 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  .d2-card.d2-open .d2-media { width: 76px; height: 76px; }
  .d2-rowhead {
    display: flex; align-items: center; gap: 11px; flex: 1; order: 2; min-width: 0;
    background: none; border: 0; padding: 0 0 0 11px; cursor: pointer;
    font-family: inherit; text-align: left; letter-spacing: inherit;
  }
  .d2-rowname { font-size: 13px; font-weight: 700; color: #222; flex: 1; min-width: 0; }
  .d2-rowcat {
    font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    background: none !important; padding: 0; flex: none;
  }
  .d2-rowcat.d2-c-teal  { color: #84cdb4; }
  .d2-rowcat.d2-c-green { color: #9fd06c; }
  .d2-rowcat.d2-c-gold  { color: #d9a501; }
  .d2-rowcat.d2-c-navy  { color: #32356a; }
  .d2-chev { color: #c1c1c1; flex: none; transition: transform 300ms cubic-bezier(0.215, 0.61, 0.355, 1); }

  .d2-body {
    order: 3; flex: none; width: 100%;
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 320ms cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  .d2-bodyinner { min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column; gap: 0; }
  .d2-body .d2-tag, .d2-body h3 { display: none; }

  .d2-card.d2-open { border-color: #5798ff; box-shadow: 0 4px 14px rgba(87,152,255,.18); }
  .d2-card.d2-open .d2-chev { transform: rotate(180deg); color: #5798ff; }
  .d2-card.d2-open .d2-body { grid-template-rows: 1fr; }
  /* Expanding a row reveals the whole description — no clamp on mobile */
  .d2-fund.d2-clamped .d2-bodyinner > p { -webkit-line-clamp: unset; }
  .d2-more { display: none; }
  .d2-bodyinner p { padding: 10px 0 12px; }
  .d2-bodyinner .d2-actions { border-top: 0; padding-top: 0; gap: 10px; margin-top: 0; }
  .d2-bodyinner .d2-actions .d2-amountbox input { padding: 9px 0; font-size: 16px; }
  .d2-bodyinner .d2-add { padding: 11px; font-size: 12px; }

  /* Custom card */
  .d2-custom { flex-direction: column; padding: 14px; }
  .d2-custom-body { padding: 0; gap: 8px; }
  .d2-custom-body h3 { font-size: 14px; }
  .d2-custom-body p { font-size: 12px; line-height: 17px; }
  .d2-custom-name { max-width: none; font-size: 16px; }
  .d2-custom-actions { width: 100%; border-left: 0; padding: 10px 0 0; gap: 9px; }
  .d2-custom-actions .d2-amountbox input { font-size: 16px; }

  .d2-featured-actions .d2-amountbox input { font-size: 16px; }

  /* Confirmation */
  .d2-confirm-hero { padding: 116px 12px 28px; }
  .d2-circle-c { width: 260px; height: 260px; top: -130px; left: -100px; }
  .d2-circle-d { display: none; }
  .d2-confirm-hero h1 { font-size: 30px; line-height: 37px; }
  .d2-confirm-hero p { font-size: 14px; line-height: 20px; }
  .d2-confirm-band { padding: 0 0 28px; background: linear-gradient(180deg, #fff 200px, #f1f1f1 200px); }
  .d2-confirm-band-inner { flex-direction: column; gap: 24px; }
  .d2-confirm-photo { border-radius: 0 0 0 80px; }
  .d2-confirm-photo img { min-height: 0; height: 200px; }
  .d2-giftcard { width: auto; margin: 0 10px; padding: 22px; }
  .d2-builds { padding: 32px 10px 36px; }
  .d2-builds h2 { font-size: 22px; line-height: 26px; }
  .d2-builds-grid { grid-template-columns: 1fr; gap: 12px; }
  .d2-buildmedia { height: 140px; }
}

@media (min-width: 768px) {
  .d2-bar, .d2-sheet, .d2-overlay { display: none !important; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .d2-page *, .d2-sheet, .d2-bar, .d2-overlay, .d2-fly, .d2-body, .d2-chev {
    transition-duration: 1ms !important; animation-duration: 1ms !important;
  }
}
