<?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="AsOf2025-11-14">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000895421</identifier>
        </entity>
        <period>
            <startDate>2025-11-14</startDate>
            <endDate>2025-11-14</endDate>
        </period>
    </context>
    <unit id="USD">
        <measure>iso4217:USD</measure>
    </unit>
    <unit id="Shares">
        <measure>shares</measure>
    </unit>
    <unit id="USDPShares">
        <divide>
            <unitNumerator>
                <measure>iso4217:USD</measure>
            </unitNumerator>
            <unitDenominator>
                <measure>shares</measure>
            </unitDenominator>
        </divide>
    </unit>
    <unit id="Ratio">
        <measure>pure</measure>
    </unit>
    <dei:EntityCentralIndexKey contextRef="AsOf2025-11-14" id="Fact000003">0000895421</dei:EntityCentralIndexKey>
    <ffd:FeeExhibitTp contextRef="AsOf2025-11-14" id="Fact000009">EX-FILING FEES</ffd:FeeExhibitTp>
    <ffd:FormTp contextRef="AsOf2025-11-14" id="Fact000010">S-3</ffd:FormTp>
    <dei:EntityRegistrantName contextRef="AsOf2025-11-14" id="Fact000011">MORGAN STANLEY</dei:EntityRegistrantName>
    <ffd:SubmissnTp contextRef="AsOf2025-11-14" id="Fact000012">424B2</ffd:SubmissnTp>
    <ffd:RegnFileNb contextRef="AsOf2025-11-14" id="Fact000013">333-275587</ffd:RegnFileNb>
    <ffd:FnlPrspctsFlg contextRef="AsOf2025-11-14" id="Fact000014">true</ffd:FnlPrspctsFlg>
    <ffd:OfferingTableNa contextRef="AsOf2025-11-14" id="Fact000015">N/A</ffd:OfferingTableNa>
    <ffd:OffsetTableNa contextRef="AsOf2025-11-14" id="Fact000016">N/A</ffd:OffsetTableNa>
    <ffd:CombinedProspectusTableNa contextRef="AsOf2025-11-14" id="Fact000017">N/A</ffd:CombinedProspectusTableNa>
    <ffd:NrrtvMaxAggtOfferingPric
      contextRef="AsOf2025-11-14"
      decimals="0"
      id="Fact000018"
      unitRef="USD">653000.00</ffd:NrrtvMaxAggtOfferingPric>
    <ffd:NrrtvDsclsr contextRef="AsOf2025-11-14" id="Fact000019">The
prospectus is a final prospectus for the related offering.</ffd:NrrtvDsclsr>
</xbrl>
