.ivasure-gift-card-fields[hidden] {
  display: none;
}

.ivasure-gift-card-fields,
.ivasure-gift-card-redeem,
.ivasure-gift-card-redeem-form,
.ivasure-gift-card-balance,
.ivasure-gift-card-balance-form,
.ivasure-gift-card-recovery-form,
.ivasure-gift-card-recipient,
.ivasure-gift-card-claim-summary {
  --ks-border-1: var(--sc-input-border-color, var(--sc-color-gray-200, #d8dee6));
  --ks-surface-1: var(--sc-input-background-color, #ffffff);
  --ks-surface-2: var(--sc-card-background-color, #ffffff);
  --ks-text-1: var(--sc-input-label-color, #1f2937);
  --ks-text-2: var(--sc-color-gray-600, #6b7280);
  --ks-radius-2: var(--sc-input-border-radius, 8px);
  /* Same suite-wide teal as Filters and Wishlist, published on :root by the
     Filters addon from the merchant's Design settings, with the shared
     default as a standalone fallback. -accessible is the step that clears
     4.5:1 against white and is what filled buttons and body-size links use;
     the base stays for borders and decorative fills. */
  /* --ks-brand* are printed once by core from the merchant design token,
     with the accessible step measured rather than guessed so white-on-brand
     clears WCAG AA for any colour they choose. The literals below are the
     standalone fallback and match the shipped default. */
  --ks-color-primary: var(--ks-brand, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)));
  --ks-color-primary-accessible: var(--ks-brand-accessible, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) calc(var(--ff-primary-l, 40%) - 15%)));
  --ks-color-primary-dark: var(--ks-brand-strong, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) calc(var(--ff-primary-l, 40%) - 22%)));
  --ks-color-primary-darker: hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) calc(var(--ff-primary-l, 40%) - 28%));
  --ks-color-success: #16a34a;
  --ks-color-danger: #dc2626;
  --ks-color-warning: #b7791f;
}

.ivasure-gift-card-fields,
.ivasure-gift-card-redeem,
.ivasure-gift-card-redeem-form,
.ivasure-gift-card-balance,
.ivasure-gift-card-balance-form,
.ivasure-gift-card-recovery-form,
.ivasure-gift-card-recipient,
.ivasure-gift-card-field {
  scroll-margin-block-start: max(112px, calc(var(--header-height, 0px) + 24px));
  scroll-margin-block-end: 96px;
}

.ivasure-gift-card-fields {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: var(--ks-radius-2, 8px);
  background: linear-gradient(180deg, var(--ks-surface-2, #fff) 0%, #f7fffd 100%);
  box-shadow: 0 10px 24px rgba(15, 127, 117, 0.08);
  display: grid;
  gap: 12px;
}

.ivasure-gift-card-fields--minimal {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 10px 0 8px;
}

.ivasure-gift-card-intent {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: calc(var(--ks-radius-2, 8px) - 1px);
  background: var(--ks-surface-1, #fff);
  min-inline-size: 0;
}

.ivasure-gift-card-fields--minimal .ivasure-gift-card-intent {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ivasure-gift-card-intent__legend {
  font-weight: 600;
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.35;
}

.ivasure-gift-card-intent__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.ivasure-gift-card-intent__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: 999px;
  background: var(--ks-surface-1, #fff);
  font-weight: 600;
  color: var(--ks-text-1, hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) var(--ff-text-main-l, 12%)));
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  /* An option label breaks between words only. The checkout form the widget
     sits in allows breaks anywhere, and that is inherited: squeezed to ~112px
     on a phone, "For myself" rendered as "For mys / elf" (2026-09-05 shopper
     audit). The phone layout below gives each option its own row instead. */
  overflow-wrap: normal;
  word-break: normal;
}

.ivasure-gift-card-intent__option input {
  margin: 0;
  accent-color: var(--ks-color-primary, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)));
}

.ivasure-gift-card-intent__option:focus-within {
  border-color: var(--ks-color-primary, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ks-color-primary) 22%, transparent);
}

