/* Wundercash AK: Merchant payment data containment (step 3 and the copy dialog).
   Additive, does not touch payment logic or the original payload. */
#payment-card,
#payment-card > .screen,
#payment-card .screen,
#payment-card .merchant-preview,
#payment-card .merchant-preview > span,
#payment-card .merchant-preview small {
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
}
#payment-card .screen { width:100%!important; }
#payment-card .merchant-preview {
  width:100%!important;
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  overflow:hidden!important;
  text-align:left!important;
}
#payment-card .merchant-preview > span {
  display:block!important;
  flex:1 1 0%!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}
#payment-card .merchant-preview small {
  display:block!important;
  width:100%!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  text-overflow:ellipsis!important;
}
#payment-card .merchant-preview > svg,
#payment-card .merchant-preview > :is(.icon, .lucide) {
  flex:0 0 20px!important;
  width:20px!important;
  height:20px!important;
}
/* Dialog size must never be determined by an unbroken 8 KB QR/payment string. */
dialog.payment-data-dialog {
  box-sizing:border-box!important;
  width:min(450px,calc(100vw - 28px))!important;
  max-width:calc(100vw - 28px)!important;
  min-width:0!important;
  overflow-x:hidden!important;
}
dialog.payment-data-dialog > .dialog-top { min-width:0!important; max-width:100%!important; }
dialog.payment-data-dialog .payment-payload {
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  white-space:pre!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  overflow-x:auto!important;
  overflow-y:auto!important;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
  font-size:12px!important;
  line-height:1.6!important;
}
dialog.payment-data-dialog .payment-source-actions {
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  gap:8px!important;
}
dialog.payment-data-dialog .payment-source-actions > button[data-copy-payload] {
  flex:0 0 auto!important;
  width:auto!important;
  min-width:44px!important;
  max-width:135px!important;
  white-space:nowrap!important;
}
dialog.payment-data-dialog .payment-source-actions > a {
  flex:1 1 0%!important;
  width:0!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}
dialog.payment-data-dialog .payment-source-actions > a > span {
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}
@media(max-width:380px){
  #payment-card .merchant-preview { gap:8px!important; }
  dialog.payment-data-dialog { width:calc(100vw - 24px)!important; max-width:calc(100vw - 24px)!important; }
}
