/* Vchat 0.62.22-alpha — Mobile Inbox polish
   Final exact-scope layer loaded after every legacy/release stylesheet.
   It only composes existing controls; no IDs, handlers or business logic change. */

@media (max-width: 900px) {
  /* One balanced conversation header row: back | identity | mode + more. */
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-head{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr) auto!important;
    grid-template-areas:"back person actions"!important;
    align-items:center!important;
    column-gap:9px!important;
    row-gap:0!important;
    min-height:64px!important;
    height:auto!important;
    padding:9px 12px!important;
    overflow:visible!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-open-conversations{
    grid-area:back!important;
    align-self:center!important;
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #ddd9f5!important;
    border-radius:13px!important;
    background:#fff!important;
    color:#6253d6!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-open-conversations b{display:none!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-open-conversations span{font-size:25px!important;line-height:1!important;}

  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person{
    grid-area:person!important;
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    min-width:0!important;
    width:auto!important;
    margin:0!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person .vchat-avatar{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    border-radius:14px!important;
    font-size:15px!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person>div{min-width:0!important;overflow:hidden!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-active-name{
    display:block!important;
    max-width:100%!important;
    color:#11182c!important;
    font-size:15px!important;
    font-weight:850!important;
    line-height:1.15!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person-meta{
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    min-width:0!important;
    margin-top:4px!important;
    overflow:hidden!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person-meta>*{
    min-width:0!important;
    max-width:118px!important;
    color:#6559d0!important;
    font-size:9.5px!important;
    line-height:1!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-active-department{display:none!important;}

  #vchat-frontend-app.vchat-frontend-app .vchat-chat-actions,
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-actions-0518{
    grid-area:actions!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:7px!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }
  /* Details and resolve remain available from Más on mobile. */
  #vchat-frontend-app.vchat-frontend-app #vchat-open-contact,
  #vchat-frontend-app.vchat-frontend-app #vchat-resolve{display:none!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-claim{
    display:grid!important;
    place-items:center!important;
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:0 8px!important;
    border:1px solid #6554d8!important;
    border-radius:12px!important;
    background:#6554d8!important;
    color:#fff!important;
    font-size:0!important;
    font-weight:850!important;
    box-shadow:0 6px 14px rgba(86,70,199,.12)!important;
    pointer-events:auto!important;
  }
  #vchat-frontend-app.vchat-frontend-app #vchat-claim::after{
    content:'Humano'!important;
    display:block!important;
    color:#fff!important;
    font-size:10.5px!important;
    font-weight:850!important;
    line-height:1!important;
  }
  #vchat-frontend-app.vchat-frontend-app #vchat-claim[data-current-mode="human"]::after{content:'AI'!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-more{
    display:grid!important;
    place-items:center!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #ddd9f5!important;
    border-radius:12px!important;
    background:#fff!important;
    color:#5f52cf!important;
    font-size:0!important;
    box-shadow:none!important;
    pointer-events:auto!important;
  }
  #vchat-frontend-app.vchat-frontend-app #vchat-more::before{
    content:'•••'!important;
    display:block!important;
    color:#5f52cf!important;
    font-size:14px!important;
    font-weight:900!important;
    letter-spacing:1px!important;
    line-height:1!important;
  }

  /* Mobile only needs Reply / Note in this bar. Etapa, Productos and the rest live in Más. */
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-toolbar,
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-toolbar-0518{
    display:block!important;
    min-height:48px!important;
    height:auto!important;
    margin:0!important;
    padding:7px 12px!important;
    border-top:1px solid #eceaf4!important;
    border-bottom:1px solid #eceaf4!important;
    background:#fff!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-quick-actions,
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-quick-actions-0518{display:none!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-reply-mode{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    width:100%!important;
    max-width:none!important;
    min-height:34px!important;
    height:34px!important;
    padding:3px!important;
    border:0!important;
    border-radius:12px!important;
    background:#f0edf8!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-reply-mode button{
    display:grid!important;
    place-items:center!important;
    width:100%!important;
    min-width:0!important;
    height:28px!important;
    min-height:28px!important;
    margin:0!important;
    padding:0 10px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:#7b7591!important;
    font-size:0!important;
    font-weight:850!important;
    box-shadow:none!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-reply-mode button::after{
    display:block!important;
    color:inherit!important;
    font-size:11px!important;
    font-weight:850!important;
    line-height:1!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-reply-mode button:first-child::after{content:'Responder'!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-reply-mode button:last-child::after{content:'Nota'!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-reply-mode button.is-active{
    background:#fff!important;
    color:#5f52cf!important;
    box-shadow:0 2px 8px rgba(54,45,107,.08)!important;
  }

  /* Keep only the two useful SLA chips and guarantee readable contrast. */
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-bar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:7px!important;
    width:100%!important;
    min-height:42px!important;
    height:42px!important;
    max-height:42px!important;
    margin:0!important;
    padding:5px 12px!important;
    overflow:hidden!important;
    background:#fff!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item{
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    min-width:0!important;
    width:100%!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    margin:0!important;
    padding:4px 9px!important;
    border:1px solid #e4e1ef!important;
    border-radius:12px!important;
    background:#fff!important;
    color:#292b43!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item:nth-child(2),
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item:nth-child(3){display:none!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item.vchat-sla-state{
    border-color:#9ee6c1!important;
    background:#f1fcf6!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item>span{
    display:grid!important;
    place-items:center!important;
    width:22px!important;
    min-width:22px!important;
    height:22px!important;
    color:#6255d7!important;
    font-size:10px!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item>div{display:flex!important;align-items:baseline!important;gap:5px!important;min-width:0!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item small{color:#88839a!important;font-size:8.5px!important;white-space:nowrap!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item strong{min-width:0!important;color:#292b43!important;font-size:10.5px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}

  /* Composer utility rail: five compact, evenly spaced controls. */
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-wrap{
    padding:8px 12px max(10px,env(safe-area-inset-bottom))!important;
    background:#fff!important;
    border-top:1px solid #eceaf4!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools{
    display:grid!important;
    grid-template-columns:repeat(5,40px)!important;
    justify-content:space-between!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
    min-height:40px!important;
    height:40px!important;
    margin:0 0 8px!important;
    padding:0!important;
    overflow:visible!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools>span{display:none!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools button{
    display:grid!important;
    place-items:center!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #e3dff4!important;
    border-radius:12px!important;
    background:#faf9ff!important;
    color:#6657d9!important;
    font-size:0!important;
    font-weight:900!important;
    line-height:1!important;
    box-shadow:none!important;
    overflow:hidden!important;
    pointer-events:auto!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools #vchat-saved-reply{margin:0!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools #vchat-attach::before{content:'＋'!important;font-size:19px!important;color:#6657d9!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools #vchat-emoji::before{content:'☺'!important;font-size:18px!important;color:#6657d9!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools #vchat-schedule-message::before{content:'◷'!important;font-size:18px!important;color:#6657d9!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools #vchat-saved-reply::before{content:'/'!important;font-size:21px!important;font-weight:900!important;color:#6657d9!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools #vchat-record-audio .vchat-mic-icon{display:block!important;width:18px!important;height:18px!important;color:#6657d9!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 52px!important;
    align-items:end!important;
    gap:8px!important;
    width:100%!important;
    min-height:56px!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-composer textarea{
    width:100%!important;
    min-width:0!important;
    min-height:56px!important;
    max-height:110px!important;
    padding:14px 15px!important;
    border:1px solid #ded9f0!important;
    border-radius:16px!important;
    background:#fff!important;
    color:#20263a!important;
    font-size:14px!important;
    line-height:1.35!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-composer textarea::placeholder{color:#a4a0b4!important;opacity:1!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-send-message{
    display:grid!important;
    place-items:center!important;
    width:52px!important;
    min-width:52px!important;
    height:52px!important;
    min-height:52px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:15px!important;
    background:linear-gradient(135deg,#7554f2,#526ff0)!important;
    color:#fff!important;
  }
  #vchat-frontend-app.vchat-frontend-app #vchat-send-message .vchat-send-label{display:none!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-send-message .vchat-send-icon{display:block!important;color:#fff!important;font-size:24px!important;line-height:1!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-composer-hint{display:none!important;}

  /* Buttons that older skins occasionally rendered white-on-white. */
  #vchat-frontend-app.vchat-frontend-app .vchat-lifecycle-banner button,
  #vchat-frontend-app.vchat-frontend-app .vchat-handoff-actions button,
  #vchat-frontend-app.vchat-frontend-app .vchat-booking-context-open{
    color:#5f52cf!important;
    background:#fff!important;
    border-color:#dcd7f2!important;
  }
}

@media (max-width: 520px) {
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-head{
    grid-template-columns:40px minmax(0,1fr) auto!important;
    column-gap:7px!important;
    padding:8px 10px!important;
  }
  #vchat-frontend-app.vchat-frontend-app .vchat-open-conversations{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person .vchat-avatar{width:38px!important;min-width:38px!important;height:38px!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-active-name{font-size:14px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-person-meta>*{max-width:92px!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-claim{width:60px!important;min-width:60px!important;max-width:60px!important;height:38px!important;min-height:38px!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-claim::after{font-size:9.5px!important;}
  #vchat-frontend-app.vchat-frontend-app #vchat-more{width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-toolbar,
  #vchat-frontend-app.vchat-frontend-app .vchat-chat-toolbar-0518{padding:6px 10px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-bar{padding:5px 10px!important;gap:6px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item{padding-inline:7px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item small{display:none!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-sla-item strong{font-size:10px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-wrap{padding-inline:10px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools{grid-template-columns:repeat(5,38px)!important;gap:6px!important;}
  #vchat-frontend-app.vchat-frontend-app .vchat-composer-tools button{width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;}
}
