.studio-main:has(#page[data-view=agent]){height:100dvh;min-height:0;overflow:hidden}.studio-main:has(#page[data-view=agent])>.studio-footer{display:none}#page[data-view=agent]{display:flex;min-height:0;max-width:none}.cup-agent-root{width:100%;min-height:0;display:grid;grid-template-columns:220px minmax(0,1fr);flex:1;color:var(--text)}.agent-conversations{display:flex;flex-direction:column;padding:22px 14px 16px;background:var(--panel);border-right:1px solid var(--line);min-height:0}.agent-sidebar-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:22px}.agent-sidebar-top strong{font-size:13px}.agent-sidebar-top .chip{font-size:11px;padding:5px 8px}.agent-history-note{font-size:11px;line-height:1.7;color:var(--muted);margin:20px 8px 0}.agent-history-empty{font-size:12px;color:var(--muted);padding:16px 8px}#agent-conversation-list{flex:1;overflow:auto;min-height:0}.agent-conversation{width:100%;display:grid;grid-template-columns:18px minmax(0,1fr);text-align:left;gap:5px 8px;border:1px solid transparent;border-radius:9px;padding:12px;margin-bottom:6px;color:var(--muted);background:transparent}.agent-conversation strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:500}.agent-conversation small{grid-column:2;font-size:10px}.agent-conversation.active,.agent-conversation:hover{color:var(--text);background:var(--studio-selected);border-color:var(--line)}.agent-chat{display:flex;flex-direction:column;min-width:0;min-height:0;padding:24px clamp(20px,4vw,65px) 18px}.agent-chat-header{display:flex;justify-content:space-between;align-items:center;gap:15px;flex-shrink:0}.agent-eyebrow{font-size:9px;letter-spacing:1.8px;color:var(--muted)}.agent-chat-header h1{font-size:23px;line-height:1.4;margin:4px 0 0;font-weight:650}#agent-service-note{font-size:11px;line-height:1.7;color:var(--muted);margin:16px 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex-shrink:0}#agent-service-note .chip{font-size:10px;min-height:25px;padding:3px 8px}.agent-online-dot{height:6px;width:6px;border-radius:100%;background:#28ae7e;flex-shrink:0}.agent-messages{flex:1;overflow:auto;min-height:0;padding:15px 4px 30px;scrollbar-width:thin;overscroll-behavior:contain}.agent-welcome{max-width:620px;margin:clamp(10px,5vh,60px) auto 20px;text-align:center}.agent-welcome>img{width:44px;height:44px}.agent-welcome h2{font-size:clamp(23px,2.6vw,33px);letter-spacing:-.6px;font-weight:600;margin:18px 0 10px}.agent-welcome>p{font-size:13px;color:var(--muted);line-height:1.8;margin-bottom:28px}.agent-suggestions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;text-align:left}.agent-suggestions button{display:flex;justify-content:space-between;gap:15px;align-items:center;font-size:12px;line-height:1.7;text-align:left;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px;color:var(--muted)}.agent-suggestions button:hover{border-color:var(--accent);color:var(--text)}.agent-message{max-width:760px;margin:0 auto 26px;line-height:1.85;font-size:13px}.agent-message.from-user{padding:14px 18px;border:1px solid var(--line);border-radius:12px;background:var(--panel);margin-left:15%}.agent-speaker{display:block;font-size:10px;letter-spacing:.6px;color:var(--accent);font-weight:600;margin-bottom:7px}.agent-message-content{white-space:pre-wrap;overflow-wrap:anywhere}.agent-message-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.agent-message-actions .chip{font-size:11px}.agent-compose{max-width:860px;width:100%;margin:auto auto 0;flex-shrink:0;border:1px solid var(--line);background:var(--panel);border-radius:14px;padding:14px 16px 8px;box-shadow:0 4px 20px #00000005}.agent-compose #agent-input{border:0;box-shadow:none;background:transparent;padding:4px 0;min-height:72px;max-height:190px;resize:vertical;font-size:14px}.agent-compose #agent-input:focus{outline:none}.agent-compose:focus-within{border-color:var(--accent)}.agent-compose-actions{display:flex;align-items:center;gap:12px;margin-top:8px}.agent-compose-actions label{min-width:0;max-width:55%;flex:1}.agent-compose-actions #agent-model{font-size:11px;min-height:34px;padding:6px 28px 6px 9px;border-radius:7px}#agent-char-count{font-size:10px;color:var(--muted);margin-left:auto;white-space:nowrap}.agent-compose-actions .primary{padding:7px 16px;min-height:35px;font-size:12px}.agent-compose-note{font-size:10px;line-height:1.7;color:var(--muted);margin:10px 0 4px}#agent-error{font-size:11px;line-height:1.7;color:#ca675f;margin:5px 0;white-space:pre-wrap}#agent-error:empty,#agent-request-status:empty{display:none}#agent-request-status{font-size:11px;line-height:1.7;color:var(--muted);margin:0 0 8px}.agent-compose button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:1100px){.cup-agent-root{grid-template-columns:180px minmax(0,1fr)}.agent-chat{padding:20px}.agent-conversations{padding:20px 10px}.agent-sidebar-top{align-items:flex-start;flex-direction:column;gap:12px}.agent-suggestions{grid-template-columns:1fr}.agent-welcome{margin:10px auto}.agent-welcome h2{font-size:25px}.agent-chat-header h1{font-size:20px}.agent-compose-note{font-size:10px}}
@media(max-width:760px){.cup-agent-root{display:flex;flex-direction:column}.agent-conversations{border-right:0;border-bottom:1px solid var(--line);padding:10px 14px;max-height:104px;flex-shrink:0}.agent-sidebar-top{flex-direction:row;margin:0 0 8px;align-items:center}.agent-history-note,.agent-history-empty{display:none}#agent-conversation-list{display:flex;overflow-x:auto;gap:7px;flex-shrink:0}.agent-conversation{display:block;width:auto;min-width:100px;max-width:180px;white-space:nowrap;padding:6px 10px;margin:0;font-size:11px}.agent-conversation>span,.agent-conversation small{display:none}.agent-conversation strong{display:block}.agent-chat{padding:14px 14px 10px;flex:1}.agent-chat-header h1{font-size:18px}.agent-chat-header .quiet{font-size:10px;padding:5px 8px;min-height:30px}.agent-eyebrow{display:none}#agent-service-note{margin:8px 0;font-size:10px}.agent-welcome h2{font-size:23px}.agent-welcome>p{font-size:12px;margin-bottom:18px}.agent-welcome>img{width:32px;height:32px}.agent-suggestions{gap:8px}.agent-suggestions button{padding:11px 12px}.agent-compose{padding:10px 12px 6px}.agent-compose #agent-input{min-height:65px;font-size:13px}.agent-compose-actions{gap:7px}.agent-compose-actions label{max-width:50%}.agent-compose-actions #agent-model{font-size:10px}.agent-compose-actions .primary{font-size:11px;padding:6px 10px}#agent-char-count{font-size:9px}.agent-message.from-user{margin-left:7%}.agent-message-actions{gap:6px}}
.agent-compose.is-dragging{border-color:var(--accent);box-shadow:0 0 0 2px var(--studio-selected)}.agent-attachments{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;max-width:100%}.agent-attachments:empty,#agent-image-note:empty{display:none}.agent-attachment{position:relative;flex:0 0 100px;min-width:0;border:1px solid var(--line);border-radius:9px;background:var(--bg);overflow:hidden}.agent-attachment>img{display:block;width:100%;height:64px;object-fit:contain;background:var(--panel)}.agent-attachment>span{display:block;padding:4px 7px;font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-remove-image{position:absolute;top:3px;right:3px;display:grid;place-items:center;width:23px;height:23px;min-height:0;padding:0;border:1px solid #ffffff70;border-radius:50%;color:#fff;background:#16202bcc;font-size:18px;line-height:1}.agent-remove-image:hover{background:#192331}.agent-remove-image:focus-visible,.agent-history-image:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.agent-compose-actions #agent-attach{flex-shrink:0;padding:6px 9px;min-height:34px;font-size:11px;white-space:nowrap;border-radius:7px}.agent-compose #agent-files[hidden]{display:none}#agent-image-note{color:var(--muted);font-size:10px;line-height:1.6;margin:7px 0 0}.agent-history-images{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}.agent-history-image{display:flex;flex-direction:column;max-width:180px;min-width:80px;width:calc(50% - 5px);text-decoration:none;border:1px solid var(--line);border-radius:9px;overflow:hidden;color:var(--muted);background:var(--panel)}.agent-history-image img{width:100%;height:130px;display:block;object-fit:contain}.agent-history-image span{font-size:10px;padding:5px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:760px){.agent-compose-actions{flex-wrap:wrap}.agent-compose-actions label{max-width:none;flex:1;min-width:110px}.agent-compose-actions #agent-attach{font-size:10px;padding:6px 7px}.agent-attachment{flex-basis:84px}.agent-attachment>img{height:52px}.agent-history-image img{height:110px}#agent-image-note{font-size:9px}}
@media(max-width:440px){#agent-char-count{display:none}.agent-compose-actions label{min-width:90px}.agent-compose-actions .primary{padding:6px 9px}}

/* A single centered start area. Existing conversations retain their scrolling chat layout. */
body .studio-main #page[data-view="agent"] .agent-chat-header{min-height:30px;gap:14px;}
body .studio-main #page[data-view="agent"] .agent-chat-header #agent-service-note{flex:1;min-width:0;margin:0;font-size:12px;line-height:1.6;gap:8px;}
body .studio-main #page[data-view="agent"] .agent-chat-header #agent-refresh{flex:none;min-height:30px;padding:5px 9px;font-size:12px;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome){overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-messages{flex:0 0 auto;overflow:visible;min-height:auto;width:100%;max-width:860px;margin: auto auto 0;padding:28px 0 0;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-welcome{width:100%;max-width:none;margin:0 auto;text-align:center;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-welcome h2{margin-top:14px;margin-bottom:8px;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-welcome>p{margin:0 0 24px;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-compose{flex:0 0 auto;max-width:860px;margin:24px auto auto;}
body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-suggestions{grid-template-columns:repeat(2,minmax(0,1fr));}
@media(max-width:900px){body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-suggestions{grid-template-columns:1fr;}}
@media(max-width:760px){body .studio-main #page[data-view="agent"] .agent-chat-header #agent-service-note{font-size:11px;}body .studio-main #page[data-view="agent"] .agent-chat-header #agent-refresh{font-size:11px;}body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-messages{padding-top:20px;}body .studio-main #page[data-view="agent"] .agent-chat:has(.agent-welcome) .agent-compose{margin-top:18px;}}

/* Short conversations keep their composer close; long transcripts consume the remaining height and scroll. */
body .studio-main #page[data-view="agent"] .agent-chat:not(:has(.agent-welcome)) .agent-messages{flex:0 1 auto;padding:22px 4px 0;min-height:0;}
body .studio-main #page[data-view="agent"] .agent-chat:not(:has(.agent-welcome)) .agent-compose{margin:20px auto 0;}
body .studio-main #page[data-view="agent"] .agent-messages>.agent-message:last-child{margin-bottom:0;}
body .studio-main #page[data-view="agent"] .agent-message:has(+.agent-request-failure){margin-bottom:10px;}
body .studio-main #page[data-view="agent"] .agent-request-failure{box-sizing:border-box;max-width:760px;margin:0 auto 24px 15%;padding:15px 18px;border:1px solid color-mix(in srgb,var(--muted) 24%,var(--line));border-left:3px solid #b99767;border-radius:12px;background:color-mix(in srgb,var(--panel) 80%,transparent);color:var(--text);}
body .studio-main #page[data-view="agent"] .agent-request-failure:last-child{margin-bottom:0;}
body .studio-main #page[data-view="agent"] .agent-request-caption{display:block;color:var(--muted);font-size:11px;line-height:1.6;margin-bottom:4px;}
body .studio-main #page[data-view="agent"] .agent-request-failure>strong{display:block;font-size:14px;font-weight:600;line-height:1.7;}
body .studio-main #page[data-view="agent"] .agent-request-failure>p{margin:5px 0;color:var(--muted);font-size:13px;line-height:1.7;overflow-wrap:anywhere;}
body .studio-main #page[data-view="agent"] .agent-request-failure>.agent-failure-balance{font-size:12px;}
body .studio-main #page[data-view="agent"] .agent-request-failure>[data-edit-failed]{display:inline-flex;margin-top:7px;padding:6px 11px;min-height:32px;border:1px solid var(--line);border-radius:8px;font-size:12px;}
body .studio-main #page[data-view="agent"] .agent-failure-edit-note{display:inline-block;margin:7px 0 0 10px;font-size:11px;color:var(--muted);line-height:1.6;}
body .studio-main #page[data-view="agent"] .agent-request-failure>[data-edit-failed][hidden],body .studio-main #page[data-view="agent"] [data-edit-failed][hidden]+.agent-failure-edit-note{display:none;}
@media(max-width:760px){body .studio-main #page[data-view="agent"] .agent-request-failure{margin-left:7%;padding:12px 14px;}body .studio-main #page[data-view="agent"] .agent-failure-edit-note{display:block;margin-left:0;}}
