.pe-wallet-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.pe-wallet-card .kicker {
  color: var(--accent, #00e5a0);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.pe-wallet-card h2 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
}

.pe-wallet-copy {
  margin: 0;
  color: var(--text-secondary, var(--muted, #90a1b0));
  white-space: pre-line;
}

.pe-wallet-card.is-wallet-missing {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.pe-wallet-card.is-wallet-missing .kicker,
.pe-wallet-card.is-wallet-missing h2 {
  grid-column: 1 / -1;
}

.pe-wallet-card.is-wallet-missing .pe-wallet-copy {
  grid-column: 1;
}

.pe-wallet-card.is-wallet-missing .pe-wallet-row {
  display: contents;
}

.pe-wallet-card.is-wallet-missing .pe-wallet-status {
  grid-column: 1 / -1;
  width: auto;
}

.pe-wallet-card.is-wallet-missing .pe-wallet-actions {
  grid-column: 2;
  grid-row: 3;
  align-self: start;
  padding-top: 1px;
}

.wallet-connection-label {
  color: var(--accent, #00e5a0);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.pe-wallet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.pe-wallet-row.is-connected {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.pe-wallet-status {
  display: grid;
  align-items: center;
  gap: 4px;
  margin: 0;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, var(--text, #f1f5f9));
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pe-wallet-status[data-state="error"] {
  border-color: rgba(255, 141, 87, 0.22);
  background: rgba(255, 141, 87, 0.1);
}

.pe-wallet-status[data-state="pending"] {
  border-color: rgba(255, 214, 102, 0.28);
  background: rgba(255, 214, 102, 0.12);
}

.pe-wallet-status[data-state="success"] {
  border-color: rgba(0, 229, 160, 0.24);
  background: rgba(0, 229, 160, 0.1);
}

.pe-wallet-status .wallet-status-label {
  color: var(--accent, #00e5a0);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wallet-pairing-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.wallet-pairing-card-compact {
  justify-items: start;
}

.wallet-pairing-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
}

.wallet-pairing-tile {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 14px;
}

.wallet-pairing-tile + .wallet-pairing-tile {
  border-left: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.wallet-pairing-tile-copy {
  min-height: 3.3em;
  margin: 0;
  color: var(--text-secondary, var(--muted, #90a1b0));
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.wallet-pairing-qr {
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  line-height: 0;
}

.wallet-pairing-qr img,
.wallet-pairing-qr canvas {
  display: block;
  width: 168px;
  height: 168px;
}

.wallet-pairing-qr-pending {
  display: grid;
  place-items: center;
  width: 188px;
  height: 188px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, var(--muted, #90a1b0));
  border: 1px dashed rgba(255, 255, 255, 0.2);
  text-align: center;
}

.wallet-pairing-qr-pending span {
  max-width: 120px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.wallet-pairing-qr-label {
  max-width: 188px;
  color: var(--text-secondary, var(--muted, #90a1b0));
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.wallet-pairing-error {
  width: 100%;
  color: #ffb38a;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.wallet-pairing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.wallet-pairing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--cta-padding-y, 11px) var(--cta-padding-x, 22px);
  border-radius: var(--cta-radius, 18px);
  background: var(--accent, #00e5a0);
  color: #04120c;
  font-family: var(--cta-font-family, "DM Sans", sans-serif);
  font-size: var(--cta-font-size, 0.96rem);
  font-weight: var(--cta-font-weight, 700);
  line-height: var(--cta-line-height, 1.1);
  text-decoration: none;
  gap: 8px;
}

.wallet-pairing-button-secondary {
  border: 1px solid var(--accent, #00e5a0);
  background: transparent;
  color: var(--accent, #00e5a0);
}

.wallet-pairing-button-icon {
  width: 1.35em;
  height: 1.35em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pe-wallet-card .button {
  justify-self: stretch;
  border: 0;
  background: var(--accent, #00e5a0);
  color: #04120c;
  cursor: pointer;
}

.pe-wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: auto;
  justify-content: flex-end;
}

.pe-wallet-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 150px;
  height: 44px;
  min-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: min-width 160ms ease, width 160ms ease, padding 160ms ease, gap 160ms ease, background 160ms ease;
}

.pe-wallet-actions .button[hidden],
.pe-wallet-actions [hidden] {
  display: none !important;
}

.wallet-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35em;
  line-height: 1;
}

.wallet-button-icon svg {
  width: 1.16em;
  height: 1.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.signup-wallet-panel [data-wallet-connect] .wallet-button-icon,
.payment-wallet-panel [data-wallet-connect] .wallet-button-icon {
  font-size: 1.18em;
}

.signup-wallet-panel [data-wallet-connect] .wallet-button-icon svg,
.payment-wallet-panel [data-wallet-connect] .wallet-button-icon svg {
  width: 1em;
  height: 1em;
}

.pe-wallet-row.is-connected .pe-wallet-status {
  display: grid;
  align-items: center;
  min-height: 0;
  padding-top: 8px;
  padding-bottom: 8px;
  text-align: center;
}

.pe-wallet-row.is-connected .pe-wallet-actions {
  justify-content: flex-end;
}

.pe-wallet-row.is-connected .pe-wallet-actions .button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
}

.pe-wallet-row.is-connected .pe-wallet-actions .button > span:not(.wallet-button-icon) {
  display: inline-block;
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 160ms ease, opacity 120ms ease;
}

.pe-wallet-row.is-connected .pe-wallet-actions .button:hover,
.pe-wallet-row.is-connected .pe-wallet-actions .button:focus-visible {
  width: 180px;
  min-width: 180px;
  padding-left: 18px;
  padding-right: 18px;
  gap: 10px;
}

.pe-wallet-row.is-connected .pe-wallet-actions .button:hover > span:not(.wallet-button-icon),
.pe-wallet-row.is-connected .pe-wallet-actions .button:focus-visible > span:not(.wallet-button-icon) {
  width: auto;
  opacity: 1;
}

@media (max-width: 640px) {
  .pe-wallet-row,
  .pe-wallet-row.is-connected,
  .pe-wallet-card.is-wallet-missing {
    grid-template-columns: minmax(0, 1fr);
  }

  .pe-wallet-actions,
  .pe-wallet-row.is-connected .pe-wallet-actions {
    justify-content: flex-end;
  }

  .wallet-pairing-actions {
    justify-content: flex-start;
  }

  .wallet-pairing-table {
    grid-template-columns: minmax(0, 1fr);
  }

  .wallet-pairing-tile + .wallet-pairing-tile {
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-left: 0;
  }

  .pe-wallet-card.is-wallet-missing .pe-wallet-copy,
  .pe-wallet-card.is-wallet-missing .pe-wallet-status,
  .pe-wallet-card.is-wallet-missing .pe-wallet-actions {
    grid-column: 1;
  }

  .pe-wallet-card.is-wallet-missing .pe-wallet-actions {
    grid-row: auto;
    justify-content: flex-start;
  }
}
