/* Script workspace: document directory, manuscript and independent assistant. */
.sw-page.native-script.page{--script-directory-width:348px;grid-template-columns:var(--script-directory-width) 1px minmax(0,1fr);padding:0;gap:0;background:#252525}
.sw-page .native-script-directory{grid-column:1;display:flex;flex-direction:column;margin:0 8px 8px 0;padding:16px;border-radius:24px;background:#181818;overflow:auto;min-width:0}
.sw-page .native-script-directory header{margin-bottom:20px;flex:none}
.sw-page .native-script-directory header h2{font-size:16px;font-weight:600}
.sw-page .native-file-tree{font-size:14px;flex:1}
.sw-page .native-file-tree>button{height:42px;border-radius:9px;padding-left:34px}
.sw-page .native-file-tree details{margin:4px 0}
.sw-page .native-file-tree summary{height:38px;display:flex;align-items:center;gap:10px;cursor:pointer;padding:0 12px;color:#c9c9c9}
.sw-page .native-file-tree summary:before{content:'›';width:12px;color:#969696;transform:rotate(0deg)}
.sw-page .native-file-tree details[open]>summary:before{transform:rotate(90deg)}
.sw-page .native-file-tree summary .icon{width:24px;height:24px;color:#c3c3c3}
.sw-page .sw-workspace-folder{padding-left:24px}
.sw-page .sw-directory-splitter{grid-column:2;background:#3d3d3d;cursor:col-resize;touch-action:none;position:relative;z-index:3}
.sw-directory-splitter:before{content:'';position:absolute;left:-3px;right:-3px;top:0;bottom:0}
.sw-directory-splitter:hover,.sw-directory-splitter:focus{background:#b6b6b6;outline:0}
.sw-page .native-script-main{grid-column:3;border:0;padding:0;position:relative;min-width:0;overflow:hidden}
.sw-document-scroll{height:100%;overflow:auto;overscroll-behavior:contain;padding:36px 48px 116px;scrollbar-width:thin;scrollbar-color:#484848 transparent}
.sw-page .native-page-heading{height:40px;border-bottom:1px solid #3a3a3a;padding:0 0 14px;margin:0 0 20px;display:flex;align-items:center}
.sw-page .native-page-heading h1{font-family:"Songti SC","Noto Serif CJK SC",serif;font-size:30px;line-height:1;font-weight:500}
.sw-page #script-count{margin-left:auto;color:#898989;font-size:12px;white-space:nowrap}
.sw-page .native-script-toolbar{position:static;height:64px;margin:0 0 32px;gap:8px;flex-wrap:nowrap;background:transparent;padding:0}
.sw-toolbar-left{display:flex;align-items:center;gap:16px;flex:1;min-width:0;height:64px}
.sw-toolbar-left [role="tablist"]{height:64px;flex:none}
.sw-toolbar-right{display:flex;align-items:center;gap:10px;flex:none}
.sw-toolbar-left .sw-fold-all{margin-left:auto;display:flex;align-items:center;gap:4px;height:30px;padding:1px 8px;white-space:nowrap;border:0;border-radius:32px;background:transparent;color:#eee;font-size:12px;cursor:pointer}
.sw-fold-all>.icon{width:14px;height:14px;transform:rotate(180deg)}
.sw-fold-all.all-folded>.icon{transform:none}
.sw-toolbar-right .sw-narration{height:36px;display:flex;align-items:center;gap:4px;border:1px solid #262626cc;border-radius:38px;padding:10px 16px;background:#26262666;color:#eee;font-size:13px;white-space:nowrap;cursor:pointer}
.sw-narration>.icon{width:14px;height:14px}
.sw-toolbar-right .sw-toolbar-more>summary{width:34px;height:34px;display:flex;align-items:center;justify-content:center;padding:0;background:#ffffff0a;color:#eee;font-size:18px;border-radius:50%}
.sw-fold-all:hover,.sw-toolbar-right .sw-narration:hover,.sw-toolbar-right .sw-toolbar-more>summary:hover{background:#ffffff0d}
.sw-project-header .sw-assistant-reopen{position:static;flex:none;display:flex;align-items:center;gap:6px;background:#303030;color:#ddd;border:1px solid #444;border-radius:18px;padding:8px 12px;font-size:13px;cursor:pointer;z-index:10}
.sw-page .native-script-tab{display:flex;align-items:center;font-size:14px;gap:8px;height:40px;padding:12px 0;border-bottom:2px solid #ddd;white-space:nowrap}
.sw-page .native-script-toolbar>.btn{font-size:12px;padding:4px 6px}
.sw-page #script-form{display:block;padding:0;overflow:visible;min-height:200px}
.sw-page #script-body[hidden]{display:none!important}
.sw-chapters{padding-left:24px}
.sw-chapter{margin:0 0 32px;scroll-margin-top:24px}
.sw-chapter>header{position:relative;height:36px;display:flex;align-items:center;gap:6px;margin-bottom:20px;color:#dfdfdf}
.sw-chapter-number{font-size:16px}
.sw-chapter .sw-chapter-title{flex:1;min-width:0;outline:0;border:1px solid transparent;border-radius:5px;background:transparent;color:#dedede;font-size:16px;padding:5px 4px}
.sw-chapter .sw-chapter-title:hover,.sw-chapter .sw-chapter-title:focus{border-color:#555;background:#292929}
.sw-chapter>header strong{font-size:16px;font-weight:500;flex:1}
.sw-chapter .sw-fold{width:24px;height:28px;padding:2px;flex:none;background:transparent}
.sw-chapter.is-folded .sw-fold svg{transform:rotate(-90deg)}
.sw-chapter.is-folded textarea{display:none}
.sw-chapter.is-folded{margin-bottom:12px}
.sw-chapter.is-folded>header{margin-bottom:0}
.sw-chapter textarea{display:block;width:calc(100% - 32px);margin:0 0 0 32px;padding:0;border:0;border-radius:0;resize:none;overflow:hidden;background:transparent;color:#b9b9b9;font:400 14px/24px -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;box-shadow:none;outline:none;min-height:96px;white-space:pre-wrap}
.sw-chapter textarea:focus{outline:none;box-shadow:none;background:transparent}
.sw-menu{position:relative;font-size:12px;color:#acacac}
.sw-menu>summary{display:flex;align-items:center;gap:6px;cursor:pointer;border-radius:18px;padding:6px 10px;list-style:none;white-space:nowrap}
.sw-menu>summary::-webkit-details-marker{display:none}
.sw-menu>summary:hover,.sw-menu[open]>summary{background:#333;color:#eee}
.sw-menu .native-menu-panel{position:absolute;top:calc(100% + 6px);right:0;left:auto;display:grid;min-width:176px;padding:6px;border:1px solid #454545;border-radius:12px;background:#2a2a2a;box-shadow:0 8px 26px #0004;z-index:50}
.sw-menu .native-menu-panel button{border:0;background:transparent;color:#ddd;text-align:left;padding:10px 12px;border-radius:7px;cursor:pointer;font-size:13px}
.sw-menu .native-menu-panel button:hover{background:#414141}
.sw-chapter-menu{position:absolute;left:-28px;top:2px;opacity:0;pointer-events:none}
.sw-chapter:hover .sw-chapter-menu,.sw-chapter:focus-within .sw-chapter-menu,.sw-chapter-menu[open]{opacity:1;pointer-events:auto}
.sw-chapter-menu>summary{padding:2px;width:24px;height:24px;justify-content:center}
.sw-chapter-menu .native-menu-panel{left:0;right:auto;min-width:192px;border-radius:24px;padding:8px}
.sw-chapter-menu .native-menu-panel button{display:flex;align-items:center;gap:12px;min-height:40px;border-radius:16px}
.sw-chapter-menu [data-script-action="delete-part"] .icon{color:#f36b78}
@media(hover:none){.sw-chapter-menu{opacity:1;pointer-events:auto}}
.sw-chapter-menu>summary>.icon{display:none}
.sw-page .native-step-pill{bottom:22px;background:#303030;padding:9px 10px 9px 20px;gap:16px;max-width:calc(100% - 48px);box-shadow:0 8px 28px #0002;z-index:5}
.sw-page .native-step-pill>span{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sw-page .native-step-pill>.btn{border-radius:24px;white-space:nowrap;padding:10px 16px;font-size:13px}
.sw-project-header .sw-project-style,.sw-project-header .sw-project-ratio{display:flex;align-items:center;gap:7px;padding:5px 8px;font-size:13px;border:0;background:transparent;color:#d5d5d5;cursor:pointer;white-space:nowrap}
.sw-project-header .sw-project-style{max-width:200px}
.sw-project-style span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sw-project-header .sw-project-ratio{border-left:1px solid #444;margin-left:4px}
.sw-source-card{display:flex;align-items:center;gap:10px;background:#303030;border-radius:15px;padding:14px;color:#d4d4d4;text-decoration:none;min-width:0;text-align:left}
.sw-source-card>span:last-child{min-width:0;flex:1}
.sw-source-card strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:400}
.sw-source-card small{display:block;color:#999;margin-top:4px;font-size:12px}
.sw-file-icon{color:#4ac1e2;flex:none}
.sw-file-icon svg{width:26px;height:30px}
#script-source-files .sw-source-card{margin:4px 0 4px 20px;padding:10px;border-radius:8px;background:transparent}
#script-source-files .sw-source-card:hover{background:#292929}
.sw-empty-files{display:block;padding:12px 24px;color:#797979;font-size:12px}
.sw-script-receipt>.sw-source-card{width:238px;max-width:100%;margin:22px 0 42px auto}
.sw-script-receipt>p{font-size:14px;color:#d6d6d6;line-height:1.75;margin:20px 0 30px}
.sw-assistant .agent-panel-heading{position:relative;gap:0}
.sw-assistant .chat-session-heading{flex:1;min-width:0}
.sw-assistant-title{color:#e8e8e8;font-size:14px;font-weight:600;white-space:nowrap;padding-left:7px}
body .studio-shell .sw-assistant .agent-composer .composer-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:nowrap}
body .studio-shell .sw-assistant .agent-composer .native-attach{flex:0 0 32px;width:32px;height:32px;padding:6px;display:flex;align-items:center;justify-content:center}
body .studio-shell .sw-assistant .agent-composer .composer-send{flex-shrink:0}
body .studio-shell .sw-assistant .agent-composer .composer-toolbar>.grow{min-width:0}

.sw-assistant .chat-session-memory{display:none}
.sw-assistant .sw-display-menu>summary{font-size:0;padding:8px;background:#292929}
.sw-assistant .sw-display-menu>summary:before{content:'◧';font-size:16px}
.sw-assistant .sw-display-menu>summary>.icon{width:12px}
.sw-assistant .sw-chat-suggestions{display:flex;gap:6px;margin-bottom:10px}
.sw-chat-suggestions .btn{background:#333;border:1px solid #414141;border-radius:20px;font-size:12px;padding:8px 12px}
.sw-assistant .sw-skill-button{font-size:13px;display:flex;align-items:center;gap:5px;background:#090909;border-radius:22px;padding:6px 10px;height:32px;width:auto}
.sw-assistant #agent-text{font-size:14px;line-height:22px}
.creation-workspace.sw-chat-full .creation-content{display:none}
.creation-workspace.sw-chat-full .agent-panel{width:100%;max-width:none;flex:1;margin-top:0;height:100%}
.sw-page.native-script.page.directory-collapsed{grid-template-columns:0 0 minmax(0,1fr)}
.sw-page.directory-collapsed .native-script-directory,.sw-page.directory-collapsed .sw-directory-splitter{display:none}
@media(max-width:1300px){.sw-chapters{padding-left:40px}.sw-page.native-script.page{--script-directory-width:260px}.sw-document-scroll{padding-left:30px;padding-right:30px}.sw-page .native-step-pill>span{display:none}}
@media(max-width:1050px){.sw-chapters{padding-left:48px}.sw-page.native-script.page{--script-directory-width:210px}.sw-document-scroll{padding-left:22px;padding-right:22px}.sw-project-header .sw-project-style{max-width:125px}}
@media(max-width:760px){.sw-page.native-script.page{grid-template-columns:0 0 minmax(0,1fr)}.sw-page .native-script-directory,.sw-directory-splitter{display:none}.sw-project-header .sw-project-style{display:none}}
body .studio-shell .sw-assistant [hidden]{display:none!important}
body .studio-shell .sw-assistant .sw-skill-button{display:flex;width:auto;min-width:88px;flex:none;white-space:nowrap;font-size:13px;padding:6px 10px;gap:5px;border-radius:20px;background:#080808}
body .studio-shell .sw-assistant .sw-skill-button svg{width:15px;height:15px;flex:none}
body .studio-shell .sw-assistant .agent-scroll{padding:20px 24px}
body .studio-shell .creation-workspace.sw-chat-full{display:flex}

/* The chapter rail stays beside the manuscript, independent of the file tree. */
.sw-episode-nav{position:absolute;left:var(--script-directory-width);top:176px;width:35px;height:138px;z-index:15}
.sw-episode-trigger{width:35px;height:138px;padding:0;border:0;border-radius:10px;background:transparent;color:#aaa;cursor:pointer;display:block}
.sw-episode-trigger:hover,.sw-episode-trigger[aria-expanded="true"]{background:#ffffff08;color:#ddd}
.sw-episode-trigger:focus-visible{outline:1px solid #aaa;outline-offset:-2px}
.sw-episode-tick{stroke:currentColor;stroke-linecap:round;opacity:.25}
.sw-episode-tick.active{opacity:1}
.sw-episode-marker{fill:currentColor;display:none}
.sw-episode-marker.active{display:block}
.sw-episode-popover{position:absolute;right:calc(100% + 8px);top:-6px;width:min(224px,calc(var(--script-directory-width) - 8px));max-height:calc(100vh - 240px);display:flex;flex-direction:column;padding:16px 8px;border:1px solid #ffffff14;border-radius:24px;background:#262626ed;backdrop-filter:blur(24px);box-shadow:0 12px 36px #0004;color:#ddd}
.sw-episode-popover[hidden]{display:none!important}
.sw-episode-popover:before{content:"";position:absolute;width:8px;right:-9px;top:0;height:100%}
.sw-episode-popover h2{font-size:14px;font-weight:600;margin:0 8px 12px;line-height:24px}
.sw-episode-links{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#555 transparent;min-height:0}
.sw-episode-links button{display:block;max-width:100%;width:100%;text-align:left;padding:10px 12px;border:0;border-radius:10px;color:#bdbdbd;font-size:14px;line-height:20px;background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.sw-episode-links button:hover{background:#ffffff0a;color:#fff}
.sw-episode-links button[aria-current="true"]{color:#fff;background:#ffffff10}
.sw-page.directory-collapsed .sw-episode-nav{left:0}
.sw-page.directory-collapsed .sw-episode-popover{left:calc(100% + 8px);right:auto;width:224px}
.sw-page.directory-collapsed .sw-episode-popover:before{left:-9px;right:auto}
body .studio-shell .sw-project-header .sw-directory-reopen{position:static;flex:none;color:#aaa}
body .studio-shell .sw-project-header .sw-directory-reopen[hidden]{display:none!important}
@media(max-width:760px){.sw-episode-nav{left:0}.sw-episode-popover{left:calc(100% + 8px);right:auto;width:224px}.sw-episode-popover:before{left:-9px;right:auto}}

.sw-autosave-state{margin-left:auto;background:none;border:0;font-size:11px;color:#888;cursor:pointer;padding:4px 8px}
.sw-autosave-state[data-status="error"]{color:#dfb275}
.sw-autosave-state[hidden]{display:none!important}
.sw-autosave-state:not([hidden])+#script-count{margin-left:8px}
/* Story/outline fields share the imported screenplay workspace. */
.sw-page [role=tablist]{display:flex;gap:24px}.sw-page button.native-script-tab{background:none;border:0;border-bottom:2px solid transparent;color:#888;border-radius:0;cursor:pointer}.sw-page button.native-script-tab[aria-selected=true]{color:#eee;border-bottom-color:#ddd}.sw-documents{padding:20px 0 48px}.sw-document-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px 24px}.sw-document-field{display:flex;flex-direction:column;gap:12px;color:#aaa;font-size:14px;margin:0}.sw-document-field.long{grid-column:1/-1}.sw-document-field input,.sw-document-field textarea{box-sizing:border-box;width:100%;border:1px solid rgba(38,38,38,.4);background:rgba(38,38,38,.64);border-radius:20px;color:#fff;padding:12px 20px;font:inherit;line-height:1.7;outline:none;resize:none}.sw-document-field input:focus,.sw-document-field textarea:focus{border-color:#777}.sw-document-field textarea{min-height:50px;overflow-y:hidden}.sw-outline{margin-bottom:32px}.sw-outline h3{font-size:16px;font-weight:500;margin:0 0 18px}.sw-outline .sw-document-field{margin-bottom:20px}.sw-page [hidden]{display:none!important}@media(max-width:700px){.sw-document-grid{grid-template-columns:1fr}.sw-page [role=tablist]{gap:16px}}
