/* Echo phone chat: a focused messenger screen above the call, not a small
   bottom sheet. This file is intentionally last in the cascade. Windows,
   including narrow WebView2 windows, never gets mobile-chat-open. */
@media (max-width:780px) {
  body.in-room.mobile-chat-open {
    overflow:hidden;
  }
  body.in-room.mobile-chat-open #chatPanel,
  body.in-room.mobile-chat-open #chatPanel.chat-large {
    position:fixed!important;
    z-index:150!important;
    inset:var(--echo-mobile-chat-top,0px) auto auto var(--echo-mobile-chat-left,0px)!important;
    width:var(--echo-mobile-chat-width,100vw)!important;
    height:var(--echo-mobile-chat-height,100dvh)!important;
    min-width:0!important;min-height:0!important;
    max-width:none!important;max-height:none!important;
    box-sizing:border-box;
    border:0!important;border-radius:0!important;
    background:#111b22!important;
    box-shadow:none!important;
    display:flex;flex-direction:column;overflow:hidden;
  }
  body.in-room.mobile-chat-open #chatPanel .chat-head {
    flex:0 0 auto;
    padding:12px 16px;
    cursor:default;
    border-bottom:1px solid var(--eg-line,var(--border));
  }
  body.in-room.mobile-chat-open #chatPanel .chat-messages {
    flex:1 1 auto;
    min-height:0;
    max-height:none;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:14px 12px;
  }
  body.in-room.mobile-chat-open #chatPanel .chat-compose {
    position:relative;
    flex:0 0 auto;
    margin:0;
    padding:10px 12px max(10px,env(safe-area-inset-bottom));
    background:#17262c;
    border-top:1px solid var(--eg-line,var(--border));
  }
  body.in-room.mobile-chat-open #chatPanel .chat-compose textarea {
    font-size:16px; /* iOS: prevent focus zoom from obscuring input */
    min-height:42px;height:42px;
    line-height:22px;
  }
  body.in-room.mobile-chat-open #chatPanel .chat-compose button {
    width:42px;height:42px;min-width:42px;
  }
  body.in-room.mobile-chat-open #chatPanel .chat-jump-latest {
    bottom:calc(78px + env(safe-area-inset-bottom));
  }
  body.in-room.mobile-chat-keyboard #chatPanel .chat-head {
    padding:7px 12px;
  }
  body.in-room.mobile-chat-keyboard #chatPanel .chat-heading small {
    display:none;
  }
}