.ivasure-gift-card-intent__option.is-active {
  border-color: var(--ks-color-primary, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)));
  background: rgba(15, 159, 143, 0.1);
}

.ivasure-gift-card-intent__help {
  font-size: 13px;
  color: var(--ks-text-2, #6b7280);
  align-self: center;
}

.ivasure-gift-card-intent__summary,
.ivasure-gift-card-intent__delivery-note,
.ivasure-gift-card-recipient-list__help,
.ivasure-gift-card-field__help,
.ivasure-gift-card-field__counter {
  margin: 0;
  color: var(--ks-text-2, #6b7280);
  font-size: 13px;
  line-height: 1.45;
}

.ivasure-gift-card-intent__summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ks-border-1, #e0e0e0);
}

.ivasure-gift-card-intent__delivery-note,
.ivasure-gift-card-recipient-list__help {
  grid-column: 1 / -1;
}

.ivasure-gift-card-field__optional {
  color: var(--ks-text-2, #6b7280);
  font-weight: 500;
}

.ivasure-gift-card-field__help {
  margin-top: 6px;
}

.ivasure-gift-card-field__counter {
  margin-top: 6px;
  /* Logical property flips correctly for RTL locales (German/RTL supported). */
  text-align: end;
  font-size: 12px;
}

.ivasure-gift-card-field__counter.is-near-limit {
  /* Darker red for WCAG AA at 12px (#dc2626 was ~4.0:1 on white). */
  color: var(--ks-color-danger-strong, #b91c1c);
}

/* Per-field role="alert" live region (delivery date): same empty-collapse rule
   as the intent warning so the region can exist from first paint. */
.ivasure-gift-card-field__error:empty {
  display: none;
}

/* Scoped to the fields wrapper on purpose: a bare single-class selector loses
   `color` to host-theme paragraph rules (measured on the IvaSure theme), which
   would render the error in the same grey as the help text beneath it. */
.ivasure-gift-card-fields .ivasure-gift-card-field__error {
  margin: 6px 0 0;
  /* Darker red for WCAG AA at 13px on white. */
  color: var(--ks-color-danger-strong, #b91c1c);
  font-size: 13px;
  line-height: 1.45;
}

/* Permanent role="alert" live region: collapsed while empty so it takes no
   visual space, but stays in the a11y tree so injected text is announced. */
.ivasure-gift-card-intent__warning:empty {
  display: none;
}

.ivasure-gift-card-intent__warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: calc(var(--ks-radius-2, 8px) - 2px);
  background: rgba(220, 38, 38, 0.08);
  /* Darker red for WCAG AA on the light-red tint (#dc2626 was ~4.3:1). */
  color: var(--ks-color-danger-strong, #b91c1c);
  font-size: 13px;
  line-height: 1.4;
}

.ivasure-gift-card-fields--layout-stacked .ivasure-gift-card-intent__options {
  flex-direction: column;
  align-items: flex-start;
}

.ivasure-gift-card-fields--intent-checkbox .ivasure-gift-card-intent__options {
  align-items: center;
}

.ivasure-gift-card-fields--intent-checkbox.ivasure-gift-card-fields--layout-stacked .ivasure-gift-card-intent__options {
  align-items: flex-start;
}

.ivasure-gift-card-intent__conditional[hidden] {
  display: none;
}

.ivasure-gift-card-intent__conditional {
  display: grid;
  gap: 12px;
}

.ivasure-gift-card-field {
  margin: 0;
}

.ivasure-gift-card-recipient-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.ivasure-gift-card-recipient {
  padding: 14px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: var(--ks-radius-2, 8px);
  background: var(--ks-surface-1, #fff);
}

.ivasure-gift-card-recipient-title {
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.35;
}

.ivasure-gift-card-recipient .ivasure-gift-card-field {
  margin-bottom: 10px;
}

.ivasure-gift-card-recipient .ivasure-gift-card-field:last-child {
  margin-bottom: 0;
}

.ivasure-gift-card-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ks-text-1, hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) var(--ff-text-main-l, 12%)));
  line-height: 1.35;
}

.ivasure-gift-card-field label input,
.ivasure-gift-card-field label textarea {
  margin-top: 7px;
  font-weight: 400;
}

.ivasure-gift-card-field input,
.ivasure-gift-card-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: var(--ks-radius-2, 8px);
  background: var(--ks-surface-1, #ffffff);
  color: var(--ks-text-1, hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) var(--ff-text-main-l, 12%)));
  padding: 11px 12px;
  font-size: 16px;
  line-height: 1.4;
}

