/* Points & withdrawal flow — isolated from social-app gold theme */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html.social-app body.withdraw-app,
html.ap-expo-app body.withdraw-app,
html.social-bridge-mode body.withdraw-app,
body.withdraw-app {
  min-height: 100dvh;
  margin: 0;
  background: #f3f4f6 !important;
  background-image: none !important;
  color: #111827 !important;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

body.withdraw-app:not(:has(.wd-page)) {
  padding: calc(12px + env(safe-area-inset-top, 0)) 16px calc(24px + env(safe-area-inset-bottom, 0));
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

body.withdraw-app input[type='file'] {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.wd-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top, 0)) 14px calc(88px + env(safe-area-inset-bottom, 0));
}

.wd-header-link {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #5b67f6;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  max-width: 88px;
  line-height: 1.2;
  text-align: center;
}

.wd-header-side {
  width: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.wd-header-side--start {
  justify-content: flex-start;
}

.wd-balance-card {
  background: linear-gradient(135deg, #fda4af 0%, #f472b6 45%, #ec4899 100%);
  border-radius: 24px;
  padding: 28px 16px 26px;
  color: #fff;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.28);
  overflow: visible;
}

.wd-balance-card .main {
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
  padding: 0 8px;
}

.wd-balance-card .lbl {
  font-size: 13px;
  opacity: 0.92;
  margin-top: 6px;
}

.wd-balance-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 0 4px;
  font-size: 13px;
}

.wd-balance-row > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 14px;
}

.wd-balance-row strong {
  font-size: 17px;
  line-height: 1.2;
  word-break: break-word;
}

