/* ============================================================
   3-D Secure Verification Page
   Bank-grade design — trustworthy, calm, professional
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --tds-blue: #0066FF;
  --tds-blue-hover: #0052CC;
  --tds-blue-light: #E8F0FE;
  --tds-blue-ring: rgba(0, 102, 255, 0.12);
  --tds-green: #16A34A;
  --tds-green-light: #DCFCE7;
  --tds-red: #DC2626;
  --tds-red-light: #FEF2F2;
  --tds-red-border: #FECACA;
  --tds-amber: #D97706;
  --tds-amber-light: #FEF3C7;
  --tds-text: #111827;
  --tds-text-secondary: #6B7280;
  --tds-text-muted: #9CA3AF;
  --tds-bg: #F8FAFC;
  --tds-card: #FFFFFF;
  --tds-border: #E5E7EB;
  --tds-border-light: #F3F4F6;
  --tds-radius: 10px;
  --tds-radius-lg: 14px;
  --tds-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --tds-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tds-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --tds-transition: 200ms ease;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--tds-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--tds-text);
  background: var(--tds-bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Layout: Wrapper + Card --- */
.tds-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.tds-card {
  width: 100%;
  max-width: 440px;
  background: var(--tds-card);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Desktop: taller card, tight padding */
@media (min-width: 500px) {
  .tds-wrapper {
    align-items: center;
    padding: 8px;
    min-height: 100vh;
  }
  .tds-card {
    min-height: 580px;
    border-radius: var(--tds-radius-lg);
    box-shadow: var(--tds-shadow);
  }
}

/* Mobile: full width, fill screen */
@media (max-width: 499px) {
  body { background: var(--tds-card); }
  .tds-wrapper { min-height: 100%; }
  .tds-card { min-height: 100%; border-radius: 0; box-shadow: none; }
  .tds-body { padding: 16px 14px 8px; }
  .tds-header { padding: 10px 14px; }
  .tds-summary { padding: 8px 14px; }
  .tds-footer { padding: 8px 14px; }
}

/* --- Header --- */
.tds-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--tds-border);
  gap: 12px;
  min-height: 56px;
}

.tds-header__bank-logo {
  height: 32px;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}

.tds-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tds-header__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tds-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.tds-header__verified svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tds-header__brand-logo {
  height: 28px;
  max-width: 64px;
  object-fit: contain;
}

/* Fallback shield icon when no bank SVG is provided */
.tds-header__shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--tds-blue);
}

.tds-header__shield svg {
  width: 28px;
  height: 28px;
}

/* --- Summary Bar --- */
.tds-summary {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 20px;
  background: var(--tds-bg);
  border-bottom: 1px solid var(--tds-border);
  font-size: 0.8125rem;
  color: var(--tds-text-secondary);
  flex-wrap: wrap;
}

.tds-summary__item {
  white-space: nowrap;
  padding: 0 10px;
}

.tds-summary__item:first-child {
  padding-left: 0;
}

.tds-summary__item:last-child {
  padding-right: 0;
}

.tds-summary__item--card {
  font-family: var(--tds-mono);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.5px;
  color: var(--tds-text);
}

.tds-summary__item--amount {
  font-weight: 700;
  color: var(--tds-text);
  font-size: 0.875rem;
}

.tds-summary__item--merchant {
  color: var(--tds-text-secondary);
  font-weight: 500;
}

.tds-summary__divider {
  width: 1px;
  height: 14px;
  background: var(--tds-border);
  flex-shrink: 0;
}

/* --- Body (screens container) --- */
.tds-body {
  flex: 1;
  padding: 20px 20px 10px;
  display: flex;
  flex-direction: column;
}

/* --- Footer (inside card, at bottom) --- */
.tds-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--tds-border-light);
  text-align: center;
  margin-top: auto;
}

.tds-footer__text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  color: var(--tds-green);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.tds-footer__text svg {
  width: 12px;
  height: 12px;
  color: var(--tds-green);
  flex-shrink: 0;
}

/* ============================================================
   Screens — shared
   ============================================================ */
.tds-screen {
  animation: tds-fadeIn 0.3s ease both;
}

