<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2025"
  xmlns:ffd="http://xbrl.sec.gov/ffd/2025"
  xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef
      xlink:href="https://xbrl.sec.gov/ffd/2025/ffd-2025.xsd"
      xlink:type="simple"/>
    <context id="c0">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000895421</identifier>
        </entity>
        <period>
            <startDate>2026-07-16</startDate>
            <endDate>2026-07-16</endDate>
        </period>
    </context>
    <unit id="usd">
        <measure>iso4217:USD</measure>
    </unit>
    <ffd:NrrtvDsclsr contextRef="c0" id="ixv-14">&lt;div&gt;The pricing supplement to which this Exhibit is attached is a final prospectus for the related offerings. The maximum aggregate offering price of the related offerings is $9,000,000,000 (comprised of $500,000,000 of the Floating Rate Senior Notes Due 2029, $2,500,000,000 of the Fixed/Floating Rate Senior Notes Due 2029, $3,000,000,000 of the Fixed/Floating Rate Senior Notes Due 2032 and $3,000,000,000 of the Fixed/Floating Rate Senior Notes Due 2037).&lt;/div&gt;</ffd:NrrtvDsclsr>
    <ffd:FnlPrspctsFlg contextRef="c0" id="ixv-22">true</ffd:FnlPrspctsFlg>
    <ffd:NrrtvMaxAggtOfferingPric contextRef="c0" decimals="INF" id="ixv-23" unitRef="usd">9000000000</ffd:NrrtvMaxAggtOfferingPric>
    <ffd:CombinedProspectusTableNa contextRef="c0" id="ixv-26">N/A</ffd:CombinedProspectusTableNa>
    <dei:EntityCentralIndexKey contextRef="c0" id="ixv-27">0000895421</dei:EntityCentralIndexKey>
    <dei:EntityRegistrantName contextRef="c0" id="ixv-28">MORGAN STANLEY</dei:EntityRegistrantName>
    <ffd:FeeExhibitTp contextRef="c0" id="ixv-29">EX-FILING FEES</ffd:FeeExhibitTp>
    <ffd:FormTp contextRef="c0" id="ixv-30">S-3</ffd:FormTp>
    <ffd:OfferingTableNa contextRef="c0" id="ixv-31">N/A</ffd:OfferingTableNa>
    <ffd:OffsetTableNa contextRef="c0" id="ixv-32">N/A</ffd:OffsetTableNa>
    <ffd:RegnFileNb contextRef="c0" id="ixv-33">333-293641</ffd:RegnFileNb>
    <ffd:SubmissnTp contextRef="c0" id="ixv-34">424B2</ffd:SubmissnTp>
</xbrl>
