/* Agent follows the reference conversation layout; account, model and receipt data remain server-owned. */
body .studio-main:has(#page[data-view=agent]) {height:auto;min-height:100dvh;overflow:visible;}
body .studio-main:has(#page[data-view=agent] .agent-reference[data-mode=conversation]) {height:100dvh;min-height:0;max-height:100dvh;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;}
body .studio-main:has(.agent-reference[data-mode=welcome]) > .studio-footer {display:flex;}
body .studio-main #page[data-view=agent] {width:100%;min-height:0;max-width:none;display:flex;}
body .studio-main #page .cup-agent-root.agent-reference {--agent-primary:var(--accent);--agent-soft:color-mix(in srgb,var(--agent-primary) 8%,var(--panel));display:flex;flex:1;flex-direction:row;min-width:0;min-height:calc(100svh - 100px);width:100%;border:0;margin:0;padding:0;color:var(--text);}
body .studio-main #page .agent-reference[data-mode=conversation] {min-height:0;overflow:hidden;}
body .studio-main #page .agent-reference button {font-family:var(--studio-ui-font);cursor:pointer;}
body .studio-main #page .agent-reference button:disabled {cursor:not-allowed;opacity:.45;}
body .studio-main #page .agent-reference svg {flex:none;}
body .studio-main #page .agent-reference :is(button,summary,input,select,textarea):focus-visible {outline:2px solid var(--agent-primary);outline-offset:2px;}
body .studio-main #page .agent-reference .quiet {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:5px 8px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);font-size:12px;line-height:1.5;box-shadow:none;}
body .studio-main #page .agent-reference .quiet:hover {color:var(--agent-primary);background:var(--agent-soft);}
body .studio-main #page .agent-reference .primary {display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--studio-primary);border-radius:9px;background:var(--studio-primary);color:var(--studio-primary-text);min-height:34px;padding:6px 12px;font-size:12px;box-shadow:none;}
body .studio-main #page .agent-reference .agent-conversations {position:sticky;top:0;display:flex;flex-direction:column;flex:none;width:240px;box-sizing:border-box;min-height:0;max-height:calc(100dvh - 58px);padding:25px 18px;background:color-mix(in srgb,var(--muted) 4%,var(--panel));border-right:1px solid var(--line);border-bottom:0;gap:12px;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-conversations {position:relative;top:auto;max-height:none;}
body .studio-main #page .agent-reference[data-history-open=false] .agent-conversations {display:none;}
body .studio-main #page .agent-reference .agent-sidebar-top {display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;flex:none;margin:0;}
body .studio-main #page .agent-reference .agent-sidebar-top strong {font-size:14px;font-weight:600;}
body .studio-main #page .agent-reference #agent-new {display:flex;justify-content:center;width:100%;flex:none;min-height:36px;background:var(--agent-soft);border:1px solid color-mix(in srgb,var(--agent-primary) 23%,var(--line));color:var(--agent-primary);border-radius:10px;}
body .studio-main #page .agent-reference #agent-conversation-list {display:block;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;}
body .studio-main #page .agent-reference .agent-conversation-group > p {font-size:12px;color:var(--muted);margin:17px 0 0;}
body .studio-main #page .agent-reference .agent-conversation-row {position:relative;display:flex;align-items:center;min-width:0;border-radius:9px;}
body .studio-main #page .agent-reference .agent-conversation {display:flex;align-items:center;gap:9px;width:100%;min-width:0;max-width:none;padding:12px 10px;margin:0;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font-size:13px;text-align:left;}
body .studio-main #page .agent-reference .agent-conversation > span {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
body .studio-main #page .agent-reference .agent-conversation-row > .agent-conversation {flex:1;padding-right:4px;}
body .studio-main #page .agent-reference :is(.agent-conversation-row.active,.agent-conversation.active,.agent-conversation-row:hover) {background:var(--agent-soft);color:var(--agent-primary);}
body .studio-main #page .agent-reference .agent-conversation-row.active > .agent-conversation {color:var(--agent-primary);}
body .studio-main #page .agent-reference .agent-conversation-menu {flex:none;margin-right:3px;}
body .studio-main #page .agent-reference .agent-conversation-menu > summary {display:grid;place-items:center;width:28px;height:28px;list-style:none;cursor:pointer;color:var(--muted);border-radius:6px;}
body .studio-main #page .agent-reference .agent-conversation-menu > summary::-webkit-details-marker {display:none;}
body .studio-main #page .agent-reference .agent-conversation-menu > div {position:absolute;z-index:20;top:calc(100% - 2px);right:0;display:grid;min-width:150px;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 7px 25px #0002;}
body .studio-main #page .agent-reference .agent-conversation-menu:not([open]) > div {display:none;}
body .studio-main #page .agent-reference .agent-conversation-menu button {display:flex;align-items:center;gap:9px;padding:8px 10px;border:0;border-radius:6px;background:transparent;color:var(--text);font-size:12px;text-align:left;}
body .studio-main #page .agent-reference .agent-conversation-menu button:hover {background:var(--agent-soft);}
body .studio-main #page .agent-reference .agent-history-empty {display:block;font-size:12px;line-height:1.9;color:var(--muted);padding:8px 10px;}
body .studio-main #page .agent-reference .agent-history-note {display:block;flex:none;padding:18px 0 0;margin:0;font-size:12px;line-height:1.9;color:var(--muted);}
body .studio-main #page .agent-reference .agent-chat {position:relative;display:flex;flex:1;flex-direction:column;align-items:center;min-width:0;min-height:0;padding:28px clamp(18px,4vw,64px) 20px;}
body .studio-main #page .agent-reference .agent-chat-header {display:flex;align-items:center;gap:12px;width:100%;max-width:850px;padding-bottom:12px;border-bottom:1px solid var(--line);flex:none;}
body .studio-main #page .agent-reference .agent-chat-header h1 {font-size:17px;font-weight:600;line-height:1.5;flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;letter-spacing:0;}
body .studio-main #page .agent-reference .agent-chat-header small {font-size:12px;white-space:nowrap;color:var(--muted);}
body .studio-main #page .agent-reference #agent-service-note {font-size:11px;line-height:1.7;margin:0;color:var(--muted);}
body .studio-main #page .agent-reference #agent-service-note:empty {display:none;}
body .studio-main #page .agent-reference[data-mode=welcome] .agent-chat-header {border:0;padding:0;min-height:0;}
body .studio-main #page .agent-reference[data-mode=welcome] .agent-chat-header > :not(#agent-history-toggle):not(#agent-service-note) {display:none;}
body .studio-main #page .agent-reference[data-history-open=true] #agent-history-toggle {display:none;}
body .studio-main #page .agent-reference[data-mode=welcome] #agent-history-toggle {position:absolute;top:10px;left:12px;}
body .studio-main #page .agent-reference .agent-welcome {width:100%;max-width:850px;padding:25px 0;margin:0;text-align:center;}
body .studio-main #page .agent-reference .agent-welcome[hidden],
body .studio-main #page .agent-reference .agent-suggestions[hidden],
body .studio-main #page .agent-reference .agent-entries[hidden],
body .studio-main #page .agent-reference .agent-message-scroll[hidden] {display:none;}
body .studio-main #page .agent-reference .agent-welcome-mark {display:grid;place-items:center;width:52px;height:52px;border-radius:17px;margin:0 auto 20px;background:var(--agent-soft);color:var(--agent-primary);transform:rotate(-6deg);}
body .studio-main #page .agent-reference .agent-welcome-brand {display:flex;align-items:center;justify-content:center;gap:12px;width:fit-content;max-width:100%;height:60px;margin:0 auto 21px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;filter:none;transform:none;}
body .studio-main #page .agent-reference .agent-welcome-brand .agent-welcome-symbol {display:block;flex:0 0 48px;width:48px;height:48px;object-fit:contain;margin:0;filter:none;box-shadow:none;transform:none;}
body .studio-main #page .agent-reference .agent-welcome-brand .agent-welcome-wordmark {display:block;flex:0 1 100px;width:100px;min-width:0;max-width:calc(100% - 60px);height:auto;max-height:48px;object-fit:contain;margin:0;filter:none;box-shadow:none;transform:none;}
body .studio-main #page .agent-reference .agent-welcome .agent-eyebrow {max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.7;}
body .studio-main #page .agent-reference .agent-welcome-mark svg {width:27px;height:27px;}
body .studio-main #page .agent-reference .agent-eyebrow {display:block;font-size:11px;letter-spacing:1.8px;color:color-mix(in srgb,var(--agent-primary) 50%,var(--muted));margin-bottom:16px;}
body .studio-main #page .agent-reference .agent-welcome h1 {font-size:clamp(25px,3vw,36px);font-weight:650;line-height:1.4;margin:0;letter-spacing:-.5px;}
body .studio-main #page .agent-reference .agent-welcome > p {font-size:14px;color:var(--muted);margin:14px 0 0;line-height:1.8;}
body .studio-main #page .agent-reference .agent-compose {max-width:850px;width:100%;box-sizing:border-box;flex:none;margin:0;padding:20px;border:1px solid color-mix(in srgb,var(--agent-primary) 22%,var(--line));border-radius:20px;background:var(--panel);box-shadow:0 2px 12px color-mix(in srgb,var(--bg) 2%,transparent);}
body .studio-main #page .agent-reference .agent-compose:focus-within {border-color:color-mix(in srgb,var(--agent-primary) 50%,var(--line));box-shadow:none;}
body .studio-main #page .agent-reference .agent-compose-label {display:flex;align-items:center;gap:8px;font-size:13px;color:var(--agent-primary);margin-bottom:14px;}
body .studio-main #page .agent-reference .agent-compose #agent-input {display:block;width:100%;box-sizing:border-box;min-height:100px;max-height:260px;resize:vertical;font-size:14px;line-height:1.9;padding:4px 0;margin:0;border:0;border-radius:0;background:transparent;color:var(--text);box-shadow:none;}
body .studio-main #page .agent-reference .agent-compose #agent-input:focus-visible {outline:0;}
body .studio-main #page .agent-reference .agent-compose #agent-input::placeholder {color:var(--muted);opacity:.8;}
body .studio-main #page .agent-reference .agent-compose-actions {display:flex;flex-wrap:nowrap;align-items:center;gap:12px;margin:12px 0 0;padding-top:12px;border-top:1px solid var(--line);}
body .studio-main #page .agent-reference .agent-attachment-actions {display:flex;align-items:center;gap:2px;margin-right:auto;flex:none;}
body .studio-main #page .agent-reference .agent-compose-actions :is(#agent-attach,#agent-library) {min-height:32px;padding:5px;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:12px;}
body .studio-main #page .agent-reference .agent-compose-actions > label {flex:0 1 200px;width:auto;min-width:0;max-width:48%;margin:0;}
body .studio-main #page .agent-reference .agent-compose #agent-model {padding:5px 24px 5px 6px;min-height:34px;font-size:12px;border:0;background:transparent;color:var(--agent-primary);}
body .studio-main #page .agent-reference .agent-compose .cup-channel-trigger {min-height:34px;padding:5px 8px;border:0;background:transparent;border-radius:7px;box-shadow:none;color:var(--agent-primary);font-size:12px;}
body .studio-main #page .agent-reference .agent-compose .cup-channel-current small {display:none;}
body .studio-main #page .agent-reference .agent-compose-actions #agent-send {width:38px;height:38px;min-height:38px;padding:0;border-radius:11px;flex:none;font-size:24px;line-height:1;background:var(--studio-primary);color:var(--studio-primary-text);border-color:var(--studio-primary);}
body .studio-main #page .agent-reference :is(#agent-image-note,#agent-request-status) {font-size:11px;line-height:1.8;color:var(--muted);margin:9px 0 0;}
body .studio-main #page .agent-reference #agent-error {font-size:12px;color:#b34559;line-height:1.8;margin:9px 0 0;}
body .studio-main #page .agent-reference #agent-error:empty {display:none;}
body .studio-main #page .agent-reference .agent-price {display:block;max-width:850px;width:100%;box-sizing:border-box;margin:8px 0 0;padding:0 4px;color:var(--muted);font-size:11px;line-height:1.9;flex:none;}
body .studio-main #page .agent-reference .agent-price span {display:block;}
body .studio-main #page .agent-reference[data-mode=welcome] .agent-price summary {display:none;}
body .studio-main #page .agent-reference .agent-price summary {color:var(--agent-primary);cursor:pointer;}
body .studio-main #page .agent-reference .agent-suggestions {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;max-width:850px;margin:30px 0 0;}
body .studio-main #page .agent-reference .agent-suggestions button {display:inline-flex;align-items:center;gap:8px;min-height:30px;padding:6px 11px;border:1px solid var(--line);border-radius:18px;background:transparent;font-size:12px;line-height:1.5;color:var(--muted);box-shadow:none;}
body .studio-main #page .agent-reference .agent-suggestions button:before {display:none;}
body .studio-main #page .agent-reference .agent-entries {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%;max-width:850px;margin-top:36px;}
body .studio-main #page .agent-reference .agent-entries button {display:flex;align-items:center;gap:10px;min-width:0;padding:18px 16px;border:1px solid color-mix(in srgb,var(--agent-primary) 16%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--agent-primary) 3%,var(--panel));color:var(--muted);font-size:13px;}
body .studio-main #page .agent-reference .agent-entries button > :last-child {margin-left:auto;}
body .studio-main #page .agent-reference .agent-message-scroll {width:100%;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-gutter:stable;outline-offset:-2px;}
body .studio-main #page .agent-reference .agent-messages {display:flex;flex-direction:column;gap:24px;max-width:850px;margin:0 auto;padding:24px 6px 32px;overflow:visible;}
body .studio-main #page .agent-reference .agent-message {max-width:100%;width:100%;margin:0;font-size:15px;line-height:1.9;}
body .studio-main #page .agent-reference .agent-message.from-user {align-self:flex-end;width:fit-content;max-width:80%;padding:14px 18px;border:0;border-radius:14px;background:var(--agent-soft);margin:0;}
body .studio-main #page .agent-reference .agent-message.from-assistant {align-self:stretch;background:transparent;border:0;padding:0;}
body .studio-main #page .agent-reference .agent-message-meta {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:9px;font-size:12px;color:var(--muted);}
body .studio-main #page .agent-reference .from-user .agent-message-meta {justify-content:flex-end;}
body .studio-main #page .agent-reference .agent-message-meta strong {font-size:12px;font-weight:600;color:var(--text);}
body .studio-main #page .agent-reference .agent-message-meta .quiet {margin-left:auto;min-height:25px;padding:2px 6px;}
body .studio-main #page .agent-reference .agent-message-billing {font-size:11px;color:var(--muted);}
body .studio-main #page .agent-reference .agent-history-image {display:flex;flex-direction:column;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--muted);font:inherit;text-align:left;cursor:zoom-in;overflow:hidden;}
body .studio-main #page .agent-reference .agent-history-image:hover {border-color:var(--agent-primary);}
body .studio-main #page .agent-reference .agent-history-image:focus-visible {outline:2px solid var(--agent-primary);outline-offset:2px;}
body .studio-main #page .agent-reference .agent-message-actions {display:flex;gap:6px;margin-top:7px;}
body .studio-main #page .agent-reference .agent-message-actions .quiet {height:27px;min-height:27px;padding:0 7px;}
body .studio-main #page .agent-reference .from-user .agent-message-actions {justify-content:flex-end;}
body .studio-main #page .agent-reference .agent-inherited-label {display:block;margin-top:8px;font-size:11px;color:var(--muted);}
body .studio-main #page .agent-reference .agent-draft-welcome {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:clamp(20px,8dvh,80px) 10px;text-align:center;color:var(--muted);font-size:14px;}
body .studio-main #page .agent-reference .agent-draft-welcome p {margin:0;}
body .studio-main #page .agent-reference #agent-branch-note {max-width:850px;margin:8px auto 0;font-size:11px;line-height:1.8;color:var(--muted);}
body .studio-main #page .agent-reference #agent-branch-note:empty {display:none;}
body .studio-main #page .agent-reference .agent-attachments {padding-top:4px;}
body .studio-main #page .agent-reference .agent-attachment {flex:0 0 90px;background:var(--panel);border-color:var(--line);}
body .studio-main #page .agent-reference .agent-attachment .cup-material-thumb {width:100%;height:64px;border:0;border-radius:0;padding:0;}
body .studio-main #page .agent-reference .agent-attachment img {display:block;width:100%;height:64px;object-fit:contain;}
body .studio-main #page .agent-reference .agent-request-failure {align-self:flex-end;max-width:80%;margin:0;padding:12px 16px;font-size:12px;}
body .studio-main #page .agent-reference .agent-revision-editor {margin-top:12px;padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--panel);}
body .studio-main #page .agent-reference .agent-revision-editor textarea {width:100%;box-sizing:border-box;min-height:112px;max-height:260px;resize:vertical;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--text);font-size:14px;line-height:1.8;}
body .studio-main #page .agent-reference .agent-revision-editor p {font-size:12px;line-height:1.8;color:var(--muted);margin:6px 0;}
body .studio-main #page .agent-reference .agent-revision-editor > div {display:flex;justify-content:flex-end;gap:8px;margin-top:10px;}
body .studio-main #page .agent-reference .agent-message.from-user:has(.agent-revision-editor) {width:80%;}
body .studio-main #page .agent-reference .agent-reference-dialog {width:min(640px,calc(100vw - 32px));max-width:640px;max-height:85svh;overflow:auto;box-sizing:border-box;border:1px solid var(--line);border-radius:14px;padding:24px;background:var(--panel);color:var(--text);box-shadow:0 18px 70px #0004;}
body .studio-main #page .agent-reference .agent-reference-dialog::backdrop {background:color-mix(in srgb,var(--bg) 40%,transparent);backdrop-filter:blur(3px);}
body .studio-main #page .agent-reference .agent-reference-dialog header {display:flex;justify-content:space-between;gap:16px;align-items:center;}
body .studio-main #page .agent-reference .agent-reference-dialog h2 {font-size:18px;font-weight:600;margin:0;}
body .studio-main #page .agent-reference .agent-reference-dialog p {font-size:13px;color:var(--muted);line-height:1.8;}
body .studio-main #page .agent-reference .agent-reference-dialog footer {display:flex;justify-content:flex-end;gap:10px;margin-top:20px;}
body .studio-main #page .agent-reference .agent-metadata-dialog {width:min(440px,calc(100vw - 32px));}
body .studio-main #page .agent-reference .agent-message-preview {width:min(900px,calc(100vw - 32px));max-width:900px;max-height:90svh;overflow:auto;}
body .studio-main #page .agent-reference .agent-message-preview h2 {overflow-wrap:anywhere;}
body .studio-main #page .agent-reference .agent-message-preview #agent-message-preview-image {display:block;width:100%;height:auto;max-height:70svh;object-fit:contain;}
body .studio-main #page .agent-reference .agent-metadata-dialog label {display:block;font-size:13px;margin-bottom:8px;}
body .studio-main #page .agent-reference .agent-metadata-dialog input {width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:9px;padding:10px 12px;background:transparent;color:var(--text);font-size:14px;}
body .studio-main #page .agent-reference .agent-danger {color:#b34559;}
body .studio-main #page .agent-reference .primary.agent-danger {color:#fff;background:#b34559;border-color:#b34559;}
body .studio-main #page .agent-reference [role=alert]:empty {display:none;}
body .studio-main #page .agent-reference .agent-error-text,
body .studio-main #page .agent-reference .agent-reference-dialog [role=alert] {color:#b34559;}
body .studio-main #page .agent-reference #agent-library-body {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-height:50svh;overflow:auto;padding:3px;}
body .studio-main #page .agent-reference #agent-library-body > p {grid-column:1/-1;}
body .studio-main #page .agent-reference .agent-library-item {position:relative;min-width:0;text-align:left;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:var(--studio-field);padding:0;color:var(--text);}
body .studio-main #page .agent-reference .agent-library-item.selected {border-color:var(--agent-primary);box-shadow:0 0 0 1px var(--agent-primary);}
body .studio-main #page .agent-reference .agent-library-item img {display:block;width:100%;height:100px;object-fit:contain;}
body .studio-main #page .agent-reference .agent-library-item span {display:block;padding:6px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
body .studio-main #page .agent-reference .agent-library-item small {display:block;padding:0 6px 6px;color:var(--agent-primary);font-size:10px;}
body .studio-main #page .agent-reference .agent-history-backdrop {display:none;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-chat {padding-top:16px;padding-bottom:8px;overflow:hidden;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-compose {flex:none;max-height:50dvh;overflow-y:auto;padding:12px 17px;border-radius:17px;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-compose-label {display:none;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-compose #agent-input {min-height:34px;max-height:160px;resize:none;line-height:26px;padding:4px 0;overflow-y:auto;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-compose-actions {border-top:0;padding-top:4px;margin-top:0;gap:8px;}
body .studio-main #page .agent-reference[data-mode=conversation] #agent-attach > span {display:none;}
body .studio-main #page .agent-reference[data-mode=conversation] .agent-price {max-height:19dvh;overflow:auto;padding:7px 4px 2px;}
@media(min-width:1500px) {body .studio-main #page .agent-reference .agent-chat {padding-top:36px;}body .studio-main #page .agent-reference .agent-welcome {padding-top:36px;}}
@media(max-width:1100px) {body .studio-main #page .agent-reference .agent-conversations {width:210px;padding:22px 12px;}body .studio-main #page .agent-reference .agent-chat {padding-left:20px;padding-right:20px;}body .studio-main #page .agent-reference .agent-entries {gap:10px;}body .studio-main #page .agent-reference .agent-entries button {padding:15px 12px;}}
@media(max-width:700px) {body .studio-main #page .agent-reference .agent-conversations {position:fixed;top:58px;bottom:0;left:0;width:260px;z-index:42;max-height:none;min-height:0;overflow:visible;box-shadow:8px 0 30px color-mix(in srgb,var(--bg) 12%,transparent);}body .studio-main #page .agent-reference[data-history-open=true] .agent-history-backdrop {display:block;position:fixed;inset:58px 0 0;padding:0;border:0;background:color-mix(in srgb,var(--bg) 25%,transparent);z-index:41;}body .studio-main #page .agent-reference .agent-chat {padding:18px 14px;}body .studio-main #page .agent-reference .agent-welcome {padding:22px 0;}body .studio-main #page .agent-reference .agent-welcome h1 {font-size:26px;}body .studio-main #page .agent-reference .agent-welcome > p {font-size:13px;}body .studio-main #page .agent-reference .agent-compose {padding:15px;}body .studio-main #page .agent-reference .agent-compose-actions {flex-wrap:wrap;gap:6px;}body .studio-main #page .agent-reference .agent-compose-actions > label {margin-left:auto;flex:1;max-width:60%;}body .studio-main #page .agent-reference .agent-entries {grid-template-columns:minmax(0,1fr);margin-top:26px;}body .studio-main #page .agent-reference .agent-price {font-size:10px;}body .studio-main #page .agent-reference .agent-suggestions {margin-top:18px;}body .studio-main #page .agent-reference .agent-message.from-user {max-width:90%;}body .studio-main #page .agent-reference .agent-message.from-user:has(.agent-revision-editor) {width:90%;}body .studio-main #page .agent-reference #agent-library-body {grid-template-columns:repeat(3,minmax(0,1fr));}body .studio-main #page .agent-reference .agent-chat-header small {display:none;}body .studio-main #page .agent-reference[data-mode=conversation] .agent-conversations {position:fixed;top:58px;max-height:none;}body .studio-main #page .agent-reference[data-mode=conversation] .agent-chat {padding:12px 14px 6px;}body .studio-main #page .agent-reference #agent-image-note {font-size:10px;}}
@media(prefers-reduced-motion:reduce) {body .studio-main #page .agent-reference * {scroll-behavior:auto;transition:none;}}

/* The welcome node remains in the DOM when hidden. Explicit conversation
   selectors must outrank the legacy .agent-chat:has(.agent-welcome) rules. */
body .studio-main #page[data-view=agent]:has(.agent-reference[data-mode=conversation]) {display:flex;flex:1 1 0;height:0;min-height:0;max-height:100%;overflow:hidden;}
body .studio-main #page[data-view=agent] .cup-agent-root.agent-reference[data-mode=conversation] {flex:1 1 0;height:100%;min-height:0;max-height:100%;overflow:hidden;box-sizing:border-box;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] > .agent-chat {flex:1 1 0;min-height:0;max-height:100%;overflow:hidden;box-sizing:border-box;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-chat-header {flex:0 0 auto;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-message-scroll {flex:1 1 0;height:0;min-height:0;overflow-x:hidden;overflow-y:auto;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-messages {flex:none;min-height:0;height:auto;width:100%;max-width:850px;margin:0 auto;padding:24px 6px 32px;overflow:visible;box-sizing:border-box;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-compose {flex:0 0 auto;width:100%;max-width:850px;margin:0;box-sizing:border-box;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-price {flex:0 0 auto;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-message.from-user {padding:0;border:0;background:transparent;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .from-user > .agent-message-content {padding:15px 18px;border-radius:13px;background:color-mix(in srgb,var(--agent-primary) 14%,var(--panel));}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .agent-message-content:empty {display:none;}
html[data-cup-theme=day] body .studio-main #page[data-view=agent] .agent-reference[data-mode=conversation] .from-user > .agent-message-content {background:color-mix(in srgb,var(--accent) 10%,var(--panel));}
@media(max-width:700px){body .studio-main #page .agent-reference .agent-welcome .agent-eyebrow{font-size:10px;letter-spacing:1px;}}

/* Compact welcome rhythm; guides, images and manually resized input still grow naturally. */
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-chat {box-sizing:border-box;padding-top:clamp(40px,6vh,88px);padding-bottom:clamp(40px,6vh,88px);}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome {flex:none;margin:auto 0 0;padding:0 0 32px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome-brand {margin-bottom:14px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-eyebrow {margin-bottom:10px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome h1 {font-size:clamp(25px,2.4vw,32px);line-height:1.35;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome>p {margin:10px 0 0;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-compose {margin:0 auto auto;padding:15px 18px 14px;border-radius:17px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-compose-label {font-size:12px;line-height:1.5;margin-bottom:8px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] #agent-skill-ui {margin-bottom:6px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-skill-toolbar {gap:7px;margin-bottom:2px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-skill-toolbar .quiet {min-height:26px;padding:3px 7px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-compose #agent-input {height:64px;min-height:64px;max-height:260px;resize:vertical;font-size:14px;line-height:1.7;padding:3px 0;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-compose-actions {gap:10px;margin-top:8px;padding-top:8px;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] #agent-image-note {margin-top:6px;font-size:10px;line-height:1.6;}
body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-price {margin-top:9px;line-height:1.7;}
body .studio-main #page[data-view=agent] .agent-reference :is(.agent-suggestions,.agent-entries) {display:none;}
body .studio-main #page[data-view=agent] .agent-reference #agent-pricing {display:none;}
@media(max-width:700px){
  body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-chat {padding-top:clamp(32px,6vh,56px);padding-bottom:clamp(32px,6vh,56px);}
  body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome {padding:0 0 24px;}
  body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-compose {padding:13px 14px 12px;}
  body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-compose-actions {gap:6px;}
}