@keyframes tds-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Icon container --- */
.tds-icon-container {
  text-align: center;
  margin-bottom: 16px;
}

.tds-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.tds-icon-circle svg {
  width: 24px;
  height: 24px;
}

.tds-icon-circle--blue   { background: var(--tds-blue-light); color: var(--tds-blue); }
.tds-icon-circle--green  { background: var(--tds-green-light); color: var(--tds-green); }
.tds-icon-circle--red    { background: var(--tds-red-light); color: var(--tds-red); }
.tds-icon-circle--amber  { background: var(--tds-amber-light); color: var(--tds-amber); }

/* --- Typography --- */
.tds-title {
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
  color: var(--tds-text);
  line-height: 1.3;
}

.tds-subtitle {
  font-size: 0.8125rem;
  text-align: center;
  color: var(--tds-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.tds-text-muted {
  font-size: 0.75rem;
  color: var(--tds-text-muted);
  text-align: center;
  margin-top: 10px;
}

/* --- Error --- */
.tds-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--tds-red-light);
  border: 1px solid var(--tds-red-border);
  border-radius: var(--tds-radius);
  margin-bottom: 14px;
}

.tds-error svg {
  width: 16px;
  height: 16px;
  color: var(--tds-red);
  flex-shrink: 0;
  margin-top: 1px;
}

.tds-error__text {
  font-size: 0.8125rem;
  color: var(--tds-red);
  line-height: 1.4;
}

.tds-field-error {
  font-size: 0.75rem;
  color: var(--tds-red);
  display: block;
  margin-top: 4px;
}

/* --- Form --- */
.tds-form {
  margin-top: 4px;
}

.tds-form-group {
  margin-bottom: 14px;
}

.tds-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tds-text-secondary);
  margin-bottom: 6px;
}

/* --- Input --- */
.tds-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  font-size: 0.9375rem;
  font-family: var(--tds-font);
  border: 1.5px solid var(--tds-border);
  border-radius: var(--tds-radius);
  outline: none;
  transition: border-color var(--tds-transition), box-shadow var(--tds-transition);
  background: var(--tds-card);
  color: var(--tds-text);
  -webkit-appearance: none;
}

.tds-input::placeholder {
  color: var(--tds-text-muted);
}

.tds-input:focus {
  border-color: var(--tds-blue);
  box-shadow: 0 0 0 3px var(--tds-blue-ring);
}

.tds-input--error {
  border-color: var(--tds-red);
}

.tds-input--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.tds-input--otp {
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 6px;
  font-family: var(--tds-mono);
  min-height: 52px;
}

/* --- Button --- */
.tds-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--tds-radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--tds-font);
  cursor: pointer;
  transition: all var(--tds-transition);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  position: relative;
}

.tds-btn--primary {
  background: var(--tds-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 102, 255, 0.2);
}

.tds-btn--primary:hover {
  background: var(--tds-blue-hover);
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
  transform: translateY(-1px);
}

.tds-btn--primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 1px 2px rgba(0, 102, 255, 0.15);
}

.tds-btn--primary:disabled {
  background: #94b8ff;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tds-btn--danger {
  background: var(--tds-red);
  color: #fff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.tds-btn--danger:hover {
  background: #B91C1C;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.tds-btn--danger:active {
  transform: translateY(0) scale(0.99);
}

.tds-btn--outline {
  background: transparent;
  color: var(--tds-blue);
  border: 1.5px solid var(--tds-blue);
}

.tds-btn--outline:hover {
  background: var(--tds-blue-light);
}

/* --- Resend link --- */
.tds-resend {
  text-align: center;
  margin-top: 10px;
}

.tds-resend__link {
  color: var(--tds-blue);
  font-size: 0.8125rem;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--tds-transition);
}

.tds-resend__link:hover {
  color: var(--tds-blue-hover);
  text-decoration: underline;
}

/* --- Secure badge --- */
.tds-secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.6875rem;
  color: var(--tds-green);
  font-weight: 500;
  margin-top: 12px;
}

.tds-secure-badge svg {
  width: 12px;
  height: 12px;
}

/* ============================================================
   Skeleton Splash Screen (before content loads)
   ============================================================ */
