/* Mobile-only wallet sheets. Desktop rules stay in desktop-workspace.js. */
.wallet-transfer-scroll,
.wallet-transfer-actions { display: contents; }
.wallet-network-menu { display: none; }
.wallet-network-menu.is-open { display: block; }

#wallet-state-loading.wallet-card-skeleton {
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 24px;
  padding: 18px 16px 16px !important;
  background: radial-gradient(circle at 50% -20%,rgba(23,70,255,.12),transparent 56%),#08090c !important;
}
#wallet-state-loading.wallet-card-skeleton [style*="animation:dtSpin"] {
  background: linear-gradient(100deg,rgba(255,255,255,.035) 20%,rgba(255,255,255,.095) 42%,rgba(255,255,255,.035) 64%) !important;
  background-size: 220% 100% !important;
  animation: wallet-skeleton-shimmer 1.35s ease-in-out infinite !important;
}

@media (max-width: 768px) {
  body:not(.desktop-mode):has(#deposit-modal.open),
  body:not(.desktop-mode):has(#withdraw-modal.open),
  body:not(.desktop-mode).wallet-transfer-modal-open { overflow: hidden !important; }
  body:not(.desktop-mode):has(#deposit-modal.open) #bottom-nav,
  body:not(.desktop-mode):has(#withdraw-modal.open) #bottom-nav { display: none !important; }
  body:not(.desktop-mode).wallet-transfer-modal-open #bottom-nav { display: none !important; }

  body:not(.desktop-mode) #deposit-modal,
  body:not(.desktop-mode) #withdraw-modal {
    z-index: 10000 !important; align-items: flex-end !important; justify-content: center !important;
    padding: 0 !important; background: rgba(0,0,0,.72) !important;
    -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important;
    overscroll-behavior: contain;
  }
  body:not(.desktop-mode) #withdraw-modal .wallet-transfer-dialog {
    width: 100% !important; max-width: none !important; height: auto !important; margin: 0 !important;
    padding: 0 !important; overflow: visible !important; border: 0 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important; transform: none !important;
  }
  body:not(.desktop-mode) .wallet-transfer-surface,
  body:not(.desktop-mode) .wallet-receive-surface {
    position: relative !important; width: 100% !important; max-width: none !important;
    max-height: calc(100dvh - 12px) !important; margin: 0 !important; padding: 0 !important;
    box-sizing: border-box !important; display: flex !important; flex-direction: column !important;
    align-items: stretch !important; overflow: hidden !important; border: 1px solid #2C2C2E !important;
    border-bottom: 0 !important; border-radius: 26px 26px 0 0 !important; background: #111113 !important;
    box-shadow: 0 -20px 60px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.035) !important;
    animation: wallet-mobile-sheet-in .28s cubic-bezier(.16,1,.3,1) both;
  }
  body:not(.desktop-mode) .mobile-only-handle {
    width: 38px !important; height: 4px !important; min-height: 4px; display: block !important;
    margin: 9px auto 2px !important; border-radius: 999px; background: rgba(255,255,255,.18) !important;
  }
  body:not(.desktop-mode) .wallet-transfer-head {
    width: auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    flex: 0 0 auto; margin: 0; padding: 14px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.055);
  }
  body:not(.desktop-mode) .wallet-transfer-head h3 {
    margin: 4px 0; color: #fff; font: 750 21px/1.15 'Space Grotesk','Inter',sans-serif !important;
    letter-spacing: -.02em;
  }
  body:not(.desktop-mode) .wallet-transfer-head p {
    max-width: 310px; margin: 0; color: rgba(255,255,255,.48); font: 500 12px/1.45 'Inter',sans-serif;
  }
  body:not(.desktop-mode) .wallet-transfer-kicker {
    color: #7C9BFF; font: 850 9px/1 'Inter',sans-serif; letter-spacing: .16em;
  }
  body:not(.desktop-mode) .wallet-transfer-close {
    width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; padding: 0;
    border: 1px solid #2C2C2E; border-radius: 12px; background: #0D0E11; color: rgba(255,255,255,.68);
  }
  body:not(.desktop-mode) .wallet-transfer-scroll {
    display: block; min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 14px 18px 18px;
  }
  body:not(.desktop-mode) .wallet-transfer-scroll::-webkit-scrollbar { display: none; }

  body:not(.desktop-mode) .wallet-network-picker { position: relative; width: 100%; margin-bottom: 15px; }
  body:not(.desktop-mode) .wallet-network-selector {
    width: 100%; min-height: 66px; display: flex; align-items: center; gap: 11px; margin: 0;
    padding: 10px 12px; box-sizing: border-box; border: 1px solid #2C2C2E; border-radius: 16px;
    background: #0D0E11; color: #fff; text-align: left;
  }
  body:not(.desktop-mode) .wallet-network-selector[aria-expanded="true"] {
    border-color: rgba(53,99,255,.72); box-shadow: 0 0 0 3px rgba(53,99,255,.12);
  }
  body:not(.desktop-mode) .wallet-solana-mark,
  body:not(.desktop-mode) .wallet-network-option__logo {
    width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: #111113;
  }
  body:not(.desktop-mode) .wallet-solana-mark img,
  body:not(.desktop-mode) .wallet-network-option__logo img { width: 25px; height: auto; display: block; }
  body:not(.desktop-mode) .wallet-network-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
  body:not(.desktop-mode) .wallet-network-copy small,
  body:not(.desktop-mode) .wallet-network-balance small {
    color: rgba(255,255,255,.35); font: 750 9px/1.2 'Inter',sans-serif;
    text-transform: uppercase; letter-spacing: .08em;
  }
  body:not(.desktop-mode) .wallet-network-copy strong,
  body:not(.desktop-mode) .wallet-network-balance strong {
    margin-top: 3px; color: #fff; font: 750 13px/1.2 'Inter',sans-serif;
  }
  body:not(.desktop-mode) .wallet-network-copy > span {
    max-width: 160px; margin-top: 3px; overflow: hidden; color: rgba(255,255,255,.43);
    font: 600 9px/1.2 'JetBrains Mono',monospace; text-overflow: ellipsis; white-space: nowrap;
  }
  body:not(.desktop-mode) .wallet-network-balance {
    min-width: 82px; display: flex; flex-direction: column; align-items: flex-end;
    padding-left: 9px; border-left: 1px solid #2C2C2E;
  }
  body:not(.desktop-mode) .wallet-network-balance strong { font-size: 11px; }
  body:not(.desktop-mode) .wallet-network-chevron {
    flex: 0 0 auto; color: rgba(255,255,255,.44); transition: transform .18s ease;
  }
  body:not(.desktop-mode) .wallet-network-selector[aria-expanded="true"] .wallet-network-chevron { transform: rotate(180deg); }
  body:not(.desktop-mode) .wallet-network-menu {
    display: none; margin-top: 7px; padding: 6px; border: 1px solid #2C2C2E; border-radius: 15px;
    background: #0D0E11; box-shadow: 0 18px 40px rgba(0,0,0,.42);
  }
  body:not(.desktop-mode) .wallet-network-menu.is-open { display: block; animation: wallet-network-open .16s ease-out both; }
  body:not(.desktop-mode) .wallet-network-option {
    width: 100%; min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 7px 8px;
    border: 0; border-radius: 11px; background: rgba(53,99,255,.08); color: #fff; text-align: left;
  }
  body:not(.desktop-mode) .wallet-network-option__copy {
    min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px;
  }
  body:not(.desktop-mode) .wallet-network-option__copy strong { font: 750 13px/1.2 'Inter',sans-serif; }
  body:not(.desktop-mode) .wallet-network-option__copy span {
    overflow: hidden; color: rgba(255,255,255,.44); font: 600 9px/1.2 'JetBrains Mono',monospace;
    text-overflow: ellipsis; white-space: nowrap;
  }
  body:not(.desktop-mode) .wallet-network-option__check {
    width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center;
    border-radius: 50%; background: #3563FF; color: #fff;
  }

  body:not(.desktop-mode) .wallet-field-label,
  body:not(.desktop-mode) .wallet-amount-line > span {
    display: block; margin: 0 0 7px 2px; color: rgba(255,255,255,.52); font: 750 10px/1.2 'Inter',sans-serif;
  }
  body:not(.desktop-mode) .wallet-amount-line {
    display: flex; align-items: center; justify-content: space-between; margin-top: 13px;
  }
  body:not(.desktop-mode) .wallet-amount-line > span strong { color: rgba(255,255,255,.8); }
  body:not(.desktop-mode) .wallet-input-wrap input {
    min-height: 50px; padding: 0 48px 0 13px !important; border: 1px solid #2C2C2E !important;
    border-radius: 14px !important; background: #0D0E11 !important; color: #fff !important;
    font: 600 12px/1 'JetBrains Mono',monospace !important;
  }
  body:not(.desktop-mode) .wallet-input-wrap input:focus {
    border-color: #3563FF !important; box-shadow: 0 0 0 3px rgba(53,99,255,.13);
  }
  body:not(.desktop-mode) .wallet-amount-input input { padding-right: 104px !important; font-size: 17px !important; }
  body:not(.desktop-mode) .wallet-amount-symbol {
    position: absolute; top: 50%; right: 62px; transform: translateY(-50%);
    color: rgba(255,255,255,.48); font: 750 10px/1 'Inter',sans-serif;
  }
  body:not(.desktop-mode) .wallet-amount-input button {
    top: 50% !important; right: 8px !important; transform: translateY(-50%);
    border: 1px solid rgba(53,99,255,.32); background: rgba(53,99,255,.12) !important; color: #9AB0FF !important;
  }
  body:not(.desktop-mode) #withdraw-recipient-status { margin: 7px 2px 0 !important; padding: 0 !important; line-height: 1.45; }
  body:not(.desktop-mode) .wallet-transfer-estimate {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin: 8px 2px 0; color: rgba(255,255,255,.35); font: 600 9px/1.4 'Inter',sans-serif;
  }
  body:not(.desktop-mode) .wallet-transfer-estimate span:first-child { color: rgba(255,255,255,.62); }
  body:not(.desktop-mode) #withdraw-error {
    margin: 10px 0 0 !important; padding: 9px 10px; border: 1px solid rgba(255,69,58,.24);
    border-radius: 10px; background: rgba(255,69,58,.08); color: #FF6961 !important; text-align: left !important;
  }
  body:not(.desktop-mode) .wallet-transfer-footnote {
    width: 100%; margin: 12px 0 0; color: rgba(255,255,255,.34);
    font: 500 9px/1.5 'Inter',sans-serif; text-align: left;
  }
  body:not(.desktop-mode) .wallet-transfer-actions {
    display: block; position: relative; z-index: 2; flex: 0 0 auto; padding: 10px 18px calc(env(safe-area-inset-bottom) + 12px);
    border-top: 1px solid #2C2C2E; background: #111113; box-shadow: 0 -12px 28px rgba(0,0,0,.34);
  }
  body:not(.desktop-mode) .wallet-transfer-primary {
    min-height: 50px; border: 1px solid #3563FF !important; border-radius: 14px !important;
    background: #3563FF !important; color: #fff !important; box-shadow: 0 10px 24px rgba(53,99,255,.22);
    font: 850 13px/1 'Inter',sans-serif !important; letter-spacing: 0 !important; text-transform: none !important;
  }
  body:not(.desktop-mode) .wallet-transfer-primary:disabled {
    border-color: #2C2C2E !important; background: #1C1C1E !important; color: rgba(255,255,255,.3) !important;
    box-shadow: none !important; opacity: 1 !important;
  }
  body:not(.desktop-mode) .wallet-qr-panel {
    width: min(56vw,220px); aspect-ratio: 1; align-self: center; display: grid; place-items: center;
    margin: 2px auto 14px !important; padding: 10px !important; border-radius: 18px !important;
  }
  body:not(.desktop-mode) .wallet-qr-panel img { width: 100% !important; height: 100% !important; }
  body:not(.desktop-mode) .wallet-qr-panel > div { display: none !important; }
  body:not(.desktop-mode) .wallet-deposit-address {
    margin-bottom: 0 !important; padding: 10px !important; border-color: #2C2C2E !important; background: #0D0E11 !important;
  }
  body:not(.desktop-mode) .wallet-receive-surface .wallet-transfer-scroll { display: flex; flex-direction: column; }
}

@keyframes wallet-mobile-sheet-in {
  from { transform: translateY(28px); opacity: .7; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes wallet-network-open {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes wallet-skeleton-shimmer {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

@media (prefers-reduced-motion: reduce) {
  #wallet-state-loading.wallet-card-skeleton [style*="animation:dtSpin"] { animation: none !important; }
}
