/* iBNiChat 0.6.0 — in-call messages. Fully scoped; other room UI is untouched. */
#btnRoomChat { position:relative; }
#btnRoomChat[aria-expanded="true"] { background:rgba(129,70,184,.22); box-shadow:inset 0 0 0 1px rgba(166,121,235,.75); }
#ibniChatUnread {
  position:absolute; top:-5px; right:-5px; min-width:19px; height:19px;
  display:grid; place-items:center; padding:0 4px; border-radius:999px;
  background:#e05261; color:#fff; font-size:10px; font-weight:800;
  border:2px solid #151b28; line-height:1;
}
#ibniChatUnread[hidden], .ibni-chat-root [hidden] { display:none !important; }
.ibni-chat-root { --chat-bg:#131a28; --chat-panel:#192232; --chat-line:rgba(187,201,225,.12);
  --chat-text:#f3f6fe; --chat-muted:#aebbd0; --chat-purple:#9d73e6;
  position:fixed; inset:0; z-index:3100; pointer-events:none; color:var(--chat-text);
  font:400 14px/1.45 Inter,system-ui,-apple-system,sans-serif;
}
.ibni-chat-root *, .ibni-chat-root *::before, .ibni-chat-root *::after { box-sizing:border-box; }
.ibni-chat-backdrop { position:absolute; inset:0; background:rgba(6,12,24,.58);
  opacity:0; visibility:hidden; transition:opacity .22s ease; }