.wd-balance-row span {
  font-size: 10px;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

.wd-btn-pink {
  background: linear-gradient(135deg, #f472b6, #ec4899) !important;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.35) !important;
  margin-top: 8px;
}

.wd-zero-balance {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.wd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.wd-header a.wd-header-back,
.wd-header button.wd-header-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  border: none;
  padding: 0;
  cursor: pointer;
}

.wd-header a:not(.wd-header-link):not(.wd-header-back) {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.wd-header h1 {
  font-size: 15px;
  font-weight: 600;
  color: #111827 !important;
  margin: 0;
  flex: 1;
  text-align: center;
}

.wd-header-spacer {
  width: 64px;
  flex-shrink: 0;
}

.wd-alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #ede9fe;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: #5b21b6;
  margin-bottom: 10px;
  line-height: 1.35;
  flex-shrink: 0;
}

.wd-alert-banner i {
  margin-top: 2px;
  flex-shrink: 0;
}

.wd-gradient-card {
  background: linear-gradient(135deg, #a78bfa 0%, #6366f1 50%, #3b82f6 100%);
  border-radius: 16px;
  padding: 14px;
  color: #fff;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.wd-gradient-card .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.wd-gradient-card .amount-lg {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.wd-gradient-card .amount-label {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 2px;
}

.wd-gradient-card .record-btn {
  background: rgba(255, 255, 255, 0.28);
  border: none;
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.wd-gradient-card .cols {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 12px;
  font-size: 11px;
  opacity: 0.95;
}

.wd-gradient-card .cols > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 120px;
}

.wd-gradient-card .cols strong {
  font-size: 16px;
  line-height: 1.2;
  word-break: break-word;
}

.wd-gradient-card .cols span {
  font-size: 12px;
  opacity: 0.85;
}

.wd-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
}

.wd-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px;
}

.wd-card-qr h3 {
  margin-bottom: 4px;
}

.wd-qr-sub {
  margin: 0 0 12px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.wd-amount-input {
  background: #f3f4f6;
  border-radius: 14px;
  padding: 20px 16px;
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  border: none;
  width: 100%;
  display: block;
  -webkit-appearance: none;
  appearance: none;
}

.wd-amount-input:focus {
  outline: 2px solid #5b67f6;
  outline-offset: 0;
}

.wd-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 10px 0 0;
}

.wd-qr-upload {
  display: block;
  width: 100%;
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  padding: 0;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.wd-qr-upload:hover,
.wd-qr-upload:focus-visible {
  border-color: #5b67f6;
  background: #eef2ff;
  outline: none;
}

.wd-qr-upload.has-file {
  border-color: #5b67f6;
  background: #fff;
  border-style: solid;
}

.wd-qr-placeholder {
  padding: 28px 20px;
}

.wd-qr-placeholder .icon {
  font-size: 40px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.wd-qr-placeholder p {
  margin: 0 0 6px;
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}

.wd-qr-hint {
  display: block;
  font-size: 12px;
  color: #9ca3af;
}

.wd-qr-preview-wrap {
  padding: 16px;
  background: #f9fafb;
}

.wd-qr-preview-wrap img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.wd-qr-change {
  display: inline-block;
  margin-top: 12px;
  border: none;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.wd-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.wd-rules-table td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.wd-rules-table td:first-child {
  background: #f5f3ff;
  color: #4b5563;
  width: 42%;
}

.wd-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin-top: auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(0deg, #f3f4f6 85%, rgba(243, 244, 246, 0));
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wd-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  background: #5b67f6;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(91, 103, 246, 0.25);
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}

.wd-btn-primary i {
  font-size: 12px;
}

.wd-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.wd-btn-primary.is-ready {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  animation: none;
}

.wd-btn-compact {
  padding: 11px 14px !important;
  font-size: 13px !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12) !important;
}

.wd-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.wd-points-actions {
  display: grid;
  gap: 8px;
  margin: 8px 0 24px;
}

.wd-points-actions .wd-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wd-btn-inline-submit {
  margin-top: 14px;
  width: 100%;
}

.wd-flow-help {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #4b5563;
}

.wd-flow-help strong {
  display: block;
  margin-bottom: 6px;
  color: #111827;
  font-size: 12px;
}

.wd-flow-help ol {
  margin: 0;
  padding-left: 18px;
}

.wd-flow-help li {
  margin-bottom: 4px;
}

.wd-flow-help li:last-child {
  margin-bottom: 0;
}

.wd-submit-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  color: #6b7280;
}

.wd-submit-hint.is-ready {
  color: #059669;
  font-weight: 600;
}

.wd-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.wd-step {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border-radius: 10px;
  padding: 7px 4px;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  line-height: 1.3;
  word-break: break-word;
}

.wd-step i {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.wd-step.done {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.wd-step.active {
  color: #5b67f6;
  border-color: #c7d2fe;
  background: #eef2ff;
}

.wd-qr-success {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  font-size: 13px;
  color: #047857;
  font-weight: 600;
}

/* Prevent social-theme overrides inside withdrawal flow */
body.withdraw-app a,
body.withdraw-app button {
  -webkit-tap-highlight-color: transparent;
}

body.withdraw-app .social-bottom-nav,
body.withdraw-app .social-bridge-header,
body.withdraw-app .navbar,
body.withdraw-app .footer:not(.wd-footer) {
  display: none !important;
}

/* Never hide withdraw exchange UI in the app shell */
html.social-app body.withdraw-app .wd-mode-tabs,
body.withdraw-app .wd-mode-tabs {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 5;
}

html.social-app body.withdraw-app footer.wd-footer,
body.withdraw-app footer.wd-footer {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  visibility: visible !important;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
}

/* Critical: .wd-btn-primary { display:block } must not override [hidden] */
body.withdraw-app .wd-btn-primary[hidden],
body.withdraw-app .wd-btn-inline-submit[hidden],
body.withdraw-app button[hidden],
body.withdraw-app .wd-card[hidden],
body.withdraw-app .wd-flow-help[hidden],
body.withdraw-app .wd-steps[hidden],
body.withdraw-app [hidden] {
  display: none !important;
}

html.social-app body.withdraw-app .wd-mode-tab,
body.withdraw-app .wd-mode-tab {
  display: inline-flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Detail / notice pages */
.wd-status {
  text-align: center;
  margin: 8px 0 20px;
}

.wd-status .amt {
  font-size: 40px;
  font-weight: 800;
  color: #111827;
}

.wd-status .st {
  font-size: 14px;
  color: #9ca3af;
  margin-top: 4px;
}

.wd-status .st.pending { color: #f59e0b; }
.wd-status .st.paid { color: #3b82f6; }
.wd-status .st.completed { color: #10b981; }
.wd-status .st.rejected { color: #ef4444; }

.wd-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.wd-detail-row .label {
  color: #6b7280;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.wd-detail-row .value {
  font-weight: 600;
  color: #111827;
  text-align: right;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  word-break: break-word;
}

.wd-detail-row:last-child {
  border-bottom: none;
}

.wd-qr-preview {
  text-align: center;
  padding: 12px;
}

.wd-qr-preview img {
  max-width: 220px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.wd-notice-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wd-notice-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.wd-notice-body {
  flex: 1;
  min-width: 0;
}

.wd-notice-body h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #111827;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wd-notice-body p {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

.wd-notice-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #5b67f6;
  text-decoration: none;
  font-weight: 600;
}

.wd-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 16px 0 8px;
}

.wd-mode-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 0 10px;
  padding: 3px;
  background: #e5e7eb;
  border-radius: 10px;
}

.wd-mode-tabs--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.wd-mode-tab {
  border: none;
  background: transparent;
  color: #4b5563;
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  line-height: 1.15;
}

.wd-mode-tab i {
  font-size: 11px;
}

.wd-mode-tab.is-active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.wd-mode-tab[data-mode="exchange"].is-active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
}

.wd-mode-tab[data-mode="transfer"].is-active {
  background: linear-gradient(135deg, #fb7185, #ec4899);
  color: #fff;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.28);
}

.wd-transfer-intro {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wd-transfer-warn {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border: 1px solid #fecdd3;
  margin-bottom: 10px;
}

.wd-transfer-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.wd-transfer-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.wd-transfer-row-head h3 {
  margin: 0;
}

.wd-link-btn {
  border: none;
  background: none;
  color: #ec4899;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.wd-transfer-id-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.wd-text-input {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 0;
  font-size: 14px;
  background: transparent;
  outline: none;
}

.wd-text-input:focus {
  border-bottom-color: #ec4899;
}

.wd-check-btn {
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  flex-shrink: 0;
}

.wd-check-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wd-recipient-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fdf2f8;
  border-radius: 12px;
  margin-bottom: 14px;
}

.wd-recipient-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.wd-recipient-card strong {
  display: block;
  font-size: 14px;
  color: #111827;
}

.wd-recipient-card span {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.wd-transfer-amount-title {
  margin-top: 4px !important;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.wd-transfer-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
}

.wd-bean-icon {
  font-size: 16px;
  line-height: 1;
}

.wd-amount-input--plain {
  border: none !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  background: transparent !important;
}

.wd-transfer-calc {
  margin-top: 14px;
}

.wd-transfer-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #374151;
}

.wd-transfer-calc-row strong {
  color: #111827;
}

.wd-transfer-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.wd-transfer-history h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
}

.wd-transfer-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-transfer-history li {
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.wd-transfer-history li.wd-empty {
  color: #9ca3af;
}

.wd-btn-transfer {
  background: linear-gradient(135deg, #fb7185, #ec4899) !important;
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.28);
}

.wd-btn-transfer.is-ready {
  transform: translateY(-1px);
}

/* Removed duplicate shortcut row — keep CSS inert if cached HTML remains */
.wd-exchange-shortcut {
  display: none !important;
}

.wd-card-flush {
  padding: 0;
  overflow: hidden;
}

.wd-card-flush .wd-detail-row {
  padding: 14px 16px;
  margin: 0;
}
