.giving-dialog {
  width: min(430px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 32px;
  overflow-y: auto;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #252b36;
  font-family: Arial, sans-serif;
  box-shadow: 0 20px 80px #0004;
}

.giving-dialog::backdrop {
  background: #15232db3;
}

.giving-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #596574;
  font: 28px Arial, sans-serif;
  cursor: pointer;
}

.giving-dialog h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 32px;
  font-size: 24px;
  line-height: 1.3;
}

.giving-shield {
  width: 28px;
  height: 32px;
  flex-shrink: 0;
  color: #00bc80;
}

.giving-frequency {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.giving-frequency label {
  position: relative;
  cursor: pointer;
}

.giving-frequency input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.giving-frequency span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border: 1px solid #c6cfdd;
  border-radius: 9px;
  font-size: 20px;
}

.giving-frequency b {
  color: #ff4081;
}

.giving-frequency input:checked + span,
.giving-presets button[aria-pressed="true"] {
  border-color: #3274ee;
  background: #edf3ff;
  box-shadow: inset 0 0 0 1px #3274ee;
  font-weight: 700;
}

.giving-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.giving-presets button {
  min-height: 50px;
  padding: 10px 4px;
  border: 1px solid #c6cfdd;
  border-radius: 9px;
  background: #fff;
  color: inherit;
  font: 20px Arial, sans-serif;
  cursor: pointer;
}

.giving-amount-field {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 65px;
  padding: 12px 18px;
  border: 1px solid #c6cfdd;
  border-radius: 9px;
  font-size: 30px;
}

.giving-amount-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.giving-currency {
  margin-left: 8px;
  color: #657287;
  font-size: 18px;
}

.giving-bottom {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.giving-comment-toggle {
  justify-self: start;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 16px Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

#giving-comment-box label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

#giving-comment {
  width: 100%;
  padding: 10px;
  border: 1px solid #c6cfdd;
  border-radius: 8px;
  resize: vertical;
  font: 16px Arial, sans-serif;
}

.giving-summary {
  margin: 0;
  color: #596574;
  font-size: 14px;
}

.giving-wallets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.giving-wallets button,
.giving-other {
  min-height: 60px;
  padding: 14px 10px;
  border: 0;
  border-radius: 10px;
  font: 700 18px Arial, sans-serif;
  cursor: pointer;
}

.giving-google {
  background: #000;
  color: #fff;
}

.giving-google span {
  color: #4285f4;
  font-size: 24px;
}

.giving-wallets .giving-paypal {
  background: #ffc439;
  color: #003087;
  font-style: italic;
}

.giving-other {
  width: 100%;
  background: #306dea;
  color: #fff;
}

.giving-dialog button:hover {
  filter: brightness(0.94);
}

.giving-card-brands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.giving-card-brands span {
  padding: 3px 4px;
  border: 1px solid #e3e8ef;
  color: #164c9c;
  font-size: 9px;
  font-weight: 700;
}

.giving-note {
  margin: 0;
  color: #596574;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.giving-error {
  margin: 8px 0 0;
  color: #a12632;
  font-size: 13px;
}

.giving-message {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #edf3ff;
  font-size: 14px;
  line-height: 1.5;
}

.giving-error:empty,
.giving-message:empty {
  display: none;
}

.giving-dialog button:focus-visible,
.giving-dialog input:focus-visible,
.giving-dialog textarea:focus-visible,
.giving-frequency input:focus-visible + span,
.giving-message:focus {
  outline: 3px solid #075d85;
  outline-offset: 3px;
}

@media (max-width: 480px), (max-height: 760px) {
  .giving-dialog {
    padding: 32px 20px 20px;
  }

  .giving-dialog h2 {
    font-size: 22px;
  }

}