.ivasure-gift-card-field input:focus,
.ivasure-gift-card-field textarea:focus {
  border-color: var(--ks-color-primary, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ks-color-primary) 22%, transparent);
  outline: none;
}

.ivasure-gift-card-field input {
  min-height: 46px;
}

.ivasure-gift-card-field textarea {
  min-height: 116px;
  resize: vertical;
}

@media (min-width: 782px) {
  .ivasure-gift-card-intent__conditional {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ivasure-gift-card-recipient-list,
  .ivasure-gift-card-intent__delivery-note,
  .ivasure-gift-card-recipient-list__help,
  .ivasure-gift-card-field--message {
    grid-column: 1 / -1;
  }
}

.ivasure-gift-card-balance {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.ivasure-gift-card-balance-form,
.ivasure-gift-card-recovery-form--standalone {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--ks-border-1, #d8dee6);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--ks-surface-2, #ffffff) 0%, #f7fffd 100%);
  box-shadow: 0 10px 24px rgba(15, 127, 117, 0.08);
}

.ivasure-gift-card-balance-form h3,
.ivasure-gift-card-recovery-form--standalone h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.ivasure-gift-card-balance-result {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)) 22%, #fff);
  border-radius: 8px;
  background: var(--ks-surface-1, #ffffff);
}

.ivasure-gift-card-balance-result[hidden] {
  display: none;
}

.ivasure-gift-card-balance-result__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.ivasure-gift-card-balance-result__label {
  color: var(--ks-text-2, #6b7280);
}

.ivasure-gift-card-balance-result__value {
  text-align: right;
  color: var(--ks-text-1, #1f2937);
}

@media (max-width: 640px) {
  .ivasure-gift-card-balance-result__row {
    display: grid;
    gap: 2px;
  }

  .ivasure-gift-card-balance-result__value {
    text-align: left;
  }
}

.ivasure-gift-card-redeem-form {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: var(--ks-radius-2, 8px);
  background: linear-gradient(180deg, var(--ks-surface-2, #fff) 0%, #f7fffd 100%);
  box-shadow: 0 10px 24px rgba(15, 127, 117, 0.08);
}

.ivasure-gift-card-redeem-intro {
  margin: 0 0 14px;
  display: grid;
  gap: 6px;
}

.ivasure-gift-card-redeem-title {
  margin: 0;
  color: var(--ks-text-1, #1f2937);
  font-size: clamp(1.35rem, 1.1rem + 0.75vw, 1.8rem);
  line-height: 1.18;
  font-weight: 700;
}

.ivasure-gift-card-redeem-description {
  margin: 0;
  color: var(--ks-text-2, #6b7280);
  max-width: 46rem;
  line-height: 1.55;
}

.ivasure-gift-card-claim-summary {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: var(--ks-radius-2, 6px);
  background: var(--ks-surface-1, #fff);
}

.ivasure-gift-card-claim-summary p {
  margin: 0 0 6px;
}

.ivasure-gift-card-claim-summary p:last-child {
  margin-bottom: 0;
}

.ivasure-gift-card-redeem-label {
  font-weight: 600;
  margin-bottom: 8px;
}

/* Helper texts on the checkout take a muted ink that follows the colour
   scheme: the Etch layer's muted token flips with the theme, where the
   SureCart grey behind --ks-text-2 stayed a light-scheme value on the dark
   checkout (2.9:1, 2026-09-05 shopper audit). Without that layer the grey
   stands, exactly as before. */
.ivasure-gift-card-redeem-note {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ks-sc-etch-muted, var(--ks-text-2, #646970));
}

.ivasure-gift-card-field-help {
  margin: 6px 0 0;
  color: var(--ks-sc-etch-muted, var(--ks-text-2, #6b7280));
  font-size: 13px;
  line-height: 1.45;
}

.ivasure-gift-card-redeem-link {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ks-color-primary-accessible);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.ivasure-gift-card-redeem-link:hover {
  color: var(--ks-color-primary-dark);
}

.ivasure-gift-card-recovery[hidden] {
  display: none;
}

.ivasure-gift-card-recovery {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--ks-border-1, #d8dee6);
}

.ivasure-gift-card-redeem-note--recovery {
  margin-bottom: 10px;
}

.ivasure-gift-card-recovery-privacy-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)) 22%, #fff);
  border-radius: 8px;
  background: #f3fbf9;
  color: var(--ks-text-2, #4b5563);
  font-size: 13px;
  line-height: 1.45;
}

.ivasure-gift-card-recovery .ivasure-gift-card-recovery-form {
  margin: 0;
  padding: 0;
}

.ivasure-gift-card-recovery-button {
  margin-top: 6px;
}

.ivasure-gift-card-redeem-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}

.ivasure-gift-card-redeem-toggle input {
  margin: 0;
}

.ivasure-gift-card-wallet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}

.ivasure-gift-card-wallet-toggle input {
  margin: 0;
}

.ivasure-gift-card-redeem-body[hidden] {
  display: none;
}

.ivasure-gift-card-redeem-form.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.ivasure-gift-card-redeem-button {
  padding: 10px 16px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--ks-radius-2, 6px);
  background: var(--ks-color-primary-accessible);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ivasure-gift-card-redeem-button:hover {
  background: var(--ks-color-primary-dark);
}

.ivasure-gift-card-redeem-form[data-ivasure-gift-card-redeem-wallet-only="1"] .ivasure-gift-card-field {
  margin-bottom: 8px;
}

.ivasure-gift-card-notice {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--ks-radius-2, 6px);
  border: 1px solid var(--ks-border-1, #e0e0e0);
  background: var(--ks-surface-1, #fff);
  color: var(--ks-text-1, hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) var(--ff-text-main-l, 12%)));
  font-size: 14px;
  line-height: 1.4;
}

.ivasure-gift-card-notice.is-success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.4);
  /* Darker green (green-800) for WCAG AA on the light-green tint;
     the token default #16a34a was only ~2.9:1. */
  color: var(--ks-color-success-strong, #166534);
}

.ivasure-gift-card-notice.is-error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.4);
  color: var(--ks-color-danger, #dc2626);
}

.ivasure-gift-card-post-redeem-actions {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ivasure-gift-card-post-redeem-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--ks-radius-2, 6px);
  background: var(--ks-color-primary-accessible);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ivasure-gift-card-post-redeem-action:hover {
  background: var(--ks-color-primary-dark);
  color: #fff;
}

.ivasure-gift-card-post-redeem-action:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ks-color-primary) 28%, transparent);
}

.ivasure-gift-card-post-redeem-action--secondary {
  background: var(--ks-surface-1, #fff);
  border-color: var(--ks-border-1, #d8dee6);
  color: var(--ks-color-primary-accessible);
}

.ivasure-gift-card-post-redeem-action--secondary:hover {
  background: color-mix(in srgb, var(--ks-color-primary) 8%, transparent);
  border-color: var(--ks-color-primary, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)));
  color: var(--ks-color-primary-dark);
}

.ivasure-gc-wallet-dashboard {
  margin: 10px 0 0;
}

.ivasure-gc-wallet-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
}

