/* MISTER FAST LiveMapChat WEB V3.3.0.5 — Independent Drag Bar + Visible Controls
   Scope: /modules/livemapchat_web/ only. /modules/livemapchat/ MINI remains untouched. */
@media (min-width:901px){
  body.mf-desktop-shell-body .mf514-grid,
  body.mf-desktop-shell-body .mf514-window.is-expanded .mf514-grid,
  body.mf-desktop-shell-body .mf514-window.is-map-fullscreen .mf514-grid{
    grid-template-columns:240px minmax(0,1fr)!important;
    grid-template-areas:"sidebar map"!important;
  }
  body.mf-desktop-shell-body .mf59-edge-handle{display:none!important}

  body.mf-desktop-shell-body .mf514-chat-pane{
    position:fixed!important;
    inset:auto 18px 18px auto!important;
    width:390px!important;
    min-width:330px!important;
    max-width:calc(100vw - 36px)!important;
    height:min(570px,calc(100vh - 36px))!important;
    min-height:300px!important;
    max-height:calc(100vh - 36px)!important;
    z-index:9990!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    margin:0!important;
    border:1px solid #c9d9ee!important;
    border-radius:18px!important;
    background:#fff!important;
    box-shadow:0 18px 54px rgba(0,43,105,.22),0 4px 14px rgba(0,43,105,.12)!important;
    transform:none!important;
  }

  .mf3305-chat-dragbar{
    order:-1000!important;
    flex:0 0 40px!important;
    min-height:40px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    padding:4px 6px 4px 8px!important;
    background:linear-gradient(135deg,#003da5,#075bc7)!important;
    border-bottom:3px solid #ffc400!important;
    color:#fff!important;
    position:relative!important;
    z-index:2147483000!important;
  }

  .mf3305-chat-dragzone{
    min-width:0!important;
    flex:1 1 auto!important;
    height:32px!important;
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    padding:2px 7px!important;
    border-radius:9px!important;
    cursor:grab!important;
    user-select:none!important;
    touch-action:none!important;
  }
  .mf3305-chat-dragzone:hover{background:rgba(255,255,255,.12)!important}
  .mf3305-chat-dragzone:active{cursor:grabbing!important;background:rgba(255,255,255,.19)!important}
  .mf3305-grip{font-size:20px!important;line-height:1!important;opacity:.92!important;pointer-events:none!important}
  .mf3305-chat-dragzone span:last-child{display:flex!important;flex-direction:column!important;min-width:0!important;pointer-events:none!important}
  .mf3305-chat-dragzone strong{font-size:14px!important;line-height:15px!important;color:#fff!important;white-space:nowrap!important}
  .mf3305-chat-dragzone small{font-size:9px!important;line-height:10px!important;color:#fff!important;opacity:.78!important;white-space:nowrap!important}

  .mf3305-chat-controls{display:flex!important;align-items:center!important;gap:4px!important;flex:0 0 auto!important}
  .mf3305-chat-controls button{
    width:30px!important;height:30px!important;min-width:30px!important;
    display:grid!important;place-items:center!important;
    padding:0!important;margin:0!important;
    border:1px solid rgba(255,255,255,.52)!important;
    border-radius:9px!important;
    background:rgba(255,255,255,.13)!important;
    color:#fff!important;
    font:700 16px/1 Arial,sans-serif!important;
    cursor:pointer!important;
  }
  .mf3305-chat-controls button:hover{background:rgba(255,255,255,.28)!important}

  /* Keep original MF Chat header intact below the new drag bar. */
  body.mf-desktop-shell-body .mf514-chat-head{
    cursor:default!important;
    touch-action:auto!important;
    flex:0 0 auto!important;
  }
  body.mf-desktop-shell-body .mf514-chat-head::before,
  body.mf-desktop-shell-body .mf514-chat-head::after{content:none!important;display:none!important}

  body.mf-desktop-shell-body .mf514-chat-pane.is-dragging{
    transition:none!important;
    will-change:left,top!important;
    box-shadow:0 24px 66px rgba(0,43,105,.30),0 5px 18px rgba(0,43,105,.18)!important;
  }
  html.mf3305-chat-drag-active,
  html.mf3305-chat-drag-active body,
  html.mf3305-chat-drag-active *{cursor:grabbing!important;user-select:none!important}

  body.mf-desktop-shell-body .mf514-chat-pane.is-minimized{
    width:300px!important;
    min-width:260px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
  }
  body.mf-desktop-shell-body .mf514-chat-pane.is-minimized > :not(.mf3305-chat-dragbar){display:none!important}
  body.mf-desktop-shell-body .mf514-chat-pane.is-closed{display:none!important}

  .mf3305-chat-launcher{
    position:fixed!important;
    right:20px!important;
    bottom:20px!important;
    z-index:9992!important;
    min-width:64px!important;
    height:58px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    padding:0 13px!important;
    border:3px solid #fff!important;
    border-radius:30px!important;
    background:#003da5!important;
    color:#fff!important;
    box-shadow:0 12px 34px rgba(0,43,105,.28)!important;
    cursor:pointer!important;
  }
  .mf3305-chat-launcher span{font-size:24px!important}
  .mf3305-chat-launcher b{font-size:11px!important;white-space:nowrap!important}
  .mf3305-chat-launcher[hidden]{display:none!important}

  /* WEB page scroll recovery: MyDriver List remains accessible below Map. */
  html:has(body.mf-desktop-shell-body),body.mf-desktop-shell-body{
    height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;
  }
  body.mf-desktop-shell-body .mf514-window,
  body.mf-desktop-shell-body .mf514-grid,
  body.mf-desktop-shell-body .mf514-main,
  body.mf-desktop-shell-body .mf514-map-pane{max-height:none!important;overflow:visible!important}
  body.mf-desktop-shell-body .mf514-window{height:auto!important;min-height:calc(100vh - 70px)!important}
  body.mf-desktop-shell-body .mf514-grid{height:auto!important;min-height:calc(100vh - 70px)!important;align-items:start!important}
  body.mf-desktop-shell-body .mf514-main,body.mf-desktop-shell-body main.mf514-main{height:auto!important;min-height:calc(100vh - 70px)!important}
  body.mf-desktop-shell-body .mf328-mydriver{position:relative!important;display:block!important;height:auto!important;min-height:260px!important;max-height:none!important;overflow:visible!important}
  body.mf-desktop-shell-body .mf328-table-wrap,body.mf-desktop-shell-body .mf328-list{max-height:none!important;overflow-y:visible!important}
  body.mf-desktop-shell-body .mf328-table-wrap{overflow-x:auto!important}
}

@media (max-width:900px){
  .mf3305-chat-dragbar,.mf3305-chat-launcher{display:none!important}
}
