/*
 * QuickSend mobile-first layout stabilization
 * Version: 2026-07-24-mobile1
 * Loaded after the legacy stylesheet to resolve text wrapping, horizontal
 * overflow, cramped forms and small-screen navigation without changing app logic.
 */

:root {
  --qs-mobile-gutter: clamp(0.75rem, 4vw, 1.25rem);
  --qs-safe-bottom: env(safe-area-inset-bottom, 0px);
  --qs-safe-top: env(safe-area-inset-top, 0px);
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  overflow-x: clip;
  line-height: 1.5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
picture,
svg,
video,
canvas {
  max-width: 100%;
}

img,
video {
  height: auto;
}

input,
select,
textarea,
button {
  min-width: 0;
  max-width: 100%;
  font: inherit;
}

textarea {
  overflow-wrap: anywhere;
}

:where(.flex, .inline-flex, .grid) > * {
  min-width: 0;
}

:where(h1, h2, h3, h4, h5, h6, p, label, a, button, td, th, small, strong) {
  overflow-wrap: anywhere;
  word-break: normal;
}

button,
a,
select,
label {
  touch-action: manipulation;
}

button {
  line-height: 1.25;
}

[hidden],
.hidden {
  display: none !important;
}

/* Public navigation, banners and page shells */
#main-nav,
#offline-banner,
#app-content,
#layout-dashboard,
#dashboard-screen {
  max-width: 100%;
}

#main-nav > div {
  padding-left: max(var(--qs-mobile-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--qs-mobile-gutter), env(safe-area-inset-right, 0px));
}

#offline-banner {
  min-height: 2.5rem;
  padding-left: var(--qs-mobile-gutter);
  padding-right: var(--qs-mobile-gutter);
  line-height: 1.35;
}

#toast-container {
  left: 0;
  right: 0;
  width: auto !important;
  max-width: 28rem;
  margin-inline: auto;
}

.qs-toast,
.qs-update-banner {
  max-width: calc(100vw - (2 * var(--qs-mobile-gutter))) !important;
}

#chat-panel,
#notif-dropdown,
#invoice-paper:not(.qs-invoice-paper),
#transfer-confirm-modal > div,
#pin-change-modal > div,
#client-lock-screen > div {
  max-width: calc(100vw - (2 * var(--qs-mobile-gutter))) !important;
}

#chat-messages,
.chat-bubble-user,
.chat-bubble-bot,
.qs-chat-txn-card,
.qs-txn-help-summary {
  overflow-wrap: anywhere;
}

.qs-chat-txn-card > * {
  min-width: 0;
}

/* Long uploaded filenames and transaction identifiers should wrap instead of vanish. */
#dep-file-name,
#reg-id-filename,
#my-qr-meta,
#inv-receiver,
.qs-txn-help-summary strong {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

#my-qr-code {
  width: min(224px, 68vw) !important;
  height: min(224px, 68vw) !important;
  margin-inline: auto;
}

#my-qr-code canvas,
#my-qr-code img {
  width: 100% !important;
  height: 100% !important;
}

#my-qr-meta {
  min-width: 0 !important;
  width: 100%;
}

/* Forms and readable controls */
.glass-input,
input,
select,
textarea {
  width: 100%;
}

input[type="date"] {
  min-height: 3rem;
}

input[type="file"] {
  font-size: 0.8125rem;
}

form button,
form input,
form select,
form textarea {
  min-height: 44px;
}

/* Login and registration are designed from the narrowest viewport upward. */
#view-login > div,
#view-register > div {
  padding-left: var(--qs-mobile-gutter) !important;
  padding-right: var(--qs-mobile-gutter) !important;
}

#view-login .glass-card,
#view-register .glass-card {
  width: 100%;
  padding: clamp(1rem, 4vw, 2.5rem) !important;
  border-radius: clamp(1.25rem, 5vw, 2rem) !important;
}

#view-register h2,
#view-login h2 {
  line-height: 1.25;
  text-wrap: balance;
}

#view-register .reg-indicator {
  flex: 0 0 auto;
}

/* Dashboard foundation */
#layout-dashboard,
#layout-dashboard > div,
#layout-dashboard main,
#main-scroll,
.dash-content-tab {
  min-width: 0;
  width: 100%;
}

#layout-dashboard > div {
  min-height: 100dvh;
}

#main-scroll {
  overflow-x: hidden !important;
}

#digital-card,
.glass-card,
.hist-item {
  max-width: 100%;
}

#dash-balance {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.tracker-container,
.qs-stepper-4 {
  min-width: 0;
}