.tds-splash {
  position: fixed;
  inset: 0;
  background: var(--tds-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.4s ease;
}
.tds-splash.tds-splash--hidden {
  opacity: 0;
  pointer-events: none;
}
.tds-splash__logo {
  width: 120px;
  height: auto;
  filter: grayscale(1) brightness(1.8);
  margin-bottom: 24px;
}
.tds-splash__skeleton {
  width: 200px;
  height: 6px;
  border-radius: 3px;
  background: var(--tds-border);
  overflow: hidden;
  position: relative;
}
.tds-splash__skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: tds-shimmer 1.5s ease-in-out infinite;
}
@keyframes tds-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.tds-splash__text {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--tds-text-muted);
  letter-spacing: 0.3px;
}

/* ============================================================
   Loading Screen
   ============================================================ */
.tds-loading {
  text-align: center;
  padding: 48px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Loading Stripe logo with skeleton shimmer */
.tds-loading__logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 8px;
}

.tds-loading__logo {
  width: 100px;
  height: auto;
  display: block;
  filter: grayscale(1) brightness(1.6) opacity(0.5);
}

.tds-loading__logo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
  animation: tds-shimmer 1.8s ease-in-out infinite;
}

.tds-loading__text {
  font-size: 0.875rem;
  color: var(--tds-text-secondary);
  margin-bottom: 8px;
}

.tds-loading__lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--tds-text-muted);
  font-size: 0.6875rem;
  margin-top: 4px;
}

.tds-loading__lock svg {
  width: 12px;
  height: 12px;
}

/* ============================================================
   Push Screen
   ============================================================ */
.tds-push-phone {
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  display: flex;
  justify-content: center;
}

.tds-push-pulse {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tds-blue-ring);
  animation: tds-pulse 2s ease-in-out infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@keyframes tds-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50%      { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* Timer */
.tds-timer-container {
  text-align: center;
  margin: 20px 0 16px;
}

.tds-timer-svg {
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
}

.tds-timer-bg {
  fill: none;
  stroke: var(--tds-border);
  stroke-width: 5;
}

.tds-timer-progress {
  fill: none;
  stroke: var(--tds-blue);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.tds-timer-text {
  fill: var(--tds-text);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--tds-mono);
  text-anchor: middle;
  dominant-baseline: central;
  transform: rotate(90deg);
  transform-origin: 60px 60px;
}

/* ============================================================
   Success Screen
   ============================================================ */
.tds-result-icon {
  text-align: center;
  margin-bottom: 20px;
}

.tds-result-svg {
  width: 72px;
  height: 72px;
}

/* Green success circle + check */
.tds-success-bg {
  fill: var(--tds-green-light);
}

.tds-success-check {
  fill: none;
  stroke: var(--tds-green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: tds-drawStroke 0.5s 0.3s ease forwards;
}

/* Red failed circle + X */
.tds-failed-bg {
  fill: var(--tds-red-light);
}

.tds-failed-line {
  fill: none;
  stroke: var(--tds-red);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: tds-drawStroke 0.4s 0.3s ease forwards;
}

@keyframes tds-drawStroke {
  to { stroke-dashoffset: 0; }
}

/* ============================================================
   Custom Content
   ============================================================ */
.tds-custom-content {
  text-align: center;
  margin-bottom: 16px;
  max-height: 40vh;
  overflow-y: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tds-custom-content img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--tds-radius);
  margin-bottom: 12px;
}

.tds-custom-content p {
  font-size: 0.9375rem;
  color: var(--tds-text);
  line-height: 1.6;
  padding: 12px 16px;
  background: var(--tds-bg);
  border-radius: var(--tds-radius);
  border: 1px solid var(--tds-border);
  text-align: left;
  white-space: pre-wrap;
}

/* ============================================================
   Utilities
   ============================================================ */
.tds-mt-4  { margin-top: 4px; }
.tds-mt-8  { margin-top: 8px; }
.tds-mt-12 { margin-top: 12px; }
.tds-mt-16 { margin-top: 16px; }
.tds-mt-20 { margin-top: 20px; }
.tds-mt-24 { margin-top: 24px; }
.tds-mb-0  { margin-bottom: 0; }

.tds-hidden { display: none !important; }

/* ============================================================
   Warning Banner — "Do not close" notice
   ============================================================ */
.tds-warning-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--tds-radius);
  margin-bottom: 16px;
  animation: tds-fadeIn 0.3s ease both;
}

