[hidden]{display:none!important}
.studio-panel{max-width:1040px;margin:0 auto;padding:28px 16px 56px;width:100%;outline:none}
.studio-panel h1{font-size:clamp(26px,4vw,40px);letter-spacing:-.04em;margin:8px 0 12px}
.studio-eyebrow{font-size:10px;letter-spacing:.16em;color:#88767d;font-weight:700}
.studio-lead{max-width:720px;line-height:1.8;color:#756d72;margin-bottom:24px}
.studio-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px;margin:20px 0 32px}
.studio-card{min-width:0;padding:24px;border:1px solid #e5dcdf;border-radius:18px;background:#fffdfd;box-shadow:0 4px 20px #35212b04}
.studio-card h2{font-size:17px;line-height:1.5;margin:0 0 10px}
.studio-card p{font-size:13px;line-height:1.7;color:#72696f}
.studio-meta{font-size:11px!important;color:#81757c;line-height:1.6}
.studio-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:12px 0}
.studio-button,.studio-link{border:1px solid #e2d9dd;border-radius:9px;padding:9px 12px;background:#fff;color:#393037;font:500 11px Montserrat,sans-serif;text-decoration:none;cursor:pointer;line-height:1.5}
.studio-button:hover,.studio-link:hover{background:#f2e9ed;border-color:#c3abb6}
.studio-button.primary{background:#211e20;color:white;border-color:#211e20}
.studio-button:disabled{opacity:.5;cursor:wait}
.studio-panel :focus-visible,.studio-actions :focus-visible,.attachment-bar :focus-visible{outline:2px solid #9b6d84;outline-offset:3px}
.studio-task{display:flex;gap:10px;font-size:12px;line-height:1.7;margin:12px 0;align-items:flex-start}
.studio-task input{margin-top:4px;accent-color:#79566a;flex-shrink:0}
.studio-card progress{width:100%;height:7px;accent-color:#987183}
.studio-section-title{font-size:20px;margin-top:34px}
.studio-editor{padding:24px;background:#f2e9ed;border-radius:16px;margin-bottom:24px}
.studio-editor label{display:block;font-size:12px;font-weight:600;margin-bottom:16px}
.studio-editor input,.studio-editor textarea,.studio-search{display:block;width:100%;padding:12px;margin-top:8px;border:1px solid #ddd0d7;border-radius:9px;font:14px Montserrat,sans-serif;background:#fff;color:#292128}
.studio-editor textarea{resize:vertical}
.studio-search{max-width:460px;margin-top:24px}
.studio-note,.studio-empty,.studio-status{padding:18px;background:#f2eaee;border-radius:12px;font-size:13px;line-height:1.8}
.studio-card pre{overflow:auto;max-height:260px;padding:16px;background:#f6f3f5;border:1px solid #e7dfe3;border-radius:10px;font:12px/1.7 Consolas,monospace;white-space:pre;tab-size:2}
.ai-main{padding-bottom:20px}
.chat-card{box-shadow:none;background:transparent;border:none;max-width:900px;width:100%;margin-inline:auto}
.chat-messages{min-height:200px;max-height:calc(100dvh - 280px);padding:24px 12px;scrollbar-width:thin}
.message-avatar,.message-name{display:none!important}
.message{gap:0;margin-bottom:28px}
.ai-message .message-content{background:transparent;border:0;padding:0;width:100%;max-width:100%;box-shadow:none}
.message-body{font-size:14px;line-height:1.85;overflow-wrap:anywhere}
.user-message .message-content{max-width:min(85%,680px);padding:14px 20px;border-radius:18px;background:#eee5ea;color:#2f272c}
.user-message .message-body{white-space:pre-wrap}
.message-body pre{overflow:auto;max-width:100%;border-radius:0 0 12px 12px}
.message-body pre code{font-size:12px;line-height:1.7}
.code-toolbar{padding:9px 12px;background:#ece7ea;border:1px solid #ded5da;border-radius:12px 12px 0 0;margin-bottom:0;justify-content:flex-end}
.code-toolbar .studio-meta{margin-right:auto}
.code-toolbar+pre{margin-top:0!important}
.chat-form{background:#fffdfd;border:1px solid #dfd3d9;border-radius:18px;padding:12px;box-shadow:0 8px 25px #45323b08}
.chat-form .composer{border:0;box-shadow:none;background:transparent}
.attachment-bar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:0 2px 6px}
.attachment-bar small{font-size:10px;color:#867881}
.attachment-list{display:flex;gap:6px;flex-wrap:wrap}
.attachment-chip{display:flex;align-items:center;gap:8px;max-width:100%;background:#f1e8ed;border-radius:8px;padding:5px 8px;font-size:11px}
.attachment-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
.attachment-chip button{border:0;background:none;cursor:pointer;font-size:18px}
.project-context{max-width:900px;margin:12px auto;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;background:#eee3e9;border-radius:10px;font-size:12px}
.chat-active .intro-section,.chat-active .suggestions{display:none!important}
.chat-active .chat-messages{min-height:calc(100dvh - 330px)}
.stop-button{border:1px solid #b99ead;background:#f2e6ec;border-radius:9px;padding:8px 12px;cursor:pointer;font:12px Montserrat,sans-serif}
.request-status{font-size:11px;color:#8b7581;min-height:18px;margin:6px 0}
@media(max-width:600px){.studio-panel{padding:20px 0}.studio-card{padding:18px}.chat-messages{padding:18px 2px;max-height:calc(100dvh - 290px)}.studio-actions{gap:6px}.studio-button,.studio-link{min-height:36px}.attachment-bar small{line-height:1.5}.user-message .message-content{max-width:92%}}
.user-message .message-content p{color:#2f272c}.message{animation:none}.loading-message .message-body{white-space:pre-wrap}
/* Keep the account footer visible as mobile browser bars change height. */
.sidebar{height:100dvh;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));overflow:hidden}
.sidebar-header,.sidebar>.new-chat,.sidebar-menu,.sidebar-footer{flex-shrink:0}
.conversation-history{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.sidebar-footer{margin-top:0;padding-top:10px}
.account-dialog{width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:24px;border:1px solid #e5dddd;border-radius:20px;background:#faf7f7;color:#1d1d1f;box-shadow:0 20px 80px #0003}
.account-dialog::backdrop{background:#0005}
.account-dialog h2{margin:18px 0;font-size:22px}
.account-dialog p,.account-dialog a{font-size:13px;line-height:1.6}
.account-dialog label{display:flex;flex-direction:column;gap:8px;margin:20px 0;font-size:13px}
.account-dialog input:not([type=checkbox]),.account-dialog select{width:100%;min-height:44px;border:1px solid #d9cece;border-radius:9px;background:white;padding:10px;font:inherit;color:inherit}
.account-dialog input[type=checkbox]{align-self:flex-start;width:20px;height:20px}
.account-dialog a{display:block;margin-top:20px;color:inherit}
html[data-chat-font=large] .message-content{font-size:18px}
html[data-chat-font=large] .message-content p{font-size:18px}
@media(max-height:560px){.sidebar-header{margin-bottom:8px;min-height:34px}.sidebar-menu{margin-top:8px;gap:0}.sidebar-link{min-height:34px}.conversation-history{margin-top:8px}.sidebar-footer{padding-top:4px}}
@media(max-height:380px){.sidebar{overflow-y:auto}.conversation-history{flex:none;max-height:80px}}
.design-preview{min-height:160px;border-radius:12px;padding:20px;margin-bottom:20px;background:#f1e6ec;color:#3f303a;display:flex;flex-direction:column;justify-content:space-between;gap:15px}
.design-preview span{font-size:9px;letter-spacing:.15em}.design-preview strong{font-size:23px;max-width:210px;line-height:1.2}.design-preview-blocks{height:28px;border-top:2px solid currentColor;border-bottom:1px solid currentColor;opacity:.3}
.design-preview.study{background:#e5ece6;color:#314c3a}.design-preview.product{background:#292c3b;color:#f4e7db}.design-preview.dashboard{background:#e8e8f4;color:#43416d}
.sidebar-menu{min-height:120px;max-height:52dvh;overflow-y:auto;flex-shrink:1;overscroll-behavior:contain}
/* Workspace-first chat: reserve the viewport for messages and code. */
.main-content:has(.chat-card:not([hidden])){height:100dvh;min-height:0;overflow:hidden}
.ai-main{width:100%;max-width:none;padding:24px 32px 12px}
.ai-main:has(.chat-card:not([hidden])){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.ai-main .intro-section{max-width:none;flex-shrink:0}.intro-section h1{font-size:clamp(25px,3vw,38px);line-height:1.2}.intro-label,.intro-text{display:none}
.suggestions{margin-top:16px;flex-shrink:0}.suggestion-button{min-height:44px;padding:8px 12px}
.ai-main .chat-card{max-width:none;flex:1;min-height:0;display:flex;flex-direction:column;margin-top:12px;border-radius:0;overflow:hidden}
.ai-main .chat-messages,.chat-active .chat-messages{flex:1;min-height:0;max-height:none;padding:20px 4px;overscroll-behavior:contain}
.chat-form{flex-shrink:0;margin:0}.message-content,.message-body{min-width:0}.message-body pre{white-space:pre;overflow-x:auto}.message-body pre code{font-size:13px}
.ai-warning{font-size:10px;margin:6px 0 0;flex-shrink:0}.main-content:has(.chat-card:not([hidden]))>.ai-footer{display:none}.project-context{max-width:none;flex-shrink:0}
@media(max-width:700px){.ai-main{padding:10px 10px calc(8px + env(safe-area-inset-bottom,0px))}.ai-main .intro-section h1{font-size:23px}.suggestions{display:none}.ai-main .chat-card{margin-top:8px}.ai-main .chat-messages{padding:10px 2px}.chat-form{padding:8px;border-radius:14px}.form-footer,.attachment-bar small{display:none}.attachment-bar{gap:6px;padding-bottom:3px}.ai-warning{font-size:9px;line-height:1.4}.code-toolbar{padding:6px;gap:4px;flex-wrap:wrap}.code-toolbar .studio-button{padding:6px 8px;font-size:10px}.message{margin-bottom:20px}.message-body pre{padding:12px}.ai-header{min-height:54px;padding-top:6px;padding-bottom:6px}.request-status{margin:2px 0;min-height:0}}
@media(max-width:700px){.ai-main .suggestions{display:grid;grid-template-columns:1fr;gap:6px;margin-top:12px}.ai-main .suggestion-button{min-height:40px;padding:8px 12px;font-size:11px}.chat-drafting .ai-main .suggestions{display:none}}
/* Keep mobile browsers from enlarging the page when the composer receives focus. */
@media(max-width:980px),(pointer:coarse){.composer #user-input{font-size:16px}}