.qs-step,
.qs-step span,
.step-circle + span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Tables keep all columns available through deliberate horizontal scrolling. */
.overflow-x-auto {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.overflow-x-auto > table,
table.whitespace-nowrap {
  min-width: max-content;
}

/* Backoffice baseline */
#login-screen,
#dashboard-screen,
#dashboard-screen main,
#views-container,
.view-section {
  min-width: 0;
  max-width: 100%;
}

#login-screen .glass-card {
  width: min(100%, 27.5rem) !important;
  padding: clamp(1.25rem, 6vw, 2.5rem) !important;
}

.admin-command-strip,
#dashboard-screen header,
.support-resolution-actions {
  flex-wrap: wrap;
}

.admin-flow-pill {
  white-space: normal !important;
  text-align: center;
}

/* Small phones first */
@media (max-width: 479px) {
  body {
    font-size: 0.9375rem;
  }

  #main-nav .h-20 {
    height: 4rem !important;
  }

  #app-content {
    padding-top: calc(4rem + var(--qs-safe-top)) !important;
  }

  #mobile-menu-dropdown {
    top: calc(4rem + var(--qs-safe-top)) !important;
    max-height: calc(100dvh - 4rem - var(--qs-safe-top));
    overflow-y: auto;
  }

  .quicksend-brand-text {
    margin-left: 0.55rem !important;
  }

  .quicksend-brand-text strong {
    font-size: 0.95rem !important;
  }

  .quicksend-brand-text small {
    font-size: 0.58rem !important;
  }

  #view-login > div,
  #view-register > div {
    min-height: calc(100dvh - 4rem) !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.5rem !important;
    align-items: flex-start !important;
  }

  #view-register .mb-10 {
    margin-bottom: 1.75rem !important;
  }

  #view-register .mb-8,
  #view-login .mb-8 {
    margin-bottom: 1.5rem !important;
  }

  #reg-step-2 .grid-cols-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #reg-phone-row {
    display: grid !important;
    grid-template-columns: minmax(7.5rem, 0.42fr) minmax(0, 0.58fr);
    gap: 0.5rem !important;
  }

  #reg-phone-code,
  #reg-phone-code + div {
    width: 100% !important;
  }

  #reg-step-2 > .flex.gap-3,
  #reg-step-3 > .flex.gap-3 {
    gap: 0.55rem !important;
  }

  #reg-step-2 > .flex.gap-3 button,
  #reg-step-3 > .flex.gap-3 button {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    white-space: normal !important;
  }

  #btn-reset-password {
    white-space: normal !important;
    line-height: 1.4;
  }

  #client-lock-screen {
    padding: var(--qs-mobile-gutter) !important;
  }

  #lock-pin-pad,
  #pin-pad {
    gap: 0.75rem !important;
    max-width: 13.5rem !important;
  }

  .pin-btn {
    width: 3.25rem !important;
    height: 3.25rem !important;
    font-size: 1.25rem !important;
  }

  #notif-dropdown {
    left: var(--qs-mobile-gutter) !important;
    right: var(--qs-mobile-gutter) !important;
    width: auto !important;
  }

  #chat-panel {
    left: var(--qs-mobile-gutter) !important;
    right: var(--qs-mobile-gutter) !important;
    width: auto !important;
  }

  .qs-chat-txn-card {
    align-items: stretch !important;
    flex-direction: column;
  }

  .qs-chat-txn-card button {
    width: 100%;
    white-space: normal !important;
  }

  .qs-update-banner {
    align-items: stretch;
    flex-wrap: wrap;
  }

  #qs-update-now {
    margin-left: 0 !important;
    flex: 1 1 auto;
    white-space: normal !important;
  }

  /* Six dashboard destinations fit the screen without forced horizontal drift. */
  #mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center !important;
    justify-content: stretch !important;
    gap: 0 !important;
    height: calc(4.75rem + var(--qs-safe-bottom)) !important;
    padding: 0.35rem 0.2rem calc(0.35rem + var(--qs-safe-bottom)) !important;
    overflow-x: hidden !important;
    white-space: normal !important;
  }

  #mobile-bottom-nav .mobile-nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 3.25rem !important;
    padding: 0.35rem 0.15rem !important;
    gap: 0.2rem !important;
    border-radius: 0.75rem !important;
  }

  #mobile-bottom-nav .qs-nav-icon-img,
  #mobile-bottom-nav i {
    width: 1.45rem !important;
    height: 1.45rem !important;
    font-size: 1.35rem !important;
    object-fit: contain;
  }

  #main-scroll {
    padding-left: var(--qs-mobile-gutter) !important;
    padding-right: var(--qs-mobile-gutter) !important;
    padding-bottom: calc(5.5rem + var(--qs-safe-bottom)) !important;
  }

  #digital-card {
    padding: 1.1rem !important;
    border-radius: 1.25rem !important;
  }

  #dash-balance {
    font-size: clamp(1.85rem, 10vw, 2.65rem) !important;
    line-height: 1.08 !important;
  }

  #layout-dashboard h3 {
    line-height: 1.25;
  }

  #layout-dashboard button.whitespace-nowrap,
  #layout-dashboard a.whitespace-nowrap {
    white-space: normal !important;
  }

  #invoice-paper:not(.qs-invoice-paper) {
    width: 100% !important;
    max-height: calc(100dvh - 1.5rem - var(--qs-safe-top)) !important;
    padding: 1rem !important;
    overflow: auto !important;
  }

  /* Admin mobile shell */
  #dashboard-screen:not(.hidden) {
    width: 100%;
    min-height: 100dvh;
    height: auto !important;
  }

  #dashboard-screen main {
    width: 100%;
    min-height: 100dvh;
    height: auto !important;
  }

  #dashboard-screen header {
    height: auto !important;
    min-height: 4rem;
    padding: 0.75rem var(--qs-mobile-gutter) !important;
    gap: 0.65rem;
  }

  #views-container {
    width: 100%;
    padding: 1rem var(--qs-mobile-gutter) 2rem !important;
    overflow-x: hidden !important;
  }

  #dashboard-screen aside {
    max-width: min(86vw, 18rem);
  }

  #view-support .support-chat-card {
    min-height: 0 !important;
    height: calc(100dvh - 8.5rem) !important;
    max-height: none !important;
  }

  #view-support .support-sidebar {
    max-height: 38% !important;
  }

  #view-support #support-user-list > div {
    min-width: min(14.5rem, 78vw) !important;
  }

  #dashboard-screen [class*="rounded-[2rem]"],
  #dashboard-screen .rounded-3xl {
    border-radius: 1.25rem !important;
  }

  #dashboard-screen .p-8 {
    padding: 1rem !important;
  }

  #dashboard-screen table {
    font-size: 0.75rem;
  }
}

