/*
 * M4.14C2A — Public Donate
 *
 * The asset/network controls deliberately reuse the established
 * Deposit presentation classes. Donate-specific layout remains
 * isolated under .donate-* selectors.
 */

.donate-tab-panel {
  max-width: 1180px;
  margin: 0 auto;
}

.donate-intro-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.7fr)
    minmax(260px, .8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.donate-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 178px;
}

.donate-kicker {
  display: inline-block;
  width: fit-content;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.donate-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}

.donate-hero > p {
  max-width: 760px;
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.donate-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.donate-trust-row span {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem;
}

.donate-destination-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 178px;
}

.donate-destination-card > span,
.donate-destination-card > small {
  color: var(--muted);
}

.donate-destination-card > span {
  margin-bottom: 8px;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.donate-destination-card > strong {
  display: block;
  margin-bottom: 9px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.donate-destination-card > small {
  line-height: 1.45;
}

.donate-wallet-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(241, 189, 100, .42);
  border-radius: var(--radius);
  background: rgba(241, 189, 100, .08);
}

.donate-wallet-warning strong {
  color: var(--warning);
  white-space: nowrap;
}

.donate-wallet-warning span {
  color: var(--text);
  line-height: 1.45;
}

.donate-workflow-panel {
  margin-bottom: 14px;
}

.donate-workflow-header {
  align-items: center;
}

.donate-workflow-header .mode-badge {
  white-space: nowrap;
}

.donate-flow {
  display: grid;
  gap: 0;
}

.donate-workflow-panel .deposit-step:last-child {
  border-bottom: 0;
}

.donate-workflow-panel .deposit-option-list {
  max-height: 390px;
}

.donate-workflow-panel .deposit-option small {
  overflow-wrap: anywhere;
}

.donate-workflow-panel .deposit-copy-row code {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.donate-footnote {
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .donate-intro-grid {
    grid-template-columns: 1fr;
  }

  .donate-hero,
  .donate-destination-card {
    min-height: 0;
  }

  .donate-wallet-warning {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .donate-wallet-warning strong {
    white-space: normal;
  }
}

/*
 * C2C responsive visual acceptance polish.
 *
 * Scope the shared topbar correction specifically to Donate.
 * Other dashboard pages retain their accepted responsive geometry.
 */
@media (max-width: 600px) {
  body:has(#tab-donate.active) .topbar {
    min-height: 0 !important;
    height: auto !important;
    justify-content: flex-start !important;
    align-content: flex-start;
    gap: 12px;
  }

  body:has(#tab-donate.active)
  .topbar > div:first-child {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: 100%;
  }

  body:has(#tab-donate.active) .top-actions {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    flex: 0 0 auto !important;
    align-self: stretch;
    width: 100%;
    gap: 8px;
    margin-top: 2px;
  }

  body:has(#tab-donate.active)
  .top-actions > * {
    min-width: 0;
  }

  body:has(#tab-donate.active)
  .top-actions .button,
  body:has(#tab-donate.active)
  .top-actions .dashboard-ui-select {
    width: 100%;
  }

  body:has(#tab-donate.active)
  .top-actions #modeBadge {
    width: max-content;
    justify-self: start;
    align-self: center;
  }

  .donate-workflow-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .donate-workflow-header .mode-badge {
    flex: 0 0 auto;
    align-self: flex-start;
    white-space: nowrap;
    font-size: .7rem;
    padding: 5px 8px;
  }

  .donate-trust-row {
    display: grid;
  }

  .donate-trust-row span {
    width: fit-content;
  }

  #donateNetworkList
  .deposit-option-main {
    min-width: 0;
  }

  #donateNetworkList
  .deposit-option-main > span {
    min-width: 0;
  }

  #donateNetworkList
  .deposit-option-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/*
 * The QR card intentionally has a light surface.
 * Override the dashboard's dark secondary-button treatment
 * so Copy address reads as an enabled control.
 */
.donate-workflow-panel
.deposit-qr-card
.button.secondary {
  color: #073b2b;
  background: #effff8;
  border-color: rgba(7, 59, 43, .24);
  opacity: 1;
  font-weight: 700;
  box-shadow:
    0 5px 14px rgba(0, 0, 0, .12);
}

.donate-workflow-panel
.deposit-qr-card
.button.secondary:hover:not(:disabled) {
  color: #022d20;
  background: #dcfff1;
  border-color: rgba(7, 59, 43, .40);
}


/* ============================================================
   M4.16B1 — OPTIONAL DONATION INTENT TRACKING
   ============================================================ */

.donate-intent-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line, #d8dee8);
  border-radius: 14px;
  background: var(--panel-soft, rgba(127, 127, 127, 0.05));
}

.donate-intent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.donate-intent-head strong {
  display: block;
  margin-bottom: 5px;
}

.donate-intent-head p,
.donate-intent-active small,
.donate-intent-expiry {
  margin: 0;
  color: var(--muted, #657081);
  line-height: 1.5;
}

.donate-intent-active {
  display: grid;
  gap: 12px;
}

.donate-intent-txid-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 8px;
  align-items: end;
}

.donate-intent-txid-row label {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 700;
}

.donate-intent-txid-row input {
  min-width: 0;
  min-height: 42px;
}

.donate-intent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .donate-intent-head {
    display: grid;
  }

  .donate-intent-txid-row {
    grid-template-columns: 1fr;
  }

  .donate-intent-txid-row label {
    grid-column: auto;
  }

  .donate-intent-txid-row .button {
    width: 100%;
  }
}


/* ============================================================
   M4.17B2 — DONOR ATTRIBUTION UI
   ============================================================ */

.donate-attribution-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--line, #d8dee8);
  border-radius: 12px;
  background: var(
    --panel-soft,
    rgba(127, 127, 127, 0.05)
  );
}

.donate-attribution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.donate-attribution-head strong {
  display: block;
  margin-bottom: 4px;
}

.donate-attribution-head p {
  margin: 0;
  color: var(--muted, #657081);
  line-height: 1.45;
}

.donate-attribution-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.donate-attribution-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: .76rem;
  font-weight: 700;
}

.donate-attribution-grid select,
.donate-attribution-grid input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
}

.donate-attribution-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.donate-attribution-status,
.donate-attribution-note {
  color: var(--muted, #657081);
  line-height: 1.45;
}

.donate-attribution-status {
  font-size: .76rem;
}

.donate-attribution-note {
  margin: 0;
}

@media (max-width: 720px) {
  .donate-attribution-head {
    display: grid;
  }

  .donate-attribution-grid {
    grid-template-columns: 1fr;
  }

  .donate-attribution-actions {
    display: grid;
  }

  .donate-attribution-actions .button {
    width: 100%;
  }
}


/* ============================================================
   M4.17E1 — PUBLIC DONATION LEDGER
   ============================================================ */

.donate-ledger-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.donate-ledger-header {
  align-items: center;
}

.donate-ledger-header p {
  max-width: 760px;
}

.donate-ledger-summary {
  display: grid;
  grid-template-columns:
    minmax(180px, .45fr)
    minmax(0, 1.55fr);
  gap: 12px;
}

.donate-ledger-stat {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.donate-ledger-stat > span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.donate-ledger-stat > strong {
  font-size: 1.45rem;
  line-height: 1;
}

.donate-ledger-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.donate-ledger-total {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.donate-ledger-total .deposit-coin-mark {
  flex: 0 0 auto;
}

.donate-ledger-total strong {
  color: var(--text);
}

.donate-ledger-total > span:last-child,
.donate-ledger-total-empty {
  color: var(--muted);
  font-size: .78rem;
}

.donate-ledger-status {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.donate-ledger-list {
  display: grid;
  gap: 9px;
}

.donate-ledger-entry {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(220px, auto);
  gap: 16px;
  align-items: center;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.donate-ledger-entry-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.donate-ledger-entry-asset {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.donate-ledger-entry-value {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.donate-ledger-entry-value > strong {
  font-size: 1rem;
}

.donate-ledger-entry-value > strong span,
.donate-ledger-entry-value small {
  color: var(--muted);
}

.donate-ledger-entry-value small {
  overflow-wrap: anywhere;
  font-size: .76rem;
}

.donate-ledger-entry-donor {
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 0;
}

.donate-ledger-entry-donor > span:first-child {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.donate-ledger-anonymous,
.donate-ledger-donor-name {
  color: var(--text);
  font-weight: 700;
}

.donate-ledger-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.donate-ledger-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.donate-ledger-social span {
  color: var(--muted);
  font-size: .68rem;
}

.donate-ledger-social strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .76rem;
}

.donate-ledger-social:hover {
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .donate-ledger-header {
    align-items: stretch;
  }

  .donate-ledger-header .button {
    width: 100%;
  }

  .donate-ledger-summary {
    grid-template-columns: 1fr;
  }

  .donate-ledger-entry {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .donate-ledger-entry-donor {
    justify-items: start;
  }

  .donate-ledger-socials {
    justify-content: flex-start;
  }
}