.ibni-chat-panel {
  position:absolute; right:14px; top:12px;
  bottom:calc(88px + env(safe-area-inset-bottom,0px));
  width:min(420px, calc(100vw - 28px)); max-height:900px;
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--chat-bg); color:var(--chat-text);
  border:1px solid rgba(210,224,250,.17);
  border-radius:20px;
  box-shadow:0 20px 70px rgba(0,0,0,.53);
  transform:translateX(calc(100% + 40px));
  opacity:0; visibility:hidden;
  transition:transform .24s cubic-bezier(.2,.8,.2,1),opacity .18s,visibility .18s;
  pointer-events:none; overscroll-behavior:contain;
}
.ibni-chat-root.is-open .ibni-chat-panel { transform:translateX(0); opacity:1; visibility:visible; pointer-events:auto; }
.ibni-chat-root button { font:inherit; cursor:pointer; color:inherit; -webkit-tap-highlight-color:transparent; }
.ibni-chat-root button:focus-visible, #btnRoomChat:focus-visible, .ibni-chat-root textarea:focus-visible {
  outline:2px solid #c1a8fc; outline-offset:2px;
}
.ibni-chat-root button:disabled { cursor:not-allowed; opacity:.43; }
.ibni-chat-header { flex:none; display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:18px 16px 12px; background:#1b2536; border-bottom:1px solid var(--chat-line); }
.ibni-chat-titles { flex:1; min-width:0; }
.ibni-chat-titles h3 { color:var(--chat-text); margin:0; font-size:16px; font-weight:750; letter-spacing:-.025em; }
.ibni-chat-titles p { color:var(--chat-muted); margin:3px 0 0; font-size:11px; line-height:1.4; }
.ibni-chat-header-actions { display:flex; align-items:center; gap:4px; }
.ibni-chat-icon-btn { width:38px; height:38px; min-width:38px; display:grid; place-items:center;
  border:0; background:transparent; border-radius:11px; color:var(--chat-text); font-size:20px!important; }
.ibni-chat-icon-btn:hover { background:rgba(255,255,255,.1); }
.ibni-chat-icon-btn i { font-size:19px; }
.ibni-chat-notice { flex:none; color:var(--chat-muted); text-align:center; font-size:11px;
  background:rgba(126,111,177,.12); padding:8px 12px; line-height:1.5; }
.ibni-chat-status { flex:none; min-height:0; padding:0 14px; color:#eec187; font-size:12px;
  text-align:center; }
.ibni-chat-status:not(:empty) { padding:8px 14px; background:#47371f; }
.ibni-chat-scroll { flex:1; overflow-y:auto; overflow-x:hidden; min-height:0;
  padding:13px 14px 14px; overscroll-behavior:contain; scrollbar-width:thin;
  scrollbar-color:rgba(171,190,218,.28) transparent; -webkit-overflow-scrolling:touch;
}
.ibni-chat-messages { display:flex; flex-direction:column; gap:11px; min-height:100%; justify-content:flex-end; }
.ibni-chat-empty { align-self:center; text-align:center; color:var(--chat-muted);
  padding:55px 15px 20px; font-size:13px; }
.ibni-chat-day { align-self:center; color:#c8d3e6; background:#303b4c;
  border-radius:100px; padding:4px 11px; font-size:11px; font-weight:650; margin:8px 0 3px; }
.ibni-chat-more { display:block; margin:5px auto 14px; padding:8px 14px;
  border:1px solid var(--chat-line); background:var(--chat-panel); border-radius:100px;
  font-size:12px!important; }
.ibni-chat-message { width:min(92%,350px); max-width:100%; display:flex; flex-direction:column; gap:3px;
  min-width:0; overflow-wrap:anywhere; }
.ibni-chat-message.is-other { align-self:flex-start; }
.ibni-chat-message.is-mine { align-self:flex-end; }
.ibni-chat-sender { display:flex; align-items:center; gap:6px; color:#c7d7ef;
  font-size:11px; padding:0 5px; }
.ibni-chat-message.is-mine .ibni-chat-sender { justify-content:flex-end; }
.ibni-chat-sender strong { font-weight:700; }
.ibni-chat-host-label { background:#7054b1; color:#fff; border-radius:5px;
  padding:1px 5px; font-size:9px; text-transform:uppercase; letter-spacing:.035em; }
.ibni-chat-bubble { min-width:0; padding:10px 11px 6px; border-radius:14px 14px 14px 4px;
  border:1px solid rgba(196,215,247,.09); background:#2b3649; }
.is-mine .ibni-chat-bubble { background:#413567; border-color:rgba(193,168,252,.18);
  border-radius:14px 14px 4px 14px; }
.ibni-chat-quoted { width:100%; display:flex; flex-direction:column; gap:2px; text-align:left;
  border:0; border-left:3px solid #bc9bf1; border-radius:5px; padding:6px 9px;
  background:rgba(7,12,22,.3); margin-bottom:7px; font-size:11px!important; }
.ibni-chat-quoted strong { color:#d3bafa; font-weight:700; }
.ibni-chat-quoted span { color:#d7dfea; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
  max-width:100%; }
.ibni-chat-body { white-space:pre-wrap; margin:0; color:var(--chat-text);
  font-size:13px; line-height:1.48; overflow-wrap:anywhere; }
.ibni-chat-message.is-deleted .ibni-chat-body { font-style:italic; color:var(--chat-muted); }
.ibni-chat-message-bottom { display:flex; align-items:center; justify-content:flex-end; gap:9px;
  margin-top:5px; min-height:19px; }
.ibni-chat-message-bottom time { color:#c0cadb; font-size:10px; margin-right:auto; white-space:nowrap; }
.ibni-chat-message-action { padding:4px 2px; border:0; background:none; font-size:10px!important;
  color:#c9b4f5!important; font-weight:650!important; }
.ibni-chat-delete { color:#f6b4bb!important; }
.ibni-chat-message.is-highlighted .ibni-chat-bubble { box-shadow:0 0 0 2px #c2a8fa; }
.ibni-chat-jump { position:relative; align-self:center; margin:-38px 0 5px; z-index:2;
  padding:7px 14px; background:#5f4a99; border:1px solid #a58cde;
  box-shadow:0 4px 15px rgba(0,0,0,.35); border-radius:100px; font-size:12px!important; }
.ibni-chat-typing { flex:none; color:var(--chat-muted); font-size:11px; padding:0 15px;
  min-height:0; }
.ibni-chat-typing:not(:empty) { padding:5px 15px; }
.ibni-chat-compose { flex:none; padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px));
  background:#1b2536; border-top:1px solid var(--chat-line); }
.ibni-chat-compose-row { display:flex; align-items:flex-end; gap:8px; }
.ibni-chat-input { display:block; flex:1; min-width:0; width:100%; min-height:43px;
  max-height:106px; padding:12px 13px; resize:vertical;
  border-radius:14px; border:1px solid rgba(198,216,246,.2);
  background:#293449; color:#fff; font:400 13px/1.4 Inter,system-ui,sans-serif;
  -webkit-appearance:none; appearance:none; }
.ibni-chat-input::placeholder { color:#acb9cd; }
.ibni-chat-send { min-width:43px; height:43px; border-radius:12px; border:0;
  background:linear-gradient(135deg,#966bd5,#7750be); display:grid; place-items:center;
  color:#fff; box-shadow:0 5px 18px rgba(121,76,198,.24); }
.ibni-chat-send i { font-size:21px; }
.ibni-chat-compose-hint { margin-top:7px; padding-left:4px; font-size:10px; color:var(--chat-muted); }
.ibni-chat-reply-preview { border-left:3px solid #b59ce5; background:#323c53;
  border-radius:8px; margin-bottom:9px; padding:6px 8px; display:flex; align-items:center; gap:8px; }
.ibni-chat-reply-text { flex:1; display:flex; flex-direction:column; min-width:0; font-size:11px; }
.ibni-chat-reply-text strong { color:#dbc9fb; }
.ibni-chat-reply-text span { color:var(--chat-muted); white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.ibni-chat-reply-preview .ibni-chat-icon-btn { font-size:19px!important; min-width:28px; width:28px; height:28px; }
@media (max-width:700px) {
  .ibni-chat-root.is-open .ibni-chat-backdrop { opacity:1; visibility:visible; pointer-events:auto; }
  .ibni-chat-panel { left:0; right:0; top:auto; bottom:0; width:100%;
    height:min(78dvh, 700px); height:min(calc(var(--ibni-chat-available-height, 100dvh) * .84), 700px);
    max-height:calc(var(--ibni-chat-available-height, 100dvh) - 12px - env(safe-area-inset-top,0px));
    border-radius:19px 19px 0 0; border-left:0; border-right:0; border-bottom:0;
    transform:translateY(105%); box-shadow:0 -10px 50px rgba(0,0,0,.55); }
  .ibni-chat-root.is-open .ibni-chat-panel { transform:translateY(0); }
  .ibni-chat-header { padding:12px 14px 10px; }
  .ibni-chat-message { width:min(92%,340px); }
  .ibni-chat-input { font-size:16px; } /* prevents iOS WebView focus zoom */
  .ibni-chat-scroll { padding:10px 12px; }
  .ibni-chat-compose { padding:9px 10px calc(10px + env(safe-area-inset-bottom,0px)); }
  .ibni-chat-icon-btn { min-width:42px; width:42px; height:42px; }
  .ibni-chat-message-action { min-height:28px; }
  .ibni-chat-compose-hint { display:none; }
}
@media (max-height:570px) {
  .ibni-chat-panel { top:8px; bottom:8px; }
  .ibni-chat-root.is-open .ibni-chat-panel { max-height:calc(var(--ibni-chat-available-height, 100dvh) - 8px); }
}
@media (prefers-reduced-motion:reduce) {
  .ibni-chat-panel, .ibni-chat-backdrop { transition:none; }
}
