/* 20 Nov: match Demo Lab's shared header rhythm on the Modules landing
   and retain that genuine header when entering the immersive three choices.
   Does not alter the Demo Lab, Languages or other shared headers. */
body.modules-page:not(.is-module-entry-open) .modules-shell{
  padding-top:2rem!important;
}
body.modules-page:not(.is-module-entry-open){
  min-height:100dvh;
  height:auto!important;
  overflow-y:auto!important;
}
body.modules-page .modules-shell>.experience-header{
  min-height:72px;
  box-sizing:border-box;
}
@media(min-width:901px){
  body.modules-page.is-module-entry-open .modules-shell{
    width:100%!important;max-width:none!important;
    height:100dvh!important;min-height:0!important;
    display:flex!important;flex-direction:column!important;
    overflow:hidden!important;
    padding:clamp(8px,1.2vh,14px) 0 0!important;
  }
  body.modules-page.is-module-entry-open .modules-shell>.experience-header{
    display:flex!important;visibility:visible!important;opacity:1!important;
    position:relative;z-index:9;
    flex:0 0 auto!important;
    width:min(1400px,calc(100% - 2rem))!important;
    max-width:1400px!important;height:auto!important;min-height:72px!important;max-height:none!important;
    margin:0 auto!important;padding:0 0 1.5rem!important;
    border-bottom:1px solid rgba(255,255,255,.1)!important;
    pointer-events:auto!important;
  }
  body.modules-page.is-module-entry-open .modules-landing{
    display:flex!important;flex:1 1 0!important;flex-direction:column;
    height:auto!important;min-height:0!important;
    width:100%!important;max-width:none!important;
    overflow:hidden!important;
  }
  body.modules-page.is-module-entry-open .module-entry.is-open{
    flex:1 1 0!important;min-height:0!important;
    height:100%!important;max-height:100%!important;
    margin:0!important;
  }
  body.modules-page.is-module-entry-open [data-module-entry="takeover"].is-open{
    --dd-open-banner-height:clamp(76px,10vh,105px);
    height:100%!important;min-height:0!important;max-height:100%!important;
  }
  body.modules-page.is-module-entry-open [data-module-entry="takeover"].is-open>.module-entry-panel{
    flex:1 1 auto!important;min-height:0!important;
  }
  body.modules-page.is-module-entry-open [data-module-entry="takeover"] .takeover-story{
    padding:clamp(.5rem,1.1vh,1rem) 0!important;
  }
  body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story{
    grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)!important;
    grid-template-rows:auto minmax(0,1fr) auto;
    align-items:center;gap:clamp(.6rem,1.3vw,1.2rem);
    padding:clamp(.65rem,1.3vw,1.2rem)!important;
  }
}
/* Other Modules experiences retain their own scrolling logic. The Discover
   panel formerly claimed the entire viewport; account for the shared header
   without hiding content or the selection controls. */
