/*
 * MISTER FAST LiveMapChat WEB — Theme V1.3 Floating Chat Enterprise
 * Visual layer only. Does not modify floating controller, open/close, drag,
 * dock, resize, chat API, room logic, driver feed, map, login or session.
 */

@media (min-width:901px){
  body.mf-workspace-theme-v1 .mf514-chat-pane{
    --mf-chat-blue:#003DA5;
    --mf-chat-blue-deep:#002B75;
    --mf-chat-yellow:#FFC400;
    --mf-chat-surface:#FFFFFF;
    --mf-chat-soft:#F4F7FB;
    --mf-chat-line:#DCE6F1;
    --mf-chat-text:#17345C;
    --mf-chat-muted:#68809B;
    border:1px solid rgba(0,61,165,.22)!important;
    border-radius:18px!important;
    background:var(--mf-chat-surface)!important;
    box-shadow:0 22px 55px rgba(0,43,117,.24),0 4px 14px rgba(0,43,117,.10)!important;
    color:var(--mf-chat-text)!important;
    overflow:hidden!important;
  }

  /* Dedicated drag bar: appearance only; hit areas remain controlled by V3.3.0.6.3 */
  body.mf-workspace-theme-v1 .mf3305-chat-dragbar{
    min-height:50px!important;
    padding:0 8px 0 13px!important;
    border:0!important;
    border-bottom:3px solid var(--mf-chat-yellow)!important;
    background:linear-gradient(100deg,var(--mf-chat-blue-deep),var(--mf-chat-blue) 58%,#0A5DD0)!important;
    color:#fff!important;
    box-shadow:0 2px 0 rgba(255,255,255,.08) inset!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-dragzone{
    min-width:0!important;
    gap:9px!important;
    color:#fff!important;
  }
  body.mf-workspace-theme-v1 .mf3305-grip{
    display:grid!important;
    place-items:center!important;
    width:23px!important;
    height:32px!important;
    color:rgba(255,255,255,.92)!important;
    font-size:21px!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-dragzone strong{
    display:block!important;
    color:#fff!important;
    font-size:16px!important;
    font-weight:900!important;
    line-height:1.05!important;
    letter-spacing:.1px!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-dragzone small{
    display:block!important;
    margin-top:2px!important;
    color:rgba(255,255,255,.76)!important;
    font-size:9px!important;
    font-weight:700!important;
    line-height:1!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-controls{
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-controls button{
    width:34px!important;
    height:34px!important;
    padding:0!important;
    border:1px solid rgba(255,255,255,.48)!important;
    border-radius:10px!important;
    background:rgba(255,255,255,.10)!important;
    color:#fff!important;
    font-size:16px!important;
    font-weight:900!important;
    box-shadow:none!important;
    transition:background .15s ease,border-color .15s ease,color .15s ease!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-controls button:hover,
  body.mf-workspace-theme-v1 .mf3305-chat-controls button:focus-visible,
  body.mf-workspace-theme-v1 .mf3305-chat-controls button.is-active{
    border-color:var(--mf-chat-yellow)!important;
    background:var(--mf-chat-yellow)!important;
    color:var(--mf-chat-blue-deep)!important;
  }

  /* Header and current-room identity */
  body.mf-workspace-theme-v1 .mf514-chat-head{
    min-height:8px!important;
    padding:0!important;
    border:0!important;
    background:#fff!important;
  }
  body.mf-workspace-theme-v1 .mf514-chat-head-actions{
    min-height:0!important;
    padding:0!important;
  }
  body.mf-workspace-theme-v1 .mf514-chat-head-actions > em{
    display:none!important;
  }
  body.mf-workspace-theme-v1 .mf601-context{
    margin:0!important;
    padding:13px 15px 11px!important;
    border:0!important;
    border-bottom:1px solid var(--mf-chat-line)!important;
    background:#fff!important;
  }
  body.mf-workspace-theme-v1 .mf601-context-icon{
    display:grid!important;
    place-items:center!important;
    width:42px!important;
    height:42px!important;
    border:2px solid var(--mf-chat-yellow)!important;
    border-radius:14px!important;
    background:#FFF9DE!important;
    color:var(--mf-chat-blue-deep)!important;
    font-size:15px!important;
    font-weight:900!important;
  }
  body.mf-workspace-theme-v1 .mf601-context-main small,
  body.mf-workspace-theme-v1 .mf601-context-main em{
    color:var(--mf-chat-muted)!important;
  }
  body.mf-workspace-theme-v1 .mf601-context-main b{
    color:var(--mf-chat-blue-deep)!important;
    font-size:16px!important;
    font-weight:900!important;
  }
  body.mf-workspace-theme-v1 .mf601-member-button{
    min-width:58px!important;
    border:1px solid var(--mf-chat-line)!important;
    border-radius:13px!important;
    background:var(--mf-chat-soft)!important;
    color:var(--mf-chat-blue)!important;
  }
  body.mf-workspace-theme-v1 .mf601-member-button:hover{
    border-color:rgba(0,61,165,.32)!important;
    background:#EAF2FF!important;
  }

  /* Conversation modes */
  body.mf-workspace-theme-v1 .mf602-modes{
    gap:6px!important;
    padding:8px!important;
    border:0!important;
    border-bottom:1px solid var(--mf-chat-line)!important;
    background:#fff!important;
  }
  body.mf-workspace-theme-v1 .mf602-mode{
    min-height:62px!important;
    padding:8px 5px!important;
    border:1px solid transparent!important;
    border-radius:13px!important;
    background:var(--mf-chat-soft)!important;
    color:#536E8C!important;
  }
  body.mf-workspace-theme-v1 .mf602-mode span{
    font-size:15px!important;
  }
  body.mf-workspace-theme-v1 .mf602-mode b{
    color:inherit!important;
    font-size:11px!important;
    font-weight:800!important;
    white-space:nowrap!important;
  }
  body.mf-workspace-theme-v1 .mf602-mode.is-active{
    border-color:#C8DCF7!important;
    background:#EAF3FF!important;
    color:var(--mf-chat-blue)!important;
    box-shadow:inset 0 -3px 0 var(--mf-chat-blue)!important;
  }
  body.mf-workspace-theme-v1 .mf615-mode-count{
    min-width:18px!important;
    height:18px!important;
    padding:0 5px!important;
    border-radius:999px!important;
    background:var(--mf-chat-yellow)!important;
    color:var(--mf-chat-blue-deep)!important;
    font-size:10px!important;
    font-weight:900!important;
  }

  /* Messages */
  body.mf-workspace-theme-v1 .mf514-messages{
    padding:12px 13px 16px!important;
    background:#F5F8FC!important;
    scrollbar-color:#AFC0D2 transparent!important;
    scrollbar-width:thin!important;
  }
  body.mf-workspace-theme-v1 .mf514-empty{
    color:var(--mf-chat-muted)!important;
  }
  body.mf-workspace-theme-v1 .mf514-message{
    gap:8px!important;
    margin:0 0 11px!important;
  }
  body.mf-workspace-theme-v1 .mf514-message-avatar{
    display:grid!important;
    place-items:center!important;
    width:34px!important;
    height:34px!important;
    flex:0 0 34px!important;
    border:1px solid #C9D8E8!important;
    border-radius:50%!important;
    background:#fff!important;
    color:var(--mf-chat-blue)!important;
    font-size:12px!important;
    font-weight:900!important;
  }
  body.mf-workspace-theme-v1 .mf514-message > div{
    max-width:78%!important;
    padding:10px 12px!important;
    border:1px solid #D9E4EF!important;
    border-radius:15px 15px 15px 5px!important;
    background:#fff!important;
    color:var(--mf-chat-text)!important;
    box-shadow:0 3px 10px rgba(28,67,104,.06)!important;
  }
  body.mf-workspace-theme-v1 .mf514-message > div > b{
    color:var(--mf-chat-blue-deep)!important;
    font-weight:900!important;
  }
  body.mf-workspace-theme-v1 .mf514-message > div > b em,
  body.mf-workspace-theme-v1 .mf514-message > div > small{
    color:var(--mf-chat-muted)!important;
  }
  body.mf-workspace-theme-v1 .mf514-message.is-mine{
    justify-content:flex-end!important;
  }
  body.mf-workspace-theme-v1 .mf514-message.is-mine .mf514-message-avatar{
    order:2!important;
    border-color:#B7CCEA!important;
    background:#EEF5FF!important;
  }
  body.mf-workspace-theme-v1 .mf514-message.is-mine > div{
    order:1!important;
    border-color:#BED4F2!important;
    border-radius:15px 15px 5px 15px!important;
    background:#EAF3FF!important;
  }

  /* Send target and composer */
  body.mf-workspace-theme-v1 .mf601-send-target{
    min-height:26px!important;
    padding:4px 13px!important;
    border-top:1px solid var(--mf-chat-line)!important;
    background:#fff!important;
    color:var(--mf-chat-muted)!important;
    font-size:10px!important;
  }
  body.mf-workspace-theme-v1 .mf601-send-target b{
    color:var(--mf-chat-blue)!important;
  }
  body.mf-workspace-theme-v1 .mf514-composer{
    gap:6px!important;
    padding:9px 10px 10px!important;
    border-top:1px solid var(--mf-chat-line)!important;
    background:#fff!important;
    box-shadow:0 -8px 20px rgba(0,43,117,.04)!important;
  }
  body.mf-workspace-theme-v1 .mf514-composer > button:not(.mf514-send){
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    padding:0!important;
    border:1px solid #D5E1ED!important;
    border-radius:10px!important;
    background:#F8FAFD!important;
    color:var(--mf-chat-blue)!important;
    box-shadow:none!important;
  }
  body.mf-workspace-theme-v1 .mf514-composer > button:not(.mf514-send):hover{
    border-color:#B8CCE2!important;
    background:#EEF5FF!important;
  }
  body.mf-workspace-theme-v1 .mf514-composer input[name="message"]{
    min-width:0!important;
    min-height:38px!important;
    padding:0 13px!important;
    border:1px solid #CAD8E7!important;
    border-radius:14px!important;
    background:#fff!important;
    color:var(--mf-chat-text)!important;
    font-size:13px!important;
    box-shadow:0 1px 2px rgba(0,43,117,.03) inset!important;
  }
  body.mf-workspace-theme-v1 .mf514-composer input[name="message"]:focus{
    border-color:var(--mf-chat-blue)!important;
    box-shadow:0 0 0 3px rgba(0,61,165,.10)!important;
    outline:none!important;
  }
  body.mf-workspace-theme-v1 .mf514-send{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    border:0!important;
    border-radius:50%!important;
    background:var(--mf-chat-blue)!important;
    color:#fff!important;
    font-size:18px!important;
    box-shadow:0 7px 16px rgba(0,61,165,.24)!important;
  }
  body.mf-workspace-theme-v1 .mf514-send:hover{
    background:var(--mf-chat-blue-deep)!important;
    transform:none!important;
  }

  body.mf-workspace-theme-v1 .mf514-emoji{
    border:1px solid var(--mf-chat-line)!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 12px 30px rgba(0,43,117,.16)!important;
  }

  /* Launcher used only after close */
  body.mf-workspace-theme-v1 .mf3305-chat-launcher{
    min-height:48px!important;
    padding:0 17px!important;
    gap:8px!important;
    border:2px solid #fff!important;
    border-radius:999px!important;
    background:linear-gradient(100deg,var(--mf-chat-blue-deep),var(--mf-chat-blue))!important;
    color:#fff!important;
    box-shadow:0 14px 30px rgba(0,43,117,.28)!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-launcher span{
    display:grid!important;
    place-items:center!important;
    width:28px!important;
    height:28px!important;
    border-radius:50%!important;
    background:var(--mf-chat-yellow)!important;
  }
  body.mf-workspace-theme-v1 .mf3305-chat-launcher b{
    font-size:14px!important;
    font-weight:900!important;
  }

  /* Minimized state: style only, visibility/height remains controller-owned */
  body.mf-workspace-theme-v1 .mf514-chat-pane.is-minimized{
    border-radius:15px!important;
    box-shadow:0 12px 28px rgba(0,43,117,.24)!important;
  }
  body.mf-workspace-theme-v1 .mf514-chat-pane.is-minimized .mf3305-chat-dragbar{
    min-height:40px!important;
    border-bottom-width:0!important;
  }

  body.mf-workspace-theme-v1 .mf514-chat-pane.is-dragging{
    box-shadow:0 28px 70px rgba(0,43,117,.32)!important;
  }
}

/* On smaller screens, keep existing chat layout and only harmonize color. */
@media (max-width:900px){
  body.mf-workspace-theme-v1 .mf514-chat-pane{
    background:#fff!important;
    color:#17345C!important;
  }
  body.mf-workspace-theme-v1 .mf514-composer{
    border-top-color:#DCE6F1!important;
    background:#fff!important;
  }
  body.mf-workspace-theme-v1 .mf514-send{
    background:#003DA5!important;
    color:#fff!important;
  }
}

@media (prefers-reduced-motion:reduce){
  body.mf-workspace-theme-v1 .mf3305-chat-controls button,
  body.mf-workspace-theme-v1 .mf514-send{
    transition:none!important;
  }
}
