/* Giving module — public give pages (mobile-first, church colour via --primary), admin extras, statements & posters. */

/* ── Public give page ─────────────────────────────────────────────── */
.give-page { max-width: 1040px; margin: 0 auto; }
.give-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 22px 26px; margin-bottom: 18px; color: #fff;
  background: var(--primary, #4f46e5); background-image: radial-gradient(600px 240px at 100% 0%, rgba(255,255,255,.22), transparent 60%), linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.22) 100%); }
.give-hero h1 { color: #fff; font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.give-hero p { margin: 0; opacity: .92; font-size: 15px; max-width: 60ch; white-space: pre-line; }
.give-hero .give-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .9; margin-bottom: 8px; }
.give-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 900px) { .give-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } .give-hero { padding: 36px 34px; } .give-hero h1 { font-size: 32px; } }
.give-card { background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 18px; box-shadow: 0 10px 30px rgba(15,23,42,.06); padding: 20px 18px; }
@media (min-width: 640px) { .give-card { padding: 26px 26px; } }
.give-side > * + * { margin-top: 16px; }
.give-step { margin-bottom: 20px; }
.give-step-title { font-weight: 700; font-size: 14px; color: var(--ink, #0f172a); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.give-step-title .muted { font-weight: 500; }

/* Choice pills (funds, frequency) — real radio inputs, styled */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.pill-group legend { padding: 0; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--border-strong, #cbd5e1);
  background: #fff; color: var(--ink, #0f172a); font-weight: 600; font-size: 14px; cursor: pointer; transition: border-color .12s, background .12s, color .12s; user-select: none; }
.pill span:hover { border-color: var(--primary, #4f46e5); }
.pill input:checked + span { background: var(--primary, #4f46e5); border-color: var(--primary, #4f46e5); color: #fff; }
.pill input:focus-visible + span { outline: 2px solid var(--primary, #4f46e5); outline-offset: 2px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 1.5px solid var(--border-strong, #cbd5e1); border-radius: 12px; overflow: hidden; }
.segmented .pill span { border: 0; border-radius: 0; width: 100%; min-height: 44px; }
.segmented .pill + .pill span { border-left: 1.5px solid var(--border-strong, #cbd5e1); }

/* Amount presets */
.amount-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.amount-grid .pill span { width: 100%; border-radius: 12px; min-height: 52px; font-size: 16px; font-variant-numeric: tabular-nums; }
.amount-custom { margin-top: 10px; }
.amount-custom .input-group .addon { font-weight: 700; color: var(--ink, #0f172a); min-width: 48px; justify-content: center; }
.amount-custom .input { height: 52px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.give-fixed-amount { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--ink, #0f172a); }
.give-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 560px) { .give-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.give-card .input { height: 44px; font-size: 15px; }
.give-card textarea.input { height: auto; }
.give-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2, #f8fafc); border: 1px solid var(--border, #e5e7eb); margin: 4px 0 14px; font-size: 14px; }
.give-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.give-submit { width: 100%; height: 54px; font-size: 17px; border-radius: 14px; }
.give-secure { display: flex; gap: 8px; align-items: flex-start; justify-content: center; text-align: center; color: var(--muted, #64748b); font-size: 12.5px; margin-top: 12px; }
.give-member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft, #eef2ff); margin-bottom: 16px; font-size: 14px; }
.give-optional summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--primary, #4f46e5); list-style: none; }
.give-optional summary::-webkit-details-marker { display: none; }
.give-optional summary::before { content: "+ "; }
.give-optional[open] summary::before { content: "– "; }
.giftaid-box { border: 1.5px solid #bfdbfe; background: #eff6ff; border-radius: 14px; padding: 14px; margin: 6px 0 16px; }
.giftaid-box .giftaid-logo { font-weight: 800; color: #1d4ed8; letter-spacing: -.01em; }
.giftaid-box .small { color: #1e3a8a; }
.giftaid-fields { margin-top: 12px; }
.give-help-list { list-style: none; margin: 0; padding: 0; }
.give-help-list li { padding: 10px 0; border-bottom: 1px solid var(--surface-3, #f1f5f9); display: flex; gap: 10px; align-items: flex-start; }
.give-help-list li:last-child { border-bottom: 0; }
.give-help-list .mono { font-size: 15px; font-weight: 700; color: var(--ink, #0f172a); word-break: break-all; }
.give-ways h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.give-ways section + section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border, #e5e7eb); }
.give-project { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--ink, #0f172a); padding: 10px 0; }
.give-project:hover { text-decoration: none; }
.give-project img, .give-project .ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--primary-soft, #eef2ff); display: grid; place-items: center; color: var(--primary, #4f46e5); }
.give-project strong { display: block; }
.ttg-box { display: flex; gap: 12px; align-items: center; }
.ttg-bubble { background: var(--ink, #0f172a); color: #fff; border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-weight: 700; font-family: var(--mono); font-size: 14px; }
.giving-icon-bubble { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--primary-soft, #eef2ff); color: var(--primary, #4f46e5); flex-shrink: 0; }

/* Thank-you */
.thanks { text-align: center; max-width: 560px; margin: 8px auto 0; }
.thanks-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: #dcfce7; color: #15803d; }
.thanks-icon.warn { background: #fef3c7; color: #b45309; }
.thanks-icon.bad { background: #fee2e2; color: #b91c1c; }
.thanks h1 { font-size: 26px; margin-bottom: 6px; }
.thanks .receipt { text-align: left; margin: 20px 0; }
.thanks .receipt .kv { grid-template-columns: minmax(100px, 40%) 1fr; }

/* Thermometer (project progress) */
.thermo { margin: 12px 0 4px; }
.thermo-track { position: relative; height: 16px; border-radius: 999px; background: var(--surface-3, #f1f5f9); overflow: hidden; box-shadow: inset 0 1px 2px rgba(15,23,42,.08); }
.thermo-fill, .thermo-pledged { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.thermo-fill { background: linear-gradient(90deg, var(--primary, #4f46e5), #16a34a); }
.thermo-pledged { background: repeating-linear-gradient(45deg, rgba(79,70,229,.18), rgba(79,70,229,.18) 6px, rgba(79,70,229,.08) 6px, rgba(79,70,229,.08) 12px); }
.thermo-legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; color: var(--muted, #64748b); }
.thermo-legend strong { color: var(--ink, #0f172a); font-size: 18px; }
.thermo-note { font-size: 12.5px; color: var(--muted, #64748b); margin-top: 2px; }
.project-hero-img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 16px; margin-bottom: 16px; background: var(--surface-3, #f1f5f9); }
.project-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; text-align: center; }
.project-stats div { background: var(--surface-2, #f8fafc); border-radius: 12px; padding: 10px 6px; }
.project-stats strong { display: block; font-size: 17px; }
.project-stats span { font-size: 12px; color: var(--muted, #64748b); }
.project-desc { white-space: pre-line; }

/* Website blocks */
.giving-cta { padding: 40px 16px; text-align: center; }
.giving-cta-inner { max-width: 640px; margin: 0 auto; }
.giving-cta h2 { font-size: 26px; margin: 12px 0 8px; }
.giving-cta p { color: var(--muted, #64748b); font-size: 16px; }
.giving-project-block .thermo { text-align: left; }

/* ── Admin ────────────────────────────────────────────────────────── */
.giving-member-card .card-title { font-size: 16px; }
.gift-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gift-void td { opacity: .55; }
.gift-void .gift-amount { text-decoration: line-through; }
.totals-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.totals-bar strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.filters .input[type="date"] { min-width: 0; width: 150px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.mini-stats strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.campaign-card { display: flex; flex-direction: column; overflow: hidden; margin: 0; }
.campaign-card img, .campaign-card .ph { width: 100%; height: 130px; object-fit: cover; background: linear-gradient(135deg, var(--primary-soft), #fef3c7); display: grid; place-items: center; color: var(--primary); }
.status-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.status-steps li { padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.status-steps li.done { background: #dcfce7; color: #166534; }
.status-steps li.current { background: var(--primary-soft); color: var(--primary-ink); }
.match-ok { color: var(--success); font-weight: 700; }
.match-bad { color: var(--danger); font-weight: 700; }

/* Count sheet */
.count-sheet { width: 100%; border-collapse: collapse; }
.count-sheet th, .count-sheet td { padding: 6px 8px; border-bottom: 1px solid var(--surface-3); font-variant-numeric: tabular-nums; }
.count-sheet th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.count-sheet td.num, .count-sheet th.num { text-align: right; }
.count-sheet input.input { height: 34px; width: 90px; text-align: right; margin-left: auto; }
.count-sheet tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.count-sheet .kind-row td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--ink-2); }

/* Batch entry grid */
.entry-grid { width: 100%; border-collapse: collapse; min-width: 760px; }
.entry-grid th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.entry-grid td { padding: 4px 6px; border-bottom: 1px solid var(--surface-3); vertical-align: top; }
.entry-grid .input { height: 36px; font-size: 14px; padding: 0 8px; }
.entry-grid td.n { color: var(--faint); width: 32px; text-align: right; padding-top: 12px; font-size: 12px; }
.entry-grid .amount { text-align: right; font-variant-numeric: tabular-nums; }
.entry-grid tr.row-error td { background: #fef2f2; }
.entry-grid .row-msg { color: var(--danger); font-size: 12px; padding: 2px 2px 0; }
.entry-who { position: relative; }
.entry-who .picker-results { min-width: 260px; }
.entry-who .linked { position: absolute; right: 8px; top: 10px; color: var(--success); pointer-events: none; }
.entry-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); position: sticky; bottom: 0; }
.entry-total { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Share & QR */
.qr-card { text-align: center; }
.qr-card .qr-box svg { width: 180px; height: 180px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.code-snippet { font-family: var(--mono); font-size: 12.5px; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.embed-preview { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 8px; background: var(--surface-2); }
.embed-preview iframe { width: 100%; height: 620px; border: 0; border-radius: 10px; background: #fff; }

/* Settings rows */
.rows-table { width: 100%; border-collapse: collapse; }
.rows-table td { padding: 4px 6px 4px 0; }
.rows-table .input { height: 36px; }

/* ── Statements (print) ───────────────────────────────────────────── */
.statement { page-break-after: always; break-after: page; padding-bottom: 24px; }
.statement:last-child { page-break-after: auto; break-after: auto; }
.statement + .statement { border-top: 1px dashed #cbd5e1; padding-top: 32px; margin-top: 32px; }
@media print { .statement + .statement { border-top: 0; margin-top: 0; padding-top: 0; } }
.st-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; border-bottom: 3px solid var(--st-color, #4f46e5); padding-bottom: 14px; margin-bottom: 18px; }
.st-church { display: flex; gap: 12px; align-items: center; }
.st-church img { height: 56px; max-width: 160px; object-fit: contain; }
.st-church strong { font-size: 18px; display: block; }
.st-church .small, .st-meta .small { color: #64748b; }
.st-meta { text-align: right; }
.st-title { font-size: 20px; font-weight: 800; margin: 0; color: var(--st-color, #4f46e5); }
.st-to { margin-bottom: 18px; line-height: 1.5; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.st-table th { text-align: left; border-bottom: 1.5px solid #0f172a; padding: 6px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.st-table td { border-bottom: 1px solid #e5e7eb; padding: 5px 4px; }
.st-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table tfoot td { font-weight: 800; border-top: 1.5px solid #0f172a; border-bottom: 0; }
.st-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 640px) { .st-grid { grid-template-columns: minmax(0, 1fr); } .st-head { flex-direction: column; } .st-meta { text-align: left; } }
.st-legal { font-size: 12.5px; color: #334155; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.st-sign { margin-top: 28px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.st-sign .line { border-top: 1px solid #0f172a; min-width: 220px; padding-top: 6px; font-size: 13px; }
.st-foot { margin-top: 20px; font-size: 11.5px; color: #64748b; white-space: pre-line; }

/* ── Poster (print) ───────────────────────────────────────────────── */
.poster { max-width: 640px; margin: 0 auto; text-align: center; border: 2px solid var(--poster-color, #4f46e5); border-radius: 24px; padding: 36px 28px; }
.poster .p-church { font-weight: 700; color: #475569; letter-spacing: .02em; }
.poster h1 { font-size: 34px; letter-spacing: -.02em; margin: 10px 0 8px; color: var(--poster-color, #4f46e5); }
.poster .p-sub { font-size: 17px; color: #334155; margin-bottom: 20px; }
.poster .p-qr svg { width: 280px; height: 280px; }
.poster .p-url { font-family: var(--mono); font-size: 16px; margin-top: 14px; word-break: break-all; }
.poster .p-amount { display: inline-block; margin-top: 10px; font-size: 22px; font-weight: 800; background: #f1f5f9; border-radius: 999px; padding: 6px 18px; }
.poster .p-ways { text-align: left; margin-top: 22px; border-top: 1px solid #e5e7eb; padding-top: 16px; font-size: 14px; }
.poster .p-ways strong { display: block; margin-bottom: 4px; }

.is-hidden { display: none; }
.inline-dates { display: inline-block; }
.inline-dates summary { list-style: none; cursor: pointer; }
.inline-dates summary::-webkit-details-marker { display: none; }
.inline-dates[open] > span { display: flex; }

/* Batch entry on phones: each line becomes a small card */
@media (max-width: 640px) {
  .entry-grid { min-width: 0; }
  .entry-grid thead { display: none; }
  .entry-grid tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 10px 8px; border-bottom: 1px solid var(--border); }
  .entry-grid td { border: 0; padding: 0; }
  .entry-grid td.n { display: none; }
  .entry-grid td.entry-who { grid-column: 1 / -1; }
  .entry-grid td:last-child { text-align: right; }
  .entry-foot { flex-direction: column; align-items: stretch; }
  .count-sheet input.input { width: 72px; }
}