.ivasure-gc-wallet-panel {
  padding: 18px;
  border: 1px solid color-mix(in srgb, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)) 22%, #fff);
  border-radius: var(--ks-radius-2, 8px);
  background: linear-gradient(180deg, var(--ks-surface-2, #ffffff) 0%, #f7fffd 100%);
  box-shadow: 0 10px 24px rgba(15, 127, 117, 0.08);
}

.ivasure-gc-wallet-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ivasure-gc-wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--ks-surface-1, #fff);
  border: 1px solid var(--ks-border-1, #edf0f2);
  border-radius: var(--ks-radius-2, 6px);
  font-weight: 600;
}

.ivasure-gc-wallet-currency {
  letter-spacing: 0;
  text-transform: uppercase;
  color: #6b7280;
  font-size: 12px;
}

.ivasure-gc-wallet-amount {
  font-size: 16px;
  color: #111827;
}

.ivasure-gc-wallet-empty {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.ivasure-gc-wallet-history {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--ks-border-1, #e5e7eb);
  border-radius: var(--ks-radius-2, 8px);
  background: var(--ks-surface-1, #fff);
}

.ivasure-gc-wallet-history-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.ivasure-gc-wallet-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.ivasure-gc-wallet-history-item {
  padding: 10px 12px;
  border: 1px solid var(--ks-border-1, #edf0f2);
  border-radius: var(--ks-radius-2, 6px);
  background: var(--ks-surface-2, #fafafa);
}

.ivasure-gc-wallet-history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ivasure-gc-wallet-history-code {
  font-weight: 700;
  letter-spacing: 0;
  color: #111827;
}

.ivasure-gc-wallet-history-amount {
  font-weight: 600;
  color: #111827;
}

.ivasure-gc-wallet-history-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.ivasure-gc-wallet-history-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.ivasure-gift-card-merch {
  /* Wave 6: merch now speaks the shared --ks-* token bridge (matches the rest of
     the gift-card frontend). The legacy --ivasure-gc-* custom properties are kept
     as DEPRECATED aliases that consume the new tokens for one release so external
     stylesheets overriding --ivasure-gc-* keep working. Remove the aliases next. */
  --ks-merch-surface: var(--sc-card-background-color, #fff);
  --ks-merch-border: var(--sc-color-gray-200, #e5e7eb);
  --ks-merch-text: var(--sc-input-label-color, #111827);
  --ks-merch-muted: var(--sc-color-gray-500, #6b7280);
  --ks-merch-accent: var(--sc-color-primary-600, #111827);
  --ks-merch-accent-contrast: var(--sc-color-white, #fff);

  /* DEPRECATED aliases (removal targeted for the next release). */
  --ivasure-gc-surface: var(--ks-merch-surface);
  --ivasure-gc-border: var(--ks-merch-border);
  --ivasure-gc-text: var(--ks-merch-text);
  --ivasure-gc-muted: var(--ks-merch-muted);
  --ivasure-gc-accent: var(--ks-merch-accent);
  --ivasure-gc-accent-contrast: var(--ks-merch-accent-contrast);

  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--ks-merch-border);
  border-radius: 8px;
  background: var(--ks-merch-surface);
  color: var(--ks-merch-text);
}

.ivasure-gift-card-merch__header {
  margin-bottom: 12px;
}

.ivasure-gift-card-merch__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.ivasure-gift-card-merch__subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--ivasure-gc-muted);
}

.ivasure-gift-card-merch__helper {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ivasure-gc-muted);
}

.ivasure-gift-card-merch__description {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ivasure-gc-text);
}

.ivasure-gift-card-merch__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ivasure-gift-card-merch__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ivasure-gift-card-merch__meta {
  font-size: 12px;
  color: var(--ivasure-gc-muted);
  margin-left: 12px;
  white-space: nowrap;
}

.ivasure-gift-card-merch__link {
  font-weight: 600;
  color: var(--ivasure-gc-text);
  text-decoration: none;
}

.ivasure-gift-card-merch__link:hover {
  text-decoration: underline;
}

.ivasure-gift-card-merch__actions {
  margin-top: 12px;
}

.ivasure-gift-card-merch__featured {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--ivasure-gc-border);
  border-radius: 6px;
  background: #fff;
}

.ivasure-gift-card-merch__featured-link {
  font-weight: 700;
  color: var(--ivasure-gc-text);
  text-decoration: none;
}

.ivasure-gift-card-merch__featured-link:hover {
  text-decoration: underline;
}

.ivasure-gift-card-merch__fallback {
  margin-top: 8px;
}

.ivasure-gift-card-merch__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--ivasure-gc-accent);
  color: var(--ivasure-gc-accent-contrast);
  text-decoration: none;
  font-weight: 600;
}

.ivasure-gift-card-merch__cta:hover {
  opacity: 0.9;
}

.ivasure-gift-card-merch--compact {
  padding: 12px;
}

.ivasure-gift-card-merch--compact .ivasure-gift-card-merch__title {
  font-size: 16px;
}

.ivasure-gift-card-merch--compact .ivasure-gift-card-merch__list {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}

.ivasure-gift-card-merch--split {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.ivasure-gift-card-merch--split .ivasure-gift-card-merch__header {
  margin-bottom: 0;
}

.ivasure-gift-card-merch--split .ivasure-gift-card-merch__list {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ivasure-gift-card-merch--split .ivasure-gift-card-merch__actions {
  margin-top: 0;
  align-self: start;
}

.ivasure-gift-card-merch--banner {
  background: var(--ivasure-gc-banner-bg, var(--ivasure-gc-accent));
  color: var(--ivasure-gc-banner-text, var(--ivasure-gc-accent-contrast));
  border-color: transparent;
}

.ivasure-gift-card-merch--banner .ivasure-gift-card-merch__subtitle {
  color: inherit;
  opacity: 0.8;
}

.ivasure-gift-card-merch--banner .ivasure-gift-card-merch__link {
  color: inherit;
}

.ivasure-gift-card-merch--banner .ivasure-gift-card-merch__cta {
  background: var(--ivasure-gc-banner-cta-bg, var(--ivasure-gc-accent-contrast));
  color: var(--ivasure-gc-banner-cta-text, var(--ivasure-gc-accent));
}

.ivasure-gift-card-merch--banner .ivasure-gift-card-merch__list {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

@media (max-width: 640px) {
  .ivasure-gift-card-merch--split {
    grid-template-columns: 1fr;
  }

  .ivasure-gift-card-merch--split .ivasure-gift-card-merch__list {
    grid-column: 1;
    grid-row: auto;
  }
}

/* ==========================================================================
   Wave 6 — shopper UX polish
   ========================================================================== */

/* --- Item 3: redeem page framing ----------------------------------------- */
/* The standalone redeem shortcode container previously bled to the viewport
   edge. Constrain it and give it horizontal breathing room; the inner form/
   hero keep their own card treatment. Scoped to the standalone page wrapper
   (:not([data-ivasure-gift-card-redeem])) so the in-checkout redeem block —
   which carries data-ivasure-gift-card-redeem — is left untouched. */
.ivasure-gift-card-redeem:not([data-ivasure-gift-card-redeem]) {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 24px);
  box-sizing: border-box;
}

/* --- Item 3: 3-step strip ------------------------------------------------ */
.ivasure-gift-card-redeem-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: var(--ks-radius-2, 8px);
  background: var(--ks-surface-1, #fff);
  counter-reset: ivasure-gc-step;
}

.ivasure-gift-card-redeem-steps__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ivasure-gift-card-redeem-steps__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ks-color-primary-accessible);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.ivasure-gift-card-redeem-steps__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ks-text-1, #1f2937);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .ivasure-gift-card-redeem-steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* --- Item 1: redeem result hero ------------------------------------------ */
.ivasure-gift-card-redeem-hero {
  margin: 0 0 16px;
  padding: 24px 20px;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  border: 1px solid rgba(22, 163, 74, 0.4);
  border-radius: var(--ks-radius-2, 8px);
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.1) 0%, var(--ks-surface-2, #fff) 100%);
  box-shadow: 0 10px 24px rgba(15, 127, 117, 0.08);
}

.ivasure-gift-card-redeem-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--ks-color-success, #16a34a);
  color: #fff;
}

.ivasure-gift-card-redeem-hero__amount {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ks-text-1, #14532d);
  letter-spacing: -0.01em;
}

.ivasure-gift-card-redeem-hero__lead {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #15803d;
}

.ivasure-gift-card-redeem-hero__lead--solo {
  font-size: clamp(1.1rem, 1rem + 0.8vw, 1.4rem);
}

/* The old success notice is preserved but demoted to supporting copy. */
.ivasure-gift-card-redeem-hero__notice {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ks-text-2, #4b5563);
}

.ivasure-gift-card-redeem-hero .ivasure-gift-card-post-redeem-actions {
  justify-content: center;
  margin-top: 8px;
}

/* Checkout-variant hero: rendered inline in the redeem notice node. */
.ivasure-gift-card-notice.ivasure-gift-card-redeem-message--hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 18px 14px;
}

.ivasure-gift-card-redeem-message--hero .ivasure-gift-card-redeem-hero__badge {
  width: 34px;
  height: 34px;
  font-size: 18px;
  font-weight: 700;
}

.ivasure-gift-card-redeem-message--hero .ivasure-gift-card-redeem-hero__amount {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
}

.ivasure-gift-card-redeem-message--hero .ivasure-gift-card-redeem-hero__lead {
  font-size: 14px;
}

.ivasure-gift-card-redeem-message--hero .ivasure-gift-card-redeem-hero__notice {
  font-size: 12px;
}

/* --- Item 1: collapsed "redeem another" form ----------------------------- */
.ivasure-gift-card-redeem-again {
  margin-top: 4px;
}

.ivasure-gift-card-redeem-again__summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ks-color-primary-dark);
  padding: 6px 0;
  list-style: revert;
}

