/* 화면이 옆으로 밀리지 않게 — 슬라이드의 다음 장·행의 음수 여백이 문서 폭을 넓히지 못하게 자른다(폰·태블릿·PC 공통) */
html,body{overflow-x:clip !important;}

/* 폰 — 한글이 낱말 중간에서 끊기지 않게. 화면보다 긴 낱말(주소·영문)만 넘칠 때 끊는다 */
@media (max-width:768px){
  body,body *{word-break:keep-all !important;overflow-wrap:break-word !important;}
}

/* 폰 — 오른쪽에 떠 있던 바로가기 묶음을 하단 바 바로 위 한 줄로 눕힌다(본문 글자를 덮지 않게). 칸·문구·링크는 그대로 */
@media (max-width:768px){
  .m-rect-float{
    top:auto !important;bottom:var(--clone-bar-h,96px) !important;left:0 !important;right:0 !important;
    transform:none !important;flex-direction:row !important;align-items:stretch !important;justify-content:flex-end;
    gap:4px !important;padding:4px 6px !important;box-sizing:border-box;
    background:#fff;border-top:1px solid #E5E8EB;box-shadow:0 -2px 10px rgba(0,0,0,.06);
  }
  .m-rect-float .m-rect-title{flex:0 0 auto;display:flex;align-items:center;padding:4px 8px !important;border-radius:6px !important;}
  .m-rect-float .m-rect-btn{flex:1 1 0;min-width:0 !important;padding:5px 2px !important;border-radius:6px !important;}
  .m-rect-float #mobile_consult_trigger{
    align-self:stretch !important;flex:0 0 40px !important;
    width:40px !important;min-width:40px !important;max-width:40px !important;height:auto !important;min-height:28px;
    margin:0 !important;border-radius:6px !important;
  }
  .m-rect-float #mobile_consult_trigger img{
    width:40px !important;min-width:40px !important;max-width:40px !important;height:100% !important;max-height:40px;
    margin:0 auto;border-radius:6px !important;object-fit:contain !important;
  }
}

/* 폰 — 글자를 입력하는 동안에는 하단 바·바로가기 줄을 접는다(자판이 올라온 좁은 화면에서 입력 칸을 가리지 않게). 입력이 끝나면 돌아온다 */
@media (max-width:768px){
  html.clone-typing .bottom-bar,
  html.clone-typing .m-rect-float,
  html.clone-typing #mobile_consult_trigger{display:none !important;}
  /* 빠른 상담 창·예약 달력이 열려 있는 동안에도 같다 — 창 아래쪽 칸과 버튼을 가리지 않게. 닫으면 돌아온다 */
  body.mobile-consult-lock .bottom-bar,
  body.mobile-consult-lock .m-rect-float,
  body:has(.bootstrap-datetimepicker-widget) .bottom-bar,
  body:has(.bootstrap-datetimepicker-widget) .m-rect-float{display:none !important;}
  html:not(.clone-guard-js):has(input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=hidden]):not([type=file]):focus,textarea:focus) .bottom-bar,
  html:not(.clone-guard-js):has(input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=hidden]):not([type=file]):focus,textarea:focus) .m-rect-float{display:none !important;}
}

/* 폰 — 옆으로 미는 메뉴줄의 오른쪽 끝을 흐리게 해 이어지는 칸이 더 있음을 보인다(끝까지 밀면 걷힌다) */
@media (max-width:768px){
  html.clone-guard-js ._mobile_navigation_menu.clone-more{
    -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);
    mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);
  }
}