.tds-warning-banner__icon {
  width: 14px;
  height: 14px;
  color: #92400E;
  flex-shrink: 0;
}

.tds-warning-banner__text {
  font-size: 0.75rem;
  font-weight: 500;
  color: #92400E;
  line-height: 1.4;
}

/* RTL support for Arabic */
[dir="rtl"] .tds-warning-banner {
  flex-direction: row-reverse;
  text-align: right;
}

/* ============================================================
   Print
   ============================================================ */
@media print { body { display: none; } }

/* ============================================================
   ========== MET HEADER REDESIGN (override stripe_hg defaults)
   ============================================================ */

/* Fill the iframe completely — popup container already provides radius+shadow */
html, body { height: 100%; margin: 0; padding: 0; background: var(--tds-card); }
.tds-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  background: var(--tds-card);
  padding: 0;
}
.tds-card {
  width: 100%;
  max-width: 100%;
  background: var(--tds-card);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* === HEADER: 3-zone grid === */
.tds-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--tds-border);
  background: var(--tds-card);
  min-height: 52px;
}
.tds-header__left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  min-width: 0;
  min-height: 26px;
}
.tds-header__center {
  justify-self: center;
  min-width: 0;
  text-align: center;
}
.tds-header__merchant {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--tds-text);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tds-header__right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
}
/* Brand/bank logo in LEFT slot — brand by default, bank overrides if available */
.tds-header__brand-logo,
.tds-header__bank-logo {
  display: none;
  height: 26px;
  max-width: 56px;
  width: auto;
  object-fit: contain;
}
.tds-header__brand-logo[src]:not([src=""]) { display: block; }
.tds-header__bank-logo[src]:not([src=""]) { display: block; }
/* When bank arrives, hide brand fallback */
.tds-header__bank-logo[src]:not([src=""]) ~ .tds-header__brand-logo,
.tds-header__brand-logo + .tds-header__bank-logo[src]:not([src=""]) { display: none !important; }

/* Green 3-D Secure badge (right) */
.tds-header__secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: var(--tds-green-light, #DCFCE7);
  color: var(--tds-green, #15803D);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}
.tds-header__lock {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  flex: 0 0 12px;
}
.tds-header__secure-label { color: inherit; }

/* Reset old elements we removed from HTML (keep CSS rules harmless if they linger) */
.tds-header__shield,
.tds-header__verified,
.tds-warning-banner { display: none !important; }

/* === SUMMARY: single-line dotted (auto-hide when fill data is empty) === */
.tds-summary {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 18px;
  background: var(--tds-card);
  border-bottom: 1px solid var(--tds-border);
  font-size: 12px;
  color: var(--tds-text-secondary);
  font-variant-numeric: tabular-nums;
}
/* Show only when JS adds .is-ready (after payment_data fill) */
.tds-summary.is-ready { display: flex; }
.tds-summary__item {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--tds-text-secondary);
  font-family: inherit;
  letter-spacing: 0.01em;
}
.tds-summary__item--card { color: var(--tds-text); font-weight: 600; }
.tds-summary__item--amount { color: var(--tds-text); font-weight: 600; }
.tds-summary__item--merchant { color: var(--tds-text-secondary); }
.tds-summary__sep {
  color: var(--tds-text-muted);
  font-weight: 400;
  font-size: 11px;
  line-height: 1;
}
/* Hide empty items so dots don't dangle */
.tds-summary__item:empty,
.tds-summary__item:empty + .tds-summary__sep { display: none; }
.tds-summary__divider { display: none; }

/* === FOOTER: quiet helper line === */
.tds-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--tds-border);
  background: var(--tds-card);
  color: var(--tds-text-muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
}
.tds-footer__lock {
  width: 11px;
  height: 11px;
  stroke: var(--tds-text-muted);
  flex: 0 0 11px;
}
.tds-footer__text {
  color: var(--tds-text-muted);
  letter-spacing: 0.005em;
}

/* === BODY: flex container, content vertically centered === */
.tds-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--tds-card);
  padding: 18px 20px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.tds-body > .tds-screen { width: 100%; max-width: 100%; }
