.gift-credit-section { margin-bottom: 24px; }
.gift-credit-section .section-title p { max-width: 780px; line-height: 1.6; }

/* Content sections and dialogs render on a light surface, so these cards must
   not inherit the dark console theme variables (--ink is near-white there). */
.gift-credit-funds { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 24px; }
.gift-credit-funds > div { display: grid; gap: 8px; min-width: 200px; padding: 16px; background: #f6f8fa; border: 1px solid #e5e5e5; border-radius: 10px; }
.gift-credit-funds span, .gift-credit-source { color: #737373; font-size: 12px; }
.gift-credit-funds strong { color: #0a0a0a; font-family: "Roboto Mono", monospace; font-size: 20px; font-variant-numeric: tabular-nums; }
.gift-credit-source { display: block; margin-top: 5px; }
.gift-credit-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 24px; }

/* The history table is six columns wide. The dialog opens wider than the
   default 460px body so the columns fit, and scrolls internally so the form,
   the table, and the actions never push each other off screen. */
#gift-credit-dialog { width: min(1080px, calc(100vw - 32px)); }
#gift-credit-dialog .dialog-body { width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; }
.gift-credit-dialog-body { display: grid; gap: 20px; }
.gift-credit-dialog-body .gift-credit-funds, .gift-credit-dialog-body .gift-credit-pagination { padding: 0; }
.gift-credit-dialog-body .section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gift-credit-dialog-body .table-wrap { border: 1px solid #e5e5e5; border-radius: 8px; }
.gift-credit-help, .gift-credit-form small { color: #737373; font-size: 12px; line-height: 1.7; margin: 0; }
.gift-credit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px; border: 1px solid #e5e5e5; border-radius: 10px; background: #fff; }
.gift-credit-form label { display: grid; gap: 8px; min-width: 0; }
.gift-credit-form input { min-width: 0; }
.gift-credit-reason, #gift-credit-error { grid-column: 1 / -1; }
#grant-gift-credit { grid-column: 1 / -1; justify-self: end; }
.gift-credit-section td, .gift-credit-dialog-body td { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .gift-credit-form { grid-template-columns: 1fr; padding: 14px; }
  .gift-credit-funds > div { flex: 1; min-width: 0; }
  .gift-credit-funds, .gift-credit-pagination { padding: 14px; }
  #gift-credit-dialog .dialog-body { max-height: none; }
}
