.fullscreen-floating-balance {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fullscreen-balance-pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(11, 25, 58, 0.96), rgba(7, 15, 37, 0.98));
  border: 1px solid rgba(108, 143, 220, 0.16);
  box-shadow: none;
  color: #f2f7ff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

#profile-screen.screen.active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 0 calc(var(--nav-h) + 18px + var(--safe-bottom)) !important;
}

#profile-screen .cards-stack.redesign-profile-stack {
  display: grid;
  gap: 8px;
}

#profile-screen .redesign-profile-hero,
#profile-screen .redesign-quick-links,
#profile-screen #wallet-screen {
  border-radius: 24px;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

#profile-screen .redesign-profile-hero {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

#profile-screen .screen-kicker {
  color: rgba(225, 236, 255, 0.68);
  font-size: 14px;
  font-weight: 700;
}

#profile-screen .panel-title {
  font-size: 32px;
  font-weight: 1000;
  line-height: 1.04;
  letter-spacing: 0;
  color: #f4f7ff;
}

#profile-screen .profile-badge {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 71, 255, 0.18);
  border: 1px solid rgba(179, 138, 255, 0.22);
  color: #efe8ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#profile-screen .profile-identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

#profile-screen .profile-identity-copy {
  min-width: 0;
}

#profile-screen .profile-identity-name {
  margin-top: 1px;
  color: #f4f7ff;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.02;
  letter-spacing: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#profile-screen .profile-wallet-label {
  width: 100%;
  min-height: 40px;
  min-width: 0;
  margin-bottom: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(11, 23, 58, 0.96), rgba(7, 15, 37, 0.98));
  color: #f0f5ff;
  box-shadow: none;
}

#profile-screen .profile-wallet-label span,
#profile-screen #profileWalletLabel {
  display: block;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
}

#profile-screen .redesign-balance-card {
  margin-top: 0;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#profile-screen .profile-balance-caption {
  color: rgba(225, 236, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

#profile-screen .redesign-balance-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

#profile-screen .redesign-balance-item {
  min-height: 72px;
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 16px;
  background: transparent;
  border: 0;
}

#profile-screen .balance-badge {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  color: #ffe082;
  font-size: 16px;
}

#profile-screen .balance-badge .balance-icon {
  width: 24px !important;
  height: 24px !important;
  flex-basis: 24px !important;
}

#profile-screen .balance-badge.ton {
  color: #8edcff;
}

#profile-screen .balance-label {
  color: rgba(225, 236, 255, 0.6);
  font-size: 11px;
  font-weight: 700;
}

#profile-screen .balance-value {
  margin-top: 2px;
  color: #f4f7ff;
  font-size: clamp(19px, 5.2vw, 26px);
  font-weight: 1000;
  line-height: 1;
}

#profile-screen .redesign-balance-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

#profile-screen .redesign-balance-actions .primary-btn,
#profile-screen .redesign-balance-actions .secondary-btn {
  min-height: 46px;
  border-radius: 16px;
  font-weight: 900;
}

#profile-screen .redesign-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
}

#profile-screen .profile-link-row,
#profile-screen .profile-link-row-large {
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}

#profile-screen .profile-link-row-large .masked-icon {
  width: 20px;
  height: 20px;
}

#profile-screen .profile-link-row.profile-link-row-large.profile-gold-btn {
  background: linear-gradient(135deg, #b62cff 0%, #7f36ff 44%, #1a8dff 100%);
  color: #ffffff;
  border-color: rgba(120, 190, 255, 0.42);
  box-shadow: none;
}

#profile-screen .profile-link-row.profile-link-row-large.profile-violet-btn {
  background: linear-gradient(135deg, #b62cff 0%, #7f36ff 44%, #1a8dff 100%);
  color: #fff;
  border-color: rgba(120, 190, 255, 0.42);
  box-shadow: none;
}

#profile-screen .finance-screen-block {
  display: block;
}

#profile-screen .wallet-layout {
  display: grid;
  gap: 12px;
}

#profile-screen .finance-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  border: 0;
}

#profile-screen .finance-tab-btn {
  min-height: 46px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
}

#profile-screen .finance-tab-btn.active {
  background: linear-gradient(135deg, #b62cff 0%, #7f36ff 44%, #1a8dff 100%);
  color: #fff;
}

#profile-screen .finance-tab-panel {
  display: none;
}

#profile-screen .finance-tab-panel.active {
  display: block;
}

#profile-screen #withdrawHistoryList {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

#profile-screen .panel-card,
#profile-screen .profile-balance-card,
#profile-screen .redesign-convert-card,
#profile-screen .redesign-wallet-functions,
#profile-screen .redesign-referral-card,
#profile-screen .withdraw-focus-card {
  padding: 14px;
  border-radius: 18px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#profile-screen .field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

