/* Shared width-based shell. Keep desktop editors intact; never scale the whole page. */
.adaptive-bottom-nav,.adaptive-page-title,.adaptive-menu-button,.adaptive-composer-more,.adaptive-canvas-views{display:none}
.adaptive-menu-sheet{box-sizing:border-box;width:min(480px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:20px;border:1px solid var(--line-strong);border-radius:20px;background:var(--surface);color:var(--text)}
.adaptive-menu-sheet::backdrop{background:#0009}
.adaptive-menu-sheet header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.adaptive-menu-sheet h2{font-size:18px;margin:0}
.adaptive-menu-sheet button,.adaptive-menu-items a{box-sizing:border-box;min-height:44px;border:0;border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;text-decoration:none;padding:12px 16px;text-align:left;cursor:pointer}
.adaptive-menu-items{display:grid;gap:8px}.adaptive-menu-sheet header button{font-size:22px}
.adaptive-shell :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(min-width:840px) and (max-width:1199px){
 body.adaptive-shell .side-rail{width:80px!important;padding:20px 8px;align-items:center;box-sizing:border-box}
 body.adaptive-shell .side-rail .brand-name,body.adaptive-shell .side-rail .rail-item>span:not(.rail-icon){display:none}
 body.adaptive-shell .side-rail .rail-item{width:52px;min-height:48px;justify-content:center;padding:10px;margin-left:auto;margin-right:auto}
 body.adaptive-shell .side-rail .brand-mark{padding:0}
 body.adaptive-shell .main-content{margin-left:80px!important;width:calc(100% - 80px)!important;padding-left:24px;padding-right:24px;min-width:0}
 body.adaptive-shell .main-content.inspiration-main{padding:0}
 body.adaptive-shell.inspiration-body #canvasLayout.agent-dock-layout[data-agent-dock='right']:not(.agent-closed):not(.quick-creation-open):not(.detail-open){display:grid;grid-template-columns:minmax(0,1fr) var(--agent-dock-width,340px)}
 body.adaptive-shell.inspiration-body #canvasLayout[data-agent-dock='right']>#canvasAgent{position:relative;inset:auto;width:100%;height:100%;max-width:none}
 body.adaptive-shell.inspiration-body #canvasLayout:not(.agent-closed) .canvas-bottom-controls{visibility:visible;pointer-events:auto}
}
@media(max-width:1199px){
 .adaptive-shell .canvas-agent{container-type:inline-size}
 .adaptive-shell .account-grid{grid-template-columns:minmax(0,1fr)}
 .adaptive-shell .asset-more{opacity:1}
}
@container(max-width:380px){.agent-tools #agentChatModel{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.agent-composer textarea{font-size:16px}}
@media(max-width:839px){
 body.adaptive-shell{--adaptive-nav-height:calc(64px + env(safe-area-inset-bottom,0px));min-width:0;overflow-x:clip}
 body.adaptive-shell .app-shell{display:block;min-width:0}
 body.adaptive-shell .side-rail{display:none!important}
 body.adaptive-shell .main-content{box-sizing:border-box;width:100%!important;margin-left:0!important;min-width:0;min-height:100dvh;padding:0 max(16px,env(safe-area-inset-right)) calc(var(--adaptive-nav-height) + 24px) max(16px,env(safe-area-inset-left))!important}
 .adaptive-shell .adaptive-bottom-nav{position:fixed;z-index:100;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;box-sizing:border-box;height:var(--adaptive-nav-height);padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:var(--nav-bg,var(--bg));border-top:1px solid var(--line)}
 .adaptive-bottom-nav a{display:flex;min-height:48px;align-items:center;justify-content:center;flex-direction:column;gap:4px;border-radius:12px;color:var(--muted);text-decoration:none;font-size:12px;line-height:16px}
 .adaptive-bottom-nav svg{width:22px;height:22px;flex:none}
 .adaptive-bottom-nav a[aria-current]{color:var(--text);background:var(--surface-3)}
 .adaptive-shell .topbar{min-height:60px;height:auto!important;flex:0 0 60px!important;margin:0!important;padding:8px 0!important;gap:8px;flex-wrap:nowrap;box-sizing:border-box}
 .adaptive-shell:not(.inspiration-body) .topbar{position:sticky;top:0;z-index:80;background:var(--bg)}
 .adaptive-shell .adaptive-page-title{display:block;flex:1;min-width:0;font-size:17px;font-weight:600;color:var(--text);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .adaptive-shell .adaptive-menu-button{display:block;flex:none;min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--text);font:inherit;font-size:13px}
 .adaptive-shell .topbar .breadcrumbs,.adaptive-shell .topbar .account-pill,.adaptive-shell .topbar .avatar-button,.adaptive-shell .topbar .quiet-button,.adaptive-shell #accountWorkspaceBadge{display:none!important}
 .adaptive-shell .top-actions,.adaptive-shell .admin-top-actions,.adaptive-shell .account-top-actions{gap:6px;margin-left:auto;min-width:0}
 .adaptive-shell .credit-pill{min-height:38px;max-width:150px;padding:0 10px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .adaptive-shell :is(input,textarea,select){max-width:100%;min-width:0;font-size:16px}
 .adaptive-shell :is(.modal,.drawer,.admin-detail-drawer){box-sizing:border-box;min-width:0;max-width:calc(100vw - 24px);max-height:calc(var(--adaptive-height,100dvh) - 24px);overflow-y:auto}
 .adaptive-shell .modal{padding:24px 18px}
 .adaptive-shell :is(.account-panel,.account-state-card,.account-login-card){min-width:0;overflow-wrap:anywhere}
 .adaptive-shell :is(.account-grid,.account-form,.admin-usage-stats,.performance-grid){grid-template-columns:minmax(0,1fr)}
 .adaptive-shell :is(.account-stats,.output-summary){grid-template-columns:repeat(2,minmax(0,1fr))}
 .adaptive-shell .account-tabs,.adaptive-shell .output-tabs,.adaptive-shell .resource-main-tabs{max-width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin}
 .adaptive-shell :is(.account-tabs,.output-tabs,.resource-main-tabs)>*{flex-shrink:0;min-height:44px}
 .adaptive-shell .account-hero,.adaptive-shell .library-header,.adaptive-shell .outputs-header{padding-top:20px;gap:16px;align-items:flex-start;flex-direction:column}
 .adaptive-shell :is(.account-hero,.library-header,.outputs-header) h1{font-size:26px;line-height:1.35;overflow-wrap:anywhere}
 .adaptive-shell :is(.output-toolbar,.resource-header-actions,.admin-toolbar){flex-wrap:wrap;gap:12px}
 .adaptive-shell .output-toolbar-right{width:100%;flex-wrap:wrap;min-width:0}
 .adaptive-shell .output-toolbar-right .search-box{width:auto;flex:1 1 160px;min-width:0}
 .adaptive-shell .output-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
 .adaptive-shell .output-notice{grid-column:1/-1}
 .adaptive-shell .asset-grid:not(.is-list),.adaptive-shell .product-library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
 .adaptive-shell .library-page,.adaptive-shell .library-main{min-width:0}
 .adaptive-shell .library-tab{min-height:40px;font-size:13px}
 .adaptive-shell :is(.asset-toolbar-actions,.library-tabs){max-width:100%;flex-wrap:wrap}
 .adaptive-shell .asset-grid.is-list .asset-card-meta{grid-template-columns:minmax(0,1fr) 40px 32px}
 .adaptive-shell .skill-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
 .adaptive-shell .toast{bottom:calc(var(--adaptive-nav-height) + 12px);max-width:calc(100% - 32px);box-sizing:border-box}
 /* Start page scrolls until a conversation begins; the active transcript owns its scroll. */
 body.adaptive-shell.home-page.home-member:not(.home-has-conversation),body.adaptive-shell.home-page.adaptive-projects-view{height:auto;overflow-y:auto}
 body.adaptive-shell.home-page.home-member:not(.home-has-conversation) .app-shell,body.adaptive-shell.home-page.adaptive-projects-view .app-shell{height:auto;overflow:visible}
 body.adaptive-shell.home-page.home-member:not(.home-has-conversation) .main-content,body.adaptive-shell.home-page.adaptive-projects-view .main-content{height:auto;display:block;overflow:visible}
 body.adaptive-shell.home-page.home-member:not(.home-has-conversation) .hero-section{display:block;padding:20px 0 0;overflow:visible;min-height:0}
 body.adaptive-shell.home-page.home-member .hero-copy{padding:8px 0 20px}
 body.adaptive-shell.home-page .member-hero-copy .eyebrow{display:none}
 body.adaptive-shell.home-page .hero-copy h1{font-size:clamp(24px,5vw,32px)!important;line-height:1.35}
 body.adaptive-shell.home-page .hero-copy p{font-size:14px;line-height:1.65}
 body.adaptive-shell.home-page #creator{box-sizing:border-box;width:100%;max-width:760px;padding:16px 0;margin:0 auto}
 body.adaptive-shell.home-page #creator>div:first-child h2{font-size:20px}
 body.adaptive-shell.home-page #creator>div:first-child p{font-size:14px}
 body.adaptive-shell.home-page .home-agent-composer{padding:12px;border:1px solid var(--line-strong);border-radius:18px;background:var(--composer-bg,var(--surface));margin-top:16px}
 body.adaptive-shell.home-page .home-agent-input{font-size:16px;padding:4px;min-height:110px;margin:0 0 12px;line-height:1.6}
 body.adaptive-shell.home-page .home-agent-tools{flex-wrap:nowrap;gap:4px;min-width:0}
 body.adaptive-shell.home-page .home-agent-tools button{min-height:44px;padding:8px;font-size:13px;flex-shrink:0}
 body.adaptive-shell.home-page .home-agent-tools #modelButton{flex:1 1 auto;min-width:0;max-width:180px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
 body.adaptive-shell.home-page .home-agent-tools :is(#assetButton,#skillButton,#homeDirectorPilot){display:none}
 body.adaptive-shell.home-page .home-agent-tools .adaptive-composer-more{display:block}
 body.adaptive-shell.home-page .home-agent-tools #startButton{margin-left:auto;min-width:44px}
 body.adaptive-shell.home-page.home-member:not(.home-has-conversation) .home-start-actions{display:grid;grid-template-columns:1fr;margin:24px 0;gap:10px}
 body.adaptive-shell.home-page.home-member:not(.home-has-conversation) .homepage-content-host:not([hidden]),body.adaptive-shell.home-page.home-member:not(.home-has-conversation) .workspace-section{display:block}
 body.adaptive-shell.home-page .workspace-section{margin:24px 0}
 body.adaptive-shell.home-page .project-layout{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:18px}
 body.adaptive-shell.home-page .home-project-preview{height:auto;aspect-ratio:16/9}
 body.adaptive-shell.home-page .home-project-meta h3{font-size:15px}
 body.adaptive-shell.home-page .home-project-meta p{font-size:13px}
 body.adaptive-shell.home-page.adaptive-projects-view .hero-section,body.adaptive-shell.home-page.adaptive-projects-view .homepage-content-host,body.adaptive-shell.home-page.adaptive-projects-view .bottom-strip,body.adaptive-shell.home-page.adaptive-projects-view .page-footer{display:none!important}
 body.adaptive-shell.home-page.adaptive-projects-view .workspace-section{display:block!important;padding:16px 0}
 body.adaptive-shell.home-page.home-has-conversation:not(.adaptive-projects-view):not(.home-show-projects){height:var(--adaptive-height,100dvh)}
 body.adaptive-shell.home-page.home-has-conversation:not(.adaptive-projects-view):not(.home-show-projects) .main-content{height:var(--adaptive-height,100dvh);padding-bottom:calc(var(--adaptive-nav-height) + 8px)!important;min-height:0}
 body.adaptive-shell.home-page.home-has-conversation #creator .home-thread{padding:8px 0;margin:8px 0;overflow-x:hidden}
 body.adaptive-shell.home-page.home-has-conversation .home-agent-composer{margin-top:8px;flex-shrink:0}
 body.adaptive-shell.home-page.home-has-conversation .home-agent-input{min-height:56px;height:56px}
 body.adaptive-shell.home-page .home-conversation-toolbar{padding:0!important}
 /* Keyboard height never changes the width class or remounts the editor. */
 .adaptive-shell.adaptive-keyboard-open .adaptive-bottom-nav{display:none}
 body.adaptive-shell.adaptive-keyboard-open{--adaptive-nav-height:0px}
 body.adaptive-shell.home-page.adaptive-keyboard-open .hero-copy,body.adaptive-shell.home-page.adaptive-keyboard-open #creator>div:first-child{display:none}
 /* Canvas gets its own navigation and a single full-width active panel. */
 body.adaptive-shell.inspiration-body .adaptive-bottom-nav,body.adaptive-shell.inspiration-body .adaptive-page-title{display:none}
 body.adaptive-shell.inspiration-body .main-content.inspiration-main{padding:0!important;height:var(--adaptive-height,100dvh);min-height:0;overflow:hidden;display:flex;flex-direction:column}
 body.adaptive-shell.inspiration-body .canvas-topbar{padding:6px 12px!important;min-height:56px;flex-basis:56px!important}
 .adaptive-shell .canvas-project-heading{flex:1;min-width:0}
 .adaptive-shell .canvas-top-save{display:none}
 .adaptive-shell .canvas-top-actions>button{min-height:44px}
 .adaptive-shell .adaptive-canvas-views{display:flex;align-items:center;gap:6px;padding:6px 12px;background:var(--bg);border-bottom:1px solid var(--line);flex:0 0 56px;box-sizing:border-box}
 .adaptive-canvas-views a,.adaptive-canvas-views button{min-height:40px;display:grid;place-items:center;padding:0 16px;border:0;border-radius:10px;font:inherit;font-size:14px;text-decoration:none;background:transparent;color:var(--muted)}
 .adaptive-canvas-views a{margin-right:auto;padding-left:0}
 .adaptive-canvas-views button[aria-pressed=true]{color:var(--text);background:var(--surface-3)}
 body.adaptive-shell.inspiration-body #canvasLayout.agent-dock-layout[data-agent-dock]{flex:1;min-height:0!important;height:auto!important;position:relative;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;gap:0}
 body.adaptive-shell.inspiration-body #canvasLayout[data-agent-dock]>#canvasAgent{position:absolute!important;inset:0!important;box-sizing:border-box;width:100%!important;height:100%!important;max-width:none!important;border-radius:0;border:0;grid-column:auto;grid-row:auto;z-index:70;background:var(--bg)}
 body.adaptive-shell.inspiration-body #canvasLayout.agent-closed>#canvasAgent{display:none!important}
 body.adaptive-shell.inspiration-body .agent-dock-separator{display:none!important}
 body.adaptive-shell.inspiration-body #canvasLayout>.canvas-workspace{grid-column:1!important;grid-row:1!important;min-width:0;width:100%}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-head{display:none}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-thread{padding:12px 16px}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-composer{margin:8px 12px max(12px,env(safe-area-inset-bottom));padding:12px}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-composer textarea{font-size:16px;min-height:54px}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-tools{flex-wrap:nowrap;min-width:0}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-tools button{min-height:44px;min-width:44px;padding:6px;flex-shrink:0}
 body.adaptive-shell.inspiration-body #canvasLayout .agent-tools #agentChatModel{flex:1 1 auto;min-width:0;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body.adaptive-shell.inspiration-body .canvas-bottom-controls{left:8px;right:8px;bottom:max(12px,env(safe-area-inset-bottom));gap:8px}
 body.adaptive-shell.inspiration-body .canvas-bottom-controls .dock{max-width:100%;box-sizing:border-box;overflow-x:auto;height:56px;justify-content:flex-start;gap:4px;scrollbar-width:none}
 body.adaptive-shell.inspiration-body .canvas-bottom-controls .dock button{min-width:44px;height:44px;flex-shrink:0}
 body.adaptive-shell.inspiration-body .canvas-bottom-controls .canvas-zoom{height:44px;max-width:100%;box-sizing:border-box}
 body.adaptive-shell.inspiration-body .canvas-toolbar .canvas-zoom button{min-width:36px;height:36px}
 body.adaptive-shell.inspiration-body .canvas-stage>.dock-menu,body.adaptive-shell.inspiration-body .canvas-stage>.dock-pop{bottom:128px;left:12px;right:12px;width:auto;max-width:calc(100% - 24px);max-height:calc(100% - 140px);overflow:auto}
 body.adaptive-shell.adaptive-shots-view #canvasTimeline:not([hidden]){position:absolute;inset:0;z-index:30;margin:0;padding:16px;max-height:none;box-sizing:border-box;background:var(--bg);overflow:auto;border-radius:0}
 body.adaptive-shell.adaptive-shots-view .canvas-timeline-list{display:flex;flex-direction:column;max-height:none;overflow:visible}
 body.adaptive-shell.adaptive-shots-view .canvas-timeline-shot{width:100%;box-sizing:border-box;min-width:0}
 .adaptive-shell .canvas-timeline-heading{flex-wrap:wrap;gap:12px}
 .adaptive-shell .canvas-project-menu{max-width:calc(100vw - 24px);max-height:calc(var(--adaptive-height,100dvh) - 80px);overflow:auto}
 body.adaptive-shell.inspiration-body .gen-panel{position:fixed!important;left:12px!important;right:12px!important;top:auto!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:auto!important;min-width:0!important;max-width:calc(100vw - 24px);max-height:calc(var(--adaptive-height,100dvh) - 130px);overflow-y:auto;box-sizing:border-box;z-index:90}
 body.adaptive-shell.inspiration-body .gen-panel.is-node-anchored::before{display:none}
 /* Long administration tables become labelled per-model cards. */
 .adaptive-shell .billing-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .adaptive-shell .billing-table-wrap{overflow:visible}
 .adaptive-shell .billing-table{width:100%!important;min-width:0!important;display:block}
 .adaptive-shell .billing-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .adaptive-shell .billing-table tbody{display:grid;gap:16px}
 .adaptive-shell .billing-table tr:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr);padding:16px;border:1px solid var(--line-strong);border-radius:14px;min-width:0}
 .adaptive-shell #adminBillingPanel .billing-table td{display:block;width:auto!important;min-width:0!important;padding:10px 0;border:0;overflow-wrap:anywhere;font-size:14px}
 .adaptive-shell .billing-table td::before{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}
 .adaptive-shell .billing-table td:nth-child(1)::before{content:'已核价'}
 .adaptive-shell .billing-table td:nth-child(2)::before{content:'模型 / 规格'}
 .adaptive-shell .billing-table td:nth-child(3)::before{content:'供应商成本'}
 .adaptive-shell .billing-table td:nth-child(4)::before{content:'计价方式 / 单独倍率'}
 .adaptive-shell .billing-table td:nth-child(5)::before{content:'指定售价（元）'}
 .adaptive-shell .billing-table td:nth-child(6)::before{content:'当前换算结果'}
 .adaptive-shell .billing-table :is(input,select){width:100%;box-sizing:border-box}
 .adaptive-shell .billing-table input[type=checkbox]{width:24px;height:24px}
 .adaptive-shell .billing-uniform .billing-category-control{display:none}
}
@media(max-width:599px){.adaptive-shell .billing-controls{grid-template-columns:minmax(0,1fr)!important}.adaptive-shell .homepage-content-items{grid-template-columns:minmax(0,1fr)}.adaptive-shell .adaptive-menu-sheet{margin:auto 0 0;width:100%;max-width:none;max-height:calc(var(--adaptive-height,100dvh) - 24px);border-radius:20px 20px 0 0;padding-bottom:max(24px,env(safe-area-inset-bottom))}}
@media(min-width:600px) and (max-width:839px){.adaptive-shell .homepage-content-items{grid-template-columns:repeat(2,minmax(0,1fr))}.adaptive-shell .home-start-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}.adaptive-shell .home-start-actions button{display:flex!important;flex-direction:column;align-items:flex-start}.adaptive-shell .home-start-actions small{grid-column:auto}}
@media(hover:none){.adaptive-shell .asset-more,.adaptive-shell .canvas-product-images span button{opacity:1}}
@media(any-pointer:coarse){
 .adaptive-shell :is(.topbar,.agent-tools,.home-agent-tools,.conversation-popup,.gen-panel) button{min-height:44px;min-width:44px}
 .adaptive-shell .conversation-popup .conversation-options button{min-height:48px}
}
/* Node menus extend beyond the composer; the editor and menu own their scrolling. */
@media(max-width:839px){body.adaptive-shell.inspiration-body .gen-panel.is-node-anchored{overflow:visible}}
