/* Agent workspace: quiet surfaces, readable conversation, one clear action. */
.portal-page {
  --agent-ink:var(--text-primary);
  --agent-secondary:var(--text-secondary);
  --agent-muted:var(--text-tertiary);
  --agent-line:var(--border-default);
  --agent-soft:var(--surface-subtle);
  --agent-accent:#d84b2a;
  --agent-radius:12px;
}
.app-layout { grid-template-columns:256px minmax(0,1fr); background:#fff; }
.app-sidebar { padding:24px 12px 16px; background:var(--surface-subtle); border-color:var(--border-subtle); }
.app-brand { margin:0 16px 24px; }
.app-space-caption { padding:0 16px; margin-bottom:20px; line-height:1.6; }
.app-space-caption strong { font-size:var(--font-body); }
.app-navigation button { padding:12px; font-size:var(--font-body); }
.app-navigation button>small { margin-left:auto; font-size:var(--font-caption); color:var(--agent-muted); }
.agent-sidebar-heading { display:flex; justify-content:space-between; align-items:center; padding:24px 12px 12px; font-size:var(--font-small); font-weight:500; color:var(--agent-secondary); }
.agent-sidebar-heading button { display:grid; place-items:center; width:30px; height:30px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--agent-ink); font-size:23px; font-weight:300; }
.agent-sidebar-heading button:hover { background:var(--border-subtle); }
.agent-contacts { min-height:0; flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:4px; padding-bottom:16px; scrollbar-width:thin; }
.agent-contact { display:flex; align-items:center; gap:12px; width:100%; min-width:0; padding:11px 12px; text-align:left; border:1px solid transparent; border-radius:8px; background:transparent; }
.agent-contact:hover { background:var(--border-subtle); }
.agent-contact[aria-current="page"] { background:#fff; border-color:var(--border-default); box-shadow:0 2px 4px #00000003; }
.agent-contact-avatar { position:relative; display:grid; place-items:center; flex-shrink:0; width:36px; height:36px; border:1px solid var(--border-default); border-radius:12px; background:var(--border-subtle); color:var(--text-secondary); font-size:15px; font-weight:500; }
.agent-contact-avatar.role-prospecting { background:#fff0e9; color:#a6381d; border-color:#efd5c8; }
.agent-contact-avatar.role-research { background:#eeedf4; color:#57506e; border-color:#ddd9e7; }
.agent-contact-avatar.role-outreach { background:#edf3ec; color:#496345; border-color:#d7e4d4; }
.agent-contact.is-working .agent-contact-avatar::after { content:""; position:absolute; right:-3px; bottom:-3px; width:8px; height:8px; background:var(--agent-accent); border:2px solid var(--surface-subtle); border-radius:50%; }
.agent-contact-copy { display:flex; flex-direction:column; gap:4px; min-width:0; }
.agent-contact-copy strong { font-size:var(--font-body); line-height:1.6; font-weight:500; color:var(--agent-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-contact-copy small { font-size:var(--font-small); line-height:1.6; color:var(--agent-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-sidebar-hint { padding:12px 12px 20px; font-size:var(--font-caption); line-height:1.8; color:var(--agent-muted); }
.agent-sidebar-utilities { display:flex; justify-content:space-between; gap:12px; padding:16px 12px 0; border-top:1px solid var(--border-default); }
.agent-sidebar-utilities button,.agent-sidebar-utilities a { text-decoration:none; border:0; padding:4px 0; background:transparent; font-size:var(--font-small); color:var(--agent-secondary); }
.agent-sidebar-utilities button:hover,.agent-sidebar-utilities a:hover { color:var(--agent-ink); }
.agent-sidebar-error { padding:12px; font-size:var(--font-small); color:#a53921; line-height:1.8; }
.agent-sidebar-error button { border:0; background:none; color:inherit; text-decoration:underline; }
.workspace-data-navigation { display:flex; align-items:center; gap:8px; margin:-8px 0 24px; padding-bottom:16px; border-bottom:1px solid var(--agent-line); }
.workspace-data-navigation>button,.workspace-more>summary { white-space:nowrap; border:0; border-radius:8px; padding:8px 12px; background:none; color:var(--agent-secondary); font-size:var(--font-body); cursor:pointer; }
.workspace-data-navigation>button:hover,.workspace-more>summary:hover { background:var(--agent-soft); }
.workspace-data-navigation>button[aria-current="page"] { color:var(--agent-ink); background:var(--border-subtle); }
.workspace-more { margin-left:auto; position:relative; }
.workspace-more>div { position:absolute; top:40px; right:0; z-index:12; display:flex; flex-direction:column; min-width:160px; padding:6px; border:1px solid var(--agent-line); border-radius:12px; background:#fff; box-shadow:0 8px 24px #0000000d; }
.workspace-more button { padding:10px 12px; border:0; border-radius:6px; background:none; color:var(--agent-secondary); font-size:var(--font-body); text-align:left; }
.workspace-more button:hover { background:var(--agent-soft); color:var(--agent-ink); }
body.agent-conversation-open .app-layout { height:100vh; height:100dvh; min-height:0; overflow:hidden; }
body.agent-conversation-open .app-sidebar { height:100%; min-height:0; }
body.agent-conversation-open .app-content { display:flex; flex-direction:column; min-height:0; }
body.agent-conversation-open .app-topbar { flex-shrink:0; }
body.agent-conversation-open .dashboard-main { flex:1; min-height:0; padding:0; overflow:hidden; }
body.agent-conversation-open .dashboard-note { display:none; }
.agent-view { display:flex; flex-direction:column; width:100%; height:100%; min-height:0; overflow:hidden; background:#fff; color:var(--agent-ink); }
.agent-chat-header,.agent-compose-area,.agent-suggestions,.agent-profile-panel { flex-shrink:0; }
.agent-chat-header { display:flex; align-items:center; gap:12px; padding:20px 32px; border-bottom:1px solid var(--surface-hover); }
.agent-chat-heading { min-width:0; }
.agent-chat-header h1 { margin:0; font-size:var(--font-reading); line-height:1.6; font-weight:500; letter-spacing:-.02em; color:var(--agent-ink); }
.agent-chat-header p { margin:2px 0 0; font-size:var(--font-small); line-height:1.7; color:var(--agent-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-header-state { margin-left:auto; padding:4px 8px; border:1px solid var(--agent-line); border-radius:6px; color:var(--agent-muted); font-size:var(--font-caption); white-space:nowrap; }
.agent-header-state.is-working { color:var(--text-secondary); border-color:var(--border-default); background:var(--surface-subtle); }
.agent-profile-toggle { display:flex; align-items:center; gap:8px; flex-shrink:0; padding:9px 12px; border:1px solid transparent; border-radius:9px; color:var(--agent-secondary); font-size:var(--font-small); background:transparent; }
.agent-profile-toggle svg { width:18px; height:18px; }
.agent-profile-toggle:hover,.agent-profile-toggle[aria-expanded="true"] { background:var(--agent-soft); border-color:var(--agent-line); color:var(--agent-ink); }
.agent-profile-panel { position:relative; display:grid; grid-template-columns:1fr 1fr; gap:24px; max-height:34vh; overflow:auto; padding:24px 48px 24px 24px; margin:16px 32px 0; border:1px solid var(--agent-line); border-radius:var(--agent-radius); background:var(--surface-subtle); }
.agent-section-label { font-size:var(--font-small); line-height:1.5; font-weight:500; color:var(--agent-secondary); }
.agent-profile-panel p { margin:12px 0 8px; color:var(--agent-ink); font-size:var(--font-body); line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.agent-profile-panel small { color:var(--agent-muted); font-size:var(--font-small); line-height:1.8; }
.agent-profile-panel ul { margin:12px 0 0; padding:0; list-style:none; }
.agent-profile-panel li { display:flex; justify-content:space-between; gap:12px; padding:6px 0; font-size:var(--font-body); line-height:1.8; color:var(--agent-ink); overflow-wrap:anywhere; }
.agent-profile-panel li>button { flex-shrink:0; align-self:flex-start; padding:4px 8px; border:0; border-radius:6px; background:none; color:var(--agent-secondary); font-size:var(--font-small); }
.agent-profile-panel li>button:hover { color:#a53921; background:#f5e8e2; }
.agent-profile-panel .agent-memory-empty { color:var(--agent-secondary); font-size:var(--font-body); }
.agent-profile-close { position:absolute; top:12px; right:12px; font-size:22px; }
.agent-thread-area { flex:1; position:relative; min-height:0; }
.agent-thread { height:100%; overflow-y:auto; overscroll-behavior:contain; padding:36px max(32px,calc((100% - 760px)/2)) 24px; scrollbar-gutter:stable; scrollbar-width:thin; }
.agent-message { display:flex; margin-bottom:32px; }
.agent-message-content { width:100%; max-width:100%; min-width:0; }
.agent-message.is-user { justify-content:flex-end; }
.agent-message.is-user .agent-message-content { width:auto; max-width:85%; padding:12px 18px; border-radius:16px 16px 4px 16px; background:var(--surface-hover); }
.agent-message-speaker { display:flex; align-items:center; gap:8px; margin-bottom:12px; color:var(--agent-secondary); font-size:var(--font-small); line-height:1.5; }
.agent-message-mark { display:grid; place-items:center; width:22px; height:22px; border:1px solid #ecd9d1; border-radius:8px; background:#fff1eb; color:#b63e23; font-size:var(--font-body); font-weight:600; }
.agent-message-text { margin:0; color:var(--agent-ink); font-size:var(--font-reading); line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; }
.agent-message.is-user .agent-message-text { font-size:15px; line-height:1.8; }
.agent-message-actions { display:flex; margin-top:8px; min-height:28px; }
.agent-message-copy { display:flex; align-items:center; gap:6px; padding:5px 8px; border:0; border-radius:7px; color:var(--agent-secondary); font-size:var(--font-caption); background:transparent; opacity:0; }
.agent-message-copy svg { width:14px; height:14px; }
.agent-message:hover .agent-message-copy,.agent-message:focus-within .agent-message-copy { opacity:1; }
.agent-message-copy:hover { background:var(--agent-soft); color:var(--agent-ink); }
.agent-view.is-new-agent .agent-thread { display:flex; align-items:center; }
.agent-view.is-new-agent .agent-message { width:100%; margin:16px 0; }
.agent-message.is-welcome .agent-message-speaker { margin-bottom:20px; font-size:var(--font-body); }
.agent-message.is-welcome .agent-message-mark { width:32px; height:32px; border-radius:11px; font-size:18px; }
.agent-message.is-welcome .agent-message-text { max-width:620px; font-size:24px; line-height:1.65; font-weight:500; letter-spacing:-.02em; }
.agent-suggestions { display:flex; flex-wrap:wrap; gap:10px; padding:12px max(32px,calc((100% - 760px)/2)) 20px; }
.agent-suggestion { display:flex; justify-content:space-between; align-items:center; gap:16px; flex:1 1 220px; min-width:0; padding:14px 16px; border:1px solid var(--agent-line); border-radius:12px; background:#fff; color:var(--text-secondary); font-size:var(--font-body); line-height:1.7; text-align:left; }
.agent-suggestion:hover { background:var(--surface-subtle); border-color:var(--border-strong); color:var(--agent-ink); }
.agent-suggestion-arrow { align-self:flex-start; flex-shrink:0; color:var(--agent-muted); font-size:var(--font-reading); }
.agent-compose-area { position:relative; z-index:5; padding:12px max(32px,calc((100% - 760px)/2)) 16px; background:#fff; }
.agent-composer { padding:16px 18px 12px; border:1px solid var(--border-default); border-radius:18px; background:#fff; box-shadow:0 4px 18px #17213307; }
.agent-composer textarea { width:100%; min-height:48px; max-height:160px; padding:0 4px; resize:none; border:0; border-radius:0; outline:none; background:none; color:var(--agent-ink); font:inherit; font-size:var(--font-reading); line-height:1.7; }
.portal-page .agent-composer textarea:focus,.portal-page .agent-composer textarea:focus-visible { outline:none; outline-offset:0; box-shadow:none; }
.agent-composer textarea::placeholder { color:var(--text-tertiary); }
.agent-composer-tools { display:flex; align-items:center; gap:12px; margin-top:8px; }
.agent-composer-tools>span { color:var(--agent-muted); font-size:var(--font-caption); line-height:1.5; }
.agent-attach { display:flex; align-items:center; gap:6px; min-height:36px; padding:6px 8px; border:0; border-radius:8px; background:none; color:var(--agent-secondary); font-size:var(--font-small); }
.agent-attach svg { width:19px; height:19px; }
.agent-attach:hover { background:var(--surface-hover); color:var(--agent-ink); }
.agent-send { display:grid; place-items:center; flex-shrink:0; margin-left:auto; width:36px; height:36px; padding:0; border:1px solid var(--text-primary); border-radius:50%; background:var(--text-primary); color:#fff; }
.agent-send svg { width:20px; height:20px; }
.agent-send:not(:disabled):hover { background:var(--text-secondary); }
.agent-send[aria-busy="true"]::before { margin:0!important; width:14px; height:14px; }
.agent-send[aria-busy="true"] svg { display:none; }
.agent-send:disabled:not([aria-busy="true"]) { background:var(--border-default); border-color:var(--border-default); color:var(--text-tertiary); opacity:1; }
.agent-compose-note { margin:10px 0 0; text-align:center; font-size:var(--font-caption); line-height:1.6; color:var(--agent-muted); }
.agent-attachments { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 12px; }
.agent-attachment { display:inline-flex; align-items:center; gap:8px; max-width:100%; padding:6px 8px 6px 12px; border:1px solid var(--border-default); border-radius:8px; background:#fff; color:var(--text-secondary); font-size:var(--font-small); }
.agent-attachment>span { overflow-wrap:anywhere; }
.agent-attachment button { display:grid; place-items:center; flex-shrink:0; width:24px; height:24px; padding:0; border:0; border-radius:5px; background:none; color:var(--agent-secondary); font-size:18px; }
.agent-attachment button:hover { background:var(--border-subtle); }
.agent-result-card { width:100%; max-width:640px; min-width:0; margin-top:20px; padding:20px; border:1px solid var(--border-default); border-radius:var(--agent-radius); background:#fff; }
.agent-card-heading { display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.agent-card-symbol { display:grid; place-items:center; color:var(--text-secondary); }
.agent-card-symbol svg { width:18px; height:18px; }
.agent-card-eyebrow { font-size:var(--font-small); line-height:1.5; color:var(--agent-secondary); }
.agent-card-status { display:inline-flex; align-items:center; gap:5px; margin-left:auto; padding:4px 7px; border:1px solid var(--border-default); border-radius:6px; background:#f7f7f2; font-size:var(--font-caption); line-height:1.4; color:#626251; }
.agent-card-status.is-running { color:#285b85; background:#f0f7fc; border-color:#d4e4ef; }
.agent-card-status.is-completed { color:#306641; background:#f1f8f1; border-color:#d8e9d7; }
.agent-card-status.is-failed { color:#a53921; background:#fff4ef; border-color:#eed3c6; }
.agent-result-card h3 { margin:0 0 8px; font-size:17px; line-height:1.6; font-weight:500; letter-spacing:-.02em; color:var(--agent-ink); overflow-wrap:anywhere; }
.agent-card-description { margin:0; color:var(--agent-secondary); font-size:var(--font-body); line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.agent-task-facts { display:grid; grid-template-columns:1.3fr 1fr .7fr; gap:16px; margin:20px 0 0; padding-top:16px; border-top:1px solid var(--border-subtle); }
.agent-task-facts>div { min-width:0; }
.agent-task-facts dt { margin-bottom:6px; color:var(--agent-muted); font-size:var(--font-small); }
.agent-task-facts dd { margin:0; color:var(--text-primary); font-size:var(--font-body); line-height:1.8; overflow-wrap:anywhere; }
.agent-card-outcome { margin:16px 0 0; color:#306641; font-size:var(--font-body); }
.agent-card-actions,.agent-card-choices { display:flex; flex-wrap:wrap; gap:8px; margin-top:20px; }
.agent-card-action { min-height:36px; padding:8px 12px; border:1px solid var(--border-default); border-radius:8px; background:#fff; color:var(--text-secondary); font-size:var(--font-body); line-height:1.5; text-align:left; }
.agent-card-action:hover,.agent-card-action[aria-pressed="true"] { border-color:#9c9c8b; background:#f5f5ef; color:var(--text-primary); }
.agent-card-action.is-primary { border-color:var(--text-primary); background:var(--text-primary); color:#fff; }
.agent-card-action.is-primary:hover { background:var(--text-secondary); border-color:var(--text-secondary); }
.agent-card-footnote { margin:16px 0 0; color:var(--agent-muted); font-size:var(--font-small); line-height:1.8; }
.agent-connection-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:20px; }
.agent-connection-options button { display:flex; align-items:center; gap:8px; padding:12px 10px; }
.agent-provider-mark { display:grid; place-items:center; flex-shrink:0; width:25px; height:25px; border:1px solid var(--border-default); border-radius:7px; background:#f7f7f2; color:var(--text-secondary); font-size:var(--font-small); font-weight:600; }
.agent-knowledge-file { display:flex; align-items:center; gap:12px; margin-top:12px; padding:12px; border:1px solid var(--border-subtle); border-radius:10px; background:var(--surface-subtle); }
.agent-knowledge-file svg { width:24px; height:24px; flex-shrink:0; color:var(--agent-secondary); }
.agent-knowledge-file>div { display:flex; flex-direction:column; gap:4px; min-width:0; }
.agent-knowledge-file strong { color:var(--text-secondary); font-size:var(--font-body); font-weight:500; overflow-wrap:anywhere; }
.agent-knowledge-file span { color:var(--agent-muted); font-size:var(--font-small); }
.agent-source-link { display:block; color:#3d5a6d; font-size:var(--font-body); line-height:1.8; overflow-wrap:anywhere; text-decoration:underline; text-underline-offset:4px; }
.agent-load-error,.agent-turn-error { padding:14px 16px; border:1px solid #ebd4c9; border-radius:12px; background:#fff8f3; color:#914128; font-size:var(--font-body); line-height:1.8; }
.agent-load-error { margin:16px 32px; }
.agent-turn-error { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:8px; padding:4px 6px; border:0; border-radius:0; background:transparent; color:var(--agent-secondary); font-size:var(--font-body); line-height:1.6; }
.agent-turn-error>span { display:flex;align-items:center;gap:8px;flex:1 1 auto;min-width:0; }
.agent-turn-error>span:before { content:"";width:6px;height:6px;flex:none;border-radius:50%;background:#a18b71; }
.agent-turn-error button { min-height:36px;padding:6px 10px;border:0;border-radius:7px;background:none;color:var(--agent-ink);font-size:var(--font-body); }
.agent-turn-error button:hover { background:var(--agent-soft); }
.agent-loading { color:var(--agent-secondary); font-size:var(--font-body); }
.agent-pending { display:flex; align-items:center; gap:10px; color:var(--agent-secondary); font-size:var(--font-small); line-height:1.8; padding:12px 0 20px; }
.agent-jump { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:8px; padding:8px 14px; border:1px solid var(--border-default); border-radius:999px; background:#fff; color:var(--text-primary); box-shadow:0 3px 12px #0000000a; font-size:var(--font-small); }
.agent-jump:hover { background:#f5f5ef; }
.workbench-agent-shortcuts { display:flex; flex-wrap:wrap; gap:12px; margin:24px 0; }
.workbench-agent-shortcuts button { padding:12px 16px; border:1px solid var(--agent-line); border-radius:10px; background:#fff; color:var(--agent-secondary); font-size:var(--font-body); }
.workbench-agent-shortcuts button:hover { border-color:var(--border-strong); color:var(--agent-ink); }
@keyframes agent-breathe { from {opacity:.35;} to {opacity:1;} }
@media(max-width:1050px) {
 .app-layout { grid-template-columns:224px minmax(0,1fr); }
 .app-navigation button>small { display:none; }
 .agent-contact { gap:8px; padding:10px; }
 .agent-header-state { display:none; }
 .agent-chat-header,.agent-thread,.agent-compose-area,.agent-suggestions { padding-left:24px; padding-right:24px; }
 .agent-profile-panel { margin-left:24px; margin-right:24px; }
 .workspace-data-navigation { gap:0; }
 .workspace-data-navigation>button { padding:8px; font-size:var(--font-small); }
}
@media(max-width:760px) {
 .app-layout { display:flex; flex-direction:column; }
 .app-sidebar { position:relative; height:auto; padding:14px 16px 10px; flex-shrink:0; }
 body.agent-conversation-open .app-sidebar { height:auto; }
 .app-brand { margin:0 0 10px; }
 .app-space-caption,.agent-sidebar-hint,.agent-sidebar-utilities { display:none; }
 .app-navigation { position:absolute; right:16px; top:12px; }
 .app-navigation button { width:auto; padding:7px 10px; font-size:var(--font-small); }
 .app-navigation button small,.app-navigation svg { display:none; }
 .agent-sidebar-heading { padding:0 2px 4px; font-size:var(--font-caption); }
 .agent-sidebar-heading button { width:28px; height:28px; }
 .agent-contacts { flex-direction:row; flex:none; overflow-x:auto; padding:0 0 2px; gap:6px; }
 .agent-contact { flex-shrink:0; width:auto; min-width:0; max-width:200px; padding:7px 10px; gap:7px; border-radius:9px; }
 .agent-contact-copy strong { font-size:var(--font-small); }
 .agent-contact-copy small { display:none; }
 .agent-contact-avatar { width:24px; height:24px; border-radius:8px; font-size:var(--font-caption); }
 .app-topbar { position:relative; height:40px; padding:0 16px; }
 .app-mobile-brand,.app-topbar-right .portal-pill,.app-user { display:none; }
 .app-topbar-title { font-size:var(--font-caption); }
 .agent-chat-header { padding:14px 16px; gap:10px; }
 .agent-chat-header>.agent-contact-avatar { display:none; }
 .agent-chat-heading { flex:1; }
 .agent-chat-header h1 { font-size:15px; }
 .agent-chat-header p { max-width:220px; font-size:var(--font-caption); }
 .agent-profile-toggle { padding:8px; margin-left:auto; font-size:var(--font-small); }
 .agent-profile-toggle svg { display:none; }
 .agent-profile-panel { grid-template-columns:1fr; gap:20px; padding:20px 40px 20px 20px; margin:12px 16px 0; }
 .agent-thread { padding:24px 16px 12px; scrollbar-gutter:auto; }
 .agent-message { margin-bottom:24px; }
 .agent-message-text { font-size:var(--font-reading); }
 .agent-message.is-user .agent-message-content { max-width:92%; padding:10px 14px; }
 .agent-message.is-user .agent-message-text { font-size:15px; }
 .agent-message.is-welcome .agent-message-text { font-size:21px; line-height:1.6; }
 .agent-message.is-welcome .agent-message-speaker { margin-bottom:12px; }
 .agent-suggestions { padding:8px 16px 12px; gap:8px; }
 .agent-suggestion { flex-basis:100%; padding:10px 12px; font-size:var(--font-small); }
 .agent-compose-area { padding:8px 12px max(8px,env(safe-area-inset-bottom)); }
 .agent-composer { padding:12px 12px 8px; border-radius:18px; }
 .agent-composer textarea { min-height:42px; }
 .agent-composer-tools>span { display:none; }
 .agent-send { margin-left:auto; }
 .agent-compose-note { font-size:var(--font-caption); margin-top:7px; }
 .agent-result-card { padding:16px; }
 .agent-result-card h3 { font-size:var(--font-reading); }
 .agent-task-facts { gap:12px; grid-template-columns:1fr 1fr; }
 .agent-task-facts>div:first-child { grid-column:1/-1; }
 .agent-card-status { max-width:52%; }
 .agent-connection-options { grid-template-columns:1fr; }
 .agent-connection-options button { padding:10px 12px; }
 .agent-load-error { margin:12px 16px; }
 .workspace-data-navigation { overflow-x:auto; margin-top:0; align-items:flex-start; }
 .workspace-more { position:static; margin-left:0; }
 .workspace-more>div { position:fixed; right:16px; top:176px; }
}
@media(max-height:650px) and (max-width:760px) {
 .agent-chat-header p,.agent-compose-note { display:none; }
 .agent-chat-header { padding-top:8px; padding-bottom:8px; }
 .agent-sidebar-heading { display:none; }
 .agent-view.is-new-agent .agent-thread { align-items:flex-start; }
 .agent-message.is-welcome .agent-message-text { font-size:18px; }
 .agent-suggestions { display:none; }
}
@media(hover:none) { .agent-message-copy { opacity:1; } }
@media(pointer:coarse) {
 .agent-contact,.agent-suggestion,.agent-card-action { min-height:44px; }
 .agent-attachment button,.agent-attach,.agent-profile-toggle,.agent-sidebar-heading button,.agent-send,.agent-profile-close { min-width:40px;min-height:40px; }
}

/* Stable vector portraits and direct, keyboard-accessible contact management. */
.agent-avatar-art { display:block; width:100%; height:100%; flex-shrink:0; overflow:visible; }
.agent-contact-avatar { width:40px; height:40px; padding:0; border:0; border-radius:8px; background:transparent; }
.agent-message-mark { width:28px; height:28px; padding:0; border:0; border-radius:9px; background:transparent; }
.agent-message.is-welcome .agent-message-mark { width:44px; height:44px; background:transparent; }
.agent-contact-row { position:relative; flex-shrink:0; min-width:0; border:1px solid transparent; border-radius:12px; }
.agent-contact-row.is-current { border-color:var(--border-default); background:#fff; box-shadow:0 2px 4px #00000003; }
.agent-contact-row:hover { background:var(--border-subtle); }
.agent-contact-row .agent-contact { padding-right:42px; border:0; }
.agent-contact-row .agent-contact[aria-current="page"],.agent-contact-row .agent-contact:hover { background:transparent; box-shadow:none; }
.agent-contact-delete { position:absolute; top:50%; right:6px; transform:translateY(-50%); display:grid; place-items:center; width:30px; height:34px; padding:7px; border:0; border-radius:7px; background:transparent; color:var(--text-secondary); opacity:0; }
.agent-contact-delete svg { width:16px; height:16px; }
.agent-contact-row:is(:hover,:focus-within,.is-current) .agent-contact-delete { opacity:1; }
.agent-contact-delete:not(:disabled):hover { color:#aa3c28; background:#f9e7df; }
.agent-contact-delete:disabled { opacity:.4; }
.agent-profile-management { grid-column:1/-1; display:flex; justify-content:space-between; align-items:center; gap:16px; padding-top:16px; border-top:1px solid var(--border-subtle); }
.agent-profile-management p { margin:0; font-size:var(--font-small); color:var(--agent-muted); }
.agent-delete-action { flex-shrink:0; min-height:36px; padding:8px 12px; border:1px solid #e6d1c9; border-radius:8px; background:#fff; color:#a23c28; font-size:var(--font-small); }
.agent-delete-action:hover { background:#fff1eb; border-color:#dba898; }
.agent-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; min-height:0; overflow:auto; padding:32px; text-align:center; }
.agent-empty-art { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.agent-empty-art svg { width:64px; height:64px; transform:rotate(-8deg); }
.agent-empty-art svg:nth-child(2) { width:82px; height:82px; transform:translateY(-10px); }
.agent-empty-art svg:nth-child(3) { transform:rotate(8deg); }
.agent-empty h2 { margin:0; font-size:25px; line-height:1.6; font-weight:500; letter-spacing:-.02em; }
.agent-empty p { max-width:420px; margin:0 0 8px; color:var(--agent-secondary); font-size:var(--font-body); line-height:1.9; }
.agent-empty .portal-button { min-height:42px; padding:12px 20px; }
.agent-view.is-empty-state .agent-chat-header>.agent-contact-avatar { display:none; }
.task-agent-removed { padding:12px 14px; border:1px solid var(--border-default); border-radius:8px; background:#fafaf6; color:var(--text-secondary); font-size:var(--font-small); line-height:1.8; }
@media(max-width:760px) {
 .agent-contact-row { width:auto; max-width:230px; border-radius:10px; }
 .agent-contact-row .agent-contact { max-width:none; padding-right:38px; }
 .agent-contact-avatar { width:30px; height:30px; }
 .agent-contact-delete { width:28px; height:32px; padding:6px; opacity:1; }
 .agent-chat-header>.agent-contact-avatar { display:block; width:34px; height:34px; }
 .agent-chat-header h1 { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
 .agent-chat-header p { max-width:180px; }
 .agent-profile-management { align-items:flex-start; flex-direction:column; gap:8px; }
 .agent-empty { padding:24px; }
 .agent-empty h2 { font-size:21px; }
 .agent-empty-art { gap:8px; }
 .agent-empty-art svg { width:48px; height:48px; }
 .agent-empty-art svg:nth-child(2) { width:64px; height:64px; }
}
@media(hover:none) { .agent-contact-delete { opacity:1; } }
@media(pointer:coarse) { .agent-contact-row .agent-contact { padding-right:46px; } .agent-contact-delete { width:40px; height:40px; padding:12px; right:2px; } .agent-delete-action { min-height:40px; } }
.agent-customer-list { display:grid;gap:0;margin:16px 0 7px }
.agent-customer-row { display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px 0;border-bottom:1px solid var(--surface-selected) }
.agent-customer-row:last-child { border-bottom:0 }
.agent-customer-copy { display:grid;gap:3px;min-width:0 }
.agent-customer-open { border:0;padding:0;background:transparent;color:var(--text-primary);text-align:left;font:inherit;font-size:var(--font-body);font-weight:500;cursor:pointer;overflow-wrap:anywhere }
.agent-customer-open:hover { text-decoration:underline;text-underline-offset:3px }
.agent-customer-domain { color:var(--text-tertiary);font-size:var(--font-caption);overflow-wrap:anywhere }
.agent-customer-feedback { display:flex;gap:5px;flex-shrink:0 }
.agent-feedback-choice { border:1px solid var(--border-subtle);border-radius:6px;padding:5px 8px;background:#fff;color:var(--text-tertiary);font:inherit;font-size:var(--font-caption);cursor:pointer;white-space:nowrap }
.agent-feedback-choice:hover:not(:disabled) { border-color:var(--text-tertiary);color:var(--text-primary) }
.agent-feedback-choice[aria-pressed="true"] { color:var(--text-primary);border-color:var(--text-tertiary);background:var(--surface-hover) }
.agent-feedback-choice[data-agent-feedback="rejected"][aria-pressed="true"] { color:#a8553b;border-color:#e5cabb;background:#fff6f0 }
.agent-feedback-choice:disabled { opacity:.45;cursor:not-allowed }
.agent-results-count { margin-left:auto;color:var(--text-tertiary);font-size:var(--font-caption);white-space:nowrap }
.agent-results-empty { font-size:var(--font-small);color:var(--text-tertiary);margin:18px 0 }
@media(max-width:480px) {
  .agent-customer-row { align-items:flex-start;flex-direction:column;gap:9px }
  .agent-customer-feedback { align-self:flex-start }
  .agent-feedback-choice { min-height:34px;padding:6px 11px }
  .agent-customer-results .agent-card-actions { flex-wrap:wrap }
}
/* Execution records stay with their originating message, leaving the latest turn last. */
.agent-reveal-piece { animation:agent-reveal-piece 160ms ease-out; }
@keyframes agent-reveal-piece { from { opacity:.75;transform:translateY(2px); } to { opacity:1;transform:translateY(0); } }
.agent-message-work { min-width:0; }
.agent-message-work[data-historical="true"] { margin:10px 0;border:1px solid var(--border-subtle);border-radius:8px;padding:0 12px; }
.agent-message-work>summary { display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:38px;padding:8px 0;list-style:none;color:var(--text-secondary);font-size:13px;line-height:21px;cursor:pointer; }
.agent-message-work>summary::-webkit-details-marker { display:none; }
.agent-message-work>summary:after { content:'';width:6px;height:6px;flex:none;border:solid currentColor;border-width:0 1.5px 1.5px 0;rotate:45deg;transition:rotate 160ms ease; }
.agent-message-work[open]>summary:after { rotate:225deg; }
.agent-message-work>summary:hover { color:var(--text-primary); }
.agent-run-record.is-inline { width:100%;padding:15px 0 0;margin-top:15px;border-top:1px solid var(--border-subtle); }
.agent-run-record.is-inline .agent-run-title { display:none; }.agent-run-record.is-inline .agent-run-process { margin-top:0; }
@media(prefers-reduced-motion:reduce){.agent-reveal-piece{animation:none}.agent-message-work>summary:after{transition:none}}
.agent-activity { width:100%;max-width:760px;margin:18px auto 0; }
.agent-activity-state { color:#77533c;font-size:var(--font-small);line-height:1.7;margin:10px 0; }
.agent-run-record { padding:20px 0;border-top:1px solid var(--border-subtle);margin-top:14px; }
.agent-run-title { display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;line-height:1.7;margin-bottom:10px; }
.agent-run-title>span { font-size:var(--font-caption);color:var(--text-tertiary); }.agent-run-title strong { font-size:var(--font-body);font-weight:500; }.agent-run-title small { color:var(--text-tertiary);font-size:var(--font-caption); }
.agent-run-process { border:1px solid var(--border-subtle);border-radius:12px;background:var(--surface-subtle);overflow:hidden; }
.agent-run-process>summary { display:flex;align-items:center;gap:10px;list-style:none;cursor:pointer;padding:13px 15px;min-height:52px;box-sizing:border-box; }
.agent-run-process>summary::-webkit-details-marker { display:none; }.agent-run-process>summary:focus-visible { outline:2px solid #b76a45;outline-offset:-3px; }
.agent-run-label { display:grid;gap:4px;flex:1;min-width:0; }.agent-run-label strong { font-size:var(--font-small);font-weight:500;color:var(--text-primary); }.agent-run-label small { font-size:var(--font-caption);color:var(--text-tertiary); }
.agent-run-indicator { width:9px;height:9px;border-radius:50%;background:#879889;flex-shrink:0; }.is-running .agent-run-indicator,.is-queued .agent-run-indicator { background:#c7774b;box-shadow:0 0 0 4px #f4e6dc; }.is-failed .agent-run-indicator { background:#b56855; }.is-canceled .agent-run-indicator { background:var(--text-tertiary); }
.agent-run-chevron { color:var(--text-tertiary); }.agent-run-process[open] .agent-run-chevron { transform:rotate(180deg); }
.agent-run-timeline { list-style:none;margin:0;padding:0 17px 16px 29px;max-height:320px;overflow:auto;overscroll-behavior:contain; }
.agent-run-timeline>li { border-left:1px solid var(--border-default);position:relative;padding:2px 0 16px 17px; }.agent-run-timeline>li:last-child { padding-bottom:0; }.agent-run-timeline>li::before { content:'';position:absolute;left:-3px;top:9px;width:5px;height:5px;border-radius:50%;background:#b8b4a9; }
.agent-run-timeline>li>div { display:flex;align-items:baseline;justify-content:space-between;gap:10px; }.agent-run-timeline strong { font-size:var(--font-caption);font-weight:500;color:var(--text-secondary); }.agent-run-timeline time { color:var(--text-tertiary);font-size:var(--font-caption);white-space:nowrap; }.agent-run-timeline p { font-size:var(--font-caption);line-height:1.8;color:var(--text-tertiary);margin:5px 0 0;overflow-wrap:anywhere; }
.agent-run-footnote,.agent-run-counters { font-size:var(--font-caption);color:var(--text-tertiary);line-height:1.8;margin:9px 2px; }.agent-run-footnote { padding:0 15px 10px; }
.agent-run-problem { font-size:var(--font-small);color:#93523c;line-height:1.8;padding:10px 13px;background:#fcf3ed;border-radius:9px; }.agent-run-outcome { font-size:var(--font-body);line-height:1.9;color:var(--text-secondary);overflow-wrap:anywhere;margin:13px 0; }
.agent-run-record .agent-customer-results { margin:13px 0; }.agent-run-record .agent-card-actions { margin-top:12px; }.agent-run-record .agent-card-action { cursor:pointer; }
.agent-customer-evidence { margin-top:8px;color:#635e53;font-size:var(--font-caption); }.agent-customer-evidence>summary { cursor:pointer;color:#936b4c; }.agent-customer-evidence p { line-height:1.8; }.agent-customer-evidence blockquote { border-left:2px solid #e3d6c7;padding-left:10px;margin:8px 0;line-height:1.8;overflow-wrap:anywhere; }.agent-customer-evidence a { color:#956744; }
@media(max-width:760px){.agent-activity { margin-top:12px; }.agent-run-record { padding:16px 0; }.agent-run-process>summary { min-height:58px;padding:13px; }.agent-run-timeline { max-height:260px;padding-left:23px;padding-right:13px; }.agent-run-timeline>li>div { flex-wrap:wrap;gap:3px; }.agent-run-timeline strong,.agent-run-timeline p { font-size:var(--font-small); }.agent-run-record .agent-card-action { min-height:44px; }.agent-customer-evidence>summary { min-height:36px;display:flex;align-items:center; }}
.agent-contact[data-has-result="true"] { position:relative; }.agent-contact[data-has-result="true"]::after { content:'';width:6px;height:6px;background:#c7784d;border-radius:50%;position:absolute;right:10px;top:14px; }.agent-contact[data-has-result="true"] .agent-contact-copy { padding-right:10px; }.agent-contact[data-has-result="true"] small { color:#9d623e; }
.agent-history-more {
  align-self: center;
  display: block;
  min-height: 36px;
  margin: 0 auto 20px;
  padding: 8px 14px;
  border: 1px solid var(--line, #e5e5e5);
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #666);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease;
}
.agent-history-more:hover { color: var(--ink, #171717); border-color: #aaa; }
.agent-history-more:focus-visible { outline: 2px solid #888; outline-offset: 3px; }
.agent-history-more:disabled { cursor: progress; opacity: .65; }


.agent-strategies-button { margin-left:auto; flex-shrink:0; }
@media(max-width:480px) {
 .agent-chat-header { gap:8px; }
 .agent-strategies-button { padding:8px 10px; font-size:var(--font-small); min-height:40px; }
 .agent-profile-toggle span { display:none; }
 .agent-profile-toggle svg { display:block; }
 .agent-profile-toggle { margin-left:0; }
}

/* Name edits are a single focused action beside the conversation title. */
.agent-title-row { display:flex; align-items:center; gap:6px; min-width:0; }
.agent-title-row h1 { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-rename-action { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; padding:0; border:0; border-radius:8px; color:var(--text-tertiary); background:transparent; cursor:pointer; transition:color .16s,background .16s; }
.agent-rename-action svg { width:16px; height:16px; }
.agent-rename-action:hover { color:var(--text-primary); background:var(--surface-subtle); }
.agent-rename-action:focus-visible { outline:2px solid var(--border-default); outline-offset:2px; }
.agent-rename-action:disabled { opacity:.4; cursor:default; }
.agent-rename-dialog { width:min(420px,calc(100vw - 32px)); }
.agent-rename-dialog .portal-input { width:100%; }
.agent-rename-error { margin:10px 0 0; color:var(--color-danger,#b42318); font-size:var(--font-small); }
.agent-avatar-eyes { transform-box:fill-box; transform-origin:center; animation:agent-eye-blink var(--blink-duration,7s) var(--blink-delay,0s) infinite; }
@keyframes agent-eye-blink { 0%,44%,48%,100% { transform:scaleY(1); } 46% { transform:scaleY(.1); } }
.agent-message-mark .agent-avatar-eyes { animation:none; }
@media (max-width:760px) { .agent-rename-action { flex-basis:40px; width:40px; height:40px; } }
@media (prefers-reduced-motion:reduce) { .agent-avatar-eyes { animation:none; } .agent-rename-action { transition:none; } }

.agent-sidebar-utilities{flex-wrap:wrap}.agent-chat-header>a.agent-profile-toggle{text-decoration:none;white-space:nowrap}

/* The face moves independently of the blink, so attention never distorts the eyes. */
.agent-avatar-gaze { transform:translate(var(--gaze-x,0px),var(--gaze-y,0px)); transition:transform 150ms cubic-bezier(.2,.7,.3,1); }
.agent-chat-header .agent-avatar-art,.agent-contact[aria-current="page"] .agent-avatar-art { animation:agent-idle-breathe 5.6s ease-in-out infinite; transform-origin:50% 65%; }
@keyframes agent-idle-breathe { 0%,100% { transform:translateY(0) rotate(0); } 50% { transform:translateY(-1px) rotate(.8deg); } }
.avatars-paused .agent-avatar-art,.avatars-paused .agent-avatar-eyes { animation-play-state:paused; }
@media (prefers-reduced-motion:reduce) { .agent-avatar-gaze { transition:none;transform:none; } .agent-chat-header .agent-avatar-art,.agent-contact[aria-current="page"] .agent-avatar-art { animation:none; } }

.agent-message.is-teammate { max-width:100%;margin-right:0; }
.agent-message.is-teammate .agent-message-text { padding:12px 16px;border-left:2px solid var(--border-default,#e4e4e7);color:var(--text-secondary,#5c5d62);font-size:var(--font-small,14px); }