/* Custom block image fix — fixed 100×100, no overflow */
.tds-custom-content {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  max-width: 100% !important;
  overflow: hidden !important;
  padding: 8px 0 !important;
}
.tds-custom-content img,
.tds-custom-content .adm-photo {
  display: block !important;
  width: 100px !important;
  height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  margin: 0 auto !important;
  flex: 0 0 100px !important;
}
.tds-custom-content p,
.tds-custom-content .adm-photo-cap {
  display: block !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  color: var(--tds-text) !important;
  background: var(--tds-bg) !important;
  border-radius: 8px !important;
  border: 1px solid var(--tds-border) !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  max-width: 280px !important;
  width: auto !important;
  word-wrap: break-word !important;
  white-space: pre-wrap !important;
}
/* When custom shown — keep body scrollable if total content > popup height */
.tds-body:has(#Qpe26HDPgq[style*="block"]) { overflow: auto; }

/* === LOADING screen with Stripe shimmer === */
.tds-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1 1 auto;
  padding: 32px 20px;
  gap: 14px;
}
.tds-loading__text {
  font-size: 13px;
  font-weight: 500;
  color: var(--tds-text-secondary);
  letter-spacing: 0.01em;
}
.tds-loading__logo-wrap {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 56px;
  width: 100%;
}
.tds-loading__logo {
  display: block !important;
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.5;
}
.tds-loading__lock { display: none !important; }

/* === Splash (initial page-load skeleton with shimmer) === */
.tds-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--tds-card);
  z-index: 9999;
  transition: opacity 0.32s ease;
  padding: 24px;
}
.tds-splash--hidden { opacity: 0; pointer-events: none; }
.tds-splash__logo {
  display: block !important;
  height: 44px;
  max-width: 180px;
  width: auto;
  object-fit: contain;
  opacity: 0.4;
}
.tds-splash__skeleton {
  display: block !important;
  width: 220px;
  max-width: 80vw;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--tds-border-light, #F3F4F6) 0%,
    var(--tds-border, #E5E7EB) 50%,
    var(--tds-border-light, #F3F4F6) 100%
  );
  background-size: 200% 100%;
  animation: tds-skeleton-shimmer 1.4s linear infinite;
}
.tds-splash__text {
  font-size: 12px;
  color: var(--tds-text-muted);
  letter-spacing: 0.02em;
}

/* Generic shimmer class — fade-in/out alpha pulse for stripe logo */
.tds-shimmer,
.tds-splash__logo--shimmer {
  animation: tds-logo-pulse 1.4s ease-in-out infinite;
}
@keyframes tds-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes tds-logo-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}

/* === RESPONSIVE: tablet (481-768) === */
@media (min-width: 481px) and (max-width: 768px) {
  .tds-card {
    max-width: 440px;
    border-radius: 12px;
  }
  .tds-header { padding: 11px 16px; min-height: 50px; }
  .tds-header__merchant { font-size: 13px; }
  .tds-body { padding: 22px 18px; }
}

/* === RESPONSIVE: mobile (≤480) === */
@media (max-width: 480px) {
  body { background: var(--tds-card); }
  .tds-wrapper {
    width: 100vw;
    min-height: 100vh;
    padding: 0;
    background: var(--tds-card);
  }
  .tds-card {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .tds-header {
    padding: 12px 14px;
    min-height: 48px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }
  .tds-header__secure { display: none; }
  .tds-header__lock { width: 16px; height: 16px; flex-basis: 16px; }
  .tds-header__merchant { font-size: 13px; }
  .tds-header__bank-logo,
  .tds-header__brand-logo { height: 24px; max-width: 52px; }
  .tds-summary {
    font-size: 11px;
    padding: 8px 14px;
    gap: 6px;
    min-height: 32px;
  }
  .tds-summary__item, .tds-summary__sep { font-size: 11px; }
  .tds-body { padding: 22px 16px; min-height: calc(100vh - 130px); }
  .tds-footer { padding: 9px 14px; font-size: 10px; gap: 5px; }
  .tds-footer__lock { width: 10px; height: 10px; flex-basis: 10px; }
}
