.agent-workspace{min-width:0}.agent-workspace-main{min-width:0}
.agent-workspace--chat{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,380px);gap:24px;align-items:start}
.agent-workspace--chat .agent-detail-heading>.agent-detail-portrait{display:none}
.agent-chat-sidebar{position:sticky;top:18px;min-width:0;background:#fff;border:1px solid #dce7ef;border-radius:17px;padding:18px;box-shadow:0 8px 24px #12233f08}
.agent-chat-sidebar[hidden],.agent-chat-content[hidden],.agent-chat-content>.agent-chat-log[hidden]{display:none}
.agent-chat-header>.agent-detail-portrait{margin:0 auto 16px;width:88px;height:88px}
.agent-chat-title{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}
.agent-chat-title h3{margin:0;font-size:16px}.agent-chat-title button{font-size:12px;padding:7px 9px;min-height:36px}
.agent-chat-context .edward-chat-controls{grid-template-columns:minmax(0,1fr) 100px;gap:8px}
.agent-chat-context select{width:100%;min-width:0;font:inherit;font-size:12px}
.agent-chat-log{height:clamp(230px,42vh,490px);min-height:0;padding:10px;margin-top:12px;overflow:auto;background:#f8fafc;border:1px solid #e7edf3;border-radius:14px;overscroll-behavior:contain}
.agent-chat-log .edward-bubble{max-width:96%;font-size:13px;padding:10px;white-space:normal}
.agent-chat-log .edward-bubble{white-space:pre-wrap}.agent-chat-log .edward-preview{white-space:normal}
.agent-chat-compose{display:flex;flex-direction:column;align-items:stretch;gap:8px}
.agent-chat-compose textarea{width:100%;min-height:80px;font:inherit;font-size:14px;resize:none;line-height:1.5;border:1px solid #dbe4ed;border-radius:12px;padding:12px;color:#20344d}.agent-chat-compose button{min-height:42px;padding:9px 18px;border-radius:11px;background:#086181;color:#fff;font-weight:700}
.agent-chat-status{min-height:18px;font-size:12px;color:#527087;margin:8px 0}
.agent-chat-hint{display:block;margin-top:8px;font-size:11px;color:#748399}
.agent-chat-sidebar :focus-visible{outline:2px solid #0784a7;outline-offset:3px}
.agent-workspace--chat .agent-tool-grid{grid-template-columns:1fr}
.agent-workspace--chat .edward-chat-controls{grid-template-columns:minmax(0,1fr) 100px}
@media(max-width:1150px){.agent-workspace--chat{grid-template-columns:minmax(0,1fr)}.agent-chat-sidebar{position:static}.agent-chat-header{display:flex;align-items:center;gap:14px}.agent-chat-header>.agent-detail-portrait{width:54px;height:54px;margin:0 0 12px}.agent-chat-title{flex:1}.agent-chat-log{height:340px;max-height:50vh}}
@media(max-width:480px){.agent-chat-sidebar{padding:14px}.agent-chat-context .edward-chat-controls{grid-template-columns:1fr}.agent-chat-title{flex-wrap:wrap}.agent-chat-hint{font-size:10px}}

.agent-chat-partial{margin:10px 0;padding:10px;border:1px solid #d5e7ef;border-radius:12px;background:#fff;color:#263b55;font-size:13px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}.agent-chat-partial small{display:block;color:#60778a;font-size:11px;margin-bottom:6px}.agent-chat-status{line-height:1.5}

/* Fit the complete composer to the current viewport; only history consumes spare space. */
@media(min-width:1151px){
.agent-chat-sidebar{display:flex;flex-direction:column;height:var(--agent-chat-height,calc(100dvh - 160px));overflow-y:auto}
.agent-chat-sidebar[data-chat-collapsed="true"]{height:auto}
.agent-chat-header,.agent-chat-context,.agent-chat-compose,.agent-chat-status,.agent-chat-hint{flex-shrink:0}
.agent-chat-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.agent-chat-content>.agent-chat-log{height:auto;max-height:none;min-height:40px;flex:1;overflow-y:auto;scrollbar-gutter:stable}
.agent-chat-compose textarea{min-height:80px}
}
@media(min-width:1151px) and (max-height:700px){.agent-chat-hint{display:none}.agent-chat-status{font-size:11px;margin:4px 0}.agent-chat-header>.agent-detail-portrait{width:32px;height:32px}.agent-chat-compose textarea{min-height:64px}.agent-chat-sidebar{padding:10px}}

/* Keep the focus border inside the composer rather than clipping an outside outline. */
.agent-chat-compose{padding:3px;min-width:0}
.agent-chat-compose textarea{box-sizing:border-box;min-width:0}
.agent-chat-sidebar .agent-chat-compose textarea:focus,
.agent-chat-sidebar .agent-chat-compose textarea:focus-visible{outline:none;outline-offset:0;border-color:#0784a7;box-shadow:inset 0 0 0 1px #0784a7}
@media(min-width:1151px){.agent-chat-sidebar{top:12px;margin-top:calc(-1 * var(--agent-chat-lift,0px));box-sizing:border-box}}

.agent-project-picker{margin-top:10px}.agent-project-row{display:flex;align-items:end;gap:8px}.agent-project-row label{flex:1;min-width:0;font-size:11px;color:#63778b}.agent-project-row select{display:block;margin-top:4px;padding:8px;border:1px solid #dce5ee;border-radius:8px;background:#fff}.agent-project-row button,.agent-project-create button{font-size:11px;padding:8px;white-space:nowrap}.agent-project-hint{display:block;font-size:10px;color:#63778b;margin:5px 0}.agent-project-create{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.agent-project-create[hidden]{display:none}.agent-project-create input{width:100%;box-sizing:border-box;padding:8px;border:1px solid #dce5ee;border-radius:8px;font:inherit;font-size:12px}

/* Project forms scroll inside context; the composer keeps its viewport space. */
@media(min-width:1151px){
.agent-chat-content>.agent-chat-context{flex:0 1 auto;min-height:0;max-height:45%;overflow-y:auto;overflow-x:hidden;padding:3px;scroll-padding-block:4px}
.agent-chat-content>.agent-chat-log{flex:1 1 0;min-height:0}
.agent-chat-status{max-height:3em;overflow-y:auto;overflow-wrap:anywhere}
}
.agent-project-create{padding:3px;min-width:0}.agent-chat-context :focus-visible{outline-offset:1px}
.agent-chat-sidebar .agent-project-create input:focus,.agent-chat-sidebar .agent-project-create input:focus-visible{outline:none;outline-offset:0;border-color:#0784a7;box-shadow:inset 0 0 0 1px #0784a7}
.agent-project-brief{margin:8px 0;font-size:12px}.agent-project-brief summary{cursor:pointer;color:#086181}.agent-project-brief label,.agent-project-brief small{display:block;margin:6px 0}.agent-project-brief textarea{box-sizing:border-box;width:100%;min-height:120px;max-height:260px;resize:vertical;font:inherit;padding:8px;border:1px solid #dbe4ed;border-radius:8px}

/* Embedded hosts reuse the same chat without the desktop sidebar geometry. */
[data-chat-layout="embedded"]{position:static;height:auto;max-height:none;padding:14px;border:1px solid #dce7ef;border-radius:12px;background:#fff}
[data-chat-layout="embedded"] .agent-chat-header{display:flex;align-items:center;gap:10px}
[data-chat-layout="embedded"] .agent-chat-header>.agent-detail-portrait{width:32px;height:32px;margin:0 0 10px;border-radius:50%;object-fit:cover}
[data-chat-layout="embedded"] .agent-chat-title{flex:1}
[data-chat-layout="embedded"] .agent-chat-content{display:block;overflow:visible}
[data-chat-layout="embedded"] .agent-chat-content>.agent-chat-log{flex:none;height:auto;max-height:340px;min-height:0;overflow:auto}
[data-chat-layout="embedded"] .agent-chat-compose textarea{box-sizing:border-box;min-height:54px}
.agent-chat-suggestions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.agent-chat-suggestions button{padding:7px 10px;border:1px solid #d8e5ed;border-radius:16px;background:#f5fafc;color:#28576d;font:inherit;font-size:12px;cursor:pointer}
.agent-chat-message{padding:10px 12px;margin:8px 0;border-radius:10px;background:#fff;color:#29495d;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.5}
.agent-chat-message--user{background:#e8f5f7;margin-left:28px}
.agent-chat-message>small{display:block;color:#657e8f;margin-bottom:4px;font-size:11px}
.agent-chat-message details{margin-top:8px;font-size:11px;color:#647d8d}

[data-chat-layout="embedded"] .agent-chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px}
@media(max-width:480px){[data-chat-layout="embedded"] .agent-chat-compose{grid-template-columns:minmax(0,1fr)}}

/* Embedded chats must not depend on the InboxIQ application's global button styles. */
[data-chat-layout="embedded"]{scroll-margin-top:20px;margin-bottom:16px}
[data-chat-layout="embedded"] button{font:inherit;cursor:pointer;border:1px solid #dce7ef;border-radius:9px;padding:7px 12px;background:#fff;color:#28576d}
[data-chat-layout="embedded"] button:disabled{cursor:default;opacity:.55}
[data-chat-layout="embedded"] .agent-chat-compose button{background:#086181;color:#fff;border-color:#086181;font-weight:600}
[data-chat-layout="embedded"] .agent-chat-context [role="alert"]{color:#a34235;font-size:13px}
[data-chat-layout="embedded"] .agent-chat-suggestions button{border-radius:16px;background:#f5fafc}

[data-chat-layout="embedded"] .agent-chat-compose [data-chat-stop]{background:#fff5f2;border-color:#eed3ca;color:#9c4030}

/* EDWARD's settings open over the chat so the composer keeps its space. */
#agent-chat-sidebar .agent-chat-header{position:relative;z-index:1;margin-bottom:4px}
#agent-chat-sidebar .agent-chat-header>.agent-detail-portrait{width:32px;height:32px;margin:0;border-radius:50%}
#agent-chat-sidebar .agent-chat-title{flex:1;flex-wrap:nowrap;margin:0}
.agent-chat-settings>summary{display:grid;place-items:center;width:36px;height:36px;border-radius:8px;cursor:pointer;list-style:none;font-size:23px}
.agent-chat-settings>summary::-webkit-details-marker{display:none}
.agent-chat-settings>summary:hover,.agent-chat-settings[open]>summary{background:#e8f5fa}
.agent-chat-settings>.agent-chat-context{position:absolute;inset:100% 0 auto;background:#fff;border:1px solid #dce7ef;border-radius:12px;padding:12px;display:grid;gap:8px;max-height:min(55dvh,420px);overflow:auto;box-shadow:0 8px 24px #12233f20}
.agent-chat-settings .agent-chat-context label{font-size:12px;color:#475e75}
.agent-chat-settings .agent-chat-context select{display:block}
.agent-chat-settings .agent-chat-context>label{display:grid;gap:6px;font-weight:700}
.agent-chat-settings .agent-chat-context>label>select{appearance:none;min-height:42px;padding:9px 32px 9px 11px;border:1px solid #dce5ee;border-radius:10px;color:#263b55;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23475e75' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;text-overflow:ellipsis;cursor:pointer}
.agent-chat-settings .agent-chat-context>label>select:hover:not(:disabled){border-color:#97b6c8}
.agent-chat-settings .agent-chat-context>label>select:disabled{opacity:.65;cursor:not-allowed}
@media(forced-colors:active){.agent-chat-settings .agent-chat-context>label>select{appearance:auto;background-image:none;padding-right:11px}}
.agent-chat-settings .agent-project-picker{margin-top:0}
#agent-chat-sidebar[data-chat-collapsed="true"]{overflow:visible}

#edward-splitter{display:none}
@media(min-width:1151px){
.agent-workspace--chat{grid-template-columns:minmax(400px,1fr) 24px minmax(320px,var(--edward-chat-width,380px));gap:0}
.agent-workspace--chat #edward-splitter{display:grid;justify-items:center;align-items:start;align-self:stretch;cursor:col-resize;touch-action:none}
#edward-splitter::before{content:"";position:sticky;top:45vh;margin-top:24px;width:4px;height:36px;background:#a4b9c8;border-radius:4px}
#edward-splitter:hover::before,#edward-splitter:active::before,#edward-splitter:focus-visible::before{background:#08718b}
#edward-splitter:focus-visible{outline:none}
#edward-splitter:focus-visible::before{outline:2px solid #08718b;outline-offset:3px}
@media(forced-colors:active){#edward-splitter::before{background:CanvasText;forced-color-adjust:none}#edward-splitter:focus-visible::before{outline-color:Highlight}}
}
