/* Only the added composite scene: Home, bill and site chrome use their original styles. */
.pxw-stage{--route-map-space:56px}
.pej-scene.route-main{background:linear-gradient(to top,#fcfdf8 var(--route-map-space),transparent var(--route-map-space))}
.pej-scene .route-stage{position:absolute;inset:0;height:100%;min-height:0;background:transparent}
.pej-scene .route-world{bottom:var(--route-map-space)}
.pej-scene .route-sky{background:none}
.pej-scene .route-tools{height:var(--route-map-space);padding:14px 4% 6px}
.pej-scene .route-map{margin:0 auto;max-width:800px}
/* The road and lower floor belong to the stage, outside both scene masks. */
.pej-integrated .pxw-stage::before{
  content:"";position:absolute;inset:auto 0 0;height:calc(var(--route-map-space) + var(--pej-route-road-height,0px));pointer-events:none;
  background:
    repeating-linear-gradient(90deg,#fcf5dd 0 70px,transparent 70px 170px) var(--pej-road-offset,0px) calc(var(--pej-route-road-height,0px) * .63) / 170px 3px repeat-x,
    linear-gradient(#d9d5c3 0 4px,#b5b3a4 4px 6px,#839694 6px,#8d9c98) top / 100% var(--pej-route-road-height,0px) no-repeat,
    #e9e7dc;
}
.pej-integrated .pej-scene .route-road{background:none;border:0}
.pej-integrated .pej-scene .route-dashes{visibility:hidden}
.pej-integrated .pej-person{bottom:calc(var(--route-map-space) + var(--pej-route-road-height,0px))}

.route-intro h2{font-size:clamp(26px,3.1vw,45px);letter-spacing:-.05em;line-height:1.09;margin:8px 0 10px;font-weight:750;color:#004959}
.route-intro h2 em{font-style:normal;color:#397c78}
.pej-scene.route-main .route-car{z-index:1}
.pej-scene.route-main .route-intro,.pej-scene.route-main .route-card,.pej-scene.route-main .route-travel-copy{z-index:2}
.pej-scene[data-scene=store] .pej-more{margin-top:10px}
@media(max-width:759px){.pxw-stage{--route-map-space:80px}.pej-scene .route-tools{padding:10px 6% 6px}.route-intro h2{font-size:29px}}
@media(min-width:1000px) and (max-height:760px){.route-intro h2{font-size:34px}}
@media(max-width:759px) and (max-height:650px){.route-intro h2{font-size:23px;margin:4px 0}.pej-scene .route-card>.route-eyebrow{display:none}.pej-scene .route-card{top:76px}.pej-scene .route-card h2{font-size:20px}}
@media(min-width:760px) and (max-height:560px){.route-intro h2{font-size:22px;margin:0}.pxw-stage{--route-map-space:42px}.pej-scene .route-tools{padding:8px 4%}.pej-scene .route-card{top:68px}}
@media(max-width:759px) and (max-height:650px){.pxw-companion[data-scene=store] .pej-thought{display:none}}

/* Accessible document flow until the horizontal renderer has measured successfully. */
html:not(.pej-integrated) #px3-film{height:auto}
html:not(.pej-integrated) body.hr-review #px3-film #main-content{height:auto;overflow:visible}
html:not(.pej-integrated) body.hr-review #main-content>section:is(.lumi-hero,.lumi-story,.pxw-journey){
  position:relative;inset:auto;height:auto;visibility:visible
}
html:not(.pej-integrated) body.hr-review #main-content>.lumi-story .lumi-story-sticky{
  height:auto;width:auto;max-height:none;transform:none
}
html:not(.pej-integrated) .pxw-stage{height:auto;min-height:0;overflow:visible}
html:not(.pej-integrated) .pej-scene{position:relative;inset:auto;height:auto;min-height:0;padding:22px 5%;overflow:visible}
html:not(.pej-integrated) .pej-scene .pxw-copy{position:relative;inset:auto;width:auto;max-width:680px}
html:not(.pej-integrated) .pej-scene .route-stage{position:relative;height:auto;overflow:visible}
html:not(.pej-integrated) .pej-scene :is(.route-intro,.route-card){
  position:relative;inset:auto;width:auto;max-width:680px;margin:0 0 16px;visibility:visible
}
html:not(.pej-integrated) :is(.px3-toolbar,.px3-transit,.pxw-companion,.pej-stops,.pej-life,.pej-car,
  .pej-scene-number,.pej-panorama,.pej-wash,.route-world,.route-tools,.route-travel-copy){display:none}

/* Blend scenery at the overlap. Keep copy and controls outside the picture mask. */
.pej-integrated .pej-scene>picture{
  inset:0;
  mask-image:var(--pej-scenery-mask);
}
.pej-integrated .pej-scene.route-main{background:none}
.pej-integrated .pej-scene{
  --pej-scenery-mask:linear-gradient(to right,transparent,#000 var(--pej-edge-in,0px),
    #000 calc(100% - var(--pej-edge-out,0px)),transparent);
}
.pej-integrated .pej-scene.route-main .route-world{mask-image:var(--pej-scenery-mask)}
.pej-integrated .pej-scene.route-main :is(.route-stage,.route-world,.route-sky,.route-strip){
  background:transparent;
}
.pej-integrated .pej-scene>.pxw-copy{
  transform:translateX(var(--pej-card-offset,0px));
  opacity:var(--pej-card-opacity,1);
}
.pej-integrated .pej-scene[data-scene=attivita]>.pxw-copy{
  box-sizing:border-box;
  max-height:94%;
  overflow:auto;
  overflow-wrap:anywhere;
}
@media(min-width:760px){
  .pej-integrated .pej-scene[data-scene=attivita]>.pxw-copy{
    width: min(52%,570px);
    max-height:calc(100% - max(5%,12px) - 10px);
  }
  .pej-integrated .pej-scene[data-scene=attivita]>.pxw-copy h2{
    font-size:clamp(24px,3.15vw,48px);
  }
}
@media(max-height:620px) and (min-width:760px){
  .pej-integrated .pej-scene[data-scene=attivita]>.pxw-copy h2{font-size:clamp(21px,4.9vh,30px)}
}

/* v7: continuous Persone → five seats; protected sections untouched. */
.pej-sample-scenery{position:absolute;inset:0;overflow:hidden;pointer-events:none;visibility:hidden}
html:not(.pej-integrated) :is(.pej-sample-scenery,.pej-departure,.pxw-stage>.route-car){display:none}
.pej-sample-scenery>img{position:absolute;max-width:none;height:auto;mask-image:linear-gradient(to bottom,transparent 32%,#000 54%)}
.pej-integrated .pxw-journey .pej-scene[data-scene=persone]>picture,
.pej-integrated .pxw-journey .route-world{opacity:calc(1 - var(--pej-sample-opacity,0))}
.pej-integrated .pxw-stage>.route-car{z-index:4;pointer-events:none}
.pej-integrated .pej-departure{position:absolute;z-index:5;pointer-events:none;max-width:none;height:auto;visibility:hidden}
.pej-integrated .pxw-journey[data-sample-board=true] .pej-scene[data-scene=persone]>picture{mask-image:var(--pej-scenery-mask);overflow:hidden}
.pej-integrated .pxw-journey[data-sample-board=true] .route-world{
 mask-image:linear-gradient(to right,transparent,#000 var(--pej-edge-in,0px)),linear-gradient(to bottom,transparent 30%,#000 58%);mask-composite:add;
}
.pej-integrated .pxw-stage>.route-intro{z-index:6;pointer-events:none;visibility:hidden}
.pej-integrated .pxw-journey[data-sample=true] .pxw-stage>.route-intro{
 top:clamp(14px,3vh,30px);left:4%;width:min(360px,43%);max-width:none;padding:16px 20px;
 border-radius:7px 22px 7px 22px;background:#fcfdf8ed;box-sizing:border-box;
}
.pej-integrated .pxw-journey[data-sample=true] .route-intro h2{font-size:clamp(23px,2.8vw,34px)}
@media(max-width:759px){.pej-integrated .pxw-journey[data-sample=true] .pxw-stage>.route-intro{left:5%;width:90%;top:12px;padding:12px 16px}}
.pej-integrated .pxw-journey[data-sample-board=true] .pej-scene[data-scene=persone] .pej-panorama{mask-image:linear-gradient(180deg,transparent,#000 26%)}
.pej-integrated .pxw-journey[data-sample=true] .pej-lumi-body{animation:none}
.pej-integrated .pxw-journey[data-sample=true] .pej-thought{display:none}
@media(min-width:760px){
 .pej-integrated .pxw-journey[data-sample=true] .pej-scene[data-scene=persone]>.pxw-copy{width:min(40%,400px);padding:18px 22px}
 .pej-integrated .pxw-journey[data-sample=true] .pej-scene[data-scene=persone]>.pxw-copy h2{font-size:clamp(25px,2.6vw,34px);margin-bottom:14px}
}
.pej-integrated .route-stage[data-sample=true] :is(.route-card,.route-intro){
 top:clamp(14px,3vh,30px);left:4%;width:min(360px,43%);max-width:none;
 padding:18px 22px;border-radius:7px 22px 7px 22px;background:#fcfdf8ed;box-sizing:border-box;
}
.pej-integrated .route-stage[data-sample=true] .route-card h2{font-size:clamp(22px,2.5vw,32px);line-height:1.12;margin:6px 0 10px}
.pej-integrated .route-stage[data-sample=true] .route-card p{font-size:14px;margin:0 0 14px}
.pej-integrated .route-stage[data-sample=true] .route-travel-copy{top:24px;background:#fcfdf8e6;font-size:14px}
@media(max-width:759px){
 .pej-integrated .route-stage[data-sample=true] :is(.route-card,.route-intro){left:5%;width:90%;top:12px;padding:13px 16px}
 .pej-integrated .route-stage[data-sample=true] .route-card h2{font-size:24px;margin:4px 0 7px}
 .pej-integrated .route-stage[data-sample=true] .route-card p{font-size:13px;margin-bottom:10px}
}
@media(max-width:759px) and (max-height:650px){
 .pej-integrated .route-stage[data-sample=true] :is(.route-card,.route-intro){top:10px;padding:10px 14px}
 .pej-integrated .route-stage[data-sample=true] .route-card h2{font-size:21px;margin:0 0 5px}
 .pej-integrated .route-stage[data-sample=true] .route-card p{font-size:12px;margin-bottom:8px}
}

/* Short foreground transition, with no competing passerby. */
.pej-integrated .pxw-journey[data-sample=true] .pej-person{visibility:hidden}
.pej-integrated .route-map a{padding:5px 8px;border-radius:4px 12px 4px 12px;transition:background-color .18s,color .18s}
.pej-integrated .route-map a[aria-current=location]{background:#004959;color:#fcfdf8}
.pej-integrated .route-map a[aria-current=location] i{background:#aec35b;border-color:#aec35b}
.pej-integrated .route-map a:focus-visible{outline:2px solid #004959;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.pej-integrated .route-map a{transition:none}}

.pej-integrated .pxw-journey[data-quiet=true] .route-map a{transition:none}


/* Full local neighbourhoods, with one road and one car throughout the journey. */
.pe-territori{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:1;visibility:hidden}
.pe-territori>img{position:absolute;left:0;max-width:none;height:auto;mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent),linear-gradient(180deg,transparent,#000 24%);mask-composite:intersect}
.pej-integrated .pej-scene{z-index:2}
.pej-integrated .pxw-stage{background:linear-gradient(#c7eeeb 0%,#e3f0ec 70%,#ebe1c9 90%)}
.pej-integrated .pxw-stage>.route-car{z-index:4}
.pe-window-question{position:absolute;z-index:3;width:90px;aspect-ratio:1.3;pointer-events:none;visibility:hidden}
.pe-window-question>img:first-child{width:100%;height:100%;object-fit:contain}
.pe-window-bill{position:absolute;left:30%;top:12%;width:40%;height:58%;object-fit:contain}
.pe-window-question>span{position:absolute;left:39%;top:4%;font-size:34px;color:#004959;font-weight:700}
.pe-window-question[data-kind=bill]>span,.pe-window-question[data-kind=question]>.pe-window-bill{display:none}
html:not(.pej-integrated) :is(.pe-territori,.pe-window-question){display:none}
@media(max-width:759px){.pe-window-question{width:68px}.pe-window-question>span{font-size:27px}}
@media(prefers-reduced-motion:no-preference){
 .pxw-journey[data-active=true][data-quiet=false] .pe-window-question>img:first-child{animation:pe-window-breathe 5s ease-in-out infinite}
 @keyframes pe-window-breathe{50%{transform:translateY(-2px)}}
}

.pe-territori>.pe-territory-screen{mask-image:none;z-index:1}
/* Feather only the two clouds cut by the original image top; preserve the tall roof. */
.pe-territori>img[data-sede=marina-di-carrara]{mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent),radial-gradient(ellipse 6% 8% at 8% 0%,transparent 65%,#000 100%),radial-gradient(ellipse 8% 9% at 60% 0%,transparent 65%,#000 100%);mask-composite:intersect}
.pe-territory-explore{position:absolute;left:4%;z-index:6;border:1px solid #277c80;background:#fcfdf8f5;color:#004959;border-radius:18px;padding:8px 13px;font-family:inherit;font-size:12px;font-weight:600;line-height:1.3;cursor:pointer}
.pe-territory-explore[hidden]{display:none}
.pe-territory-dialog{margin:auto;inset:0;width:min(1180px,94vw);max-height:90dvh;box-sizing:border-box;border:0;border-radius:12px 30px;background:#fcfdf8;color:#004959;padding:20px;overflow:auto}
.pe-territory-dialog::backdrop{background:#003d49c7}
.pe-territory-dialog header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:16px}
.pe-territory-dialog h2{margin:0;font-size:clamp(22px,4vw,32px)}
.pe-territory-dialog button{border:1px solid #004959;background:#fff;color:#004959;border-radius:18px;padding:9px 14px;cursor:pointer}
.pe-territory-dialog img{display:block;width:100%;height:auto;border-radius:8px}
.pe-territory-dialog p{font-size:14px;line-height:1.5}
.pe-territory-dialog a{display:inline-block;padding:12px 0;font-weight:700;color:#004959}
.pe-panorama-view{overflow-x:auto;margin-top:14px;overscroll-behavior-x:contain}
.pe-territory-dialog.is-zoomed img{width:max(100%,1100px);max-width:none}

/* 6 November: original service choices, limited to the added journey cards. */
.pej-practice-choices{display:grid;gap:8px;margin:12px 0 16px}
.pej-practice-choices a{display:block;padding:8px 11px;border:1px solid #397c7833;border-radius:5px 14px 5px 14px;color:#004959;text-decoration:none;background:#fcfdf8aa}
.pej-practice-choices strong{display:block;font-size:15px;line-height:1.25}
.pej-practice-choices small{display:block;font-size:13px;line-height:1.4;margin-top:3px;color:#385d62}
.pej-practice-choices a:hover{background:#eef5dc}
.pej-practice-choices a:focus-visible{outline:2px solid #004959;outline-offset:3px}
.pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy{box-sizing:border-box;max-height:none;overflow:visible}
.pej-integrated .pej-scene[data-scene=persone]>.pxw-copy p{font-size:clamp(14px,1.35vw,18px);line-height:1.45}
@media(max-width:759px){.pej-practice-choices{gap:5px;margin:9px 0 12px}.pej-practice-choices a{padding:6px 9px}.pej-practice-choices strong{font-size:14px}.pej-practice-choices small{font-size:12px}.pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy h2{font-size:clamp(23px,6.5vw,32px)}}


/* Compact service overview: three intact choices, no nested scroll surface. */
@media(max-height:650px){
 .pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy{top:10px;left:4%;width:92%;max-width:760px;padding:12px 14px}
 .pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy .pxw-kicker{font-size:10px;margin-bottom:6px}
 .pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy h2{font-size:clamp(21px,3.2vw,25px);line-height:1.12;margin:0 0 8px}
 .pej-integrated .pej-scene[data-scene=pratiche] .pej-practice-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0 0 10px}
 .pej-integrated .pej-scene[data-scene=pratiche] .pej-practice-choices a{padding:8px;min-width:0}
 .pej-integrated .pej-scene[data-scene=pratiche] .pej-practice-choices strong{font-size:13px;line-height:1.2}
 .pej-integrated .pej-scene[data-scene=pratiche] .pej-practice-choices small{font-size:12px;line-height:1.35;margin-top:5px}
 .pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy .pxw-cta{box-sizing:border-box;min-height:40px;padding:9px 13px;font-size:13px}
 .pej-integrated .pej-scene[data-scene=pratiche]>.pxw-copy>.pej-more{display:inline-block;margin:6px 0 0 12px;font-size:12px}
}

/* Low landscape: distribute full text across width, preserving the road below. */
@media(min-width:760px) and (max-height:480px){
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy{top:8px;left:4%;width:90%;max-width:760px;padding:10px 14px;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:5px 22px;align-items:start;max-height:none;overflow:visible}
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy>.pxw-kicker{grid-column:1/-1;margin:0;font-size:10px}
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy>h2{grid-column:1;grid-row:2;font-size:24px;line-height:1.12;margin:0}
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy>p{grid-column:2;grid-row:2;font-size:13px;line-height:1.4;margin:0;max-width:none}
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy>.pxw-cta{grid-column:1;grid-row:3;justify-self:start;min-height:38px;box-sizing:border-box;padding:9px 13px;font-size:12px}
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy>.pej-more{grid-column:2;margin:0;font-size:12px;line-height:1.4;padding:3px 0}
 .pej-integrated .pxw-journey[data-sample] .pej-scene:is([data-scene=persone],[data-scene=store])>.pxw-copy>a.pej-more:nth-of-type(2){grid-row:3}
 .pej-integrated .pxw-journey[data-sample] .pej-scene[data-scene=store]>.pxw-copy>a.pej-more:nth-of-type(3){grid-row:4}
 .pej-integrated .pxw-journey[data-sample] .pej-scene[data-scene=store]>.pxw-copy>a.pej-more:nth-of-type(4){grid-row:5}
 .pej-integrated .pxw-journey[data-sample] .pej-scene[data-scene=store]>.pxw-copy>.pej-open-reader{grid-column:1;grid-row:4/6;align-self:start;text-align:left}
}