@media (max-width: 359px) {
  :root {
    --qs-mobile-gutter: 0.65rem;
  }

  body {
    font-size: 0.875rem;
  }

  #reg-phone-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #reg-step-2 > .flex.gap-3,
  #reg-step-3 > .flex.gap-3 {
    flex-direction: column !important;
  }

  #reg-step-2 > .flex.gap-3 button,
  #reg-step-3 > .flex.gap-3 button {
    width: 100% !important;
  }

  #mobile-bottom-nav .mobile-nav-btn {
    min-height: 3rem !important;
  }

  #mobile-bottom-nav .qs-nav-icon-img,
  #mobile-bottom-nav i {
    width: 1.25rem !important;
    height: 1.25rem !important;
    font-size: 1.2rem !important;
  }

  #digital-card {
    padding: 0.9rem !important;
  }

  .qs-chat-suggestions,
  .qs-txn-help-suggestions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Tablet and larger screens progressively enhance the mobile base. */
@media (min-width: 480px) and (max-width: 767px) {
  #main-scroll {
    padding-left: clamp(1rem, 4vw, 1.5rem) !important;
    padding-right: clamp(1rem, 4vw, 1.5rem) !important;
  }

  #mobile-bottom-nav {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }
}

@media (min-width: 768px) {
  #view-login .glass-card,
  #view-register .glass-card {
    padding: 2rem !important;
  }

  #dashboard-screen main {
    min-width: 0;
  }
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

/* Final contrast and width corrections for the light authentication/dashboard skin. */
body[data-page="login"] #view-login h2,
body[data-page="register"] #view-register h2,
body[data-page="register"] #view-register h4,
body[data-page="register"] #reg-id-filename {
  color: #07111f !important;
}

body[data-page="register"] #reg-step-1 label > div {
  background: #f8fbfa !important;
  border-color: rgba(7, 17, 31, 0.12) !important;
}

body[data-page="register"] #reg-step-1 label > div i,
body[data-page="register"] #reg-step-1 label > div h4 {
  color: #07111f !important;
}

body[data-page="register"] #reg-step-1 label input:checked + div {
  background: rgba(11, 77, 255, 0.08) !important;
  border-color: #0b4dff !important;
  box-shadow: 0 0 0 3px rgba(11, 77, 255, 0.08) !important;
}