@media(min-width:901px){
  body.modules-page.is-module-entry-open:has([data-module-entry="discover"].is-open)
    section.module-entry[data-module-entry="discover"].is-open{
    height:100%!important;min-height:0!important;max-height:100%!important;
  }
  body.modules-page.is-module-entry-open:has([data-module-entry="discover"].is-open)
    section.module-entry[data-module-entry="discover"].is-open>.module-entry-panel{
    min-height:0!important;overflow-y:auto!important;
  }
  body.modules-page.is-module-entry-open:has([data-module-entry="builder"].is-open)
    .modules-landing{overflow-y:auto!important}
  /* Builder's later dedicated full-screen configuration screen is separate
     from the three introductory choices: do not force its header back on. */
  body.modules-page.is-configuring .modules-shell>.experience-header{
    display:none!important;visibility:hidden!important;min-height:0!important;
    height:0!important;max-height:0!important;padding:0!important;
    pointer-events:none!important;
  }
}
/* Future video package: illustrative storyboard until a recording is supplied. */
.modules-page .dd-business-film{
  display:block;position:relative;isolation:isolate;
  min-width:0;width:100%;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(188,143,246,.38);
  background:
   radial-gradient(ellipse 55% 90% at 100% 28%,rgba(106,64,166,.35),transparent 88%),
   linear-gradient(135deg,#120f22,#0b0a13);
  box-shadow:0 12px 40px rgba(0,0,0,.42),inset 0 1px rgba(238,208,255,.08);
}
.modules-page .dd-business-film [hidden]{display:none!important}
.modules-page .dd-business-film-storyboard{
  position:relative;
  padding:clamp(13px,1.5vw,22px);
}
.modules-page .dd-film-stage{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(40px,.24fr) minmax(0,1.04fr);
  align-items:center;gap:clamp(4px,.9vw,12px);
  min-height:clamp(160px,22vh,270px);
}
.modules-page .dd-film-legacy{
  display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;
  align-items:center;gap:7px;position:relative;min-width:0;
  padding-bottom:25px;
}
.modules-page .dd-film-window{
  height:clamp(67px,8.5vh,108px);
  overflow:hidden;display:flex;flex-direction:column;
  padding:6px;border-radius:7px;
  background:#211c30;border:1px solid rgba(218,185,255,.18);
  box-shadow:0 5px 16px rgba(0,0,0,.3);
  color:#eee2fa;
}
.modules-page .dd-film-window:nth-child(2){transform:translateY(-5px)}
.modules-page .dd-film-window:nth-child(3){transform:translateY(4px)}
.modules-page .dd-film-window-bar{display:flex;align-items:center;gap:5px;border-bottom:1px solid rgba(235,204,255,.16);padding-bottom:4px}
.modules-page .dd-film-dot{width:6px;height:6px;border-radius:50%;background:#a680df}
.modules-page .dd-film-window-bar strong{font-size:clamp(7px,.61vw,10px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.modules-page .dd-film-window>b{margin-top:auto;color:#b49ec7;font-size:clamp(7px,.6vw,9px);font-weight:650}
.modules-page .dd-film-lines{display:grid;gap:5px;margin-top:9px}
.modules-page .dd-film-lines i,.modules-page .dd-film-tasks i{display:block;width:85%;height:3px;background:#a383b5a6;border-radius:3px}
.modules-page .dd-film-lines i:nth-child(2){width:48%}.modules-page .dd-film-lines i:nth-child(3){width:69%}
.modules-page .dd-film-inventory{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;margin-top:11px}
.modules-page .dd-film-inventory i{height:21px;background:linear-gradient(#74568c,#2a223c);border:1px solid #bea0d144;border-radius:3px}
.modules-page .dd-film-bars{display:flex;align-items:end;gap:6px;height:30px;padding:5px 8px 0}
.modules-page .dd-film-bars i{display:block;width:18%;height:45%;background:#a66bd8aa;border-radius:3px 3px 0 0}
.modules-page .dd-film-bars i:nth-child(2){height:90%;background:#9e8ed6aa}
.modules-page .dd-film-bars i:nth-child(3){height:63%}
.modules-page .dd-film-tasks{display:grid;gap:6px;margin-top:8px}
.modules-page .dd-film-tasks i{width:80%}.modules-page .dd-film-tasks i:nth-child(2){width:56%}
.modules-page .dd-film-stage-label{
  position:absolute;bottom:1px;left:0;right:0;white-space:nowrap;
  color:#bfa7d9;text-align:center;
  font:800 clamp(7px,.6vw,9px)/1.2 "DM Sans",sans-serif;
  letter-spacing:.08em;
}
.modules-page .dd-film-connection{
  display:grid;justify-items:center;gap:5px;align-items:center;
  color:#d6aeff;
}
.modules-page .dd-film-connection>span{
  display:grid;place-items:center;
  font-size:clamp(24px,3vw,45px);
  width:clamp(38px,4.4vw,70px);aspect-ratio:1;
  border-radius:50%;
  border:1px solid rgba(207,157,251,.35);
  background:rgba(130,79,203,.2);
  box-shadow:0 0 35px rgba(152,103,234,.22);
}
.modules-page .dd-film-connection small{
  text-align:center;font-size:clamp(6px,.52vw,8px);line-height:1.35;
  letter-spacing:.05em;font-weight:800;
}
.modules-page .dd-film-unified{
  min-width:0;position:relative;padding:clamp(5px,.65vw,10px) 0 25px;
}
.modules-page .dd-film-dd-logo{
  display:flex;align-items:center;justify-content:center;
  margin-bottom:10px;height:clamp(27px,3.1vh,40px);
}
.modules-page .dd-film-dd-logo img{display:block;width:50px;max-height:100%;object-fit:contain;filter:drop-shadow(0 0 11px rgba(176,116,248,.5))}
.modules-page .dd-film-dd-window{
  overflow:hidden;border:1px solid rgba(184,140,235,.55);
  border-radius:8px;background:#111121;
  box-shadow:0 9px 25px rgba(0,0,0,.55),0 0 25px rgba(149,88,218,.15);
}
.modules-page .dd-film-dd-top{display:flex;align-items:center;gap:4px;height:22px;padding:0 7px;background:#2b1c42}
.modules-page .dd-film-dd-top span{flex:1;font-size:clamp(7px,.53vw,9px);font-weight:800;color:#dcb9ff;letter-spacing:.05em}
.modules-page .dd-film-dd-top i{width:5px;height:5px;border-radius:50%;background:#8e76af}
.modules-page .dd-film-dd-window>img{display:block;width:100%;aspect-ratio:2.2;object-fit:cover;object-position:center top;filter:brightness(.95)}
.modules-page .dd-film-caption{
  border-top:1px solid rgba(205,166,246,.15);
  display:flex;align-items:center;gap:9px;
  color:#b6a5c6;font-size:clamp(8px,.63vw,10px);
  font-weight:750;letter-spacing:.07em;
  padding:9px 4px 0;
}
.modules-page .dd-film-indicator{width:7px;height:7px;flex:none;border-radius:50%;background:#cba5f4;box-shadow:0 0 9px #ba85ed}
.modules-page .dd-film-duration{margin-left:auto;color:#d8bee9;white-space:nowrap}
.modules-page .dd-business-film video:not([hidden]){display:block;width:100%;max-height:clamp(225px,41vh,425px);object-fit:contain}
@media(max-width:900px){
 body.modules-page:not(.is-module-entry-open) .modules-shell{padding-top:1rem!important}
 .modules-page .dd-value-story .dd-business-film{grid-column:1/-1}
 .modules-page .dd-film-stage{min-height:195px}
}
@media(max-width:550px){
 .modules-page .dd-business-film-storyboard{padding:10px}
 .modules-page .dd-film-stage{grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr);gap:3px;min-height:165px}
 .modules-page .dd-film-window{height:66px;padding:4px}
 .modules-page .dd-film-dd-top{height:18px}
 .modules-page .dd-film-connection>span{width:33px;font-size:21px}
 .modules-page .dd-film-connection small{font-size:6px}
 .modules-page .dd-film-legacy{gap:4px}
}
@media(prefers-reduced-motion:reduce){
 .modules-page .dd-business-film,.modules-page .dd-film-connection{animation:none!important}
}

/* Regression repair: the high-specificity legacy fullscreen selector below
   modules-finish.css was still forcing the open card to 100dvh beneath our
   restored 72px header. It overflowed its flex slot, clipped the subtitle
   and the lower "How it connects" chapter. Match its specificity here. */
@media(min-width:901px){
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open{
   display:flex!important;flex-direction:column!important;
   flex:1 1 0!important;
   height:100%!important;min-height:0!important;max-height:100%!important;
   overflow:hidden!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open>.module-entry-trigger{
   --dd-open-banner-height:clamp(116px,14svh,140px);
   flex:0 0 var(--dd-open-banner-height)!important;
   height:var(--dd-open-banner-height)!important;
   min-height:var(--dd-open-banner-height)!important;
   max-height:none!important;
   display:grid!important;
   align-content:center!important;
   padding:clamp(12px,1.4vh,18px) max(2rem,calc((100vw - 1400px)/2))!important;
   overflow:visible!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open>.module-entry-trigger .module-entry-copy{
   display:grid!important;gap:clamp(4px,.55vh,8px)!important;
   align-content:center!important;min-height:0!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open>.module-entry-trigger .module-entry-copy small{
   display:block!important;line-height:1.4!important;
   color:#c9b9dc!important;max-width:80ch!important;
   white-space:normal!important;overflow:visible!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open>.module-entry-panel{
   display:block!important;flex:1 1 0!important;
   min-height:0!important;height:auto!important;
   overflow:hidden!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 .modules-landing{
   flex:1 1 0!important;height:auto!important;
   min-height:0!important;overflow:hidden!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-after-details-button{
   position:absolute!important;
   right:clamp(13px,1.5vw,24px)!important;
   bottom:clamp(16px,2.3vh,28px)!important;
   z-index:15!important;
   display:inline-flex!important;align-items:center!important;
   min-height:42px!important;padding:10px 17px!important;
   box-shadow:0 10px 32px rgba(0,0,0,.44);
   pointer-events:auto!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-after-main{
   min-height:0!important;overflow:visible!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story{
   overflow-y:auto!important;overscroll-behavior:contain;
   max-height:100%!important;
 }
}
@media(min-width:901px) and (max-height:780px){
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open>.module-entry-trigger{
   --dd-open-banner-height:118px;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story .dd-value-points{
   gap:6px!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-film-stage{
   min-height:140px!important;
 }
}
