:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f4f4f2;
  --ink: #222222;
  --ink-secondary: #666666;
  --primary: #017a41;
  --primary-hover: #016335;
  --primary-bright: #02a95c;
  --primary-tint: #eaf7f0;
  --border: #e6e6e4;
  --border-strong: #c8c8c5;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.18);
  --font-sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Header */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-nav-share {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.btn-nav-share:hover {
  background: var(--surface-muted);
}

.btn-nav-donate {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 40px;
}

.btn-nav-donate:hover {
  background: var(--primary-hover);
}

/* Page Container */
.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 24px;
}

.campaign-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 0;
}

.edition-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 9999px;
  background: var(--primary-tint);
  border: 1px solid #cde6d7;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}

/* GoFundMe Two-Column Layout */
.gfm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.main-col {
  min-width: 0;
}

.photo-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-muted);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile inline summary */
.mobile-meter {
  display: none;
  margin-top: 20px;
}

.organizer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.organizer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.organizer-text {
  font-size: 0.95rem;
  color: var(--ink);
}

.organizer-text strong {
  font-weight: 600;
}

/* Story */
.campaign-story {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  color: var(--ink);
  max-width: 66ch;
}

.campaign-story p {
  margin-bottom: 1.15rem;
}

.campaign-story p:last-child {
  margin-bottom: 0;
}

.need-lines {
  margin: 1.15rem 0;
  padding-left: 0;
  list-style: none;
}

.need-lines li {
  margin-bottom: 0.35rem;
}

.story-signoff {
  margin-top: 20px;
  font-weight: 600;
  color: var(--ink);
}

/* Donations Feed */
.donations-section {
  padding-top: 28px;
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.donation-feed {
  display: flex;
  flex-direction: column;
}

.donation-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.donation-item:last-child {
  border-bottom: none;
}

.donation-item.is-new {
  background: var(--primary-tint);
  padding: 14px;
  margin: 4px 0;
  border-radius: 12px;
  border-bottom: none;
}

.d-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.d-info {
  flex: 1;
  min-width: 0;
}

.d-name {
  display: block;
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.d-meta {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.d-amount {
  font-weight: 700;
  color: var(--ink);
}

.d-comment-text {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.empty-feed {
  padding: 20px 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

/* Right Sticky GoFundMe Summary Card */
.sidebar-col {
  position: sticky;
  top: 84px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.meter-numbers {
  min-width: 0;
}

.big-amt {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.goal-meta {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  margin-top: 4px;
}

/* Circular Progress Ring */
.progress-ring-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: #e7ece9;
  stroke-width: 5.5;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary-bright);
  stroke-width: 5.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}

.progress-ring-label {
  position: absolute;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-donate-primary {
  width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.btn-donate-primary:hover {
  background: var(--primary-hover);
}

.btn-share-secondary {
  width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-share-secondary:hover {
  background: var(--surface-muted);
}

.sidebar-recent {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.sidebar-donor {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-donor-info {
  min-width: 0;
}

.sidebar-donor-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-donor-amt {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.see-all-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.see-all-pill:hover {
  background: var(--surface-muted);
}

/* Sticky Mobile Bottom Bar */
.sticky-footer {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 35;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-raised {
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.footer-raised strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

.btn-donate-sticky {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 11px 24px;
  min-height: 44px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 20, 0.58);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-modal);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.btn-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.btn-close:hover {
  background: var(--surface-muted);
}

.channel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--surface-muted);
  border-radius: 9999px;
  margin-bottom: 12px;
}

.channel-tab {
  min-height: 40px;
  padding: 8px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.channel-tab.is-active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.channel-note {
  font-size: 0.84rem;
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.btn-preset {
  min-height: 38px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-preset.active {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: var(--primary);
}

.field-group {
  margin-bottom: 9px;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.field-optional {
  font-weight: 400;
  color: var(--ink-secondary);
}

.inp {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--bg);
}

.inp:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1, 122, 65, 0.14);
}

.form-error {
  display: none;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.form-error.is-visible {
  display: block;
}

.btn-pay {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
}

.btn-pay:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-pay:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Transfer Details Step — Fixed Height (Never Jumps) */
.transfer-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.transfer-status-bar.is-waiting {
  background: var(--primary-tint);
  color: var(--primary);
}

.transfer-status-bar.is-failed {
  background: var(--danger-bg);
  color: var(--danger);
}

.transfer-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.transfer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.transfer-row:first-child {
  padding-top: 0;
}

.transfer-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.transfer-key {
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

.transfer-val {
  font-weight: 600;
  font-size: 0.94rem;
  text-align: right;
}

.account-num-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-num {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.btn-copy {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-copy:hover {
  background: var(--surface-muted);
}

.btn-secondary-outline {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-secondary-outline:hover {
  background: var(--surface-muted);
}

/* Success Step */
.success-panel {
  text-align: center;
  padding: 8px 4px 4px;
}

.success-badge {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.success-amt {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.success-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-copy {
  color: var(--ink-secondary);
  font-size: 0.94rem;
  margin-bottom: 12px;
}

.success-organizer {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

/* Share Modal */
.share-modal-box {
  max-width: 420px;
}

.share-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.share-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  min-height: 52px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.share-tile:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.share-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.share-icon-wa {
  background: #e9fbf0;
  color: #16a34a;
}

.share-icon-x {
  background: #f1f1f1;
  color: #111111;
}

.share-icon-fb {
  background: #edf4ff;
  color: #1877f2;
}

.share-icon-ig {
  background: #fdf2f8;
  color: #db2777;
}

.share-feedback {
  min-height: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.copy-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-link-inp {
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.btn-copy-link {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.btn-copy-link:hover {
  background: var(--surface-muted);
}

.is-hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 860px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .page-shell {
    padding: 20px 16px 32px;
  }

  .nav-inner {
    padding: 12px 16px;
  }

  .gfm-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar-col {
    display: none;
  }

  .mobile-meter {
    display: block;
  }

  .sticky-footer {
    display: block;
  }
}

@media (max-width: 520px) {
  .btn-nav-share {
    display: none;
  }
}