body[data-page="register"] #reg-step-2 > .flex.gap-3 > button:first-child,
body[data-page="register"] #reg-step-3 > .flex.gap-3 > button:first-child {
  color: #07111f !important;
  border: 1px solid rgba(7, 17, 31, 0.12) !important;
  background: #f4f7f6 !important;
}

body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4.mb-2,
body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4 {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body[data-page="dashboard"] #digital-card p[data-i18n="bal_avail"],
body[data-page="dashboard"] #digital-card button span.truncate {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body[data-page="dashboard"] #digital-card button span.truncate {
  line-height: 1.12 !important;
  text-align: center;
}

@media (max-width: 479px) {
  body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4.mb-2 .glass-card,
  body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4 .glass-card {
    width: 100% !important;
    padding: 1rem !important;
  }

  body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4.mb-2 .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4.mb-2 .flex.justify-between {
    gap: 0.65rem;
  }

  body[data-page="dashboard"] #dash-tab-home > .w-full.mt-4.mb-2 label {
    letter-spacing: 0.055em !important;
    overflow-wrap: normal;
  }

  body[data-page="dashboard"] #digital-card button[onclick*="deposit"],
  body[data-page="dashboard"] #digital-card button[onclick*="p2p"] {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }
}

@media (max-width: 479px) {
  body[data-page="dashboard"] #set-name,
  body[data-page="dashboard"] #set-email,
  body[data-page="dashboard"] #set-id {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
  }

  /* backdrop-filter makes fixed descendants use the header as their viewport. */
  body[data-page="dashboard"] #layout-dashboard header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .qs-notif-head {
    flex-wrap: wrap;
  }

  .qs-notif-actions {
    margin-left: auto;
  }
}

@media (max-width: 479px) {
  body[data-page="dashboard"] #dash-tab-settings [data-i18n="set_kyc_status"] {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.25;
  }
}

/* 2026-08-24 transfer UX rebuild — mobile-first and scoped to transfer/review only. */
#dash-tab-transfer {
  width: 100%;
  max-width: 46rem !important;
  margin-inline: auto;
}
.qs-transfer-page-head {
  width: min(100%, 38rem);
  margin-inline: auto;
  padding-inline: .25rem;
}
.qs-transfer-page-head h3 {
  margin-bottom: .35rem !important;
  line-height: 1.12 !important;
  text-wrap: balance;
}
.qs-transfer-page-head p {
  max-width: 34rem;
  margin-inline: auto;
  line-height: 1.55;
  text-wrap: pretty;
}
body[data-page="dashboard"] #dash-tab-transfer .qs-transfer-card {
  width: 100%;
  overflow: visible !important;
  border: 1px solid rgba(15, 118, 110, .10) !important;
  border-radius: 1.35rem !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,252,252,.965)) !important;
  box-shadow: 0 18px 50px rgba(19, 54, 61, .08) !important;
  padding: 1rem !important;
}
.dark body[data-page="dashboard"] #dash-tab-transfer .qs-transfer-card {
  border-color: rgba(255,255,255,.08) !important;
  background: linear-gradient(180deg, rgba(7,20,38,.96), rgba(4,13,33,.96)) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.26) !important;
}

#unified-transfer-form,
#unified-transfer-form .qs-transfer-fields-group {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: .82rem !important;
}
#unified-transfer-form > :not([hidden]) ~ :not([hidden]),
#unified-transfer-form .qs-transfer-fields-group > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}
#unified-transfer-form > div,
#unified-transfer-form .qs-transfer-field,
#unified-transfer-form .qs-transfer-two-col > div {
  min-width: 0;
  width: 100%;
}

#unified-transfer-form label,
#unified-transfer-form .qs-transfer-field > label {
  display: block !important;
  width: 100%;
  margin: 0 0 .38rem !important;
  color: #5e716f !important;
  font-size: .66rem !important;
  font-weight: 850 !important;
  line-height: 1.28 !important;
  letter-spacing: .045em !important;
  text-align: center !important;
  text-transform: uppercase !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.dark #unified-transfer-form label,
