.messages{flex:1;overflow:auto;padding:20px;background:#fff;display:flex;flex-direction:column}
.msg{max-width:800px;padding:12px 14px;margin:8px 0;border-radius:10px;white-space:pre-wrap;display:inline-block}
.user{background:#dbeafe;align-self:flex-end;margin-left:auto;text-align:left}
.assistant{background:#f8fafc;border:1px solid #eef2f7;align-self:flex-start;margin-right:auto;color:#111827;word-wrap:break-word;overflow-wrap:break-word;}
.loading{display:flex;align-items:center;gap:8px;font-style:italic}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:40}
.modal-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:50}
.msg *{margin-top:0!important;margin-bottom:0!important;} .msg p,.msg h1,.msg h2,.msg h3,.msg h4,.msg h5,.msg h6,.msg ul,.msg ol{margin:0!important;padding:0;} .msg>div{display:block;}
.msg pre{display:block;box-sizing:border-box;max-width:100%;overflow:auto;white-space:pre;margin:8px 0;padding:8px;border-radius:8px;background:rgba(15,23,42,0.04);border:1px solid rgba(0,0,0,0.04);font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:13px;line-height:1.45;max-height:240px} .msg pre code{display:block;white-space:pre} .msg code{white-space:pre-wrap;word-break:break-word}