.tm-donate-block {
  --tm-donate-accent: var(--wp--preset--color--accent-3, #1d636b);
  --tm-donate-accent-contrast: var(--wp--preset--color--base, #f1f1e6);
  --tm-donate-success: var(--wp--preset--color--accent-1, #e6b45e);
  --tm-donate-success-contrast: var(--wp--preset--color--contrast, #314a59);
  --tm-donate-surface: var(--wp--preset--color--base, #f1f1e6);
  --tm-donate-border: var(--wp--preset--color--accent-4, #8a8a82);
  --tm-donate-muted: var(--wp--preset--color--accent-4, #8a8a82);
  --tm-donate-content-max-inline: 420px;
  --tm-donate-amount-inline: clamp(140px, 18vw, 200px);
  --tm-donate-font-body: var(
    --wp--preset--font-family--libre-franklin,
    "Libre Franklin",
    system-ui,
    -apple-system,
    sans-serif
  );
  --tm-donate-font-title: var(
    --wp--preset--font-family--pt-serif,
    "PT Serif",
    Georgia,
    serif
  );
  --tm-donate-size-title: var(
    --wp--preset--font-size--x-large,
    clamp(1.5rem, 2vw + 1rem, 2.25rem)
  );
  --tm-donate-size-text: var(--wp--preset--font-size--medium, 1rem);
  --tm-donate-size-button: var(--wp--preset--font-size--medium, 1rem);
  --tm-donate-size-caption: var(--wp--preset--font-size--small, 0.85rem);
  width: 90%;
  margin: 0;
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid var(--tm-donate-border, #8a8a82);
  border-radius: 8px;
  background: var(--tm-donate-surface, #f1f1e6);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: var(--wp--preset--color--contrast, #333);
  font-family: var(--tm-donate-font-body);
  font-size: var(--tm-donate-size-text);
  line-height: 1.6;
}

.tm-donate-title {
  margin: 0 0 10px 0;
  font-family: var(--tm-donate-font-title);
  font-size: var(--tm-donate-size-title);
  font-weight: 700;
  text-align: center;
  color: var(--wp--preset--color--contrast, #333);
}

.tm-donate-description {
  margin: 0 0 20px 0;
  text-align: center;
  color: var(--tm-donate-muted, #8a8a82);
}

.tm-donate-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 2vw, 14px);
  margin-bottom: 20px;
  justify-content: center;
  align-items: stretch;
}

.tm-donate-amount-btn {
  inline-size: var(--tm-donate-amount-inline);
  padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 22px);
  border: 2px solid var(--tm-donate-accent, #1d636b);
  background: var(--tm-donate-surface, #f1f1e6);
  color: var(--tm-donate-accent, #1d636b);
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: var(--tm-donate-size-text);
  transition: all 0.3s ease;
  flex: 0 0 var(--tm-donate-amount-inline);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tm-donate-amount-btn:hover,
.tm-donate-amount-btn.selected {
  background: var(--tm-donate-accent, #1d636b);
  color: var(--tm-donate-accent-contrast, #f1f1e6);
}

.tm-donate-amount-btn:disabled,
.tm-donate-amount-btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tm-donate-custom-amount {
  margin-bottom: 20px;
  text-align: center;
}

.tm-donate-custom-amount input {
  width: min(100%, var(--tm-donate-content-max-inline));
  padding: clamp(10px, 1.5vw, 14px);
  border: 2px solid var(--tm-donate-border, #8a8a82);
  border-radius: 6px;
  font-size: var(--tm-donate-size-text);
  text-align: center;
  margin-inline: auto;
}

.tm-donate-custom-amount input:focus {
  outline: none;
  border-color: var(--tm-donate-accent, #1d636b);
}

.tm-donate-custom-amount input:disabled,
.tm-donate-custom-amount input.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tm-donate-donor-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.tm-donate-donor-info input {
  width: min(100%, var(--tm-donate-content-max-inline));
  padding: clamp(10px, 1.5vw, 14px);
  border: 2px solid var(--tm-donate-border, #8a8a82);
  border-radius: 6px;
  font-size: var(--tm-donate-size-text);
  margin-inline: auto;
}

.tm-donate-donor-info input:focus {
  outline: none;
  border-color: var(--tm-donate-accent, #1d636b);
}

.tm-donate-submit-btn {
  width: 33%;
  padding: clamp(14px, 2.5vw, 18px);
  background: var(--tm-donate-success, #e6b45e);
  color: var(--tm-donate-success-contrast, #314a59);
  border: none;
  border-radius: 6px;
  font-size: calc(var(--tm-donate-size-button) * 1.05);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
  display: block;
  margin-inline: auto;
}

.tm-donate-submit-btn:hover:not(:disabled) {
  background: var(--tm-donate-success, #e6b45e);
  background: color-mix(in srgb, var(--tm-donate-success, #e6b45e) 85%, #000);
}

.tm-donate-submit-btn:disabled {
  background: color-mix(
    in srgb,
    var(--tm-donate-border, #8a8a82) 55%,
    var(--tm-donate-surface, #f1f1e6)
  );
  color: var(--tm-donate-muted, #8a8a82);
  cursor: not-allowed;
}

.tm-donate-loading {
  text-align: center;
  padding: 20px;
  color: var(--tm-donate-muted, #8a8a82);
  font-size: var(--tm-donate-size-text);
}

.tm-donate-loading p {
  margin: 0;
  font-weight: bold;
}

.tm-donate-disclaimer {
  margin-top: 15px;
  text-align: center;
  color: var(--tm-donate-muted, #8a8a82);
  font-size: var(--tm-donate-size-caption);
}

.tm-donate-recurring {
  display: none;
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid
    color-mix(in srgb, var(--tm-donate-accent, #1d636b) 35%, transparent);
  border-radius: 6px;
  background: color-mix(
    in srgb,
    var(--tm-donate-accent, #1d636b) 10%,
    var(--tm-donate-surface, #f1f1e6)
  );
}

.tm-donate-recurring.is-visible {
  display: block;
}

.tm-donate-recurring-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--wp--preset--color--contrast, #333);
}

.tm-donate-recurring-label-text {
  flex: 1;
}

.tm-donate-recurring-toggle {
  width: 20px;
  height: 20px;
}

.tm-donate-recurring-help {
  margin: 8px 0 0 30px;
  font-size: var(--tm-donate-size-caption);
  color: var(--tm-donate-muted, #666);
}

.tm-donate-recurring-options {
  margin: 12px 0 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-donate-recurring-option {
  padding: clamp(8px, 1.2vw, 12px) clamp(12px, 1.8vw, 16px);
  border: 1px solid var(--tm-donate-accent, #1d636b);
  background: var(--tm-donate-surface, #f1f1e6);
  border-radius: 4px;
  font-size: var(--tm-donate-size-caption);
  color: var(--tm-donate-accent, #1d636b);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: normal;
  line-height: 1.4;
}

.tm-donate-recurring-option:hover,
.tm-donate-recurring-option.selected {
  background: var(--tm-donate-accent, #1d636b);
  color: var(--tm-donate-accent-contrast, #f1f1e6);
}

.tm-donate-recurring-option:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Responsive design */
@media (max-width: 600px) {
  .tm-donate-block {
    padding: clamp(14px, 4vw, 18px);
  }

  .tm-donate-title {
    font-size: clamp(1.35rem, 5vw, 1.7rem);
  }

  .tm-donate-amounts {
    flex-direction: column;
    align-items: stretch;
  }

  .tm-donate-amount-btn {
    inline-size: 100%;
    width: 100%;
    max-width: min(100%, var(--tm-donate-content-max-inline));
    flex: 1 1 auto;
  }

  .tm-donate-donor-info {
    gap: 12px;
  }

  .tm-donate-recurring-options {
    margin-left: 0;
    justify-content: center;
    gap: 10px;
  }

  .tm-donate-recurring-option {
    width: 100%;
    max-width: min(100%, var(--tm-donate-content-max-inline));
    text-align: center;
  }
}

@media (max-width: 420px) {
  .tm-donate-block {
    --tm-donate-size-title: clamp(1.25rem, 6vw, 1.55rem);
    --tm-donate-size-text: var(--wp--preset--font-size--small, 0.95rem);
    --tm-donate-size-button: var(--wp--preset--font-size--small, 0.95rem);
  }

  .tm-donate-recurring {
    margin-inline: 0;
  }
}
