#branch-root{width:100%;min-height:70vh;color:#262923}.branch-home,.branch-project{max-width:1500px;margin:auto;padding:28px 30px}.branch-home-head,.branch-project-toolbar{display:flex;align-items:center;justify-content:space-between;gap:24px}.branch-home h1,.branch-project h1{font-size:clamp(28px,4vw,40px);line-height:1.05;margin:8px 0}.branch-home-head p,.branch-empty-list p,.branch-canvas-empty p,.branch-picker p{color:#70756c;margin:8px 0 0}.branch-search{margin:30px 0 20px}.branch-search input{width:min(460px,100%);border:1px solid #d9ddd4;border-radius:12px;padding:12px 15px;font:inherit}.branch-project-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.branch-project-card{position:relative;background:#fff;border:1px solid #e1e4dd;border-radius:16px;min-height:170px;box-shadow:0 8px 28px #2221}.branch-project-open{width:100%;height:100%;min-height:170px;border:0;background:transparent;text-align:left;padding:22px;display:flex;flex-direction:column;gap:12px;color:inherit;cursor:pointer}.branch-project-open small{color:#75796f}.branch-project-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#f0f4e8;color:#526b38;font-size:23px}.branch-more{position:absolute;right:10px;top:10px;border:0;background:none;font-size:24px}.branch-empty-list,.branch-gate{margin:52px auto;text-align:center;max-width:560px;padding:35px}.branch-empty-list>span{font-size:45px;color:#789252}.branch-project-toolbar{padding-bottom:16px;border-bottom:1px solid #e4e6e1}.branch-owner-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.branch-statusline{display:flex;justify-content:space-between;padding:10px 0;color:#74786f;font-size:13px}.branch-workspace{display:grid;grid-template-columns:235px minmax(0,1fr);height:min(72vh,850px);min-height:540px;border:1px solid #dce0d8;border-radius:16px;overflow:hidden;background:#f5f6f2}.branch-picker{background:#fff;border-right:1px solid #e1e4dd;padding:18px;overflow:auto}.branch-picker h2{font-size:16px;margin:0}.branch-picker details{border-top:1px solid #eceee9;padding:10px 0}.branch-picker summary{font-weight:650;cursor:pointer}.branch-picker details>div{display:grid;gap:5px;margin-top:8px}.branch-seed{border:0;background:#f5f7f2;text-align:left;padding:9px 10px;border-radius:8px;cursor:pointer;color:#32362e}.branch-seed:hover{background:#edf1e6}.branch-picker-note{margin-top:14px;font-size:12px;line-height:1.45;color:#73796d}.branch-canvas{position:relative;overflow:hidden;background-image:radial-gradient(#d2d7cb 1px,transparent 1px);background-size:22px 22px;touch-action:none;cursor:grab}.branch-canvas:active{cursor:grabbing}.branch-canvas-world{position:absolute;left:0;top:0;width:4000px;height:3000px;transform-origin:0 0}.branch-canvas-empty{position:absolute;left:50%;top:45%;width:min(460px,80vw);transform:translate(-50%,-50%);text-align:center;background:#ffffffed;border:1px solid #e0e4da;border-radius:18px;padding:28px;box-shadow:0 10px 35px #1e251414}.branch-canvas-empty>span{font-size:40px;color:#789252}.branch-canvas-empty h2{font-size:21px;margin:10px 0}.branch-node{position:absolute;left:var(--node-x,180px);top:var(--node-y,150px);width:290px;background:#fff;border:2px solid #aeb4a7;border-radius:14px;padding:13px;box-shadow:0 10px 30px #24271a20}.branch-node.status-alive{border-color:#298354}.branch-node.status-dead{border-color:#c84747;opacity:.76}.branch-node header{display:flex;justify-content:space-between;align-items:center;text-transform:capitalize;font-size:12px;color:#656b60}.branch-node select,.branch-node textarea,.branch-connect-dialog select{font:inherit;border:1px solid #dce0d8;border-radius:7px;padding:6px;background:#fff}.branch-node h3{margin:12px 0;font-size:17px}.branch-node label{display:block;margin:9px 0 4px;font-size:12px;font-weight:600}.branch-node label textarea,.branch-node label select{display:block;width:100%;margin-top:4px}.branch-port-list{display:flex;flex-direction:column;gap:4px;font-size:11px;color:#657058}.branch-port{display:block}.branch-port b{font-weight:600}.branch-port.output-port{text-align:right}.branch-node-actions{display:flex;align-items:center;gap:6px;margin:9px 0}.branch-node-actions .btn,.branch-connect{font-size:12px;padding:6px 8px}.branch-execution{font-size:11px;color:#75796f}.branch-connect{border:1px dashed #c6cbc0;border-radius:7px;background:#fafbf9;padding:7px;width:100%;cursor:pointer}.branch-seed-description{font-size:12px;color:#74796f;min-height:35px}.branch-canvas-controls{position:absolute;right:16px;bottom:16px;display:flex;gap:5px}.branch-canvas-controls button{width:36px;height:36px;border:1px solid #d7dcd1;border-radius:10px;background:#fff;font-size:20px}.branch-edges{position:absolute;inset:0;width:4000px;height:3000px;pointer-events:none}.branch-connect-dialog{position:fixed;z-index:30;right:25px;bottom:25px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:min(620px,90vw);padding:14px;background:#fff;border:1px solid #dce0d8;border-radius:14px;box-shadow:0 10px 40px #0002}.branch-connect-dialog select{max-width:220px}.branch-gate{background:#fff;border:1px solid #e2e5dd;border-radius:16px}.branch-gate a{display:inline-block;margin-top:12px;color:#465f32}@media(max-width:850px){.branch-home,.branch-project{padding:18px 12px}.branch-project-toolbar{align-items:flex-start;flex-direction:column}.branch-owner-tools{justify-content:flex-start}.branch-workspace{grid-template-columns:180px minmax(0,1fr);height:72vh}.branch-node{width:260px}.branch-picker{padding:12px}}@media(max-width:560px){.branch-home-head{align-items:flex-start;flex-direction:column}.branch-workspace{grid-template-columns:1fr;grid-template-rows:195px minmax(0,1fr);height:calc(100dvh - 300px);min-height:430px}.branch-picker{border-right:0;border-bottom:1px solid #e1e4dd}.branch-picker details{display:inline-block;vertical-align:top;width:48%;padding-right:4px}.branch-picker details>div{max-height:120px;overflow:auto}.branch-project-toolbar .btn{font-size:12px}}
/* Published Branch cards and read-only preview. */
.branch-gallery-cover{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:10px;margin-bottom:6px;user-select:none;-webkit-user-drag:none}.branch-public-workspace{grid-template-columns:minmax(0,1fr)}.branch-public-view .branch-canvas{cursor:grab}.branch-public-view .branch-node{user-select:none}.branch-public-view .branch-node video,.branch-public-view .branch-node audio{display:block;width:100%;max-width:100%;margin:8px 0;border-radius:8px}.branch-public-image{display:block;width:100%;border:0;padding:0;background:transparent;cursor:zoom-in}.branch-public-image img{display:block;width:100%;height:auto;max-height:320px;object-fit:contain;border-radius:8px;user-select:none;-webkit-user-drag:none}.branch-public-no-output{font-size:12px;color:#777d70}.branch-edges path{fill:none;stroke:#969e8b;stroke-width:2}.branch-edges text{font-size:12px;fill:#62695a;text-anchor:middle;paint-order:stroke;stroke:#f5f6f2;stroke-width:4px;stroke-linejoin:round}.branch-public-note{margin:12px 0;color:#767b70;font-size:13px}.branch-lightbox{position:fixed;inset:0;z-index:60;background:#121411ed;display:flex;align-items:center;justify-content:center;padding:40px}.branch-lightbox>img,.branch-lightbox>video{max-width:92vw;max-height:88vh;object-fit:contain}.branch-lightbox>audio{width:min(640px,88vw)}.branch-lightbox>[data-close-preview]{position:absolute;right:22px;top:18px;border:0;background:#ffffff22;color:#fff;border-radius:50%;font-size:30px;width:44px;height:44px}.branch-canvas-controls span{min-width:44px;text-align:center;align-self:center;font-size:12px;color:#555b50}

.branch-home-actions{display:flex;gap:8px;align-items:center}.branch-project-card> .btn{margin:0 0 14px 22px}.branch-project-card>div.branch-project-open{cursor:default}@media(max-width:560px){.branch-home-actions{width:100%;justify-content:space-between}}

.branch-node-artifacts{display:grid;gap:6px;margin:8px 0}.branch-node-artifacts img,.branch-node-artifacts video{display:block;width:100%;max-height:180px;object-fit:contain;border-radius:8px;background:#eee}.branch-node-artifacts audio{width:100%;max-width:100%}

.branch-edges text[data-delete-edge]{pointer-events:auto;cursor:pointer;fill:#566349}.branch-edges text[data-delete-edge]:hover,.branch-edges text[data-delete-edge]:focus{fill:#a33;font-weight:700}
/* Full-window Branch canvas, compact seed rail, searchable context menu and wire handles. */
.studio-shell:has(#branch-root.branch-project-open) .studio-workspace{display:block;min-height:0;height:calc(100dvh - 68px)}
.studio-shell:has(#branch-root.branch-project-open) .studio-sidebar{display:none!important}
.studio-shell:has(#branch-root.branch-project-open) #studio-main{position:fixed;z-index:20;top:68px;right:0;bottom:0;left:0;width:100%;height:calc(100dvh - 68px);min-height:0;padding:0!important;overflow:hidden;background:#f5f6f2}
#branch-root.branch-project-open{height:100%;min-height:0;width:100%;overflow:hidden}
.branch-project-open .branch-project{display:flex;flex-direction:column;width:100%;height:100%;max-width:none;margin:0;padding:12px 18px 14px;gap:5px}
.branch-project-open .branch-project-toolbar{flex:none;min-height:62px;padding:0 4px 8px;gap:18px}
.branch-project-open .branch-project-toolbar>div:nth-child(2){margin-right:auto}
.branch-project-open .branch-project-toolbar h1{font-size:clamp(22px,2.2vw,32px);margin:3px 0}
.branch-project-open .branch-project-toolbar .eyebrow{font-size:10px;letter-spacing:.13em}
.branch-project-open .branch-owner-tools{flex-wrap:nowrap;gap:7px}
.branch-project-open .branch-owner-tools .btn,.branch-project-open .branch-project-toolbar>.btn{white-space:nowrap;padding:9px 12px}
.branch-project-open .branch-statusline{flex:none;padding:2px 8px 8px}
.branch-project-open .branch-workspace{flex:1;min-height:0;height:auto;grid-template-columns:64px minmax(0,1fr);border-radius:12px}
.branch-project-open .branch-seed-rail{padding:10px 5px;display:flex;flex-direction:column;align-items:center;gap:5px;overflow-y:auto}
.branch-project-open .branch-seed-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:52px;min-height:50px;padding:5px 2px;border:0;border-radius:9px;background:transparent;color:#394134;cursor:pointer}
.branch-project-open .branch-seed-icon:hover{background:#eff4e8;color:#30441f}
.branch-project-open .branch-seed-icon>span{font-size:20px;line-height:1.1}
.branch-project-open .branch-seed-icon>small{font-size:9px;line-height:1.1;text-align:center}
.branch-project-open .branch-picker-note{font-size:9px;line-height:1.25;text-align:center}
.branch-project-open .branch-canvas{min-width:0;min-height:0}
.branch-project-open .branch-port-list{gap:5px;margin:14px 0}
.branch-project-open .branch-port{display:flex;align-items:center;gap:5px;width:max-content;min-height:17px;padding:0;border:0;background:none;color:#647052;font:inherit;font-size:11px;cursor:crosshair}
.branch-project-open .branch-port.output-port{margin-left:auto}
.branch-project-open .branch-port i{display:block;flex:none;width:9px;height:9px;border:2px solid #61754a;border-radius:50%;background:#fff}
.branch-project-open .branch-port.input-port{flex-direction:row}
.branch-project-open .branch-port.input-port:first-letter{color:#61754a}
.branch-wire-preview{display:none;position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:5}
.branch-wire-preview path{fill:none;stroke:#718557;stroke-width:2;stroke-dasharray:5 4}
.branch-context-menu{position:absolute;z-index:12;width:min(290px,calc(100% - 24px));max-height:min(420px,70%);overflow:auto;padding:12px;background:#fff;border:1px solid #d9ded2;border-radius:12px;box-shadow:0 12px 36px #20271b30}
.branch-context-menu label{display:grid;gap:6px;font-size:12px;font-weight:650}
.branch-context-menu input{width:100%;padding:9px 10px;border:1px solid #d8ded1;border-radius:8px;font:inherit}
.branch-context-seeds{display:grid;gap:3px;margin-top:8px}
.branch-context-seeds button{display:flex;align-items:center;gap:9px;padding:8px;border:0;border-radius:7px;background:#fff;text-align:left;cursor:pointer}
.branch-context-seeds button:hover{background:#f0f4e9}
.branch-context-seeds button span{width:22px;font-size:17px;text-align:center}
@media(max-width:900px){.branch-project-open .branch-project-toolbar{align-items:center;flex-direction:row;gap:8px}.branch-project-open .branch-owner-tools{overflow-x:auto;max-width:58vw}.branch-project-open .branch-project-toolbar .btn{font-size:11px;padding:8px}.branch-project-open .branch-workspace{grid-template-columns:54px minmax(0,1fr)}}
@media(max-width:560px){.studio-shell:has(#branch-root.branch-project-open) #studio-main{top:56px;height:calc(100dvh - 56px)}.branch-project-open .branch-project{padding:6px}.branch-project-open .branch-project-toolbar{min-height:76px;flex-wrap:wrap;justify-content:flex-start}.branch-project-open .branch-project-toolbar>div:nth-child(2){min-width:calc(100% - 120px)}.branch-project-open .branch-owner-tools{max-width:100%;width:100%;justify-content:flex-start}.branch-project-open .branch-statusline{font-size:11px}.branch-project-open .branch-workspace{grid-template-columns:48px minmax(0,1fr)}.branch-project-open .branch-seed-icon{width:42px;min-height:44px}.branch-project-open .branch-picker-note{display:none}}/* Branch canvas revision: edge ports, full workspace and compact media cards. */
#branch-root.branch-project-open{position:fixed;inset:68px 0 0;z-index:20;height:auto;background:#f5f6f2;box-sizing:border-box}
#branch-root.branch-project-open .branch-project{box-sizing:border-box;padding:10px 0 0;gap:0;max-width:none;height:100%;width:100%}
#branch-root .branch-project-toolbar{padding:0 20px 10px;min-height:56px}
#branch-root .branch-project-toolbar h1{font-size:clamp(18px,2vw,28px);max-width:38vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#branch-root .branch-project-toolbar .eyebrow{display:none}
#branch-root .branch-statusline{padding:5px 20px 8px;font-size:11px}
#branch-root .branch-workspace{border-radius:0;border-left:0;border-right:0;border-bottom:0;grid-template-columns:68px minmax(0,1fr);min-height:0;grid-template-rows:minmax(0,1fr)}
#branch-root .branch-seed-rail{position:relative;z-index:8;padding:8px 5px;background:#fff;overscroll-behavior:contain}
#branch-root .branch-picker-note{display:none}
#branch-root .branch-canvas{overscroll-behavior:contain}
#branch-root .branch-canvas-empty{left:100px;top:100px;transform:none;width:420px}
#branch-root .branch-node{width:310px;box-sizing:border-box;padding:16px 20px 18px;border-radius:16px;box-shadow:0 12px 36px #24271a15;cursor:default}
#branch-root .branch-node header{cursor:grab;user-select:none}
#branch-root .branch-node h3{font-size:18px;margin:12px 0 18px;cursor:grab}
#branch-root .branch-node textarea{resize:vertical;box-sizing:border-box;min-height:70px;line-height:1.45;font-size:13px;padding:10px}
#branch-root .branch-node textarea[data-field="prompt"]{min-height:130px}
#branch-root .branch-node-actions{margin:14px 0 0;display:block}
#branch-root .branch-node .btn-primary{width:100%;padding:11px 12px;font-size:13px;border-radius:10px;margin-top:12px}
#branch-root .branch-node-actions .btn-primary{margin:0}
#branch-root .branch-port-list{position:static;height:0;margin:0;gap:0}
#branch-root .branch-port{position:absolute;z-index:4;min-width:24px;min-height:26px;padding:3px;font-size:10px;touch-action:none}
#branch-root .branch-port.input-port{left:-16px;top:calc(84px + var(--port-index,0)*38px)}
#branch-root .branch-port.output-port{right:-16px;bottom:26px}
#branch-root .branch-port i{width:16px;height:16px;border:3px solid #fff;background:#f44835;box-shadow:0 0 0 1px #e83c2b;box-sizing:border-box;transition:transform .15s,box-shadow .15s}
#branch-root .branch-port:hover i,#branch-root .branch-port:focus-visible i{transform:scale(1.3);box-shadow:0 0 0 5px #f4483520}
#branch-root .branch-port b{position:absolute;white-space:nowrap;background:#fff;padding:3px 6px;border-radius:5px;opacity:0;pointer-events:none;box-shadow:0 2px 8px #0001}
#branch-root .input-port b{right:27px}#branch-root .output-port b{left:27px}
#branch-root .branch-port:hover b,#branch-root .branch-port:focus-visible b{opacity:1}
#branch-root .branch-references{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin:4px 0 14px}
#branch-root .branch-reference{min-width:0;border:1px solid #e2e5dd;border-radius:10px;overflow:hidden;background:#fafbf8}
#branch-root .branch-reference-title{padding:7px 9px;font-size:11px;text-transform:capitalize;color:#666e5e;display:flex;justify-content:space-between;gap:6px}
#branch-root .branch-reference-title span{font-size:9px;color:#34845c}
#branch-root .branch-reference-thumb{display:block;width:100%;padding:0;border:0;background:#f0f2ec;cursor:zoom-in}
#branch-root .branch-reference-thumb img{display:block;width:100%;height:92px;object-fit:cover}
#branch-root .branch-reference-empty{height:76px;display:grid;place-items:center;text-align:center;padding:8px;color:#91968b;font-size:11px;box-sizing:border-box}
#branch-root .branch-reference-actions{display:flex;border-top:1px solid #e2e5dd}
#branch-root .branch-reference-actions button,#branch-root .branch-reference-actions label,#branch-root .branch-reference-remove{flex:1;margin:0;padding:9px 3px;border:0;background:white;cursor:pointer;font:inherit;font-size:11px;text-align:center;color:#46543b}
#branch-root .branch-reference-actions label{border-right:1px solid #e2e5dd}
#branch-root .branch-reference-actions :hover{background:#f0f5e7}
#branch-root .branch-reference-remove{width:100%;border-top:1px solid #e2e5dd}
#branch-root .branch-linked-prompt{margin:12px 0;border-left:2px solid #c8d8af;padding-left:10px}
#branch-root .branch-linked-prompt span{font-size:10px;color:#748365}
#branch-root .branch-linked-prompt p{font-size:12px;color:#525a4b;line-height:1.45;margin:5px 0;max-height:76px;overflow:auto;white-space:pre-wrap}
#branch-root .branch-preview{display:block;width:100%;padding:0;background:#f3f4ef;border:0;border-radius:10px;overflow:hidden;cursor:zoom-in}
#branch-root .branch-preview-link{border:0;background:none;text-align:right;font-size:11px;color:#657552;cursor:pointer;padding:6px}
#branch-root .branch-node-artifacts img,#branch-root .branch-node-artifacts video{max-height:220px;min-height:100px}
#branch-root .branch-edges{overflow:visible}
#branch-root .branch-edges path{stroke:#8ba273;stroke-width:2.5;stroke-dasharray:8 5;animation:branch-flow 1.8s linear infinite}
#branch-root .branch-edges text{font-size:10px;opacity:.7}
#branch-root .branch-edges text:hover{opacity:1}
.branch-wire-preview path{stroke:#f44835;stroke-width:2.5;animation:branch-flow .8s linear infinite}
.branch-media-dialog{border:0;border-radius:16px;padding:40px 18px 18px;background:#151813;color:#fff;max-width:94vw;max-height:94dvh;overflow:auto}
.branch-media-dialog::backdrop{background:#10130feb;backdrop-filter:blur(6px)}
.branch-media-dialog img,.branch-media-dialog video{display:block;max-width:86vw;max-height:80dvh;object-fit:contain;margin:auto}
.branch-media-dialog>button{position:absolute;right:8px;top:5px;background:none;border:0;color:white;font-size:28px;cursor:pointer}
@keyframes branch-flow{to{stroke-dashoffset:-26}}
@media(prefers-reduced-motion:reduce){#branch-root .branch-edges path,.branch-wire-preview path{animation:none}}
@media(max-width:700px){#branch-root .branch-project-toolbar{padding:0 10px 8px;gap:6px}#branch-root .branch-project-toolbar h1{max-width:65vw;font-size:18px}#branch-root .branch-owner-tools{max-width:100%;width:100%;overflow:auto}#branch-root .branch-project-toolbar{flex-wrap:wrap}#branch-root .branch-workspace{grid-template-columns:52px minmax(0,1fr)}#branch-root .branch-seed-icon{width:42px}#branch-root .branch-statusline{padding:5px 10px}}
@media(max-width:560px){#branch-root.branch-project-open{top:56px}}
#branch-root .branch-seed-icon>span{width:23px;height:23px;display:block}#branch-root .branch-seed-icon svg{display:block;width:100%;height:100%}
.branch-mobile-groups{display:none}
@media(max-width:700px){
 #branch-root .branch-workspace{display:flex;position:relative;flex-direction:column-reverse;overflow:visible}
 #branch-root .branch-canvas{flex:1;width:100%;overflow:hidden}
 #branch-root .branch-seed-rail{flex:none;width:100%;height:auto;min-height:66px;box-sizing:border-box;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:4px;overflow:visible;border:0;border-top:1px solid #e1e4dd;padding:0 8px max(5px,env(safe-area-inset-bottom))}
 #branch-root .branch-seed-icon{display:none}
 #branch-root .branch-seed-rail[data-open-group]:not([data-open-group=""]){padding-top:10px;background:#fff;box-shadow:0 -8px 24px #26301a10}
 #branch-root .branch-seed-icon.mobile-group-visible{display:flex;width:calc(25% - 8px);min-height:60px;background:#f5f7f0;gap:5px}
 #branch-root .branch-seed-icon>small{font-size:10px}
 #branch-root .branch-mobile-groups{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:100%;gap:4px;padding-top:5px}
 #branch-root .branch-mobile-groups button{border:0;border-radius:10px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:58px;padding:6px;color:#69745f;font:inherit}
 #branch-root .branch-mobile-groups button[aria-expanded="true"]{background:#d6ff65;color:#25341b}
 #branch-root .branch-mobile-groups svg{width:23px;height:23px;display:block}
 #branch-root .branch-mobile-groups small{font-size:10px;font-weight:650}
 #branch-root .branch-project-toolbar{min-height:46px;flex:none;display:flex;flex-wrap:nowrap;padding:6px 10px;gap:8px}
 #branch-root .branch-project-toolbar>div:nth-child(2){min-width:0;flex:1;overflow:hidden}
 #branch-root .branch-project-toolbar h1{max-width:none;font-size:16px;margin:0}
 #branch-root .branch-owner-tools{width:auto;max-width:32%;flex:none}
 #branch-root .branch-owner-tools button{display:none}
 #branch-root .branch-owner-tools [data-action="fit"]{display:block;min-height:40px}
 #branch-root .branch-project-toolbar>.btn{min-height:40px;font-size:11px;padding:8px}
 #branch-root .branch-statusline{font-size:10px;padding:2px 12px 6px}
 #branch-root .branch-canvas-controls{right:10px;bottom:10px}
 #branch-root .branch-canvas-controls button{width:42px;height:42px}
 #branch-root .branch-node{width:290px}
 #branch-root .branch-port{min-width:36px;min-height:36px}
 #branch-root .branch-port.input-port{left:-23px}
 #branch-root .branch-port.output-port{right:-23px}
 #branch-root .branch-port i{width:20px;height:20px}
 #branch-root .branch-reference-actions label,#branch-root .branch-reference-actions button{min-height:40px;display:grid;place-items:center;font-size:12px}
 #branch-root .branch-node textarea{font-size:16px}
 .branch-media-dialog{max-width:100vw;padding:40px 8px 12px;margin:auto}
 .branch-media-dialog img,.branch-media-dialog video{max-width:94vw;max-height:80dvh}
}
.branch-mobile-more{display:none!important}
@media(max-width:700px){#branch-root .branch-mobile-more{display:block!important;min-width:40px;min-height:40px}#branch-root .branch-owner-tools.mobile-owner-open{position:absolute;right:10px;top:54px;z-index:30;display:flex;flex-direction:column;max-width:230px;width:210px;background:#fff;padding:8px;box-shadow:0 8px 30px #0002;border:1px solid #dce0d8;border-radius:12px}#branch-root .mobile-owner-open button{display:block;width:100%;min-height:42px;text-align:left}#branch-root .branch-owner-tools.mobile-owner-open [data-action="fit"]{text-align:left}}
html:has(#branch-root.branch-project-open),body:has(#branch-root.branch-project-open){overflow:hidden}
#branch-root.branch-project-open{padding:0!important;top:var(--branch-header-height,68px)!important}
.studio-shell:has(#branch-root.branch-project-open) #studio-main{top:var(--branch-header-height,68px)!important;height:calc(100dvh - var(--branch-header-height,68px))!important}
#branch-root .branch-seed-rail{overflow-x:hidden}
@media(max-width:700px){#branch-root .branch-seed-rail{overflow:visible}#branch-root .branch-edges text{font-size:14px}}
/* Keep Branch zoom clear of the Agent messenger. */
#branch-root .branch-canvas-controls{left:16px;right:auto;bottom:16px}
@media(max-width:700px){#branch-root .branch-canvas-controls{left:10px;right:auto;bottom:10px}}
.branch-size-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}
.branch-size-controls>label{min-width:0;margin:0!important}.branch-size-controls>label:first-child:last-child{grid-column:1/-1}
.branch-size-controls select{width:100%;box-sizing:border-box;padding:8px!important;font-size:12px!important;min-height:38px}
.branch-size-controls .branch-framing{grid-column:1/-1}
.branch-soundtrack{margin-top:14px;padding-top:12px;border-top:1px solid #e5e9de;font-size:12px}
.branch-soundtrack>strong{display:block;margin-bottom:8px}.branch-soundtrack>small{display:block;color:#7b8370;line-height:1.5}
.branch-soundtrack audio{width:100%;height:36px}.branch-soundtrack>.btn{width:100%;min-height:38px;margin-top:8px}
.branch-soundtrack input[type=range]{width:100%}.branch-music-reference{font-size:11px;padding:10px;border-radius:9px;background:#f0f4e8;color:#68765b;line-height:1.4}
.branch-import-label{cursor:pointer}.branch-file-state{color:#718460}.branch-soundtrack-note{display:block;text-align:center;color:#c9d6b9;margin-top:8px}
.branch-render-dialog{border:0;border-radius:16px;background:#f8faf4;padding:20px;width:min(540px,90vw);color:#27301e}.branch-render-dialog::backdrop{background:#151b12dd}.branch-render-dialog video{display:block;width:100%;max-height:50vh;margin-top:12px;object-fit:contain}.branch-render-dialog p{font-size:13px;line-height:1.5}.branch-render-dialog button{border:1px solid #ced7c1;padding:9px 18px;border-radius:9px;background:white;cursor:pointer}
/* Read-only Branches share the editor's visual structure with a compact header. */
html:has(.branch-public-open),body:has(.branch-public-open){overflow:hidden}
.studio-shell:has(.branch-public-open) .studio-sidebar{display:none!important}
#branch-gallery-root.branch-public-open{position:fixed;inset:var(--branch-header-height,68px) 0 0;z-index:20;padding:0!important;background:#f5f6f2;overflow:hidden}
.branch-public-open .branch-public-view{display:flex;flex-direction:column;width:100%;height:100%;max-width:none;box-sizing:border-box;padding:0;margin:0}
.branch-public-open .branch-public-toolbar{flex:none;display:flex;align-items:center;gap:12px;padding:9px 18px;min-height:58px;box-sizing:border-box;border-bottom:1px solid #dde3d5}
.branch-public-open .branch-public-heading{flex:1;min-width:0}
.branch-public-open .branch-public-heading h1{font-size:18px;line-height:1.15;margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:50vw}
.branch-public-open .branch-public-heading small{display:block;font-size:10px;color:#7a8470;margin-top:3px}
.branch-public-open .branch-owner-tools{flex-wrap:nowrap;flex:none;gap:7px}.branch-public-open .branch-owner-tools .btn{white-space:nowrap;padding:9px 13px;font-size:12px}
.branch-public-open .branch-workspace{flex:1;height:auto;min-height:0;border:0;border-radius:0;display:block}
.branch-public-open .branch-canvas{width:100%;height:100%}
.branch-public-open .branch-node{width:310px;padding:16px 20px;box-sizing:border-box;border-radius:16px;min-height:245px}
.branch-public-open .branch-node h3{font-size:18px;margin:12px 0 14px}.branch-public-type{display:flex;align-items:center;gap:6px}.branch-public-type svg{width:18px;height:18px}
.branch-review-badge{font-size:10px;text-transform:capitalize;border:1px solid #dce3d4;border-radius:12px;padding:4px 8px;background:#f8faf4}
.branch-public-result img,.branch-public-result video{display:block;width:100%;height:180px;object-fit:contain;background:#edf0e7;border-radius:10px}
.branch-public-result audio{width:100%;margin:10px 0}.branch-public-result .branch-preview-link{display:block;margin-left:auto;border:0;background:none;color:#63764d;font-size:11px;cursor:pointer;padding:6px}
.branch-public-version{font-size:10px;color:#78866c;display:block;margin:8px 0}
.branch-public-placeholder{min-height:140px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:15px;background:#f3f6ed;border:1px dashed #d8e0cd;border-radius:10px;text-align:center;gap:8px;box-sizing:border-box}
.branch-public-placeholder>span svg{width:32px;height:32px;color:#849869}.branch-public-placeholder strong{font-size:13px}.branch-public-placeholder small{font-size:11px;color:#7c8772;line-height:1.45}
.branch-public-inputs{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.branch-public-inputs>span{background:#f0f3e9;border-radius:6px;padding:4px 7px;font-size:10px;color:#758467;text-transform:capitalize}
.branch-readonly-port{position:absolute;display:flex;align-items:center;gap:5px;min-height:22px;font-size:10px;color:#768669}.branch-readonly-port.in{left:-10px;top:calc(75px + var(--port-index,0)*32px)}.branch-readonly-port.out{right:-10px;bottom:24px}
.branch-readonly-port i{width:16px;height:16px;border:3px solid white;border-radius:50%;background:#f44835;box-shadow:0 0 0 1px #e83c2b;box-sizing:border-box}
.branch-readonly-port b{position:absolute;background:#fff;padding:3px 6px;white-space:nowrap;display:none}.branch-readonly-port.in b{right:24px}.branch-readonly-port.out b{left:24px}.branch-readonly-port:hover b{display:block}
.branch-public-open .branch-edges path{stroke:#8ca573;stroke-width:2.5;fill:none;stroke-dasharray:8 5;animation:branch-flow 1.8s linear infinite}
.branch-public-open .branch-canvas-controls{left:16px;right:auto;bottom:16px}
@media(max-width:700px){.branch-size-controls select{font-size:16px!important}.branch-public-open .branch-public-toolbar{padding:7px 9px;gap:7px;min-height:54px;flex-direction:row;flex-wrap:nowrap}.branch-public-open .branch-public-heading h1{font-size:14px;max-width:32vw}.branch-public-open .branch-public-heading small{font-size:9px}.branch-public-open .branch-owner-tools .btn,.branch-public-open .branch-public-toolbar>.btn{font-size:10px;padding:8px}.branch-public-open .branch-owner-tools{gap:4px}.branch-public-open .branch-node{width:290px}.branch-public-open .branch-canvas-controls{left:10px;right:auto;bottom:10px}.branch-public-open .branch-canvas-controls button{width:42px;height:42px}}
@media(prefers-reduced-motion:reduce){.branch-public-open .branch-edges path{animation:none}}
#branch-root .branch-project-toolbar>div:nth-child(2){min-width:0;flex:1}
#branch-root .branch-project-toolbar h1{font-size:clamp(18px,1.8vw,24px);max-width:30vw}
#branch-root .branch-owner-tools{max-width:68%;overflow-x:auto}
@media(max-width:700px){#branch-root .branch-owner-tools{max-width:32%}#branch-root .branch-project-toolbar h1{max-width:none;font-size:16px}#branch-root .branch-owner-tools.mobile-owner-open{max-width:230px}}
/* Quiet media-family tints; review-status borders retain their existing colors. */
.branch-node[data-seed-type="prompt"]{background:#ffffff}
.branch-node:is([data-seed-type="image"],[data-seed-type="image-editor"],[data-seed-type="cinematic-shot"],[data-seed-type="variations"],[data-seed-type="camera"],[data-seed-type="mockup"],[data-seed-type="relight"]){background:#fff5f4}
.branch-node:is([data-seed-type="video"],[data-seed-type="video-upscale"],[data-seed-type="change-person"],[data-seed-type="video-length"]){background:#f3f7ff}
.branch-node:is([data-seed-type="music"],[data-seed-type="speech"]){background:#f3faf4}