.ivasure-gift-card-redeem-again__summary:focus-visible {
  outline: 2px solid var(--ks-color-primary);
  outline-offset: 2px;
}

.ivasure-gift-card-redeem-form--collapsed {
  margin-top: 8px;
}

/* --- Item 2: balance lookup hero + details ------------------------------- */
.ivasure-gift-card-balance-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  margin-bottom: 4px;
  border: 1px solid color-mix(in srgb, hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%)) 22%, #fff);
  border-radius: var(--ks-radius-2, 8px);
  background: linear-gradient(180deg, rgba(15, 159, 143, 0.1) 0%, var(--ks-surface-1, #fff) 100%);
}

.ivasure-gift-card-balance-hero__label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ks-color-primary-dark);
}

.ivasure-gift-card-balance-hero__value {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ks-text-1, #14532d);
  letter-spacing: -0.01em;
}

.ivasure-gift-card-balance-details {
  border: 1px solid var(--ks-border-1, #d8dee6);
  border-radius: var(--ks-radius-2, 8px);
  background: var(--ks-surface-1, #fff);
  overflow: hidden;
}

.ivasure-gift-card-balance-details__summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--ks-text-1, #1f2937);
  list-style: revert;
}

.ivasure-gift-card-balance-details__summary:focus-visible {
  outline: 2px solid var(--ks-color-primary);
  outline-offset: -2px;
}

.ivasure-gift-card-balance-details__rows {
  display: grid;
  gap: 8px;
  padding: 4px 14px 14px;
}

/* --- Item 4: wallet history pills ---------------------------------------- */
.ivasure-gc-wallet-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ivasure-gc-wallet-history-date {
  color: #6b7280;
}

.ivasure-gc-wallet-history-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.5;
}

