/* Interaction fixes layered over the current chat-only home design. */
html:root body.stellar-chat-workspace #generation-status {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
  border:0!important;
}
html:root body.stellar-chat-workspace #model-menu {
  overflow-y:auto!important;
  z-index:1500!important;
}
html:root body.stellar-chat-workspace #chat-menu { z-index:4000!important; pointer-events:auto!important; isolation:isolate!important; }
html:root body.stellar-chat-workspace #voice-call-modal { z-index:2000!important; }

/* The menu is positioned against its actual opener by positionModelMenu(). */
html:root body.stellar-chat-workspace #model-menu.hidden { display:none!important; }
html:root body.stellar-chat-workspace #model-menu:not(.hidden) {
  display:block!important;
  visibility:visible!important;
  pointer-events:auto!important;
}

/* Later conversation styles must still respect the saved text-size setting. */
html:root body.stellar-chat-workspace.txt-sm #chat .message { font-size:12.5px!important; }
html:root body.stellar-chat-workspace.txt-lg #chat .message { font-size:16px!important; }
html:root body.stellar-chat-workspace:is(.txt-sm,.txt-lg) #chat .message :is(.msg-content,.msg-inner) {
  font-size:inherit!important;
  line-height:inherit!important;
}
@media(max-width:1024px) {
  html:root body.stellar-chat-workspace.txt-sm #chat .message { font-size:13px!important; }
  html:root body.stellar-chat-workspace.txt-lg #chat .message { font-size:17px!important; }
}
@media(max-width:1100px) {
  html:root body.stellar-chat-workspace #main-col>.topbar { z-index:200!important; }
}
@media(max-width:767px) {
  html:root body.stellar-chat-workspace:not(.stellar-empty-home) #main-col>#chat {
    padding-top:calc(64px + env(safe-area-inset-top))!important;
  }
}


/* Model picker must remain scrollable at every viewport size. */
html:root body.stellar-chat-workspace #model-menu{
  max-height:min(72dvh,560px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y!important;
  scrollbar-gutter:stable;
  pointer-events:auto!important;
}
@media(max-width:767px){
  html:root body.stellar-chat-workspace #model-menu{
    max-height:calc(100dvh - 112px)!important;
    width:min(calc(100vw - 20px),420px)!important;
  }
}
