/* Conversation layout inspired by assistant-ui: bounded thread, docked composer. */
.generation-chat[hidden]{display:none}
.generation-chat{position:relative;width:100%;max-width:1080px;text-align:left;margin:0 auto;display:flex;flex-direction:column;flex:1;min-height:0}
.generation-chat-head{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:0 4px 14px;border-bottom:1px solid #e8e9ef;flex-shrink:0}
.generation-chat-head h1{font-size:17px;font-weight:600;letter-spacing:-.025em;margin:4px 0 0;color:#27272a}.chat-kicker{font-size:9px;font-weight:600;letter-spacing:.13em;color:#9b9ba4}
.generation-chat-head .outline-btn{font-size:11px;padding:7px 11px;border-radius:8px;background:#fff;border-color:#e4e4e7}
.generation-viewport{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable both-edges;scrollbar-width:thin;scrollbar-color:#d4d4d8 transparent;outline-offset:-2px}
#home .generation-viewport[data-edge-scroll]{scrollbar-width:none;scrollbar-gutter:auto}
html:has(#home.has-generation-chat.active){scrollbar-gutter:auto}
#home .generation-viewport[data-edge-scroll]::-webkit-scrollbar{display:none}
.conversation-edge-scroll{position:fixed;right:4px;width:16px;z-index:110;opacity:.14;touch-action:none;cursor:pointer;transition:opacity .18s ease;outline-offset:1px;border-radius:8px}
.conversation-edge-scroll[hidden]{display:none}
.conversation-edge-thumb{position:absolute;top:0;right:4px;width:5px;border-radius:999px;background:#88828f;transition:background-color .18s ease}
.conversation-edge-scroll:is(:hover,:focus-visible,.is-scrolling,.is-dragging){opacity:.8}
.conversation-edge-scroll:is(:hover,:focus-visible,.is-dragging) .conversation-edge-thumb{background:#716979}
.conversation-edge-scroll:focus-visible{outline:2px solid #a293cd}
@media(prefers-reduced-motion:reduce){.conversation-edge-scroll,.conversation-edge-thumb{transition:none}}
@media(forced-colors:active){.conversation-edge-scroll{opacity:1}.conversation-edge-thumb{background:ButtonText}}
.generation-messages{display:flex;flex-direction:column;gap:22px;padding:20px 8px 24px;max-width:880px;margin:0 auto}
.generation-message{display:flex;gap:12px;align-items:flex-start;min-width:0}
.chat-avatar{flex:0 0 28px;height:28px;display:grid;place-items:center;color:#18181b;background:#fff;border:1px solid #e7e7eb;border-radius:8px}
.pixel-crab{display:block;width:24px;height:18px;color:#171717;image-rendering:pixelated;overflow:visible}
.is-processing .pixel-crab{animation:crab-bob .8s steps(2,end) infinite}.is-processing .crab-claws{transform-origin:12px 8px;animation:crab-claw .8s steps(2,end) infinite}.is-processing .crab-legs{animation:crab-step .8s steps(2,end) infinite}
@keyframes crab-bob{50%{transform:translateY(-2px)}}@keyframes crab-claw{50%{transform:translateY(-1px)}}@keyframes crab-step{50%{transform:translateX(1px)}}
.chat-bubble{min-width:0;max-width:calc(100% - 40px);padding:2px 0;background:transparent;border:0;box-shadow:none}
.chat-speaker{display:block;color:#919198;font-size:10px;font-weight:500;margin-bottom:7px}
.chat-message-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:13px;color:#3f3f46}
.generation-message.user{justify-content:flex-end}.generation-message.user .chat-avatar{display:none}.generation-message.user .chat-bubble{background:#eeeef2;border-radius:16px;max-width:80%;padding:12px 16px}.generation-message.user .chat-speaker{display:none}
.chat-message-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px;font-size:10px;color:#8b8b95}.chat-message-meta span{padding:3px 6px;background:#ffffffa0;border-radius:5px;overflow-wrap:anywhere}
.chat-scroll-latest{position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:30px;height:30px;display:grid;place-items:center;border:1px solid #dedee4;border-radius:50%;background:#fff;color:#52525b;box-shadow:0 2px 8px #0000000a;cursor:pointer;z-index:2}.chat-scroll-latest[hidden]{display:none}
.generation-composer-dock{width:100%;display:flex;flex-direction:column}
#home.has-generation-chat{padding:16px 42px 20px}
#home.has-generation-chat .home-center{height:calc(100dvh - 104px);min-height:0;justify-content:flex-start;text-align:left;padding-top:0;gap:12px}
#home.has-generation-chat .home-brand,#home.has-generation-chat .home-lede,#home.has-generation-chat .home-recent{display:none}
#home.has-generation-chat .generation-composer-dock{max-width:1080px;margin:0 auto;flex-shrink:0;gap:6px}
#home.has-generation-chat .workbench{max-width:1080px;border-radius:14px}
#home.has-generation-chat #uploadTray{min-height:38px;max-width:1080px;margin:0;padding:8px 12px;border-radius:10px}
#home.has-generation-chat #uploadTray .upload-icon,#home.has-generation-chat #uploadTray .upload-copy span{display:none}
#home.has-generation-chat #uploadTray .upload-copy b{font-size:11px;font-weight:500;color:#9b9ba4}
#home.has-generation-chat #uploadTray .upload-action{font-size:11px}
#home.has-generation-chat .presentation-composer .workbench-head{display:none}
#home.has-generation-chat .presentation-composer .prompt-box{padding:10px 16px 0}
#home.has-generation-chat .presentation-composer #prompt{height:54px;min-height:42px;max-height:130px;font-size:13px;line-height:1.7}
#home.has-generation-chat .presentation-composer .workbench-footer{min-height:48px;padding:8px 12px 10px}
.chat-upload-disabled{pointer-events:none;opacity:.6}
.chat-template-bubble{width:100%;max-width:780px;min-width:0;background:#fff;border:1px solid #e5e5eb;border-radius:14px;padding:16px;box-shadow:0 2px 8px #18181b03}
.chat-template-bubble .chat-speaker{display:none}.chat-template-bubble>.chat-message-text{font-size:13px;font-weight:500;color:#3f3f46}
.chat-template-toolbar{display:flex;align-items:center;gap:12px;margin:14px 0 12px;min-width:0}
.chat-template-tabs{display:flex;align-items:center;gap:3px;min-width:0;overflow-x:auto;scrollbar-width:none;background:#f5f5f7;border-radius:8px;padding:3px}
.chat-template-tabs button{flex-shrink:0;background:transparent;border:0;border-radius:6px;padding:7px 9px;font-size:11px;color:#8a8a96;cursor:pointer;white-space:nowrap}
.chat-template-tabs button.active{background:#fff;box-shadow:0 1px 3px #18181b0a;color:#3f3f46;font-weight:600}
.chat-template-search{flex:1;min-width:80px;max-width:170px;margin-left:auto;padding:8px 10px;border:1px solid #e9e9ef;border-radius:8px;font-size:11px;background:#fff;outline-color:#bca7ef}
.chat-template-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:2px;min-width:0}
.chat-template-grid .template-option{position:relative;display:block;min-width:0;text-align:left;padding:0;background:#fff;border:1px solid #e7e7ee;border-radius:9px;overflow:hidden;cursor:pointer;box-shadow:none}
.chat-template-grid .template-option:hover{border-color:#b7b7c6}.chat-template-grid .template-option.selected{border-color:#8e72e7;box-shadow:0 0 0 1px #8e72e7}
.chat-template-grid .template-option-preview{aspect-ratio:16/9;height:auto;width:100%;background:#f7f7fa;overflow:hidden;display:grid;place-items:center;pointer-events:none}
.chat-template-grid .template-option-preview svg{width:100%;height:100%;display:block}.chat-template-grid .template-option-body{display:block;padding:7px 9px;font-size:10px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#656571}
.chat-template-grid .template-option.selected:after{content:'✓';position:absolute;top:6px;right:6px;width:17px;height:17px;display:grid;place-items:center;font-size:10px;border-radius:50%;background:#8e72e7;color:#fff}
.chat-template-pagination{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:10px;font-size:10px;color:#9898a4}.chat-template-pagination[hidden]{display:none}.chat-page-button{width:24px;height:24px;border:1px solid #e9e9ef;background:#fff;border-radius:6px;font-size:12px;color:#71717a;cursor:pointer}.chat-page-button:disabled{opacity:.35;cursor:default}
.chat-template-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:12px;margin-top:12px;border-top:1px solid #f0f0f3}
.chat-template-note{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#96909f;margin:0;line-height:1.6}
.chat-template-actions{display:flex;gap:7px;flex-shrink:0}.chat-template-actions button{font-size:11px;padding:8px 11px;min-height:32px;border-radius:8px;width:auto;white-space:nowrap;box-shadow:none}.chat-template-actions .outline-btn{border-color:#e7e7ee;color:#7c7c88;background:#fff}.chat-template-actions .primary-btn{background:#8a69e7}
.chat-template-empty{grid-column:1/-1;padding:28px 10px;font-size:11px;color:#9b9ba4;text-align:center}
.chat-template-complete{padding:10px 14px}.chat-template-complete .chat-template-toolbar,.chat-template-complete .chat-template-grid,.chat-template-complete .chat-template-pagination,.chat-template-complete .chat-template-footer{display:none}
.chat-error{color:#b75a5a}.chat-error .chat-message-text{color:inherit}.generation-chat button:focus-visible{outline:2px solid #b59be9;outline-offset:2px}
@media(min-width:581px) and (max-width:850px){#home.has-generation-chat{padding-left:24px;padding-right:24px}}
@media(max-width:700px){.generation-messages{padding:16px 2px 18px;gap:16px}.generation-message{gap:8px}.chat-avatar{flex-basis:22px;height:24px;border:0;background:transparent}.pixel-crab{width:22px}.chat-template-bubble{max-width:calc(100% - 30px);padding:12px;border-radius:12px}.chat-template-toolbar{flex-direction:column;align-items:stretch;gap:8px;margin:10px 0}.chat-template-tabs{width:100%}.chat-template-tabs button{padding:6px 8px;font-size:10px}.chat-template-search{max-width:none;width:100%;margin:0}.chat-template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.chat-template-footer{flex-direction:column;align-items:stretch;gap:9px;padding-top:10px;margin-top:10px}.chat-template-actions{justify-content:flex-end}.chat-template-actions button{font-size:10px;padding:7px 9px}.chat-template-note{font-size:10px}.generation-chat-head h1{font-size:15px}.generation-chat-head{padding-bottom:10px}#home.has-generation-chat .home-center{gap:9px}#home.has-generation-chat #uploadTray .upload-copy{display:none}}
@media(max-width:580px){#home.has-generation-chat{padding:12px 15px 14px}#home.has-generation-chat .home-center{height:calc(100dvh - 94px)}#home.has-generation-chat .presentation-composer .prompt-box{padding:8px 12px 0}#home.has-generation-chat .presentation-composer #prompt{height:42px;min-height:36px}#home.has-generation-chat .presentation-composer .workbench-footer{padding:6px 10px 8px}.generation-chat-head .outline-btn{font-size:10px;padding:6px 8px}}
@media(prefers-reduced-motion:reduce){.is-processing .pixel-crab,.is-processing .crab-claws,.is-processing .crab-legs{animation:none}}