.ivasure-gc-wallet-history-pill--scheduled {
  background: rgba(183, 121, 31, 0.14);
  color: #92600f;
  border-color: rgba(183, 121, 31, 0.3);
}

.ivasure-gc-wallet-history-pill--sent {
  background: rgba(15, 159, 143, 0.14);
  color: #087f75;
  border-color: rgba(15, 159, 143, 0.3);
}

.ivasure-gc-wallet-history-pill--processing {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.ivasure-gc-wallet-history-pill--redeemed {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.3);
}

.ivasure-gc-wallet-history-pill--expired,
.ivasure-gc-wallet-history-pill--void {
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.3);
}

.ivasure-gc-wallet-history-pill--issued {
  background: rgba(107, 114, 128, 0.1);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.25);
}

/* --- Item 5a: recipient card + numbered chip ----------------------------- */
/* Numbered chip is a CSS counter rendered via ::before so the title's
   textContent is untouched (guarded by gift-cards-checkout-intent.spec.js). */
.ivasure-gift-card-recipient-list {
  counter-reset: ivasure-gc-recipient;
}

.ivasure-gift-card-recipient {
  position: relative;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  counter-increment: ivasure-gc-recipient;
}

.ivasure-gift-card-recipient-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ivasure-gift-card-recipient-title::before {
  content: counter(ivasure-gc-recipient);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ks-color-primary-accessible);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* --- Item 5b: intent segmented control ----------------------------------- */
