/* ==========================================================
   DBG V25 – tablet/mobile polish only
   Desktop (>1180px with fine pointer) intentionally untouched.
   ========================================================== */

/* iPad / touch landscape, including large iPad Pro widths */
@media (min-width:1181px) and (max-width:1366px) and (hover:none) and (pointer:coarse){
  html,body{overflow-x:hidden!important;max-width:100%!important}
  .site-header-v6{grid-template-columns:1fr auto!important;padding-left:28px!important;padding-right:28px!important}
  .site-header-v6 .brand{width:178px!important;max-width:42vw}
  .site-header-v6 .main-nav{display:none!important}
  .site-header-v6 .menu-toggle{display:block!important;position:relative;z-index:10002}
  .header-actions-v6{display:none!important}
  .site-header-v6 .main-nav.open{display:flex!important;position:fixed!important;inset:0!important;z-index:10000!important;background:#0e1115!important;padding:110px 34px 42px!important;overflow-y:auto!important}
  .site-header-v6 .main-nav.open .menu{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:12px!important}
  .site-header-v6 .main-nav.open .menu>li>a{font-size:34px!important;text-transform:none!important;letter-spacing:-.02em!important}
  .mobile-nav-actions-v6{display:flex!important}

  .hero-v6{padding-left:40px!important;padding-right:40px!important}
  .hero-v6-copy{max-width:58%!important;margin-bottom:5vh!important}
  .hero-v6 h1{font-size:clamp(62px,7vw,88px)!important}
  .hero-blueprint-field{right:-8vw!important;width:66vw!important;height:72vh!important;opacity:.62!important}
  .hero-v6-flow{max-width:58%!important}

  .page-hero-v6{grid-template-columns:minmax(350px,44%) minmax(0,1fr)!important;column-gap:44px!important;padding-left:38px!important;padding-right:38px!important}
  .page-hero-v6 .hero-blueprint-field.subpage-floorplan{height:360px!important}
  .page-hero-v6 .page-hero-copy h1{font-size:clamp(52px,5vw,72px)!important}

  .section{padding-left:38px!important;padding-right:38px!important}
  .service-grid-v6{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .portal-grid-v6,.portal-grid-v5{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .home-project-grid,.project-grid-v6,.project-archive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .principles{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .team-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .team-working-grid,.partner-process-v6{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .contact-main-v6,.contact-layout,.form-section{gap:42px!important}

  .compare-concept{grid-template-columns:1fr!important;gap:32px!important}
  .plan-to-build,.compare-real{min-height:480px!important}

  .build21-sticky{grid-template-columns:minmax(300px,.74fr) minmax(0,1.26fr)!important;min-height:640px!important}
  .build21-copy,.build21-stage{min-height:640px!important}
  .build21-copy{padding:54px 34px!important}
  .build21-control{max-width:100%!important}
  .build21-canvas{touch-action:none!important}

  .baupilot{right:22px!important;bottom:22px!important}
  .baupilot-panel{width:min(430px,calc(100vw - 44px))!important;height:min(720px,calc(100dvh - 44px))!important}
}

/* Tablet portrait, smaller tablets, mobile nav */
@media (max-width:1180px){
  html,body{overflow-x:hidden!important;max-width:100%!important}
  *,*:before,*:after{max-width:100%}
  img,svg,video,canvas,iframe{max-width:100%;height:auto}

  .site-header-v6{height:var(--header-h)!important;grid-template-columns:1fr auto!important;padding-left:clamp(20px,4vw,34px)!important;padding-right:clamp(20px,4vw,34px)!important}
  .site-header-v6 .brand{width:176px!important;max-width:54vw!important}
  .site-header-v6 .main-nav{display:none!important}
  .header-actions-v6{display:none!important}
  .site-header-v6 .menu-toggle{display:block!important;position:relative!important;z-index:10002!important}
  .site-header-v6 .main-nav.open{display:flex!important;position:fixed!important;inset:0!important;z-index:10000!important;background:#0e1115!important;padding:calc(var(--header-h) + 42px) clamp(24px,6vw,54px) 42px!important;overflow-y:auto!important;overscroll-behavior:contain}
  .site-header-v6 .main-nav.open .menu{width:100%!important;flex-direction:column!important;align-items:flex-start!important;gap:13px!important}
  .site-header-v6 .main-nav.open .menu>li>a{font-size:clamp(28px,5.2vw,42px)!important;line-height:1.05!important;text-transform:none!important;letter-spacing:-.025em!important}
  .mobile-nav-actions-v6{display:flex!important;width:100%!important;margin-top:auto!important;padding-top:28px!important}

  .hero-v6{overflow:hidden!important;padding-left:clamp(24px,5vw,42px)!important;padding-right:clamp(24px,5vw,42px)!important}
  .hero-v6-copy{max-width:720px!important}
  .hero-blueprint-field{right:-18vw!important;width:92vw!important;height:62vh!important;opacity:.48!important}
  .hero-v6-flow{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:620px!important}

  .section,.team-working,.career-process,.applicant-checklist{padding-left:clamp(24px,5vw,42px)!important;padding-right:clamp(24px,5vw,42px)!important}
  .section-head.split{gap:22px!important}
  .section-note{max-width:58ch!important}

  .page-hero-v6{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:26px!important;padding-left:clamp(24px,5vw,42px)!important;padding-right:clamp(24px,5vw,42px)!important;padding-bottom:54px!important}
  .page-hero-v6 .hero-blueprint-field.subpage-floorplan{position:relative!important;inset:auto!important;transform:none!important;order:1!important;width:100%!important;height:260px!important;margin:0!important;opacity:.86!important}
  .page-hero-v6 .page-hero-copy{order:2!important;width:100%!important;max-width:760px!important;margin:0!important;padding:0!important}
  .page-hero-v6 .page-hero-copy:before{display:none!important}

  .service-grid-v6{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .service-card-v6{min-height:300px!important}
  .portal-grid-v6,.portal-grid-v5{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .portal-card-v6{min-height:285px!important}
  .home-project-grid,.project-grid-v6,.project-archive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:28px 18px!important}
  .team-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .principles{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .team-working-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .team-working-grid article{padding:24px!important;min-height:280px!important}
  .partner-process-v6{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .partner-process-v6 article{padding:24px!important;min-height:245px!important}

  .compare-concept{grid-template-columns:1fr!important;gap:30px!important}
  .compare-real,.plan-to-build{min-height:460px!important}
  .compare-concept-copy{max-width:760px!important}

  .contact-main-v6,.contact-layout,.form-section{grid-template-columns:1fr!important;gap:38px!important;padding-left:clamp(24px,5vw,42px)!important;padding-right:clamp(24px,5vw,42px)!important}
  .contact-direct-v6{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .office-section-v6{grid-template-columns:1fr!important}

  .footer-v6-main{grid-template-columns:1fr 1fr!important;gap:40px 26px!important}
  .footer-v6-brand{grid-column:1/-1!important}

  /* Manual 3D build control: keep it calm and usable on touch */
  .build21{overflow:hidden!important}
  .build21-sticky{grid-template-columns:minmax(280px,.74fr) minmax(0,1.26fr)!important;min-height:620px!important}
  .build21-copy,.build21-stage{min-height:620px!important}
  .build21-copy{padding:50px 28px!important}
  .build21-copy h2{font-size:clamp(48px,7vw,70px)!important}
  .build21-control{max-width:none!important}
  .build21-slider-wrap{height:42px!important}
  .build21-range{height:42px!important;touch-action:none!important}
  .build21-range::-webkit-slider-thumb{width:28px!important;height:28px!important;margin-top:-13px!important}
  .build21-range::-moz-range-thumb{width:28px!important;height:28px!important}
  .build21-canvas{touch-action:none!important}

  /* MIA panel: touch-safe and centered inside viewport */
  .baupilot{right:max(18px,env(safe-area-inset-right))!important;bottom:max(18px,env(safe-area-inset-bottom))!important}
  .baupilot-launcher-copy{display:none!important}
  .baupilot-launcher,.baupilot-launcher:hover,.baupilot-launcher.is-teasing{width:58px!important;min-width:58px!important;transform:none!important}
  .baupilot-panel{right:0!important;bottom:0!important;width:min(430px,calc(100vw - 36px))!important;height:min(720px,calc(100dvh - 36px))!important;max-height:calc(100dvh - 36px)!important}
  .baupilot-messages{overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch}
  .baupilot-composer textarea{font-size:16px!important} /* prevent iOS zoom */
}

/* Phones */
@media (max-width:800px){
  :root{--pad:20px!important;--header-h:70px!important}
  .site-header-v6{padding-left:20px!important;padding-right:18px!important}
  .site-header-v6 .brand{width:158px!important;min-height:46px!important;padding:6px 0!important}
  .site-header-v6 .brand img{max-height:38px!important}

  .hero-v6{min-height:94svh!important;padding:calc(var(--header-h) + 40px) 20px 34px!important;justify-content:flex-end!important}
  .hero-v6-copy{max-width:100%!important;margin:0 0 26px!important}
  .hero-v6 h1{font-size:clamp(48px,13.5vw,68px)!important;max-width:95%!important}
  .hero-v6 .hero-lead{font-size:14px!important;max-width:92%!important}
  .hero-blueprint-field{right:-38vw!important;top:8vh!important;width:145vw!important;height:48vh!important;opacity:.42!important}
  .hero-v6-flow{grid-template-columns:1fr 1fr!important;gap:8px!important;max-width:100%!important}
  .hero-v6-flow>div{padding:10px 8px 0 0!important}

  .section{padding-top:70px!important;padding-bottom:70px!important}
  .section-index{margin-bottom:30px!important}
  .section-head h2,.intro h2,.editorial-main h2{font-size:clamp(38px,10.5vw,54px)!important}

  .page-hero-v6{padding-top:calc(var(--header-h) + 28px)!important;padding-bottom:46px!important;gap:20px!important}
  .page-hero-v6 .hero-blueprint-field.subpage-floorplan{height:205px!important}
  .page-hero-v6 .page-hero-copy h1{font-size:clamp(44px,11.8vw,62px)!important;line-height:.94!important}
  .page-hero-v6 .page-hero-copy p{font-size:13px!important;line-height:1.55!important;max-width:94%!important}
  .page-hero-v6 .blueprint-stamp,.page-hero-v6 .blueprint-coord,.page-hero-v6 .dim-label,.page-hero-v6 .area{display:none!important}

  .intro-v6{gap:26px!important;padding-bottom:70px!important}
  .intro-v6 .profile-logo-only{width:min(270px,72vw)!important}

  .service-grid-v6,.portal-grid-v6,.portal-grid-v5,.home-project-grid,.project-grid-v6,.project-archive-grid,.team-grid,.principles,.team-working-grid,.partner-process-v6{grid-template-columns:1fr!important}
  .service-card-v6{min-height:245px!important;padding:22px!important}
  .service-card-v6 h3{margin-top:24px!important}
  .service-svg{width:58px!important;height:58px!important}
  .portal-card-v6{min-height:245px!important;padding:24px!important}
  .portal-card-v6 h3{margin-top:28px!important}
  .portal-icon-v9{margin-bottom:22px!important}

  .team-working{padding-top:68px!important;padding-bottom:68px!important}
  .team-working-title{grid-template-columns:1fr!important;gap:18px!important;margin-bottom:36px!important}
  .team-working-grid article{min-height:210px!important;padding:22px!important}
  .team-working-grid h3{margin-top:24px!important}
  .partner-process-v6 article{min-height:200px!important;padding:22px!important}
  .partner-process-v6 h3{margin-top:24px!important}

  .compare-real,.plan-to-build{min-height:340px!important}
  .compare-caption{left:12px!important;right:12px!important;bottom:12px!important}
  .compare-concept{padding-bottom:58px!important}

  .contact-direct-v6{grid-template-columns:1fr!important}
  .contact-direct-card{min-height:200px!important;padding:24px!important}
  .contact-direct-card strong{margin-top:28px!important}
  .office-map,.office-map iframe{min-height:300px!important}

  .footer-v6-main{grid-template-columns:1fr!important;gap:30px!important}
  .footer-v6-brand,.footer-v6-main .footer-v6-col:last-child{grid-column:auto!important}
  .footer-v6-bottom{grid-template-columns:1fr!important;gap:10px!important}

  /* Build module on phone: copy first, model second, no horizontal drift */
  .build21-sticky{grid-template-columns:1fr!important;grid-template-rows:auto minmax(390px,52vh)!important;min-height:0!important}
  .build21-copy{min-height:0!important;padding:calc(var(--header-h) + 18px) 20px 24px!important}
  .build21-copy h2{font-size:clamp(44px,12vw,56px)!important;margin:8px 0 10px!important}
  .build21-copy>p{min-height:0!important;font-size:12px!important;max-width:95%!important}
  .build21-control{margin-top:18px!important}
  .build21-slider-head{font-size:7px!important;margin-bottom:7px!important}
  .build21-slider-head strong{font-size:10px!important}
  .build21-ticks{font-size:6px!important}
  .build21-stage{height:52vh!important;min-height:390px!important;overflow:hidden!important}
  .build21-canvas{inset:2% -4% 10%!important;width:108%!important;height:88%!important;touch-action:none!important}
  .build21-fallback{inset:2% -4% 10%!important}
  .build21-caption{right:5%!important;bottom:4%!important}
  .build21-note{left:5%!important;bottom:4%!important;max-width:62%!important}
  .build21-inspect{display:none!important}

  /* MIA becomes a true mobile bottom-sheet */
  .baupilot{right:14px!important;bottom:14px!important}
  .baupilot-launcher,.baupilot-launcher:hover,.baupilot-launcher.is-teasing{width:54px!important;min-width:54px!important;height:54px!important}
  .baupilot-launcher-icon{width:54px!important;height:54px!important;flex-basis:54px!important}
  .baupilot-panel{position:fixed!important;left:10px!important;right:10px!important;bottom:10px!important;top:auto!important;width:auto!important;height:min(78dvh,690px)!important;max-height:calc(100dvh - 20px)!important;border-radius:8px 8px 3px 3px!important;transform:translateY(18px)!important;transform-origin:50% 100%!important}
  .baupilot.is-open .baupilot-panel{transform:none!important}
  .baupilot-head{grid-template-columns:64px 1fr 38px!important;padding:0 12px!important;min-height:68px!important}
  .baupilot-brandmark{width:64px!important;height:32px!important}
  .baupilot-head strong{font-size:12px!important}
  .baupilot-head small{font-size:7px!important;letter-spacing:.08em!important}
  .baupilot-messages{padding:18px 14px 12px!important}
  .baupilot-message{gap:8px!important;margin-bottom:13px!important}
  .baupilot-bubble{font-size:13px!important;line-height:1.55!important}
  .baupilot-message.user{margin-left:30px!important}
  .baupilot-quick{padding:8px 14px 10px!important}
  .baupilot-quick button{padding:9px 10px!important;font-size:8px!important}
  .baupilot-composer{padding:8px 8px 8px 12px!important;grid-template-columns:1fr 46px!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
  .baupilot-composer textarea{font-size:16px!important;min-height:42px!important;padding-top:10px!important}
  .baupilot-composer button{width:44px!important;height:44px!important}
  .baupilot-foot{display:none!important}
}

@media (max-width:520px){
  .hero-v6-flow{display:none!important}
  .hero-v6{min-height:90svh!important}
  .hero-blueprint-field{right:-54vw!important;width:174vw!important;opacity:.38!important}
  .page-hero-v6 .hero-blueprint-field.subpage-floorplan{height:180px!important}
  .compare-real,.plan-to-build{min-height:300px!important}
  .build21-sticky{grid-template-rows:auto minmax(350px,49vh)!important}
  .build21-stage{height:49vh!important;min-height:350px!important}
  .baupilot-panel{left:6px!important;right:6px!important;bottom:6px!important;height:min(82dvh,680px)!important;max-height:calc(100dvh - 12px)!important}
}
