/* Pulse Social Phase 52: Messenger state repair + call reliability */
.phase51-typing[hidden],
.phase51-reply-bar[hidden],
.phase51-attachment-preview[hidden],
.phase51-new-message-btn[hidden],
[data-phase51-typing][hidden],
[data-phase51-reply-bar][hidden],
[data-phase51-attachment-preview][hidden],
[data-phase52-call-preflight][hidden]{display:none!important;visibility:hidden!important;pointer-events:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;overflow:hidden!important}

/* Reset inherited Phase 19 row backgrounds/margins so class names such as "me" never look like content. */
.phase51-chat-stream .phase51-message.me,
.phase51-chat-stream .phase51-message.them{margin-left:0!important;margin-right:0!important;background:transparent!important;border:0!important;padding:0!important}
.phase51-chat-stream .phase51-message.me{justify-content:flex-end!important}
.phase51-chat-stream .phase51-message.them{justify-content:flex-start!important}
.phase51-chat-stream .phase51-message>.message-bubble{width:auto!important}

.phase52-call-actions{display:flex;align-items:center;gap:.42rem;flex-wrap:wrap}
.phase52-call-button{display:inline-flex!important;align-items:center;gap:.38rem;min-height:38px;padding:.48rem .7rem!important;border-radius:999px!important;text-decoration:none}
.phase52-call-button span[aria-hidden="true"]{font-size:1rem;line-height:1}
.phase52-call-button strong{font-size:.76rem;line-height:1;white-space:nowrap}
.phase52-call-button.audio{background:rgba(34,197,94,.1)!important;border-color:rgba(34,197,94,.3)!important;color:#bbf7d0!important}
.phase52-call-button.video{background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 74%,#7c3aed),#ec4899)!important;color:#fff!important;border-color:transparent!important}
.phase52-call-button.is-checking{opacity:.72;cursor:progress}

.phase52-call-readiness{margin-top:.8rem;padding:.72rem;border-radius:16px;border:1px solid rgba(139,92,246,.2);background:linear-gradient(135deg,rgba(139,92,246,.09),rgba(34,211,238,.05));font-size:.78rem}
.phase52-call-readiness strong{display:block;margin-bottom:.22rem}
.phase52-call-readiness p{margin:0;color:var(--muted);line-height:1.42}
.phase52-call-readiness a{font-weight:850}

.phase52-call-preflight{position:fixed;inset:0;z-index:2147483646;display:grid;place-items:center;padding:1rem;background:rgba(2,4,14,.78);backdrop-filter:blur(14px)}
.phase52-call-preflight-card{width:min(470px,100%);border-radius:28px;padding:1.1rem;background:linear-gradient(160deg,rgba(30,22,61,.99),rgba(8,11,28,.99));border:1px solid rgba(167,139,250,.3);box-shadow:0 34px 120px rgba(0,0,0,.58)}
.phase52-call-preflight-head{display:flex;align-items:center;gap:.75rem}.phase52-call-preflight-icon{width:52px;height:52px;border-radius:18px;display:grid;place-items:center;background:rgba(139,92,246,.18);font-size:1.45rem}.phase52-call-preflight-head h2{margin:0;font-size:1.18rem}.phase52-call-preflight-head p{margin:.15rem 0 0;color:var(--muted);font-size:.8rem}
.phase52-call-progress{margin:.9rem 0;padding:.72rem;border-radius:16px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.09)}
.phase52-call-progress strong{display:block}.phase52-call-progress small{display:block;color:var(--muted);margin-top:.25rem;line-height:1.4}
.phase52-call-preflight-actions{display:flex;justify-content:flex-end;gap:.5rem;flex-wrap:wrap}
.phase52-call-error{color:#fecaca!important}
.phase52-call-success{color:#bbf7d0!important}

.phase40-connect-warning.phase52-fallback-warning{border-color:rgba(34,211,238,.28);background:rgba(34,211,238,.08)}
.phase52-provider-pill{display:inline-flex;align-items:center;gap:.35rem;padding:.34rem .55rem;border-radius:999px;border:1px solid rgba(34,211,238,.24);background:rgba(34,211,238,.07);font-size:.72rem;font-weight:850;color:#a5f3fc}

@media(max-width:780px){
  .phase52-call-button strong{display:none}
  .phase52-call-button{width:40px;height:40px;padding:0!important;justify-content:center}
  .phase52-call-actions{gap:.28rem}
  .phase52-call-preflight-card{border-radius:23px}
}
