/* Fundraising jars (beta) — layered on styles.css. Used inside the app
   (Sadaqah → Fundraising jars) and by jar.html, the public page donors open.
   Fundraisers are sadaqah, so they wear the Jar's terracotta, not zakat green
   (the screen gets .sq-theme, which re-points the brand tokens). */

body[data-page="jar"] .view { padding-bottom: 48px; }

.fj-muted { color: var(--muted); font-size: 14px; }
.fj-meta { color: var(--muted); font-size: 12.5px; }
.fj-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fj-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--body-ink); font-size: 15px; }
.fj-error { color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger-border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; font-weight: 600; }
.fj-empty { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: stretch; }
.fj-empty .e-icon { font-size: 34px; }

.fj-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 40px 0; font-size: 14px; }
.fj-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--track); border-top-color: var(--brand); animation: jar-spin 0.8s linear infinite; }
@keyframes jar-spin { to { transform: rotate(360deg); } }

/* Hero */
.fj-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: start;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(70, 28, 12, 0.4) 0%, rgba(70, 28, 12, 0) 60%),
    linear-gradient(150deg, #C26C43 0%, var(--sadaqah) 40%, var(--sadaqah-deep) 100%);
  color: #fff;
  border-radius: 22px;
  padding: 20px 20px 22px;
  box-shadow: 0 10px 28px -12px rgba(150, 73, 42, 0.38);
}
.fj-hero.closed {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(150deg, #8E7A70 0%, #7A665C 45%, #64534A 100%);
  box-shadow: 0 10px 28px -12px rgba(80, 60, 50, 0.35);
}
.fj-hero .hc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fj-hero .hc-label { font-size: 12.5px; font-weight: 600; opacity: 0.9; letter-spacing: 0.04em; text-transform: uppercase; }
.fj-hero .hc-note { font-size: 13.5px; opacity: 0.9; }
.fj-empty-title { font-size: 17px; }
.fj-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; margin: 4px 0 0; }
.fj-closed-pill { font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.2); border-radius: 99px; padding: 3px 10px; }
.fj-jar-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.fj-jar { width: 132px; flex: none; }
.fj-jar svg { width: 100%; height: auto; display: block; overflow: visible; }
.fj-level { transform-box: fill-box; transform-origin: bottom; transition: transform 1100ms cubic-bezier(.22, 1, .36, 1); }
.fj-coin { opacity: 0; transform-box: fill-box; transform-origin: center; }
.fj-coin.drop { animation: fjCoinDrop 700ms cubic-bezier(.5, 0, .6, 1) 250ms forwards; }
@keyframes fjCoinDrop {
  0% { opacity: 1; transform: translateY(-10px) rotate(0deg); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(110px) rotate(140deg); }
}
.fj-nums { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fj-nums .jp-total { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.fj-nums .jp-sub { font-size: 13px; opacity: 0.88; }
.fj-nums .jp-togo { font-size: 13.5px; font-weight: 700; color: var(--coin-light); margin-top: 4px; }
.fj-nums .jp-count { font-size: 13px; opacity: 0.92; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.fj-nums .jp-count strong { font-size: 18px; }
@media (prefers-reduced-motion: reduce) {
  .fj-level { transition: none; }
  .fj-coin.drop { animation: none; }
}

/* Amount entry */
.fj-amount { display: flex; flex-direction: column; gap: 10px; }
.fj-amount-box {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface-input);
  padding: 10px 16px;
}
.fj-amount-box:focus-within { border-color: var(--brand); background: var(--surface-focus); }
.fj-rupee { font-size: 34px; font-weight: 700; color: var(--muted); }
input.fj-amount-input {
  border: none; background: transparent; outline: none; min-width: 0; width: 1.6ch; max-width: 100%;
  font-size: 40px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  text-align: center; color: var(--ink); padding: 0;
}

.fj-cta { font-size: 17px; }
.fj-details { display: flex; flex-direction: column; gap: 16px; }
.fj-disclaimer { font-size: 12.5px; }

/* Proof documents */
.fj-proofs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.fj-proof { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); font-size: 12px; min-width: 0; }
.fj-proof img, .fj-proof .jpf-icon { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--brand-softer); }
.fj-proof .jpf-icon { display: flex; align-items: center; justify-content: center; font-size: 30px; }
.fj-proof .jpf-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Donor's own pledges */
.fj-mine { display: flex; flex-direction: column; gap: 4px; }
.fj-mine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.fj-mine-row:first-of-type { border-top: none; }
.jmr-amt { font-weight: 800; font-size: 17px; }
.jmr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Forms */
.fj-form { display: flex; flex-direction: column; gap: 14px; }
.fj-form-card { display: flex; flex-direction: column; gap: 14px; }
.fj-section-title { font-size: 16px; font-weight: 800; }
.fj-sheet-lead { margin: -4px 0 14px; }
.fj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fj-chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 99px; padding: 8px 14px; font-size: 14px; font-weight: 700;
}
.fj-chip.selected { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-ink); }
select.select { appearance: auto; }
.fj-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fj-file-pick {
  display: flex; align-items: center; justify-content: center; position: relative;
  border: 1.5px dashed var(--ghost-border); border-radius: 13px; padding: 14px;
  font-weight: 700; color: var(--brand-ink); cursor: pointer; background: var(--brand-softer);
}
.fj-file-pick:focus-within { border-color: var(--brand); }
.fj-file-list { display: flex; flex-direction: column; gap: 4px; }
.fj-file-list:empty { display: none; }
.fj-file-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; min-width: 0; }
.fj-file-item > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-ink); }
.fj-file-item .link-btn { color: var(--danger); flex: none; }

