/* Desktop conversation layout matched to the approved reference image.
   Presentation only: call-permission logic and WebRTC connection code are untouched. */
@media(min-width:1181px){
  html body #conversation-overlay.mb11026-desktop .mb11027-chat-actions,
  html body #conversation-overlay.mb11026-desktop>.app-topbar .conversation-toolbar-actions{
    display:grid!important;
    grid-template-columns:auto auto auto minmax(176px,1fr) minmax(176px,1fr) minmax(156px,.9fr)!important;
    grid-template-rows:52px 52px!important;
    align-items:stretch!important;
    justify-content:end!important;
    gap:7px 8px!important;
    flex:1 1 auto!important;
    max-width:900px!important;
    margin-left:auto!important;
  }

  html body #conversation-overlay.mb11026-desktop .mb11027-chat-actions>.btn,
  html body #conversation-overlay.mb11026-desktop>.app-topbar .conversation-toolbar-actions>.btn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:7px 10px!important;
    border-radius:9px!important;
    font-size:11px!important;
    font-weight:800!important;
    line-height:1.2!important;
    white-space:normal!important;
    text-align:center!important;
    box-sizing:border-box!important;
    box-shadow:none!important;
  }

  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-back){grid-column:1!important;grid-row:1 / 3!important;align-self:center!important;height:34px!important;width:auto!important;white-space:nowrap!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-profile,.conversation-profile-btn){grid-column:2!important;grid-row:1 / 3!important;align-self:center!important;height:34px!important;width:auto!important;white-space:nowrap!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-settings,.mb11007-message-settings-btn){grid-column:3!important;grid-row:1 / 3!important;align-self:center!important;height:34px!important;width:auto!important;white-space:nowrap!important}

  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-video-settings,[data-mb-call-permission="video"]){grid-column:4!important;grid-row:1!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-video-call,[data-mb-call-kind="video"]){grid-column:4!important;grid-row:2!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb-v12005-audio-permission,[data-mb-call-permission="audio"]){grid-column:5!important;grid-row:1!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb-v12005-audio-call,[data-mb-call-kind="audio"]){grid-column:5!important;grid-row:2!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-request,[onclick*="mbOpenGiftRequestDialogForPartner"]){grid-column:6!important;grid-row:1!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-gift,[onclick*="mbOpenGiftDialogForConversation"]){grid-column:6!important;grid-row:2!important}
}

@media(min-width:901px) and (max-width:1180px){
  html body #conversation-overlay.mb11026-desktop .mb11027-chat-actions,
  html body #conversation-overlay.mb11026-desktop>.app-topbar .conversation-toolbar-actions{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-rows:40px!important;
    gap:6px!important;
    flex-basis:100%!important;
    max-width:none!important;
    margin-left:0!important;
  }
  html body #conversation-overlay.mb11026-desktop .mb11027-chat-actions>.btn,
  html body #conversation-overlay.mb11026-desktop>.app-topbar .conversation-toolbar-actions>.btn{
    width:100%!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:6px 8px!important;
    border-radius:9px!important;
    font-size:11px!important;
    font-weight:800!important;
    line-height:1.15!important;
    white-space:normal!important;
    text-align:center!important;
    box-sizing:border-box!important;
  }
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-back){grid-column:1!important;grid-row:1!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-profile,.conversation-profile-btn){grid-column:2!important;grid-row:1!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-settings,.mb11007-message-settings-btn){grid-column:3!important;grid-row:1!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-video-settings,[data-mb-call-permission="video"]){grid-column:1!important;grid-row:2!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb-v12005-audio-permission,[data-mb-call-permission="audio"]){grid-column:2!important;grid-row:2!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-request,[onclick*="mbOpenGiftRequestDialogForPartner"]){grid-column:3!important;grid-row:2!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-video-call,[data-mb-call-kind="video"]){grid-column:1!important;grid-row:3!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb-v12005-audio-call,[data-mb-call-kind="audio"]){grid-column:2!important;grid-row:3!important}
  html body #conversation-overlay :is(.mb11027-chat-actions,.conversation-toolbar-actions)>:is(.mb11027-gift,[onclick*="mbOpenGiftDialogForConversation"]){grid-column:3!important;grid-row:3!important}
}

/* Minimal Ice — approved desktop conversation theme, presentation only. */
@media(min-width:901px){
  html body #conversation-overlay.mb11026-desktop{
    background:#f7f9fc!important;
    color:#253041!important;
  }

  html body #conversation-overlay.mb11026-desktop>.app-topbar .app-topbar-inner{
    background:rgba(255,255,255,.94)!important;
    border-color:#e3eaf2!important;
    box-shadow:0 8px 24px rgba(41,55,73,.055)!important;
  }

  html body #conversation-overlay.mb11026-desktop .app-title,
  html body #conversation-overlay.mb11026-desktop .app-topbar{
    color:#253041!important;
  }

  html body #conversation-overlay.mb11026-desktop #message-thread{
    background:linear-gradient(180deg,#fbfcfe 0%,#f7f9fc 100%)!important;
    gap:7px!important;
    padding:24px 22px 28px!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-row{
    padding:0 3px!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-bubble{
    max-width:min(68%,660px)!important;
    padding:11px 14px 9px!important;
    border-radius:16px 16px 16px 6px!important;
    background:#eef3f8!important;
    color:#253041!important;
    border:1px solid #e3eaf2!important;
    box-shadow:0 3px 10px rgba(53,69,88,.045)!important;
    font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;
    font-size:15px!important;
    font-weight:500!important;
    line-height:1.42!important;
    letter-spacing:-.01em!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-row.mine .message-bubble{
    border-radius:16px 16px 6px 16px!important;
    background:#e9f0f8!important;
    color:#253041!important;
    border-color:#dce6f0!important;
    box-shadow:0 3px 10px rgba(53,69,88,.05)!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-time{
    margin-top:5px!important;
    color:#8a97a8!important;
    opacity:1!important;
    font-size:11px!important;
    font-weight:400!important;
    line-height:1.2!important;
    letter-spacing:0!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-status,
  html body #conversation-overlay.mb11026-desktop .message-status.read{
    color:#7f91a7!important;
    opacity:1!important;
    font-weight:500!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-composer{
    background:rgba(255,255,255,.96)!important;
    border-color:#e3eaf2!important;
    border-radius:18px!important;
    box-shadow:0 8px 24px rgba(41,55,73,.055)!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-composer textarea{
    background:#f8fafc!important;
    color:#253041!important;
    border-color:#e1e8f0!important;
    border-radius:14px!important;
    font-size:15px!important;
    font-weight:400!important;
    box-shadow:none!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-composer textarea::placeholder{
    color:#9aa7b7!important;
    opacity:1!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-composer textarea:focus{
    background:#fff!important;
    border-color:#b9c9dc!important;
    box-shadow:0 0 0 3px rgba(129,153,181,.10)!important;
  }

  html body #conversation-overlay.mb11026-desktop .message-composer .btn,
  html body #conversation-overlay.mb11026-desktop .emoji-trigger,
  html body #conversation-overlay.mb11026-desktop .attach-btn{
    border-color:#e1e8f0!important;
    box-shadow:none!important;
  }
}
