/* Mobile chat shell: keep the chrome steady and let only the conversation scroll. */
@media (max-width:900px){
  html[data-missgpt-lite="chat"]{
    --missgpt-chat-vw:var(--missgpt-visual-vw,100dvw);
    --missgpt-chat-vh:var(--missgpt-layout-vh,100svh);
    --missgpt-chat-keyboard-inset:var(--missgpt-visual-keyboard-inset,0px);
    --missgpt-chat-header-h:74px;
    --missgpt-chat-gutter:clamp(10px,3.05vw,14px);
    --missgpt-chat-bottom-gap:max(8px,calc(env(safe-area-inset-bottom) * .45));
    --missgpt-input-max-height:154px;
  }

  html[data-missgpt-lite="chat"],
  html[data-missgpt-lite="chat"] body{
    height:var(--missgpt-chat-vh);
    min-height:var(--missgpt-chat-vh);
    width:var(--missgpt-chat-vw);
    max-width:var(--missgpt-chat-vw);
    overflow:hidden;
    overscroll-behavior:none;
  }

  html[data-missgpt-lite="chat"] body{
    position:relative;
    left:0;
    right:auto;
    min-height:0;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-shell{
    position:fixed;
    inset:0 auto auto 0;
    width:var(--missgpt-chat-vw);
    max-width:var(--missgpt-chat-vw);
    min-height:0;
    height:var(--missgpt-chat-vh);
    display:block;
    overflow:hidden;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-header{
    position:fixed;
    z-index:20;
    top:0;
    left:0;
    right:auto;
    width:var(--missgpt-chat-vw);
    max-width:var(--missgpt-chat-vw);
    height:var(--missgpt-chat-header-h);
    flex:0 0 auto;
    padding:12px var(--missgpt-chat-gutter) 8px;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-logo{
    display:none!important;
    width:0!important;
    height:0!important;
    flex:0 0 0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-layout{
    position:absolute;
    z-index:10;
    top:var(--missgpt-chat-header-h);
    right:auto;
    bottom:var(--missgpt-chat-keyboard-inset);
    left:0;
    min-height:0;
    width:var(--missgpt-chat-vw);
    max-width:var(--missgpt-chat-vw);
    height:auto;
    padding:0 var(--missgpt-chat-gutter) var(--missgpt-chat-bottom-gap);
    overflow:hidden;
    transform:translateZ(0);
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-main{
    width:100%;
    min-height:0;
    height:100%;
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
    border-radius:24px;
    overflow:hidden;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-top{
    position:relative;
    z-index:7;
    flex:0 0 auto;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-current,
  html[data-missgpt-lite="chat"] .missgpt-chat-current > div{
    min-width:0;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-current span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-feed{
    min-height:0;
    padding:16px 14px 12px;
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    touch-action:pan-y;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-stream,
  html[data-missgpt-lite="chat"] .missgpt-message-row,
  html[data-missgpt-lite="chat"] .missgpt-bubble{
    min-width:0;
    max-width:100%;
  }

  html[data-missgpt-lite="chat"] .missgpt-message-row.user .missgpt-bubble{
    margin-left:auto;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-composer-wrap{
    position:relative;
    z-index:8;
    flex:0 0 auto;
    padding-top:8px;
    padding-right:10px;
    padding-bottom:var(--missgpt-chat-bottom-gap);
    padding-left:10px;
    transform:translateZ(0);
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-footnote{
    max-width:calc(100% - 8px);
    margin-top:6px;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-composer,
  html[data-missgpt-lite="chat"] .missgpt-chat-input{
    min-width:0;
    max-width:100%;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-composer{
    align-items:end;
    padding-top:6px!important;
    padding-bottom:6px!important;
    border-radius:23px;
  }

  html[data-missgpt-lite="chat"] .missgpt-chat-input{
    min-height:38px;
    max-height:var(--missgpt-input-max-height);
    line-height:1.22;
    padding:8px 0 7px;
    overflow-y:hidden;
  }
}