#profile-screen .field-row-wide {
  grid-template-columns: minmax(0, 1fr);
}

#profile-screen .field input {
  min-height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(9, 20, 50, 0.98), rgba(6, 13, 31, 0.99));
  border: 1px solid rgba(103, 137, 214, 0.15);
  color: #eef4ff;
  -webkit-text-fill-color: #eef4ff;
  caret-color: #ffffff;
  box-shadow: none;
  font-weight: 800;
}

#profile-screen .field input::placeholder {
  color: rgba(216, 228, 255, 0.42);
  -webkit-text-fill-color: rgba(216, 228, 255, 0.42);
}

#profile-screen .field input:-webkit-autofill,
#profile-screen .field input:-webkit-autofill:hover,
#profile-screen .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #eef4ff;
  -webkit-box-shadow: 0 0 0 1000px rgba(9, 20, 50, 0.98) inset;
  box-shadow: 0 0 0 1000px rgba(9, 20, 50, 0.98) inset;
  transition: background-color 9999s ease-out 0s;
}

#wallet-screen .wallet-function-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
}

#profile-screen .withdraw-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#profile-screen .summary-chip,
#profile-screen .profile-info-chip,
#profile-screen #convertPreviewInfo,
#profile-screen #convertRulesInfo {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(10, 21, 52, 0.96), rgba(6, 13, 33, 0.985));
  border: 1px solid rgba(108, 143, 220, 0.14);
  box-shadow: none;
  color: rgba(236, 242, 255, 0.92);
  font-size: 12px;
  line-height: 1.25;
}

#wallet-screen .profile-info-chip {
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  font-weight: 800;
}

#wallet-screen #bindTonWalletBtn,
#wallet-screen #unbindTonWalletBtn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

#wallet-screen #bindTonWalletBtn {
  width: fit-content;
  max-width: min(58vw, 230px);
  justify-self: start;
}

#wallet-screen #bindTonWalletBtn span:last-child,
#wallet-screen #unbindTonWalletBtn span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#wallet-screen #connectWalletTopBtn {
  background: linear-gradient(135deg, #b62cff 0%, #7f36ff 44%, #1a8dff 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(120, 190, 255, 0.42) !important;
  box-shadow: none !important;
}

#wallet-screen #bindTonWalletBtn {
  background: linear-gradient(135deg, #b62cff 0%, #7f36ff 44%, #1a8dff 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(120, 190, 255, 0.42) !important;
  box-shadow: none !important;
}

#wallet-screen #unbindTonWalletBtn {
  background: linear-gradient(135deg, #ff8b77 0%, #ff4f68 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 158, 158, 0.34) !important;
  box-shadow: none !important;
  white-space: nowrap;
}

#wallet-screen #bindTonWalletBtn .masked-icon,
#wallet-screen #unbindTonWalletBtn .masked-icon {
  color: currentColor !important;
}

#profile-screen #convertPreviewInfo,
#profile-screen #withdrawNetInfo {
  color: #ffe7a3;
  font-weight: 800;
}

#profile-screen #withdrawFeeInfo {
  justify-content: center;
  color: rgba(236, 242, 255, 0.92);
  font-weight: 800;
}

@media (max-width: 640px) {
  .fullscreen-floating-balance {
    gap: 5px;
  }

  .fullscreen-balance-pill {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  #profile-screen .redesign-profile-hero {
    padding: 0;
  }

  #profile-screen .profile-identity-name {
    font-size: 23px;
  }

  #profile-screen .redesign-balance-values,
  #profile-screen .withdraw-summary-grid {
    grid-template-columns: 1fr;
  }

  #profile-screen .profile-link-row,
  #profile-screen .profile-link-row-large {
    min-height: 52px;
    font-size: 14px;
    padding: 0 13px;
    border-radius: 18px;
  }

  #profile-screen .profile-link-row-large .masked-icon {
    width: 18px;
    height: 18px;
  }

  #profile-screen .field-row {
    grid-template-columns: 1fr;
  }

  #profile-screen .profile-wallet-label {
    min-height: 38px;
    margin-bottom: 8px;
  }

  #profile-screen .profile-badge {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  #profile-screen .redesign-quick-links {
    gap: 6px;
    padding: 4px;
  }

  #profile-screen .redesign-balance-card {
    padding: 0;
  }

  #profile-screen .redesign-balance-item {
    min-height: 68px;
    padding: 6px 0;
  }

  #profile-screen .balance-value {
    font-size: clamp(18px, 5vw, 24px);
  }

}