/* Add a shared track behind the existing radio-pill markup so the two options
   read as one segmented control. CSS-only; markup untouched. */
.ivasure-gift-card-fields--intent-radio .ivasure-gift-card-intent__options {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ks-border-1, #e0e0e0);
  border-radius: 999px;
  background: var(--ks-surface-2, #f3f4f6);
}

.ivasure-gift-card-fields--intent-radio .ivasure-gift-card-intent__option {
  flex: 1 1 0;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  min-height: 38px;
}

.ivasure-gift-card-fields--intent-radio .ivasure-gift-card-intent__option.is-active {
  background: var(--ks-surface-1, #fff);
  border-color: var(--ks-border-1, #e0e0e0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ivasure-gift-card-fields--intent-radio.ivasure-gift-card-fields--layout-stacked .ivasure-gift-card-intent__options {
  border-radius: var(--ks-radius-2, 8px);
}

/* Phone widths: the two halves of the segmented track squeezed to ~112px at
   390px and their labels broke inside words. One option per row here, the
   track rounded as a card rather than a pill - the shape the stacked layout
   attribute already uses - so every label sits on one line. */
@media (max-width: 560px) {
  .ivasure-gift-card-fields--intent-radio .ivasure-gift-card-intent__options {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--ks-radius-2, 8px);
  }

  .ivasure-gift-card-fields--intent-radio .ivasure-gift-card-intent__option {
    justify-content: flex-start;
  }
}

/* --- Item 5c: message counter earlier color shift ------------------------ */
.ivasure-gift-card-field__counter.is-approaching-limit {
  color: var(--ks-color-warning, #b7791f);
  font-weight: 600;
}

/* --- Item 5d: live gift-card preview ------------------------------------- */
.ivasure-gift-card-preview[hidden] {
  display: none;
}

.ivasure-gift-card-preview {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}

.ivasure-gift-card-preview__eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ks-text-2, #6b7280);
}

.ivasure-gift-card-preview__card {
  position: relative;
  padding: 18px;
  border-radius: 14px;
  color: #fff;
  /* Darker gradient stops + a subtle shadow lift white body copy toward AA
     legibility on the teal card (was ~3.3:1). */
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, var(--ks-color-primary-dark, #087f75) 0%, var(--ks-color-primary-darker) 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 12px 28px rgba(8, 127, 117, 0.24);
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}

.ivasure-gift-card-preview__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ivasure-gift-card-preview__brand {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.ivasure-gift-card-preview__amount {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1;
}

.ivasure-gift-card-preview__amount:empty {
  display: none;
}

/* The to/message/from lines are <p> elements: they must carry the card's
   white EXPLICITLY (and with the card ancestor in the selector), because a
   theme's compound paragraph rule outranks both the inherited color and a
   single-class rule (measured live: a theme repainted them near-black on
   the teal gradient, ~2:1). */
.ivasure-gift-card-preview__to {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.ivasure-gift-card-preview__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.95;
}

.ivasure-gift-card-preview__from {
  margin: 2px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.ivasure-gift-card-preview__card .ivasure-gift-card-preview__to,
.ivasure-gift-card-preview__card .ivasure-gift-card-preview__message,
.ivasure-gift-card-preview__card .ivasure-gift-card-preview__from {
  color: #fff;
}

.ivasure-gift-card-preview__to[hidden],
.ivasure-gift-card-preview__message[hidden],
.ivasure-gift-card-preview__from[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ivasure-gift-card-preview__card {
    transition: box-shadow 0.2s ease;
  }
}

/* Honor reduced-motion across every gift-card surface, not just the preview:
   suppress transitions/animations/smooth-scroll for users who ask for less
   motion (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  [class*="ivasure-gift-card"],
  [class*="ivasure-gc"] {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
