/* Keep the workstation inside its current window; each surface owns its scroll. */
html,body{block-size:100%;overflow:clip}
.app-shell{height:100dvh;max-height:100dvh;grid-template-rows:minmax(0,1fr)}
.workspace,.chat-view,.conversation-layout,.conversation-main{min-block-size:0;min-inline-size:0}
.workspace,.chat-view,.conversation-layout,.conversation-main{overflow:hidden}
.conversation-main{align-self:stretch;margin-block:0}
.messages:not(:empty){flex:1 1 0;min-height:0;overscroll-behavior:contain}
.welcome{flex:1 1 0;min-height:0;overscroll-behavior:contain}
.confirmation{flex:0 1 auto;min-height:0;overscroll-behavior:contain}
.chat-processing{flex:0 0 auto;max-height:24dvh;overflow:auto;overscroll-behavior:contain}
.sidebar,.data-view,.task-panel{overscroll-behavior:contain}
.sidebar{max-height:100dvh}
.data-view{min-width:0;max-width:100%;min-height:0;overflow:auto}
.dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}

@media(max-height:600px){
  .topbar{min-height:48px;padding-block:4px;gap:6px}
  .conversation-heading{padding-top:10px;padding-bottom:10px;gap:10px}
  .conversation-heading h1{font-size:18px;line-height:1.3;margin-bottom:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  .conversation-meta{font-size:11px;line-height:1.4}
  .conversation-actions{gap:4px}
  .conversation-actions .quiet-button,.task-toggle{min-height:34px;padding-block:6px}
  .composer{margin-top:8px;padding:8px 12px}
  .composer textarea{min-height:36px;max-height:min(120px,20dvh)}
  .composer-bottom{margin-top:4px;gap:8px;flex-wrap:nowrap}
  .composer-tools{flex:1;min-width:0}
  .composer-bottom>.primary-button{min-height:34px;padding-block:6px}
  .attach-button{min-height:32px;padding-block:5px}
  .composer-disclaimer{padding-top:5px;padding-bottom:8px}
  .confirmation{margin-top:8px;padding:12px;max-height:38dvh}
  .global-banner{max-height:16dvh;overflow:auto;padding-block:7px}
  .digest{max-height:14dvh;overflow:auto;margin-bottom:8px}
  .history-sidebar{min-height:48px;margin-top:12px}
  .task-panel{inset-block:58px 12px;max-height:calc(100dvh - 70px)}
}
@media(max-height:440px){
  .composer-disclaimer{display:none}
  .conversation-heading{padding-top:7px;padding-bottom:7px}
  .conversation-heading h1{-webkit-line-clamp:1}
  .composer textarea{max-height:18dvh}
}
