/* Nendaz Landing Page v3 — V14 mobile modal / wizard scroll layer.
   Keeps the existing DN8 routes, questions, state and submission lifecycle unchanged. */
@media (max-width:620px){
  /* Main DN8 modal: fixed viewport shell + one true internal vertical scroll region. */
  #enquiries:not([hidden]){
    position:fixed;
    inset:0;
    display:block;
    padding:0;
    overflow:hidden;
    background:rgba(7,7,9,.86);
  }
  #enquiries>.wrap{
    display:flex;
    width:100%;
    height:100%;
    min-height:0;
    padding:0;
  }
  #lead-wizard.wizard-shell{
    display:flex;
    flex:1 1 auto;
    flex-direction:column;
    width:100%;
    height:100%;
    max-height:100%;
    min-height:0;
    margin:0;
    overflow:hidden;
    border-left:0;
    border-right:0;
  }
  #lead-wizard .wizard-head{
    flex:0 0 auto;
    min-height:0;
    padding:calc(.62rem + var(--dn8-safe-top)) calc(3.25rem + var(--dn8-safe-right)) .58rem calc(.9rem + var(--dn8-safe-left));
  }
  #lead-wizard .wizard-close{
    top:calc(.62rem + var(--dn8-safe-top));
    right:calc(.62rem + var(--dn8-safe-right));
  }
  #lead-wizard .wizard-layout{
    display:grid;
    flex:1 1 auto;
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0,1fr);
    min-height:0;
    overflow:hidden;
  }
  #lead-wizard .wizard-rail{
    min-height:0;
    padding:.35rem calc(.9rem + var(--dn8-safe-right)) .35rem calc(.9rem + var(--dn8-safe-left));
    overflow:hidden;
  }
  #lead-wizard .wizard-main{
    position:relative;
    min-height:0;
    padding:.62rem calc(.9rem + var(--dn8-safe-right)) calc(.75rem + var(--dn8-safe-bottom)) calc(.9rem + var(--dn8-safe-left));
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    touch-action:pan-y;
    scroll-padding-bottom:calc(5.25rem + var(--dn8-safe-bottom));
  }

  /* Property Context V3 stays visible and readable without dominating the viewport. */
  #lead-wizard .property-context-banner{
    display:block;
    margin:0 0 .65rem;
    padding:.62rem .68rem;
    border-radius:9px;
    gap:.55rem;
    line-height:1.3;
  }
  #lead-wizard .property-context-banner__prefix{margin-bottom:.2rem;font-size:.62rem;letter-spacing:.085em}
  #lead-wizard .property-context-banner__label{font-size:1rem;line-height:1.18}
  #lead-wizard .property-context-banner__meta{margin-top:.18rem;font-size:.72rem;line-height:1.3}
  #lead-wizard .property-context-banner__reassurance{margin:.32rem 0 0;font-size:.75rem;line-height:1.32}
  #lead-wizard .property-context-banner__note{margin-top:.48rem}
  #lead-wizard .property-context-banner__note>span{margin-bottom:.2rem;font-size:.68rem}
  #lead-wizard .property-context-banner__note textarea{min-height:60px;padding:.48rem .55rem;font-size:.78rem;line-height:1.35}
  #lead-wizard .property-context-banner__clear{margin-top:.4rem;font-size:.7rem}

  /* Let the scroll container size naturally from the current DN8 stage. */
  #lead-wizard #progressive-lead-form{
    display:flex;
    flex-direction:column;
    height:auto;
    min-height:0;
  }
  #lead-wizard #wizard-stage{
    flex:0 0 auto;
    min-height:0;
    height:auto;
    overflow:visible;
    contain:none;
  }
  #lead-wizard .wizard-card{
    display:flex;
    flex-direction:column;
    height:auto;
    min-height:0;
    overflow:visible;
  }
  #lead-wizard .wizard-fields,
  #lead-wizard .wizard-fields--contact{
    flex:0 0 auto;
    min-height:0;
    overflow:visible;
    justify-content:flex-start;
    align-content:start;
  }
  #lead-wizard .wizard-stage-heading{margin-bottom:.55rem}
  #lead-wizard .wizard-stage-heading h4{font-size:clamp(1.35rem,6.5vw,1.8rem);text-align:left}
  #lead-wizard .wizard-quick-card{
    margin-bottom:.55rem;
    padding:.45rem .55rem;
  }
  #lead-wizard .wizard-quick-card span{
    overflow:visible;
    text-overflow:clip;
    white-space:normal;
  }
  #lead-wizard .choice-carousel{min-height:0;overflow:visible;touch-action:pan-y}
  #lead-wizard .choice-grid{grid-template-columns:1fr;gap:.42rem}
  #lead-wizard .choice-card span{min-height:50px;padding:.55rem .62rem}
  #lead-wizard .location-chips{grid-template-columns:repeat(2,minmax(0,1fr))}
  #lead-wizard .wizard-other-detail{max-height:none;resize:vertical!important}
  #lead-wizard .consent-box.privacy-only{margin-top:1rem}
  #lead-wizard .wizard-success{padding:1.6rem .4rem calc(2rem + var(--dn8-safe-bottom))}

  /* Navigation is a real in-flow sticky footer, never floating on top of an answer. */
  #lead-wizard .wizard-actions{
    position:sticky;
    bottom:calc(-1 * var(--dn8-safe-bottom));
    z-index:40;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:.65rem;
    min-height:58px;
    margin:1rem -.2rem 0;
    padding:.55rem .2rem calc(.55rem + var(--dn8-safe-bottom));
    border-top:1px solid rgba(255,255,255,.12);
    background:linear-gradient(to bottom,rgba(15,15,18,.94),#0f0f12 28%);
  }
  #lead-wizard .wizard-actions .right-actions{display:flex;width:auto!important;margin-left:auto}
  #lead-wizard .wizard-actions .wizard-back,
  #lead-wizard .wizard-actions .wizard-continue{
    position:static!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    width:46px!important;
    height:46px!important;
    min-width:46px!important;
    margin:0!important;
    font-size:1.25rem!important;
  }
  #lead-wizard .wizard-status{
    position:static;
    left:auto;
    bottom:auto;
    transform:none;
    width:auto;
    margin:.7rem 0 0;
  }

  /* Standalone Quick Submission: header/context stay stable; form becomes the scroll region. */
  body.quick-submission-page{height:var(--dn8-mobile-height);min-height:0;overflow:hidden}
  .quick-submission-page .quick-overlay{
    display:flex;
    min-height:0;
    height:var(--dn8-mobile-height);
    max-height:var(--dn8-mobile-height);
    padding:0;
    overflow:hidden;
  }
  .quick-submission-page .quick-modal{
    display:flex;
    width:100%;
    height:100%;
    max-height:100%;
    min-height:0;
    overflow:hidden;
    border-left:0;
    border-right:0;
  }
  .quick-submission-page .quick-header{
    flex:0 0 auto;
    padding-top:calc(.5rem + var(--dn8-safe-top));
    padding-right:calc(.55rem + var(--dn8-safe-right));
    padding-left:calc(.55rem + var(--dn8-safe-left));
  }
  .quick-submission-page .property-context-banner{
    flex:0 0 auto;
    margin:.45rem calc(.65rem + var(--dn8-safe-right)) .3rem calc(.65rem + var(--dn8-safe-left));
    padding:.55rem .62rem;
    border-radius:9px;
  }
  .quick-submission-page .property-context-banner__prefix{font-size:.6rem;margin-bottom:.18rem}
  .quick-submission-page .property-context-banner__label{font-size:.96rem;line-height:1.18}
  .quick-submission-page .property-context-banner__meta{font-size:.7rem;margin-top:.18rem}
  .quick-submission-page .property-context-banner__reassurance{font-size:.72rem;line-height:1.3;margin:.28rem 0 0}
  .quick-submission-page .property-context-banner__clear{font-size:.68rem;margin-top:.35rem}
  .quick-submission-page #quick-submission-form{
    flex:1 1 auto;
    min-height:0;
    height:auto;
    padding:0 calc(3rem + var(--dn8-safe-right)) calc(.8rem + var(--dn8-safe-bottom)) calc(3rem + var(--dn8-safe-left));
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    touch-action:pan-y;
    scroll-padding-bottom:calc(4.5rem + var(--dn8-safe-bottom));
  }
  .quick-submission-page .quick-progress{position:sticky;top:0;z-index:8;background:var(--quick-paper)}
  .quick-submission-page .form-stage{
    display:flex;
    flex:0 0 auto;
    min-height:calc(100% - 36px);
    height:auto;
    justify-content:flex-start;
    padding:.45rem 0 calc(4rem + var(--dn8-safe-bottom));
    overflow:visible;
  }
  .quick-submission-page .quick-upload-grid,
  .quick-submission-page .quick-contact-grid{min-height:0}
  .quick-submission-page .quick-consent{margin-top:1rem}
  .quick-submission-page .owner-review-verification{max-height:none!important;overflow:visible!important}
  .quick-submission-page .quick-success{
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:1.5rem calc(1rem + var(--dn8-safe-right)) calc(2rem + var(--dn8-safe-bottom)) calc(1rem + var(--dn8-safe-left));
  }
  .quick-submission-page .quick-arrow{
    position:fixed;
    top:55%;
    z-index:45;
    width:44px;
    height:44px;
    transform:translateY(-50%);
  }
  .quick-submission-page .quick-back{left:calc(.25rem + var(--dn8-safe-left))}
  .quick-submission-page .quick-next{right:calc(.25rem + var(--dn8-safe-right))}
}

@media (max-width:380px){
  #lead-wizard .wizard-main{
    padding-right:calc(.7rem + var(--dn8-safe-right));
    padding-left:calc(.7rem + var(--dn8-safe-left));
  }
  #lead-wizard .property-context-banner{padding:.55rem .6rem}
  .quick-submission-page #quick-submission-form{
    padding-right:calc(2.75rem + var(--dn8-safe-right));
    padding-left:calc(2.75rem + var(--dn8-safe-left));
  }
}
