.ai-chat-modal{width:min(1260px,100%);box-sizing:border-box;height:min(900px,94vh);max-width:none;max-height:94vh;display:grid;grid-template-columns:248px minmax(0,1fr);overflow:hidden;border:1px solid #dce3ec;border-radius:18px;background:#fff;color:#182b45}.ai-chat-sidebar{display:flex;flex-direction:column;min-height:0;background:#f4f6f9;border-right:1px solid #e3e8ef}.ai-chat-sidebar-head{padding:24px 18px 18px;display:grid;gap:18px}.ai-chat-sidebar-head strong{font-size:15px;color:#354662}.ai-chat-new{border:1px solid #cfd9e7;padding:11px 14px;text-align:left;border-radius:9px;background:#fff;color:#213d65;cursor:pointer;font-weight:600}.ai-chat-new:hover{background:#e8eff9}.ai-chat-conversations{flex:1;overflow:auto;padding:0 10px 16px}.ai-chat-conversation{display:block;width:100%;border:1px solid transparent;border-radius:9px;background:transparent;text-align:left;color:#283e5c;padding:12px 10px;margin:4px 0;cursor:pointer}.ai-chat-conversation span{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-chat-conversation small{display:block;font-size:11px;color:#748197;margin-top:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat-conversation:hover{background:#e9edf3}.ai-chat-conversation.is-active{background:#dfe9f8;border-color:#c5d5ed;color:#133a72;box-shadow:inset 3px 0 0 #245dac}.ai-chat-sidebar-note{font-size:11px;color:#7b8798;line-height:1.8;padding:17px 20px;border-top:1px solid #e4e9f0}.ai-chat-list-empty{padding:14px;color:#79869a;font-size:13px;line-height:1.8}.ai-chat-main{min-width:0;min-height:0;display:flex;flex-direction:column}.ai-chat-header{display:flex;align-items:center;justify-content:space-between;padding:20px 26px 15px;border-bottom:1px solid #edf0f5;gap:15px}.ai-chat-header>div{min-width:0;flex:1}.ai-chat-header .close{flex:none}.ai-chat-header h2{margin:0;font-size:18px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat-header p{font-size:12px;color:#7a8798;margin:6px 0 0}.ai-chat-project-bar{display:flex;align-items:center;gap:10px;padding:11px 26px;background:#fbfcfe;border-bottom:1px solid #edf0f5;font-size:12px;color:#6b7890}.ai-chat-project-bar select{max-width:420px;min-width:120px;flex:1;padding:7px 10px;background:#fff;color:#30445f;border:1px solid #d9e1ed;border-radius:7px}.ai-chat-project-bar select:disabled{opacity:1;background:#f2f5fa;color:#5a6c83}.ai-chat-project-bar>span{font-size:11px;color:#8994a4}.ai-chat-messages{flex:1;min-height:0;overflow:auto;padding:22px clamp(18px,4vw,54px);scroll-behavior:smooth;overscroll-behavior:contain}.ai-chat-message{display:flex;gap:13px;max-width:900px;margin:0 auto 27px}.ai-chat-avatar{flex:none;width:30px;height:30px;border-radius:9px;background:#e8eff9;color:#21549b;display:grid;place-items:center;font-size:15px;font-weight:600}.ai-chat-message.is-user .ai-chat-avatar{background:#edf0f4;color:#65758b}.ai-chat-message-body{min-width:0;flex:1}.ai-chat-speaker{font-size:12px;font-weight:600;color:#6c7c90;margin:4px 0 10px}.ai-chat-text{font-size:14px;line-height:1.85;overflow-wrap:anywhere;color:#283b55}.ai-chat-text p{margin:0 0 6px;white-space:pre-wrap}.ai-chat-text h4{font-size:15px;margin:18px 0 8px}.ai-chat-text ul,.ai-chat-text ol{padding-left:23px;margin:5px 0 12px}.ai-chat-text pre{white-space:pre-wrap;background:#f2f5f9;padding:15px;border-radius:8px;font-size:12px;overflow:auto}.ai-chat-text code{background:#eef2f7;padding:2px 5px;border-radius:4px;font-size:12px}.ai-chat-message.is-user .ai-chat-text{display:inline-block;padding:11px 16px;background:#f1f5fa;border-radius:2px 13px 13px 13px;max-width:100%}.ai-chat-paragraph-space{height:7px}.ai-chat-thinking{font-size:13px;color:#7f8ba0;padding:6px 0}.ai-chat-thinking span{letter-spacing:4px;animation:ai-chat-pulse 1.2s infinite}.ai-chat-error{color:#ad3d46}.ai-chat-welcome{max-width:620px;margin:clamp(24px,7vh,80px) auto;text-align:center}.ai-chat-welcome-icon{font-size:35px;color:#3166a7}.ai-chat-welcome h3{font-size:25px;font-weight:600;margin:18px 0;color:#243d60}.ai-chat-welcome p{font-size:14px;color:#8290a2;line-height:1.9}.ai-chat-starters{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:28px}.ai-chat-starters button{padding:12px 15px;border:1px solid #dce4ee;border-radius:10px;background:#fff;color:#486380;cursor:pointer;font-size:13px}.ai-chat-starters button:hover{border-color:#85a5cf;background:#f4f8fd}.ai-chat-composer{margin:0 24px;background:#fff;border:1px solid #ccd8e7;border-radius:13px;box-shadow:0 3px 16px #2a466008;padding:12px 14px}.ai-chat-composer:focus-within{border-color:#6f9bce;box-shadow:0 0 0 2px #e7eff9}.ai-chat-composer textarea{display:block;width:100%;border:0;resize:none;min-height:68px;max-height:180px;padding:3px 2px;background:transparent;font:inherit;font-size:14px;line-height:1.7;color:#243b57;outline:none;box-sizing:border-box}.ai-chat-composer textarea::placeholder{color:#94a1b1}.ai-chat-composer-bottom{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:6px}.ai-chat-composer-bottom span{font-size:11px;color:#98a3b3}.ai-chat-composer-bottom .btn{border-radius:8px;padding:8px 17px}.ai-chat-footnote{font-size:11px;color:#9aa4b3;text-align:center;padding:10px 12px 14px}.ai-chat-notice{font-size:12px;color:#ab4b48;padding:0 26px;line-height:1.8;max-height:65px;overflow:auto}.ai-chat-notice:not(:empty){padding-top:7px;padding-bottom:10px}.ai-chat-plan{border:1px solid #cfdeee;background:#fafcff;border-radius:10px;padding:15px;margin:13px 0;font-size:12px}.ai-chat-plan-title{display:flex;justify-content:space-between;gap:10px;color:#34669e}.ai-chat-plan>p{line-height:1.8;margin:10px 0;color:#687b93}.ai-chat-plan details{border-top:1px solid #e3eaf3;padding:10px 0}.ai-chat-plan summary{cursor:pointer;line-height:1.7;color:#3a506e}.ai-chat-plan-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #e3eaf3;padding-top:12px;color:#8995a5}.ai-chat-plan-footer .btn{font-size:12px}.ai-chat-table{overflow:auto;margin-top:10px}.ai-chat-table table{border-collapse:collapse;width:100%;table-layout:fixed}.ai-chat-table th,.ai-chat-table td{border:1px solid #dde5ef;padding:8px;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;vertical-align:top}.ai-chat-table th{background:#f0f4f9}.ai-chat-table td:last-child{background:#f0faf5}.ai-chat-sources{font-size:11px;color:#8494a7;margin-top:10px}.ai-chat-sources summary{cursor:pointer;margin-bottom:7px}.ai-chat-sources code{display:inline-block;padding:4px;background:#f1f4f8;margin:3px;overflow-wrap:anywhere}.ai-chat-saved{color:#26805d!important}.ai-chat-modal .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes ai-chat-pulse{50%{opacity:.25}}@media(max-width:820px){.ai-chat-modal{grid-template-columns:190px minmax(0,1fr)}.ai-chat-project-bar>span{display:none}.ai-chat-messages{padding:20px}.ai-chat-header,.ai-chat-project-bar{padding-left:18px;padding-right:18px}}@media(max-width:600px){.ai-chat-backdrop{padding:5px}.ai-chat-modal{height:98vh;max-height:98vh;width:100%;grid-template-columns:1fr;border-radius:10px}.ai-chat-sidebar{max-height:140px;border-right:0;border-bottom:1px solid #e3e8ef}.ai-chat-sidebar-head{padding:9px 12px;display:flex;align-items:center;justify-content:space-between}.ai-chat-new{padding:6px 10px;font-size:12px}.ai-chat-conversations{display:flex;padding:0 8px 6px;gap:5px;overflow:auto}.ai-chat-conversation{min-width:135px;max-width:180px;margin:0;padding:7px 9px}.ai-chat-conversation span{font-size:12px}.ai-chat-conversation small{font-size:10px}.ai-chat-sidebar-note{display:none}.ai-chat-header{padding:13px 16px}.ai-chat-header h2{font-size:16px}.ai-chat-header p{font-size:11px}.ai-chat-project-bar{padding:8px 14px}.ai-chat-welcome{margin:18px auto}.ai-chat-welcome h3{font-size:20px}.ai-chat-messages{padding:18px 12px}.ai-chat-message{gap:8px}.ai-chat-composer{margin:0 10px}.ai-chat-composer-bottom span{font-size:10px}.ai-chat-footnote{font-size:10px}.ai-chat-text{font-size:13px}.ai-chat-starters{margin-top:16px}.ai-chat-starters button{padding:9px}#aiCommandBtn{font-size:11px;padding:6px}}@media(prefers-reduced-motion:reduce){.ai-chat-thinking span{animation:none}.ai-chat-messages{scroll-behavior:auto}}

/* Conversational alignment: AI stays left, the current user stays right. */
.ai-chat-message{align-items:flex-start}
.ai-chat-message-body{flex:0 1 78%;max-width:78%}
.ai-chat-message.is-user{justify-content:flex-end}
.ai-chat-message.is-user .ai-chat-avatar{order:2}
.ai-chat-message.is-user .ai-chat-message-body{order:1;display:flex;flex-direction:column;align-items:flex-end}
.ai-chat-message.is-user .ai-chat-speaker{text-align:right}
.ai-chat-message.is-user .ai-chat-text{max-width:100%;text-align:left}
@media(max-width:600px){.ai-chat-message-body{flex-basis:84%;max-width:84%}}

/* Unified assistant: one entry, shared chat and retained professional tools. */
.ai-chat-model{padding:8px 24px;background:#f6f9fd;border-bottom:1px solid #e3eaf3;color:#52627a;font-size:12px;overflow-wrap:anywhere}.ai-chat-sidebar-tools{padding:14px 16px;border-top:1px solid #dce3ed}.ai-chat-tool{display:flex;justify-content:space-between;gap:8px;width:100%;padding:10px;border:1px solid #ccd7e6;border-radius:8px;background:#fff;color:#23456b;text-align:left;cursor:pointer;font:inherit;font-size:13px}.ai-chat-sidebar-tools small{display:block;margin-top:7px;color:#607087;line-height:1.5;font-size:11px}.ai-chat-plan-project{font-weight:600;color:#253c61}.ai-chat-record-link{display:inline-block;max-width:100%;margin:5px 8px 3px 0;padding:5px 8px;background:#edf3ff;color:#164b94;border:1px solid #c5d7f1;border-radius:6px;cursor:pointer;text-align:left;overflow-wrap:anywhere;font:inherit;font-size:12px}.ai-chat-saved .ai-chat-record-link{display:block}.ai-chat-return{margin-top:18px}.ai-chat-sources{overflow-wrap:anywhere}.ai-chat-tool:focus-visible,.ai-chat-record-link:focus-visible{outline:3px solid #7ba9f0;outline-offset:2px}@media(max-width:600px){.ai-chat-model{padding:7px 12px}.ai-chat-sidebar-tools{padding:8px}.ai-chat-sidebar-tools small{display:none}.ai-chat-tool{font-size:11px}}

.ai-chat-tool:disabled{opacity:.6;cursor:wait}

/* Owner-scoped conversation actions; existing model credentials stay untouched. */
.ai-chat-conversation-row{position:relative;display:flex;align-items:center;border-radius:8px;margin-bottom:5px;min-width:0}.ai-chat-conversation-row.is-active{background:#dbe7f7;box-shadow:inset 3px 0 0 #245fa8}.ai-chat-conversation-row>.ai-chat-conversation{flex:1;min-width:0;margin:0;padding-right:35px}.ai-chat-more{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:#52677e;font-size:21px;cursor:pointer}.ai-chat-more:hover,.ai-chat-more[aria-expanded="true"]{background:#c7d9ef;color:#143d6e}.ai-chat-more:focus-visible,.ai-chat-context-menu button:focus-visible{outline:2px solid #3978c9;outline-offset:1px}.ai-chat-context-menu[hidden],.ai-chat-action-layer[hidden],.ai-chat-rename-field[hidden]{display:none!important}.ai-chat-context-menu{position:fixed;z-index:330;width:190px;max-width:calc(100vw - 16px);padding:6px;background:#fff;border:1px solid #c9d5e5;border-radius:10px;box-shadow:0 9px 32px #152e4e2b;color:#20344d;font-family:"Microsoft YaHei","PingFang SC",Arial,sans-serif;font-size:14px;text-align:left}.ai-chat-menu-heading{padding:6px 10px;font-size:12px;color:#6a7b91}.ai-chat-context-menu button{display:block;width:100%;border:0;border-radius:5px;padding:9px 10px;background:transparent;text-align:left;color:inherit;font:inherit;cursor:pointer}.ai-chat-context-menu button:hover,.ai-chat-context-menu button:focus{background:#edf3fc}.ai-chat-context-menu button:disabled{opacity:.45;cursor:wait}.ai-chat-context-menu .is-danger{color:#b42332}.ai-chat-menu-separator{border-top:1px solid #e5ebf2;margin:5px 3px}.ai-chat-action-layer{position:absolute;inset:0;z-index:340;display:flex;align-items:center;justify-content:center;padding:18px;background:#0f233a66;border-radius:inherit}.ai-chat-action-dialog{width:410px;max-width:100%;border:1px solid #ccd8e8;border-radius:12px;padding:24px;background:#fff;box-shadow:0 16px 50px #142d4840;color:#20344d;font-family:"Microsoft YaHei","PingFang SC",Arial,sans-serif}.ai-chat-action-dialog h3{margin:0 0 12px;font-size:19px}.ai-chat-action-dialog p{font-size:14px;line-height:1.8;overflow-wrap:anywhere}.ai-chat-rename-field{display:grid;gap:8px;font-size:14px;margin:16px 0}.ai-chat-rename-field input{box-sizing:border-box;width:100%;padding:11px 12px;border:1px solid #abbdd3;border-radius:7px;font:inherit;color:#20344d;background:#fff}.ai-chat-rename-field input:focus{outline:2px solid #79a5df}.ai-chat-action-buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.ai-chat-action-dialog .ai-chat-action-error{color:#b42332;min-height:1em;margin:8px 0}.ai-chat-delete-button{background:#b42332!important;border-color:#b42332!important;color:#fff!important}.ai-chat-message:focus-visible{outline:2px solid #8faed5;outline-offset:5px;border-radius:6px}@media(max-width:600px){.ai-chat-conversation-row{flex:0 0 170px;margin:0}.ai-chat-conversation-row>.ai-chat-conversation{min-width:0;max-width:none}.ai-chat-more{opacity:1}.ai-chat-action-dialog{padding:20px}}

.ai-chat-modal{position:relative}

/* Source review and professional results stay in the single conversation. */
.ai-chat-professional[hidden],.ai-chat-revision[hidden]{display:none!important}.ai-chat-professional{margin:0 22px 10px;padding:14px 16px;background:#f1f5fb;border:1px solid #ccdaeb;border-radius:9px;color:#263c56;font:14px/1.7 "Microsoft YaHei","PingFang SC",Arial,sans-serif}.ai-chat-professional label{display:flex;gap:14px;align-items:center;font-weight:600}.ai-chat-professional select,.ai-chat-template select{min-width:180px;padding:7px 10px;border:1px solid #b8cbe1;border-radius:6px;background:#fff;color:#243c58;font:inherit}.ai-chat-professional p{margin:8px 0 0;color:#506781;font-size:12px}.ai-chat-revision{margin:0 24px 8px;color:#245fa8;font-size:13px}.ai-chat-artifact{min-width:0}.ai-chat-artifact h3{font-size:18px;margin:14px 0}.ai-chat-artifact h4{font-size:15px;margin:14px 0 8px}.ai-chat-artifact p,.ai-chat-artifact li{line-height:1.85}.ai-chat-artifact-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.ai-chat-source-list{max-height:250px;overflow:auto}.ai-chat-source-list>div{padding:7px 0;border-bottom:1px solid #e1e8f2}.ai-chat-source-list small{display:block;color:#60758c;font-size:12px}.ai-chat-source-boundary{font-size:12px;color:#596f87;line-height:1.7}.ai-chat-template{display:grid;gap:6px;margin:12px 0}.ai-chat-citations{font-size:12px;color:#546f8f}.ai-chat-main{min-height:0}.ai-chat-messages{min-height:90px}@media(max-width:600px){.ai-chat-professional{margin:0 10px 8px;padding:10px}.ai-chat-professional label{flex-wrap:wrap;gap:6px}}
