/* DD Site — isolated mobile immersive draft.
   Desktop experience remains source-identical: everything is gated <=760px.
   Original SVG cogs, Three.js meshes, business copy and existing theatre stay intact. */
@media (max-width:760px) {
  /* WORKFLOWS: use the real miniature 3D workbench, not the old card grid.
     If WebGL is unavailable, the existing six large accessible cards remain. */
  body.workflow-page:has([data-ddwb-root]) .ddwb-intro {
    position:absolute!important;z-index:7!important;
    top:max(16px,env(safe-area-inset-top,0px))!important;
    left:14px!important;right:18px!important;
    max-width:min(300px,78vw)!important;
    margin:0!important;pointer-events:none!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-intro .eyebrow{
    font-size:.54rem!important;letter-spacing:.1em;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-intro h1{
    font-size:clamp(1.85rem,8.2vw,2.8rem)!important;line-height:.97!important;
    margin:.5rem 0 .55rem!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-intro>p:last-child{
    font-size:.68rem!important;line-height:1.43!important;
    max-width:255px!important;margin:0!important;color:#b9a9ce!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-stage{
    position:absolute!important;inset:0!important;
    height:100dvh!important;min-height:0!important;
    overflow:hidden!important;padding:0!important;
    touch-action:none!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-three{
    display:block!important;position:absolute!important;inset:0!important;
    opacity:1!important;pointer-events:auto!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-three canvas{
    display:block!important;width:100%!important;height:100%!important;
    touch-action:none!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-stations{
    position:absolute!important;inset:0!important;z-index:5!important;
    display:block!important;grid-template-columns:none!important;
    padding:0!important;margin:0!important;pointer-events:none!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-station{
    position:absolute!important;inset:auto!important;
    left:var(--station-x)!important;top:var(--station-y)!important;
    transform:translate(-50%,-50%)!important;
    width:clamp(112px,36vw,156px)!important;min-width:0!important;
    min-height:46px!important;padding:.37rem .42rem!important;
    gap:.3rem!important;border-radius:8px!important;
    font-size:.65rem!important;
    display:flex!important;align-items:center!important;
    pointer-events:auto!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-station strong{
    font-size:clamp(.58rem,2.8vw,.76rem)!important;
    line-height:1.14!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-station small{
    font-size:clamp(.49rem,2.1vw,.61rem)!important;
    line-height:1.14!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-station-num{
    flex:0 0 20px!important;width:20px!important;height:22px!important;
    font-size:.55rem!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-station-enter{
    font-size:.7rem!important;margin-left:auto!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-hub-toggle{
    position:absolute!important;z-index:7!important;
    top:var(--hub-y,56%)!important;left:var(--hub-x,50%)!important;
    right:auto!important;bottom:auto!important;
    transform:translate(-50%,-50%)!important;
    min-width:59px!important;min-height:66px!important;
    padding:.25rem!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-hub-toggle>img{
    width:35px!important;height:35px!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-viewport-controls{
    display:flex!important;position:absolute!important;z-index:10!important;
    right:.55rem!important;bottom:calc(.8rem + env(safe-area-inset-bottom,0px))!important;
    flex-direction:column!important;gap:.28rem!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-viewport-controls button{
    min-width:42px!important;min-height:42px!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-view-note{
    left:.4rem!important;right:3.9rem!important;bottom:env(safe-area-inset-bottom,0px)!important;
    padding:.7rem!important;justify-content:flex-start!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-view-note .ddwb-status{
    max-width:80vw;font-size:.57rem!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-hub-menu{
    width:calc(100vw - 1.1rem)!important;
    max-height:calc(100dvh - 1rem)!important;
    padding:1rem!important;border-radius:12px!important;
    overscroll-behavior:contain;
  }
  /* If WebGL/reduced motion/data saver prevents scene creation,
     preserve the existing theatre cards and central navigation. */
  body.workflow-page:has([data-ddwb-root]) .ddwb-universe:not(.ddwb-webgl-ready) .ddwb-stations{
    position:absolute!important;inset:210px .45rem 72px!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-content:start!important;gap:.55rem!important;padding:0!important;
    overflow-y:auto!important;touch-action:pan-y!important;pointer-events:auto!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-universe:not(.ddwb-webgl-ready) .ddwb-station{
    position:relative!important;left:auto!important;top:auto!important;
    transform:none!important;width:100%!important;min-height:75px!important;
    visibility:visible!important;opacity:1!important;
  }
  body.workflow-page:has([data-ddwb-root]) .ddwb-universe:not(.ddwb-webgl-ready) .ddwb-hub-toggle{
    position:fixed!important;right:.65rem!important;bottom:.6rem!important;
    left:auto!important;top:auto!important;
    transform:none!important;
  }
  /* VAULT: same immense 488-drawer WebGL wall, compact accordion at bottom,
     feature details slide in like opening the selected drawer. */
  body.vault-wall-page .vw-root{
    height:100dvh!important;min-height:0!important;
    overflow:hidden!important;
  }
  body.vault-wall-page .vw-stage,
  body.vault-wall-page .vw-canvas{
    position:absolute!important;inset:0!important;
    touch-action:none!important;
  }
  body.vault-wall-page .vw-intro{
    top:max(15px,env(safe-area-inset-top,0px))!important;
    left:12px!important;width:min(290px,78vw)!important;
    pointer-events:none!important;z-index:5!important;
  }
  body.vault-wall-page .vw-intro h1{
    font-size:clamp(1.9rem,8vw,2.6rem)!important;
    margin:.44rem 0 .35rem!important;
  }
  body.vault-wall-page .vw-intro>p:last-child{
    display:block!important;max-width:260px!important;
    font-size:.67rem!important;line-height:1.42!important;
  }
  body.vault-wall-page .vw-overline{font-size:.45rem!important}
  body.vault-wall-page .vw-controls{
    position:absolute!important;
    top:auto!important;bottom:calc(.6rem + env(safe-area-inset-bottom,0px))!important;
    left:.5rem!important;
    width:min(305px,calc(100vw - 5.4rem))!important;
    max-height:60dvh!important;
    gap:.38rem!important;z-index:25!important;
  }
  body.vault-wall-page .vw-controls.is-search-open{
    width:min(410px,calc(100vw - 1rem))!important;
  }
  body.vault-wall-page .vw-accordion-toggle{
    min-height:44px!important;
  }
  body.vault-wall-page .vw-search-contents{
    max-height:calc(60dvh - 130px)!important;
    padding:.55rem!important;
  }
  body.vault-wall-page .vw-search-contents .vw-results{
    min-height:48px!important;max-height:24dvh!important;
    overflow-y:auto!important;touch-action:pan-y!important;
  }
  body.vault-wall-page .vw-evidence{
    gap:.22rem!important;
  }
  body.vault-wall-page .vw-evidence button{
    padding:.37rem .42rem!important;min-height:29px!important;
  }
  body.vault-wall-page .vw-wings-menu{
    max-height:calc(60dvh - 130px)!important;
    overflow:hidden!important;
  }
  body.vault-wall-page .vw-wings-grid{
    max-height:clamp(105px,27dvh,220px)!important;
    overflow-y:auto!important;touch-action:pan-y!important;
  }
  body.vault-wall-page .vw-wings-grid button{
    min-height:43px!important;
  }
  body.vault-wall-page .vw-inspector{
    position:fixed!important;z-index:65!important;
    top:auto!important;bottom:0!important;
    left:0!important;right:0!important;
    width:100%!important;height:auto!important;
    max-height:min(79dvh,710px)!important;
    border-radius:18px 18px 0 0!important;
    border-bottom:0!important;
    padding-bottom:env(safe-area-inset-bottom,0px)!important;
    box-shadow:0 -12px 85px #05030ee8,0 0 0 100vmax #02020b70!important;
    overflow:hidden!important;
  }
  body.vault-wall-page .vw-inspector-head{
    padding:.65rem 1rem!important;min-height:48px!important;
  }
  body.vault-wall-page .vw-inspector-scroll{
    padding:1rem 1.25rem 1.4rem!important;
    touch-action:pan-y!important;overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch;
  }
  body.vault-wall-page .vw-inspector-scroll h2{
    font-size:clamp(1.3rem,5vw,2rem)!important;
  }
  body.vault-wall-page .vw-record-seal{
    width:52px;height:52px;margin:0 auto .6rem;
  }
  body.vault-wall-page .vw-zoom{
    right:.52rem!important;
    bottom:calc(.6rem + env(safe-area-inset-bottom,0px))!important;
    z-index:23!important;
  }
  body.vault-wall-page .vw-zoom button{
    min-width:42px!important;min-height:42px!important;
  }
  body.vault-wall-page .vw-tooltip,
  body.vault-wall-page .vw-bottom-hint{display:none!important}
  body.vault-wall-page .vw-category-label{
    font-size:.54rem!important;letter-spacing:.07em!important;
  }
  body.vault-wall-page .vw-stage.is-fallback{
    touch-action:pan-y!important;overflow:auto!important;
  }
  body.vault-wall-page .vw-fallback{
    grid-template-columns:1fr!important;
    padding:150px .75rem 110px!important;
    touch-action:pan-y!important;overflow:auto!important;
  }
  /* SIMPLIFIED HOME: retain actual gears and drive shafts in a spacious
     mobile serpentine engine instead of substituting a list of cards. */
  body.simple-site.simple-gear-engine .simple-explorer{
    position:relative!important;display:block!important;
    width:100%!important;padding:0!important;margin:0!important;
    overflow:visible!important;background:transparent!important;
  }
  body.simple-site.simple-gear-engine .simple-network{
    position:relative!important;display:block!important;
    width:100%!important;max-width:none!important;
    height:4700px!important;min-height:4700px!important;
    padding:0!important;margin:0!important;
    overflow:hidden!important;
    background:transparent!important;border:0!important;
  }
  body.simple-site.simple-gear-engine #simple-network-node-host{
    position:absolute!important;inset:0!important;
    display:block!important;pointer-events:none!important;
  }
  body.simple-site.simple-gear-engine .simple-node,
  body.simple-site.simple-gear-engine .simple-hub{
    position:absolute!important;inset:auto!important;
    left:var(--mobile-node-x,50%)!important;
    top:var(--mobile-node-y,50%)!important;
    transform:translate(-50%,-50%)!important;
    width:clamp(112px,30vw,144px)!important;
    height:clamp(112px,30vw,144px)!important;
    min-height:0!important;margin:0!important;padding:1rem!important;
    pointer-events:auto!important;
    z-index:4!important;
  }
  body.simple-site.simple-gear-engine .simple-hub{
    width:clamp(150px,38vw,180px)!important;
    height:clamp(150px,38vw,180px)!important;
    z-index:6!important;
  }
  body.simple-site.simple-gear-engine .simple-node .engine-wheel,
  body.simple-site.simple-gear-engine .simple-hub .engine-wheel{
    position:absolute!important;inset:-5%!important;
    top:-5%!important;left:-5%!important;
    width:110%!important;height:110%!important;
    transform:none!important;
  }
  body.simple-site.simple-gear-engine .simple-node-name{
    max-width:96px!important;font-size:clamp(.7rem,3vw,.86rem)!important;
    line-height:1.13!important;
  }
  body.simple-site.simple-gear-engine .simple-hub img{
    max-width:none!important;width:90%!important;height:90%!important;
  }
  body.simple-site.simple-gear-engine .engine-pipes{
    display:block!important;position:absolute!important;
    inset:0!important;width:100%!important;height:100%!important;
    z-index:2!important;pointer-events:none!important;
    opacity:.55!important;
  }
  body.simple-site.simple-gear-engine .engine-pipes .engine-pipe-body{
    stroke-width:2.4!important;opacity:.32!important;
  }
  body.simple-site.simple-gear-engine .engine-pipes .engine-pipe-core.is-powered{
    stroke-width:1.8!important;opacity:.75!important;
  }
  body.simple-site.simple-gear-engine .engine-floating-note{
    position:absolute!important;display:grid!important;z-index:5!important;
    left:var(--mobile-note-x,50%)!important;
    top:var(--mobile-note-y,50%)!important;
    transform:translate(-50%,-50%)!important;
    width:min(164px,43vw)!important;
    padding:.67rem .75rem!important;
    min-height:0!important;pointer-events:none!important;
    background:linear-gradient(135deg,#22162ef0,#0d0b17e8)!important;
    border:1px solid #b59adb59!important;border-radius:7px!important;
    box-shadow:0 8px 24px #0007!important;
  }
  body.simple-site.simple-gear-engine .engine-floating-note strong{
    font-size:clamp(.64rem,2.6vw,.76rem)!important;
  }
  body.simple-site.simple-gear-engine .engine-floating-note p{
    display:block!important;margin:.37rem 0 0!important;
    color:#beaecf!important;
    font-size:clamp(.6rem,2.3vw,.68rem)!important;
    line-height:1.36!important;
  }
  body.simple-site.simple-gear-engine .engine-floating-note::before,
  body.simple-site.simple-gear-engine .engine-note-index{
    display:none!important;
  }
  body.simple-site.simple-gear-engine.dd-mobile-ready .simple-rail{
    position:fixed!important;z-index:91!important;
    top:auto!important;left:0!important;right:0!important;bottom:0!important;
    width:100%!important;max-width:none!important;
    height:auto!important;max-height:min(78dvh,760px)!important;
    padding:3.1rem 1.15rem calc(1.3rem + env(safe-area-inset-bottom,0px))!important;
    margin:0!important;border:1px solid #b59bdf82!important;
    border-bottom:0!important;border-radius:17px 17px 0 0!important;
    overflow-y:auto!important;touch-action:pan-y!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch;
    display:flex!important;flex-direction:column!important;
    gap:1rem!important;
    background:linear-gradient(145deg,#291b3bf9,#120f21fc)!important;
    box-shadow:0 -14px 55px #03020de3!important;
    transform:translateY(105%)!important;
    visibility:hidden!important;pointer-events:none!important;
    transition:transform .23s cubic-bezier(.18,.84,.24,1),visibility .23s!important;
  }
  body.simple-site.simple-gear-engine.dd-mobile-ready.dd-mobile-detail-open .simple-rail{
    transform:translateY(0)!important;visibility:visible!important;
    pointer-events:auto!important;
  }
  body.simple-site.simple-gear-engine .simple-rail .simple-panel,
  body.simple-site.simple-gear-engine .simple-rail .simple-panel-top,
  body.simple-site.simple-gear-engine .simple-rail .simple-panel-bottom{
    display:block!important;width:100%!important;
    border:0!important;background:transparent!important;
    padding:0!important;max-height:none!important;overflow:visible!important;
  }
  body.simple-site.simple-gear-engine .simple-panel-top h2{
    font-size:clamp(1.3rem,5vw,1.85rem)!important;line-height:1.12!important;
  }
  body.simple-site.simple-gear-engine .simple-panel-secondary{
    margin-top:1rem!important;
  }
  body.simple-site.simple-gear-engine .dd-mobile-detail-backdrop{
    position:fixed;inset:0;z-index:90;
    background:#03030bbd;backdrop-filter:blur(3px);
  }
  body.simple-site.simple-gear-engine .dd-mobile-detail-backdrop[hidden]{
    display:none!important;
  }
  body.simple-site.simple-gear-engine .dd-mobile-detail-close{
    position:sticky;top:0;align-self:flex-end;
    float:right;z-index:2;
    width:44px;height:44px;min-height:44px;
    margin:-2.4rem -.5rem .45rem 0!important;
    display:grid;place-items:center;
    border-radius:8px;border:1px solid #bba3d580;
    color:#f7eeff;background:#50366ecb;
    font:800 1.25rem 'DM Sans',sans-serif;
  }
  body.simple-site.simple-gear-engine .dd-mobile-cog-hint{
    position:absolute;z-index:5;top:9px;left:12px;
    width:min(215px,65vw);
    color:#c0a4e4;
    font:700 .59rem/1.4 'IBM Plex Mono',monospace;
    letter-spacing:.075em;pointer-events:none;
  }
  body.simple-site.simple-gear-engine .dd-mobile-spring{
    position:fixed;z-index:40;right:3px;top:calc(50% - 79px);
    width:30px;height:158px;pointer-events:none;
    filter:drop-shadow(0 5px 8px #0009);
  }
  body.simple-site.simple-gear-engine .dd-mobile-spring[hidden]{display:none!important}
  body.simple-site.simple-gear-engine .dd-mobile-spring svg{
    display:block;width:30px;height:158px;overflow:visible;pointer-events:none;
  }
  body.simple-site.simple-gear-engine .dd-mobile-spring-handle{
    position:absolute;left:2px;top:24px;
    width:26px;height:26px;min-height:26px;padding:0;
    border:2px solid #e8e3f0;border-radius:50%;
    background:radial-gradient(circle at 30% 20%,#fff,#aca7b6 55%,#554e62);
    color:#33283c;font-weight:800;cursor:grab;
    pointer-events:auto;touch-action:none;
  }
  body.simple-site.simple-gear-engine .dd-mobile-spring-handle:focus-visible{
    outline:2px solid #dcb4ff;outline-offset:3px;
  }
  body.simple-site.simple-gear-engine .dd-mobile-spring.is-dragging .dd-mobile-spring-handle{
    cursor:grabbing;
  }
  body.simple-site.simple-gear-engine .dd-spring-scroll{
    display:none!important; /* desktop-only large spring */
  }
  body.simple-site.simple-gear-engine .dd-home-about{
    margin-top:-2px!important;
  }
  body.simple-site.simple-gear-engine .simple-intro-reopen.simple-quiet-back{
    top:calc(8px + env(safe-area-inset-top,0px))!important;
    left:8px!important;min-width:42px!important;min-height:42px!important;
    width:42px!important;height:42px!important;
  }
  body.simple-site.simple-gear-engine.dd-mobile-detail-open{
    overflow:hidden!important;
  }
  body.simple-site.simple-gear-engine .dd-home-about-copy{
    padding-inline:clamp(.85rem,4vw,1.5rem)!important;
  }
}
@media (max-width:390px) {
  body.workflow-page:has([data-ddwb-root]) .ddwb-webgl-ready .ddwb-station{
    width:116px!important;
  }
  body.simple-site.simple-gear-engine .engine-floating-note{
    width:143px!important;
  }
}
@media (max-width:760px) and (prefers-reduced-motion:reduce) {
  body.simple-site.simple-gear-engine.dd-mobile-ready .simple-rail{
    transition:none!important;
  }
  body.simple-site.simple-gear-engine .dd-mobile-spring-handle,
  body.workflow-page:has([data-ddwb-root]) .ddwb-station{
    transition:none!important;
  }
}