.dark #unified-transfer-form .qs-transfer-field > label { color: #b5c0ca !important; }
#unified-transfer-form label span {
  color: #92a09f;
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.qs-transfer-control {
  position: relative;
  width: 100%;
  min-width: 0;
}
.qs-transfer-control > i:first-child {
  position: absolute !important;
  z-index: 2;
  left: .72rem !important;
  top: 50% !important;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: .68rem;
  background: #eef7f6;
  color: #0a7b78 !important;
  font-size: 1rem !important;
  transform: translateY(-50%) !important;
  pointer-events: none;
}
.dark .qs-transfer-control > i:first-child {
  background: rgba(64, 201, 191, .10);
  color: #77d5ce !important;
}
#unified-transfer-form input.glass-input,
#unified-transfer-form select.glass-input {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 3.18rem !important;
  border: 1px solid rgba(71, 96, 101, .17) !important;
  border-radius: .9rem !important;
  background: #fff !important;
  color: #132b2d !important;
  box-shadow: 0 7px 20px rgba(26, 54, 58, .045) !important;
  padding: .78rem 2.95rem !important;
  font-size: 16px !important;
  font-weight: 720 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-overflow: ellipsis;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease !important;
}
#unified-transfer-form select.glass-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  text-align-last: center;
  cursor: pointer;
}
#unified-transfer-form input.glass-input::placeholder { color: #a1adb9 !important; opacity: 1; }
.dark #unified-transfer-form input.glass-input,
.dark #unified-transfer-form select.glass-input {
  border-color: rgba(255,255,255,.095) !important;
  background: rgba(255,255,255,.045) !important;
  color: #f7fafc !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
}
#unified-transfer-form input.glass-input:focus,
#unified-transfer-form select.glass-input:focus {
  outline: none !important;
  border-color: rgba(13, 148, 136, .62) !important;
  box-shadow: 0 0 0 4px rgba(13,148,136,.09), 0 9px 24px rgba(15,23,42,.05) !important;
}
#unified-transfer-form input.glass-input:focus + .qs-transfer-caret,
#unified-transfer-form select.glass-input:focus + .qs-transfer-caret { color: #0d9488; }
.qs-transfer-caret {
  position: absolute;
  z-index: 3;
  right: .92rem;
  top: 50%;
  color: #7c8e91;
  font-size: .92rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.qs-transfer-method-note {
  display: grid;
  grid-template-columns: 2.55rem minmax(0,1fr);
  align-items: center;
  gap: .72rem;
  min-width: 0;
  padding: .78rem .82rem;
  border: 1px solid rgba(13,148,136,.14);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(13,148,136,.075), rgba(11,95,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.qs-transfer-method-note > i {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border-radius: .82rem;
  background: linear-gradient(145deg, #e4f7f5, #edf3ff);
  color: #087f79;
  font-size: 1.15rem;
}
.qs-transfer-method-note > div { min-width: 0; text-align: center; padding-right: 2.55rem; }
.qs-transfer-method-note strong,
.qs-transfer-method-note span { display: block; overflow-wrap: anywhere; }
.qs-transfer-method-note strong { color: #173335; font-size: .75rem; font-weight: 900; line-height: 1.25; }
.qs-transfer-method-note span { margin-top: .18rem; color: #748487; font-size: .62rem; font-weight: 650; line-height: 1.45; }
.dark .qs-transfer-method-note { border-color: rgba(65,207,196,.14); background: rgba(65,207,196,.055); box-shadow: none; }
.dark .qs-transfer-method-note > i { background: rgba(65,207,196,.1); color: #83ddd7; }
.dark .qs-transfer-method-note strong { color: #fff; }
.dark .qs-transfer-method-note span { color: #a7b3bf; }

.qs-transfer-two-col {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: .82rem;
  min-width: 0;
}

#tf-method-preview {
  margin-top: -.12rem !important;
  border: 1px solid rgba(13,148,136,.12) !important;
  border-radius: 1rem !important;
  background: rgba(244, 251, 250, .94) !important;
  padding: .72rem .78rem !important;
  box-shadow: none !important;
}
#tf-method-preview > div { justify-content: center; text-align: center; }
#tf-method-preview > div > div:last-child { text-align: center; }
#tf-method-preview p { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.dark #tf-method-preview { border-color: rgba(65,207,196,.11) !important; background: rgba(65,207,196,.045) !important; }

.qs-transfer-amount-section {
  display: grid;
  gap: .72rem;
  margin-top: .08rem !important;
  padding: .9rem !important;
  border: 1px solid rgba(71,96,101,.12) !important;
  border-radius: 1rem;
  background: linear-gradient(180deg, #f8fbfb, #f4f9f8);
}
.dark .qs-transfer-amount-section { border-color: rgba(255,255,255,.08) !important; background: rgba(255,255,255,.025); }
.qs-transfer-amount-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .42rem .65rem;
  min-width: 0;
}
#unified-transfer-form .qs-transfer-amount-head label { width: auto !important; margin: 0 !important; }
.qs-transfer-balance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-width: 0;
  border: 1px solid rgba(245,183,0,.18);
  border-radius: 999px;
  background: rgba(245,183,0,.09);
  padding: .32rem .58rem;
  color: #8b6500;
  font-size: .64rem;
  font-weight: 820;
  line-height: 1.2;
}
.dark .qs-transfer-balance { color: #ffd45c; border-color: rgba(245,183,0,.2); background: rgba(245,183,0,.08); }
.qs-transfer-amount-control > i:first-child { color: #0b5fff !important; background: #edf3ff; }
#unified-transfer-form #tf-amount {
  min-height: 3.45rem !important;
  padding-inline: 3rem !important;
  font-size: 1.2rem !important;
  font-weight: 850 !important;
  font-variant-numeric: tabular-nums;
}

.qs-transfer-calculation {
  width: 100%;
  min-width: 0;
  gap: .48rem !important;
  margin-top: 0 !important;
  border: 1px solid rgba(13,148,136,.12) !important;
  border-radius: .95rem !important;
  background: #fff !important;
  padding: .72rem !important;
  box-shadow: none !important;
  overflow: hidden;
}
.dark .qs-transfer-calculation { border-color: rgba(255,255,255,.08) !important; background: rgba(255,255,255,.035) !important; }
.qs-recipient-payout-card {
  display: grid;
  justify-items: center;
  gap: .22rem;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(13,148,136,.13);
  border-radius: .82rem;
  background: linear-gradient(135deg, rgba(13,148,136,.075), rgba(11,95,255,.025));
  padding: .72rem .68rem;
  text-align: center;
}
.qs-recipient-payout-card__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  color: #647679;
  font-size: .61rem;
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1.25;
  text-transform: uppercase;
}
.qs-recipient-payout-card__amount {
  display: block;
  max-width: 100%;
  color: #087b73;
  font-size: clamp(1.12rem, 5.2vw, 1.45rem);
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.qs-recipient-payout-card__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .18rem .55rem;
  color: #7a898c;
  font-size: .6rem;
  font-weight: 700;
  line-height: 1.35;
}
.qs-transfer-calculation > .flex {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: baseline;
  gap: .45rem;
  width: 100%;
  min-width: 0;
  font-size: .68rem;
  line-height: 1.35;
}
.qs-transfer-calculation > .flex > span { min-width: 0; overflow-wrap: anywhere; }
.qs-transfer-calculation > .flex > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

#unified-transfer-form #btn-submit-tf,
#unified-transfer-form .qs-transfer-submit {
  min-height: 3.68rem !important;
  margin-top: .05rem !important;
  border: 1px solid rgba(216,255,94,.72) !important;
  border-radius: 1rem !important;
  background: linear-gradient(135deg, #062f46 0%, #087c78 56%, #0eaaa0 100%) !important;
  box-shadow: 0 15px 34px rgba(6,77,86,.3), inset 0 1px 0 rgba(255,255,255,.18) !important;
  color: #fff !important;
  font-size: .94rem !important;
  font-weight: 920 !important;
  letter-spacing: .005em !important;
  line-height: 1.15 !important;
  text-align: center !important;
  white-space: normal !important;
  transform: none !important;
}
#unified-transfer-form #btn-submit-tf i { color: #d8ff5e !important; font-size: 1.18rem !important; }
#unified-transfer-form #btn-submit-tf:hover { box-shadow: 0 18px 40px rgba(6,77,86,.36) !important; filter: saturate(1.08) !important; }
#unified-transfer-form #btn-submit-tf:focus-visible { outline: 3px solid rgba(216,255,94,.72) !important; outline-offset: 3px !important; }

/* Portrait review dialog: fluid height, readable rows, no artificial empty space. */
.qs-review-modal {
  align-items: center !important;
  justify-content: center !important;
  padding:
    max(.5rem, env(safe-area-inset-top))
    max(.5rem, env(safe-area-inset-right))
    max(.5rem, env(safe-area-inset-bottom))
    max(.5rem, env(safe-area-inset-left)) !important;
  background: rgba(4, 19, 25, .69) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}
.qs-review-sheet {
  width: min(calc(100vw - 1rem), 23rem) !important;
  min-width: 0 !important;
  min-height: min(33rem, calc(100dvh - 1rem)) !important;
  height: auto !important;
  max-height: calc(100dvh - 1rem) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid rgba(255,255,255,.6) !important;
  border-radius: 1.28rem !important;
  background: #fff !important;
  box-shadow: 0 28px 80px rgba(0,18,25,.34) !important;
  transform: translate3d(0,.45rem,0) scale(.988) !important;
}
.dark .qs-review-sheet { border-color: rgba(255,255,255,.1) !important; background: #071426 !important; }
.qs-review-modal.is-open .qs-review-sheet { transform: translate3d(0,0,0) scale(1) !important; }
.qs-review-header {
  flex: 0 0 auto;
  padding: .78rem .82rem .72rem !important;
  background: linear-gradient(135deg, #07515c, #0a8580) !important;
}
.qs-review-header__top { min-height: 2rem; }
.qs-review-header__top button { width: 2rem !important; height: 2rem !important; }
.qs-review-secure { font-size: .61rem !important; letter-spacing: .045em !important; }
.qs-review-heading { align-items: center !important; gap: .62rem !important; margin-top: .46rem !important; }
.qs-review-kind-icon { width: 2.35rem !important; height: 2.35rem !important; border-radius: .78rem !important; }
.qs-review-heading > div:last-child { min-width: 0; flex: 1; text-align: center; padding-right: 2.35rem; }
.qs-review-heading p,
.qs-review-heading h3 { text-align: center !important; }
.qs-review-heading p:first-child { font-size: .5rem !important; letter-spacing: .08em !important; }
.qs-review-heading h3 { margin-top: .08rem !important; font-size: 1rem !important; line-height: 1.1 !important; text-wrap: balance; }
.qs-review-heading p:last-child { margin-top: .18rem !important; font-size: .58rem !important; line-height: 1.35 !important; }
.qs-review-progress { margin-top: .56rem !important; }
.qs-review-progress>span small { font-size: .44rem !important; }

.qs-review-summary {
  flex: 0 0 auto;
  padding: .72rem .78rem .68rem !important;
  text-align: center;
  background: linear-gradient(180deg, #fbfdfd, #f6faf9) !important;
}
.qs-review-summary>small { font-size: .52rem !important; letter-spacing: .07em !important; }
.qs-review-summary>strong {
  max-width: 100%;
  margin-top: .14rem !important;
  font-size: clamp(1.35rem, 7vw, 1.75rem) !important;
  line-height: 1.05 !important;
  overflow-wrap: anywhere;
}
.qs-review-summary>span { margin-top: .38rem !important; padding: .28rem .48rem !important; font-size: .53rem !important; }

.qs-review-rows {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  align-content: start;
  gap: .38rem !important;
  padding: .62rem .72rem !important;
  scrollbar-width: thin;
}
.qs-review-row {
  display: grid !important;
  grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr) !important;
  align-items: center !important;
  gap: .48rem !important;
  min-width: 0;
  border-radius: .76rem !important;
  padding: .52rem .58rem !important;
}
.qs-review-row dt {
  min-width: 0;
  color: #738482 !important;
  font-size: .52rem !important;
  line-height: 1.3 !important;
  text-align: left !important;
  overflow-wrap: anywhere;
}
.qs-review-row dd {
  min-width: 0;
  color: #173033 !important;
  font-size: .66rem !important;
  font-weight: 850 !important;
  line-height: 1.3 !important;
  text-align: right !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.qs-review-row.is-beneficiary {
  border-color: rgba(8,124,120,.3) !important;
  background: linear-gradient(135deg, rgba(8,124,120,.1), rgba(216,255,94,.11)) !important;
  box-shadow: inset 3px 0 0 #0a8d87 !important;
}
.qs-review-row.is-beneficiary dt { color: #08736f !important; }
.qs-review-row.is-beneficiary dd { color: #064f54 !important; font-size: .75rem !important; font-weight: 950 !important; }
.dark .qs-review-row.is-beneficiary { border-color: rgba(127,224,216,.25) !important; background: rgba(69,211,200,.08) !important; }
.dark .qs-review-row.is-beneficiary dt,
.dark .qs-review-row.is-beneficiary dd { color: #9ce9e2 !important; }
.dark .qs-review-row dd { color: #f8fafc !important; }
.qs-review-notice {
  flex: 0 0 auto;
  margin: 0 .72rem .54rem !important;
  padding: .56rem .62rem !important;
  border-radius: .76rem !important;
}
.qs-review-notice span { font-size: .54rem !important; line-height: 1.35 !important; }
.qs-review-actions {
  position: static !important;
  flex: 0 0 auto;
  grid-template-columns: .78fr 1.35fr !important;
  gap: .45rem !important;
  padding: .62rem .72rem max(.62rem, env(safe-area-inset-bottom)) !important;
}
.qs-review-actions button {
  min-width: 0;
  min-height: 2.9rem !important;
  border-radius: .82rem !important;
  padding-inline: .58rem !important;
  font-size: .69rem !important;
}
.qs-review-modal[data-kind="transfer"] .qs-review-confirm {
  border: 1px solid rgba(216,255,94,.72) !important;
  background: linear-gradient(135deg, #06364e, #0a8f89) !important;
  box-shadow: 0 12px 28px rgba(6,77,86,.3) !important;
  color: #fff !important;
  font-size: .76rem !important;
}
.qs-review-modal[data-kind="transfer"] .qs-review-confirm i { color: #d8ff5e !important; font-size: 1rem !important; }

@media (min-width: 680px) {
  body[data-page="dashboard"] #dash-tab-transfer .qs-transfer-card {
    border-radius: 1.65rem !important;
    padding: 1.45rem !important;
  }
  #unified-transfer-form,
  #unified-transfer-form .qs-transfer-fields-group { gap: 1rem !important; }
  .qs-transfer-two-col { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
  #unified-transfer-form input.glass-input,
  #unified-transfer-form select.glass-input { min-height: 3.35rem !important; }
  .qs-transfer-amount-section { padding: 1rem !important; }
}

@media (max-width: 420px) {
  #dash-tab-transfer { padding-inline: 0 !important; }
  body[data-page="dashboard"] #dash-tab-transfer .qs-transfer-card { padding: .85rem !important; border-radius: 1.18rem !important; }
  #unified-transfer-form,
  #unified-transfer-form .qs-transfer-fields-group,
  .qs-transfer-two-col { gap: .74rem !important; }
  #unified-transfer-form label,
  #unified-transfer-form .qs-transfer-field > label { font-size: .62rem !important; margin-bottom: .34rem !important; }
  .qs-transfer-method-note { grid-template-columns: 2.3rem minmax(0,1fr); padding: .7rem; gap: .58rem; }
  .qs-transfer-method-note > i { width: 2.3rem; height: 2.3rem; }
  .qs-transfer-method-note > div { padding-right: 2.3rem; }
  .qs-transfer-method-note strong { font-size: .7rem; }
  .qs-transfer-method-note span { font-size: .58rem; }
  .qs-transfer-amount-section { padding: .78rem !important; }
  .qs-transfer-calculation { padding: .62rem !important; }
  .qs-transfer-calculation > .flex { font-size: .64rem; }
  .qs-review-sheet { width: min(calc(100vw - .8rem), 22.5rem) !important; max-height: calc(100dvh - .8rem) !important; min-height: min(31.5rem, calc(100dvh - .8rem)) !important; border-radius: 1.12rem !important; }
  .qs-review-header { padding-inline: .72rem !important; }
  .qs-review-rows { padding-inline: .62rem !important; }
  .qs-review-notice { margin-inline: .62rem !important; }
  .qs-review-actions { padding-inline: .62rem !important; }
}

@media (max-width: 639px) {
  #unified-transfer-form [data-tf-step="4"] .qs-tx-actions { grid-template-columns: 1fr !important; }
  #unified-transfer-form [data-tf-step="4"] #btn-submit-tf { order: -1; width: 100% !important; }
  #unified-transfer-form [data-tf-step="4"] .qs-tx-btn--secondary { min-height: 2.85rem !important; }
}

@media (max-width: 340px) {
  body[data-page="dashboard"] #dash-tab-transfer .qs-transfer-card { padding-inline: .7rem !important; }
  .qs-transfer-method-note { grid-template-columns: 1fr; justify-items: center; }
  .qs-transfer-method-note > div { padding-right: 0; }
  .qs-transfer-control > i:first-child { left: .52rem !important; width: 1.7rem; height: 1.7rem; border-radius: .58rem; font-size: .9rem !important; }
  #unified-transfer-form input.glass-input { padding-inline: 2.3rem !important; }
  #unified-transfer-form .qs-transfer-control--select > i:first-child { display:none !important; }
  #unified-transfer-form .qs-transfer-control--select select.glass-input { padding-inline: 1.55rem !important; }
  .qs-review-progress { display: none !important; }
  .qs-review-heading p:first-child { display: none !important; }
  .qs-review-row { grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr) !important; }
  .qs-review-actions { grid-template-columns: .72fr 1.35fr !important; }
}

@media (max-height: 650px) {
  .qs-review-sheet { min-height: 0 !important; max-height: calc(100dvh - .55rem) !important; }
  .qs-review-progress,
  .qs-review-heading p:first-child,
  .qs-review-notice { display: none !important; }
  .qs-review-header { padding-block: .58rem !important; }
  .qs-review-summary { padding-block: .55rem !important; }
}