/* Pay sheet */
.fj-payto { display: flex; flex-direction: column; gap: 10px; background: var(--brand-softer); border: 1px solid var(--soft-border); border-radius: var(--radius-sm); padding: 12px 14px; }
.fj-copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.fj-copy-row > div { min-width: 0; }
.fj-copy-row code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.fj-copy-row .fj-label { margin-bottom: 0; }
.fj-pay-head { text-align: center; margin: 2px 0 14px; }
.fj-pay-amt { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.fj-pay-head .fj-muted strong { color: var(--ink); }
.fj-pay-thanks { text-align: center; }
.fj-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.fj-app {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 4px 10px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface-input);
  color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.2;
  -webkit-tap-highlight-color: transparent; transition: transform 0.06s ease;
}
.fj-app:active { transform: scale(0.96); }
.fj-app-icon {
  width: 52px; height: 52px; border-radius: 15px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #E6E3DA; /* white in dark mode too, like the apps' own icons */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
}
.fj-app-icon svg { display: block; }
.fj-app-icon .lg-g { width: 14px; height: 14px; }
.fj-app-icon .lg-gpay { font: 500 13px/1 "Google Sans", "Product Sans", Roboto, Arial, sans-serif; color: #5F6368; margin-inline-start: 1.5px; letter-spacing: -0.01em; }
.fj-app-icon .lg-pp { width: 32px; height: 32px; }
.fj-app-icon .lg-paytm { width: 40px; height: 40px; }
.fj-app-icon.any { background: var(--sadaqah-soft); color: var(--sadaqah-ink); box-shadow: none; border-color: var(--sadaqah-border); }
.fj-app-icon.any svg { width: 26px; height: 26px; }
.fj-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 2px 0 -2px; }
.fj-or::before, .fj-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fj-small { font-size: 12.5px; }

/* Owner lists */
.fj-list { display: flex; flex-direction: column; gap: 12px; }
.fj-row { display: flex; align-items: center; gap: 14px; text-align: start; width: 100%; color: var(--ink); }
.jr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.jr-mini { flex: none; width: 52px; height: 64px; border-radius: 14px; background: linear-gradient(150deg, #C26C43, var(--sadaqah-deep)); display: flex; align-items: center; justify-content: center; }
.jr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jr-top strong { overflow-wrap: anywhere; }
.jr-stats { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; color: var(--body-ink); }
.fj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fj-actions .btn { min-height: 46px; padding: 10px 12px; font-size: 15px; }
.fj-pledges { display: flex; flex-direction: column; }
.fj-pledges > .jr-top { margin-bottom: 6px; }
.fj-pledge { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.jpl-main { min-width: 0; flex: 1; }
.jpl-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.jpl-top strong { font-size: 16px; }
.jpl-top span { color: var(--body-ink); font-size: 14px; overflow-wrap: anywhere; }
.jpl-msg { margin-top: 4px; font-size: 14px; color: var(--body-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.jpl-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.jpl-del { color: var(--muted); font-size: 12.5px; padding: 4px; }
.fj-delete { color: var(--danger); align-self: center; }

/* Entry card on the Sadaqah screen */
.fj-entry { display: flex; align-items: center; gap: 13px; width: 100%; text-align: start; color: var(--ink); font: inherit; cursor: pointer; }
.fj-entry-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--sadaqah-soft); display: flex; align-items: center; justify-content: center; }
.fj-entry-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--sadaqah-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fj-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fj-entry-text span { font-size: 13.5px; color: var(--muted); }
