html .chat-main.agent-view-open>.chat-header{display:none;}
/* The Code header replaces the shared header, including its safe-area reservation. */
html .chat-main.agent-view-open .agent-panel-header {
  flex:0 0 auto;
  min-height:calc(48px + var(--safe-area-top));
  padding-top:calc(6px + var(--safe-area-top));
  padding-bottom:6px;
}
html .chat-main.agent-view-open .agent-panel-header strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* Constrain flex children before letting wide tables/code scroll locally. */
html .agent-chat,html .agent-messages,html .agent-messages>.message-row,
html .agent-messages .message,html .agent-messages .message-text{min-width:0;max-width:100%;}
html .agent-messages>.message-row{width:100%;flex-shrink:0;}
html .agent-messages .message-text{overflow-wrap:anywhere;}
html .agent-messages :is(.markdown-table-wrap,.code-block,.generative-ui-table-wrap){min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;}
@media(max-width:760px){
 /* Reserve the composer in the stable shell; anchor it once at the visible keyboard edge. */
 html .chat-main.home-composing.is-home:not(.workspace-view-open):not(.agent-view-open)>.messages{flex:1 1 auto;min-height:0;}
 html.composer-keyboard-open .chat-main>.composer-area,
 html.composer-keyboard-open .chat-main.agent-view-open .agent-composer{
  position:fixed;top:auto;bottom:var(--keyboard-inset);left:0;right:0;width:100%;max-width:none;
  margin:0;transform:none;transition:none;padding-bottom:0;z-index:30;
 }
 html.composer-keyboard-open .chat-main>.composer-area::before{display:none;}
 html.composer-keyboard-open .chat-main.agent-view-open .agent-panel-header{transform:translateY(var(--keyboard-pan-top,0px));z-index:31;}
 html .chat-main.agent-view-open .agent-history-note{gap:8px;}
 html .chat-main.agent-view-open .agent-history-note>button{flex-shrink:0;}
}
/* Streaming comments are siblings of messages; constrain their entire details/grid chain. */
html .agent-messages>.work-timeline,
html .agent-messages .work-history,
html .agent-messages .work-timeline-body,
html .agent-messages .work-commentary,
html .agent-messages .work-related,
html .agent-messages .work-action-group,
html .agent-messages .work-feed{min-width:0;max-width:100%;width:100%;box-sizing:border-box;}
html .agent-messages>.work-timeline{flex:0 0 auto;align-self:stretch;}
html .agent-messages .work-timeline-body{grid-template-columns:minmax(0,1fr);}
html .agent-messages .work-commentary{white-space:normal;overflow-wrap:anywhere;word-break:normal;}
html .agent-messages .work-commentary :is(p,ul,ol,li,h1,h2,h3,h4,blockquote){min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;}
html .agent-messages .work-commentary :not(pre)>code{white-space:break-spaces;overflow-wrap:anywhere;}
html .agent-messages .work-commentary :is(.markdown-table-wrap,.code-block,pre){min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;}
