/* DCKS v2.2.0 — mobile toolbar/search layout hotfix. Loaded last to win the cascade. */
@media (max-width:1024px){
  body.is-mobile #mobile-tools-toggle{display:none!important}

  /* Công cụ bản đồ: nút luôn ở góc phải trên; danh sách xổ dọc xuống dưới. */
  body.is-mobile #maptool-wrap{
    position:fixed!important;
    top:max(8px,env(safe-area-inset-top))!important;
    right:8px!important;
    bottom:auto!important;
    left:auto!important;
    z-index:2500!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-end!important;
    gap:5px!important;
    width:42px!important;
    max-width:42px!important;
    margin:0!important;
    transform:none!important;
    pointer-events:none!important;
  }
  body.is-mobile #maptool-wrap #maptool-toggle{
    order:1!important;
    position:static!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    min-height:42px!important;
    flex:0 0 42px!important;
    padding:0!important;
    border-radius:13px!important;
    background:rgba(255,255,255,.95)!important;
    color:#244c77!important;
    border:1px solid #c7d8ec!important;
    box-shadow:0 6px 18px rgba(31,61,102,.18)!important;
    pointer-events:auto!important;
  }
  body.is-mobile.mobile-tools-open #maptool-wrap #maptool-toggle{
    background:#246bfd!important;color:#fff!important;border-color:#246bfd!important
  }
  body.is-mobile #maptool-wrap #maptool-bar{
    order:2!important;
    position:static!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    gap:3px!important;
    width:42px!important;
    max-width:42px!important;
    max-height:calc(100dvh - 145px)!important;
    padding:4px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    border-radius:13px!important;
    background:rgba(255,255,255,.96)!important;
    border:1px solid #c7d8ec!important;
    box-shadow:0 8px 22px rgba(31,61,102,.18)!important;
    pointer-events:auto!important;
  }
  body.is-mobile #maptool-wrap.collapsed #maptool-bar,
  body.is-mobile:not(.mobile-tools-open) #maptool-wrap #maptool-bar{
    max-height:0!important;
    padding-top:0!important;
    padding-bottom:0!important;
    border-width:0!important;
    opacity:0!important;
    overflow:hidden!important;
    pointer-events:none!important;
    transform:translateY(-5px) scale(.96)!important;
  }
  body.is-mobile.mobile-tools-open #maptool-wrap:not(.collapsed) #maptool-bar{
    max-height:calc(100dvh - 145px)!important;
    opacity:1!important;
    pointer-events:auto!important;
    transform:none!important;
  }
  body.is-mobile #maptool-wrap .maptool{
    width:32px!important;height:32px!important;min-width:32px!important;flex:0 0 32px!important;border-radius:9px!important
  }
  body.is-mobile #maptool-wrap .maptool-sep{width:25px!important;height:1px!important;min-height:1px!important;margin:1px 0!important}

  /* Tra cứu: bottom sheet toàn chiều ngang, thấp và gọn. */
  body.is-mobile #gsearch-panel{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:var(--dcks-mobile-nav-h,62px)!important;
    width:100vw!important;
    max-width:none!important;
    height:auto!important;
    max-height:0!important;
    margin:0!important;
    border-radius:16px 16px 0 0!important;
    border-left:0!important;
    border-right:0!important;
    border-bottom:0!important;
    overflow:hidden!important;
    background:#fff!important;
    box-shadow:0 -12px 34px rgba(21,49,88,.24)!important;
    transform:none!important;
    z-index:2400!important;
  }
  body.is-mobile #gsearch-panel.open{
    width:100vw!important;
    max-height:min(46dvh,390px)!important;
  }
  body.is-mobile #gsearch-panel .gsp-inner{
    width:100%!important;
    max-height:min(46dvh,390px)!important;
    padding:0 10px 8px!important;
    overflow-y:auto!important;
    box-sizing:border-box!important;
  }
  body.is-mobile .gsp-head-mobile{padding:8px 2px 6px!important;min-height:36px!important}
  body.is-mobile .gsp-head-mobile b{font-size:13px!important}
  body.is-mobile .gsp-head-mobile small{font-size:8px!important;line-height:1.15!important}
  body.is-mobile .gsp-head-mobile button{width:29px!important;height:29px!important;border-radius:8px!important}
  body.is-mobile .gsp-tabs{display:grid!important;grid-template-columns:1fr 1fr!important;gap:5px!important;margin:4px 0 6px!important;padding:3px!important}
  body.is-mobile .gsp-tabs button{width:100%!important;height:34px!important;min-height:34px!important;padding:4px 7px!important;border-radius:8px!important}
  body.is-mobile .gsp-mode-card .gsp-mode-icon,
  body.is-mobile .gsp-mode-card small{display:none!important}
  body.is-mobile .gsp-input-row{display:flex!important;width:100%!important;padding:3px!important;margin-bottom:5px!important;box-sizing:border-box!important}
  body.is-mobile .gsp-input{flex:1 1 auto!important;min-width:0!important;width:auto!important;height:32px!important;min-height:32px!important;font-size:11px!important}
  body.is-mobile .gsp-input-row .btn{height:32px!important;min-height:32px!important;flex:0 0 auto!important;padding:3px 9px!important}
  body.is-mobile .gsp-place-actions{margin:0 0 4px!important;padding:5px 7px!important;font-size:8.5px!important;line-height:1.25!important}
  body.is-mobile .gsp-source-line{margin:3px 0!important}
  body.is-mobile .gsp-source-badge{font-size:8px!important}
  body.is-mobile .gsp-results{max-height:132px!important;overflow-y:auto!important}
}
@media (max-width:380px){
  body.is-mobile #maptool-wrap{top:max(5px,env(safe-area-inset-top))!important;right:5px!important;width:40px!important;max-width:40px!important}
  body.is-mobile #maptool-wrap #maptool-toggle{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;flex-basis:40px!important}
  body.is-mobile #maptool-wrap #maptool-bar{width:40px!important;max-width:40px!important}
  body.is-mobile #gsearch-panel.open,body.is-mobile #gsearch-panel .gsp-inner{max-height:min(44dvh,360px)!important}
}
