/* DD Modules signed-off polish — local overrides loaded AFTER the shared header.
   Builder controls/pricing remain unchanged. Main homepage map is untouched. */

/* Landing: three genuinely wide choices, modern title treatment, compact top space. */
body.modules-page:not(.is-module-entry-open) .modules-shell{
 padding-top:clamp(.4rem,1.1vh,.85rem)!important;
}
body.modules-page:not(.is-module-entry-open) .modules-landing{
 width:100%!important;max-width:1400px!important;
 margin:clamp(.35rem,1.5vh,1rem) auto 0!important;
 justify-content:flex-start!important;
}
body.modules-page .modules-landing>h1{
 max-width:1200px;margin:.22rem auto .65rem;
 background:linear-gradient(105deg,#fff 17%,#f5edff 49%,#d8b5ff 74%,#9caaff 100%);
 -webkit-background-clip:text;background-clip:text;color:transparent;
}
body.modules-page:not(.is-module-entry-open) .modules-landing-intro{
 margin-bottom:clamp(.85rem,2vh,1.35rem);
}
body.modules-page:not(.is-module-entry-open) .module-entry{
 width:100%!important;margin:clamp(.36rem,.85vh,.65rem) 0!important;
}
body.modules-page:not(.is-module-entry-open) .module-entry-trigger{
 min-height:clamp(98px,12.5vh,120px);padding:clamp(.85rem,1.5vw,1.45rem) clamp(1.1rem,2.3vw,2.3rem);
}
body.modules-page .module-entry-copy strong{
 text-wrap:balance;
}

/* When a section is open, its full-width banner IS the exit control. */
body.modules-page.is-module-entry-open .modules-shell>.experience-header{
 display:none!important;visibility:hidden!important;height:0!important;max-height:0!important;
 margin:0!important;padding:0!important;border:0!important;pointer-events:none!important;
}
body.modules-page.is-module-entry-open .modules-shell{
 padding-top:0!important;
}
body.modules-page.is-module-entry-open .module-entry.is-open>.module-entry-trigger{
 display:grid!important;position:relative;z-index:4;min-height:100px;
 background:linear-gradient(100deg,rgba(81,49,124,.4),rgba(43,27,66,.25) 62%,rgba(14,13,22,.97));
 border-bottom:1px solid rgba(203,163,255,.23);
}
body.modules-page.is-module-entry-open .module-entry-exit{
 display:none!important;
}
body.modules-page.is-module-entry-open .module-entry.is-open>.module-entry-trigger:focus-visible{
 outline:3px solid #d5a9ff;outline-offset:-4px;
}

/* Full-screen Switch chapters: no scroll-gutter or second stacked card. */
@media(min-width:901px){
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open){
  height:100dvh!important;min-height:0!important;overflow:hidden!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open) .modules-shell{
  height:100dvh!important;min-height:0!important;overflow:hidden!important;
  width:100%!important;max-width:none!important;margin:0!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"].is-open{
  --dd-open-banner-height:clamp(93px,12.4vh,122px);
  height:100dvh!important;min-height:0!important;max-height:100dvh!important;
  display:flex!important;flex-direction:column!important;
  margin:0!important;width:100%!important;overflow:hidden!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"].is-open>.module-entry-trigger{
  flex:0 0 var(--dd-open-banner-height);
  height:var(--dd-open-banner-height);min-height:0!important;
  padding:clamp(.75rem,1.6vh,1.15rem) max(2rem,calc((100vw - 1400px)/2));
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"].is-open>.module-entry-panel{
  display:block;flex:1 1 auto;min-height:0!important;height:auto!important;
  overflow:hidden!important;padding:0!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .takeover-story{
  width:min(1400px,calc(100% - clamp(2rem,5vw,6rem)));
  max-width:none!important;height:100%!important;
  margin:0 auto;padding:clamp(.65rem,1.6vh,1.3rem) 0!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-transformation{
  position:relative;height:100%!important;min-height:0!important;
  overflow:hidden!important;padding:0!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-scene{
  position:absolute!important;inset:0!important;width:100%;height:100%!important;
  min-height:0!important;margin:0!important;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
  gap:clamp(1.4rem,4vw,4rem);
  align-items:center;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-scene-before{
  padding-bottom:clamp(1.4rem,3vh,2.25rem);
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-scene-copy h2{
  font-size:clamp(2rem,min(3.65vw,5.4vh),4rem);line-height:1.03;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-scene-copy p{
  font-size:clamp(.75rem,1vw,.95rem);line-height:1.5;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-software-universe,
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-ecosystem{
  width:min(39vw,54vh,490px)!important;
  min-width:0!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-software-disclaimer{
  position:absolute;left:0;right:0;bottom:0;margin:0!important;
  text-align:center;font-size:.61rem;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-app-comparison:not([hidden]){
  position:absolute;z-index:12;top:8%;right:7%;width:min(390px,38vw);
  max-height:80%;overflow-y:auto;margin:0;
  box-shadow:0 18px 45px #000b;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-scene-after{
  display:none!important;grid-template-columns:1fr!important;
  overflow:hidden!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-transformation.is-dd .dd-scene-after{
  display:block!important;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-after-track{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
  width:200%;height:100%;
  transform:translateX(0);
  transition:transform .72s cubic-bezier(.22,.8,.2,1);
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-transformation.is-details .dd-after-track{
  transform:translateX(-50%);
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-after-main{
  position:relative;display:grid;align-items:center;
  grid-column:1!important;grid-row:1!important;height:100%;
  grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);
  gap:clamp(1.2rem,3vw,3rem);padding:0 .8rem 1.7rem 0;min-width:0;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-after-details-button{
  position:absolute;right:1.4rem;bottom:.35rem;min-height:36px;
  padding:.5rem 1rem;z-index:3;cursor:pointer;
  background:linear-gradient(115deg,#553584,#301e4f);
  color:#fff;border:1px solid #a68bdb70;border-radius:999px;
  font:800 .74rem 'DM Sans',sans-serif;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-after-details-button:hover{
  border-color:#e1c3ff;background:linear-gradient(115deg,#6943a3,#39265c);
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-column:2!important;grid-row:1!important;min-width:0;
  grid-template-rows:auto 1fr auto;
  align-content:center;align-items:center;
  gap:clamp(.55rem,1.2vh,1rem);
  width:100%;height:100%;min-height:0;margin:0!important;
  padding:clamp(.75rem,2vw,2rem)!important;
  box-shadow:none;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-details-back{
  grid-column:1/-1;justify-self:start;align-self:start;
  padding:.45rem .55rem;cursor:pointer;border:0;background:none;
  color:#cbb0ff;font:800 .72rem 'DM Sans',sans-serif;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story .dd-value-points{
  grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story .dd-value-copy h3{
  font-size:clamp(1.5rem,2.5vw,2.6rem);
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story .dd-workflow-demo{
  min-height:120px;
 }
 body.modules-page.is-module-entry-open [data-module-entry="takeover"] .dd-value-story .dd-workflow-demo img{
  height:clamp(120px,24vh,260px);
 }
}
/* Centre icon indicates a click via light, never via redundant text. */
.modules-page .dd-centre-mark{
 overflow:visible;isolation:isolate;
 animation:ddCentreInvitation 2.8s ease-in-out infinite;
}
.modules-page .dd-centre-mark:before{
 content:"";position:absolute;inset:-7px;border-radius:50%;
 border:2px solid #d9afff88;pointer-events:none;
 animation:ddCentreInviteRing 2.8s ease-out infinite;
}
.modules-page .dd-centre-mark img{position:relative;z-index:1}
.modules-page .dd-centre-mark span{display:none!important}
.modules-page .dd-centre-mark:hover{filter:brightness(1.13)}
@keyframes ddCentreInvitation{
  0%,100%{box-shadow:0 0 0 12px rgba(124,58,237,.08),0 0 37px #ad72fa75}
  50%{box-shadow:0 0 0 17px rgba(124,58,237,.2),0 0 65px #b77cffee}
}
@keyframes ddCentreInviteRing{
  0%{opacity:.8;transform:scale(.94)}
  75%,100%{opacity:0;transform:scale(1.26)}
}
.modules-page .product-bizcalc{
 left:calc(50% - 56px)!important;right:auto!important;
 top:4%!important;
}
/* Retain normal scrolling for the actual module configurator. */
body.modules-page.is-module-entry-open:has([data-module-entry="builder"].is-open){
 overflow-y:auto!important;height:auto!important;
}
@media(max-width:900px){
 body.modules-page.is-module-entry-open .modules-shell>.experience-header{display:none!important}
 body.modules-page.is-module-entry-open .module-entry-exit{display:none!important}
 .modules-page .dd-after-track{display:block;width:100%!important;transform:none!important}
 .modules-page .dd-after-main{display:grid;grid-template-columns:1fr;gap:1rem}
 .modules-page .dd-transformation.is-details .dd-after-main{display:none}
 .modules-page .dd-value-story{display:none!important}
 .modules-page .dd-transformation.is-details .dd-value-story{display:grid!important}
 .modules-page .dd-after-details-button{display:block;margin:1rem auto;padding:.7rem 1rem;
  border:1px solid #a78bfa;border-radius:999px;color:#fff;background:#44276d}
 .modules-page .dd-details-back{grid-column:1/-1;padding:.6rem;border:0;background:transparent;color:#cbb0ff}
 .modules-page .module-entry.is-open>.module-entry-trigger{min-height:0!important}
}
@media(min-width:901px) and (max-height:730px){
 body.modules-page:not(.is-module-entry-open) .modules-landing>h1{font-size:clamp(2.5rem,4vw,4.4rem)}
 body.modules-page:not(.is-module-entry-open) .module-entry-trigger{min-height:75px!important;padding:.55rem 1rem!important}
 body.modules-page:not(.is-module-entry-open) .module-entry-copy strong{font-size:1.25rem}
 body.modules-page:not(.is-module-entry-open) .modules-landing-intro{margin-bottom:.7rem}
}
@media(prefers-reduced-motion:reduce){
 .modules-page .dd-centre-mark,.modules-page .dd-centre-mark:before{animation:none}
 .modules-page .dd-after-track{transition:none!important}
}

/* Preserve the native hand-drawn arrow language in the sideways chapter. */
.modules-page .dd-after-details-button .dd-squiggle-arrow,
.modules-page .dd-details-back .dd-squiggle-arrow{
 display:inline-block;vertical-align:middle;width:21px;height:17px;
 margin:0 0 0 .35rem;
}
.modules-page .dd-details-back .dd-squiggle-arrow{margin:0 .35rem 0 0}

/* Critical visibility fix: the legacy :has() takeover rule in modules.css
   has higher specificity than the former full-screen flex rules.
   Without this override the entry remains display:block and its content
   collapses to 0px inside a viewport-height outer card. */
@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;
  height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;
  overflow:hidden!important;position:relative;
 }
 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 auto!important;
  height:auto!important;min-height:0!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 .takeover-story{
  height:100%!important;min-height:0!important;box-sizing:border-box!important;
 }
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open .dd-transformation{
  height:100%!important;min-height:0!important;
  box-sizing:border-box!important;
 }
}
/* On small screens the visitor can scroll rather than lose essential content. */
@media(max-width:900px){
 body.modules-page.is-module-entry-open:has([data-module-entry="takeover"].is-open)
 section.module-entry[data-module-entry="takeover"].is-open{
  display:block!important;height:auto!important;min-height:100dvh!important;overflow:visible!important;
 }
}
