@font-face{font-family:BDO;src:url('./fonts/BDOGrotesk-Regular.woff2') format('woff2');font-weight:400;font-display:swap}@font-face{font-family:BDO;src:url('./fonts/BDOGrotesk-Medium.woff2') format('woff2');font-weight:500;font-display:swap}@font-face{font-family:BDO;src:url('./fonts/BDOGrotesk-DemiBold.woff2') format('woff2');font-weight:600 900;font-display:swap}
:root{font-family:BDO,Arial,sans-serif;font-size:14px;line-height:1.5;color:var(--theme-ink, #171717);background:var(--theme-surface, #fff);--line:var(--theme-line, #dedede);--muted:var(--theme-muted, #777);--blue:var(--theme-accent, #315bf4)}*{box-sizing:border-box}body{margin:0;overflow:hidden;overscroll-behavior:none}button,input,textarea,select{font:inherit;color:inherit}button{border:0;background:none;cursor:pointer;padding:6px 8px;border-radius:3px}button:active{background:var(--theme-raised, #eee)}button:disabled{opacity:.25;cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--blue);outline-offset:4px}button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:square}input,textarea{border:0;border-radius:0;background:transparent;outline:none;width:100%;resize:none}::selection{background:var(--theme-accent-surface, #dce4ff);color:var(--theme-ink, #111)}[hidden]{display:none!important}.topbar{position:fixed;inset:0 0 auto;height:65px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;z-index:10;background:color-mix(in srgb, var(--theme-surface, #ffffff) 94.9%, transparent);backdrop-filter:blur(12px);border-bottom:1px solid var(--theme-line, #f1f1f1)}.identity{display:flex;align-items:center;gap:12px}.identity b{font-weight:600;font-size:20px;letter-spacing:-.9px}.slash{color:var(--theme-muted, #b5b5b5);font-size:19px;margin:0 7px}#board-title{font-size:12px;color:var(--theme-muted, #656565);outline:none;min-width:50px;max-width:320px;white-space:nowrap;overflow:hidden}.top-meta{display:flex;gap:17px;align-items:center;font-size:11px;color:var(--theme-muted, #858585)}.top-meta button{width:28px;height:28px;font-size:18px;color:var(--theme-ink, #555)}#help{font-size:13px;border:1px solid var(--theme-line, #ddd);width:22px;height:22px;padding:0;border-radius:50%}#board{position:fixed;inset:65px 0 0;overflow:hidden;touch-action:none;background:var(--theme-surface, #fff);background-image:radial-gradient(var(--theme-raised, #dedede) .65px,transparent .65px);background-size:24px 24px}#world{position:absolute;inset:0;transform-origin:0 0;will-change:transform}#wires{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:2}#permanent-wires path{stroke:var(--theme-muted, #a6a6a6);stroke-width:1.2;fill:none}#permanent-wires path.selected{stroke:var(--blue)}#live-wire{fill:none;stroke:var(--theme-ink, #161616);stroke-width:1.7;stroke-linecap:round}#wire-end{fill:var(--theme-ink, #171717)}#live-wire,#wire-end{display:none}body.connecting #live-wire,body.connecting #wire-end{display:block}body.connecting #board{cursor:crosshair}body.panning #board{cursor:grabbing}.card{position:absolute;width:380px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #cecece);border-radius:4px;box-shadow:0 2px 4px var(--theme-shadow, #00000004);transform-origin:0 0;contain:layout style;outline:none}.card.focused{border-color:var(--theme-line, #999)}.card.dragging{z-index:8;box-shadow:0 10px 24px var(--theme-shadow, #0000000d);will-change:transform}.card.target{outline:2px solid var(--blue);outline-offset:5px}.card.target .socket{border-color:var(--blue);background:var(--blue)}.card-header{height:43px;display:flex;align-items:center;gap:8px;padding:0 18px;border-bottom:1px solid var(--theme-line, #ededed);cursor:grab;user-select:none;touch-action:none}.card-header:active{cursor:grabbing}.type-icon{font-size:14px;line-height:1;color:var(--theme-ink, #555)}.card-type{font-size:10px;letter-spacing:.9px;text-transform:uppercase;font-weight:500}.card-number{font-size:10px;color:var(--theme-muted, #929292);margin-left:auto;font-variant-numeric:tabular-nums}.delete-card{font-size:17px;color:var(--theme-muted, #999);padding:0 0 0 7px;opacity:0;line-height:1}.card:hover .delete-card,.card:focus-within .delete-card{opacity:1}.card-main{padding:22px 22px 18px}.card-title{font-size:22px;line-height:1.2;letter-spacing:-.8px;font-weight:500;margin:0 0 18px;outline:none;overflow-wrap:anywhere;white-space:pre-wrap}.plan-body{font-size:14px;line-height:1.8;min-height:110px;outline:none;white-space:pre-wrap;overflow-wrap:anywhere}.plan-body:empty:before{content:'Start with a thought.';color:var(--theme-muted, #999)}.card-footer{display:flex;align-items:center;justify-content:space-between;padding:12px 22px;border-top:1px solid var(--theme-line, #ededed);font-size:10px;color:var(--theme-muted, #888);letter-spacing:.1px}.card-footer .author{display:flex;align-items:center;gap:6px}.author i{width:5px;height:5px;background:var(--theme-control, #222);display:inline-block;border-radius:50%}.node-status{font-size:10px;color:var(--theme-muted, #888)}.nib{position:absolute;right:-17px;top:62px;width:32px;height:32px;padding:0;border:0;display:grid;place-items:center;cursor:crosshair;touch-action:none;z-index:5;border-radius:50%;background:transparent}.nib:before{content:'';width:12px;height:12px;border-radius:50%;background:var(--theme-control, #171717);border:3px solid var(--theme-line, #fff);box-shadow:0 0 0 1px var(--theme-shadow, #171717)}.nib:hover:before,.nib:focus-visible:before{background:var(--blue);box-shadow:0 0 0 1px var(--blue)}.nib-label{position:absolute;top:6px;left:32px;white-space:nowrap;font-size:10px;color:var(--theme-muted, #777);pointer-events:none;opacity:0;background:var(--theme-surface, #fff);padding:2px 5px}.nib:hover .nib-label{opacity:1}.socket{position:absolute;left:-5px;top:73px;width:9px;height:9px;border:1px solid var(--theme-line, #999);background:var(--theme-surface, #fff);border-radius:50%;z-index:5;pointer-events:none}.context-list{display:flex;flex-wrap:wrap;gap:7px;padding:13px 22px 0}.context-chip{max-width:100%;font-size:10px;color:var(--theme-muted, #666);border:1px solid var(--theme-line, #dcdcdc);border-radius:3px;padding:5px 8px;display:flex;align-items:center;gap:7px;cursor:grab;touch-action:none;text-align:left}.context-chip:before{content:'';display:block;flex-shrink:0;width:5px;height:5px;background:var(--theme-control, #999);border-radius:50%}.context-chip.stale:before{background:var(--blue)}.context-chip .chip-title{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.context-detail{padding:13px 22px;border-bottom:1px solid var(--theme-line, #eee);font-size:11px;line-height:1.7}.context-detail blockquote{margin:10px 0;padding-left:10px;border-left:1px solid var(--theme-line, #222);white-space:pre-wrap;max-height:180px;overflow:auto;color:var(--theme-muted, #666)}.context-detail .small-link{font-size:10px;text-decoration:underline;padding:0;margin-right:12px}.thread-main{padding-bottom:6px}.thread-empty{color:var(--theme-muted, #999);font-size:13px;line-height:1.7;margin:0 0 18px}.thread-empty b{display:block;color:var(--theme-ink, #444);font-weight:400;margin-bottom:6px}.messages{max-height:320px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.message{padding:18px 22px;border-top:1px solid var(--theme-line, #eee);white-space:pre-wrap;font-size:13px;line-height:1.7;overflow-wrap:anywhere}.message-label{display:flex;align-items:center;justify-content:space-between;font-size:9px;letter-spacing:.5px;color:var(--theme-muted, #8a8a8a);margin-bottom:8px;text-transform:uppercase}.message-label span{font-size:8px;color:var(--theme-muted, #aaa)}.composer{padding:15px 22px;border-top:1px solid var(--theme-line, #ddd)}.composer textarea{font-size:13px;line-height:1.7;min-height:48px;max-height:160px;display:block}.composer textarea::placeholder{color:var(--theme-muted, #999)}.composer-meta{display:flex;justify-content:space-between;font-size:9px;color:var(--theme-muted, #aaa);margin-top:6px}.proposal{margin:0 14px 15px;border:1px solid var(--theme-line, #bdbdbd);border-radius:2px;position:relative}.proposal-top{display:flex;align-items:center;gap:7px;font-size:9px;letter-spacing:.7px;text-transform:uppercase;padding:9px 12px;border-bottom:1px solid var(--theme-line, #eee);cursor:grab;touch-action:none}.proposal-top .grip{font-size:15px;color:var(--theme-muted, #777);line-height:1}.proposal-top small{font-size:9px;letter-spacing:0;text-transform:none;color:var(--theme-muted, #888);margin-left:auto}.proposal textarea{font-size:12px;line-height:1.7;display:block;min-height:115px;padding:13px 12px;resize:vertical}.proposal.accepted{border-color:var(--theme-line, #ccc)}.proposal.accepted .proposal-top{cursor:default}.applied-text{margin:0;padding:12px;color:var(--theme-muted, #777);font-size:11px}.proposal:focus-visible{outline:2px solid var(--blue)}.drop-inline{pointer-events:none;position:absolute;inset:auto 8px 8px;background:var(--theme-control, #171717);color:var(--theme-on-dark, #fff);padding:9px 12px;font-size:11px;z-index:9;display:none}.card.target .drop-inline{display:block}.search-input{border-bottom:1px solid var(--theme-line, #222);display:flex;align-items:center;margin:0 0 12px}.search-input input{font-size:16px;padding:10px 0;letter-spacing:-.3px}.search-input span{font-size:15px}.search-help{font-size:10px;line-height:1.7;color:var(--theme-muted, #999);margin:0 0 22px}.url-input{font-size:11px;padding:12px 0;border-bottom:1px solid var(--theme-line, #ddd)}.sample-label{font-size:9px;letter-spacing:.9px;text-transform:uppercase;color:var(--theme-muted, #999);margin:24px 0 5px}.resource{display:flex;justify-content:space-between;text-decoration:none;color:var(--theme-ink, #333);font-size:12px;padding:13px 0;border-bottom:1px solid var(--theme-line, #eee);cursor:pointer}.resource span{color:var(--theme-muted, #aaa)}.web-card{width:540px}.web-card .card-title{font-size:17px}.web-address{display:flex;gap:8px;font-size:10px;color:var(--theme-muted, #888);margin-top:-8px;margin-bottom:12px;align-items:center}.web-address span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.web-address a{color:var(--theme-ink, #444);white-space:nowrap}.web-card iframe{width:100%;height:420px;display:block;border:1px solid var(--theme-line, #eee);background:var(--theme-surface, #fff)}.web-help{font-size:10px;color:var(--theme-muted, #999);margin:10px 0 0}#toolbar{position:fixed;bottom:29px;left:50%;transform:translateX(-50%);display:flex;background:color-mix(in srgb, var(--theme-surface, #ffffff) 96.08%, transparent);border:1px solid var(--theme-line, #d4d4d4);border-radius:4px;z-index:10;padding:3px;gap:1px;box-shadow:0 3px 12px var(--theme-shadow, #00000005);backdrop-filter:blur(10px)}#toolbar button{display:flex;align-items:center;gap:8px;font-size:11px;padding:11px 16px;border-radius:2px}#toolbar button+button{border-left:1px solid var(--theme-line, #eee)}footer{position:fixed;bottom:22px;left:27px;right:24px;display:flex;justify-content:space-between;align-items:center;pointer-events:none;color:var(--theme-muted, #999);font-size:10px}footer>div{pointer-events:auto;background:var(--theme-surface, #fff);display:flex;align-items:center}footer button{font-size:11px}#zoom{min-width:46px;font-variant-numeric:tabular-nums}#fit{color:var(--theme-muted, #777);margin-right:8px}#selection-nib{position:fixed;z-index:30;background:var(--theme-control, #171717);color:var(--theme-on-dark, white);border-radius:3px;box-shadow:0 2px 6px var(--theme-shadow, #0001)}#selection-nib button{display:flex;gap:8px;align-items:center;font-size:10px;padding:7px 10px;cursor:grab;touch-action:none}#selection-nib button:active{background:var(--theme-control, #333)}.nib-mark{width:6px;height:6px;border:1px solid var(--theme-line, #fff);border-radius:50%}#drag-caption{position:fixed;pointer-events:none;z-index:40;max-width:250px;padding:12px 15px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #222);border-radius:3px;box-shadow:0 5px 18px var(--theme-shadow, #00000009);font-size:11px;line-height:1.6}#drag-caption strong{font-weight:500;display:block;margin-bottom:5px}#drag-caption p{margin:4px 0;color:var(--theme-muted, #777);font-size:10px}#drag-caption .excerpt{max-height:72px;overflow:hidden;border-left:1px solid var(--theme-line, #aaa);padding-left:8px;margin:7px 0;color:var(--theme-ink, #444)}#create-menu{position:fixed;z-index:25;border:1px solid var(--theme-line, #bbb);border-radius:3px;padding:4px;background:var(--theme-surface, #fff);width:190px;box-shadow:0 8px 25px var(--theme-shadow, #0000000c)}#create-menu button{display:flex;align-items:center;justify-content:space-between;width:100%;font-size:12px;padding:10px}kbd{font:inherit;color:var(--theme-muted, #999);font-size:10px}#notice{position:fixed;bottom:93px;left:50%;transform:translateX(-50%);background:var(--theme-control, #191919);color:var(--theme-on-dark, #fff);padding:9px 14px;border-radius:3px;font-size:11px;z-index:50;opacity:0;pointer-events:none;transition:opacity 150ms ease}#notice.visible{opacity:1}dialog{border:1px solid var(--theme-line, #bbb);border-radius:4px;padding:30px;width:min(520px,90vw);max-height:85vh;box-shadow:0 15px 60px var(--theme-shadow, #0001)}dialog::backdrop{background:color-mix(in srgb, var(--theme-surface, #ffffff) 72.16%, transparent);backdrop-filter:blur(3px)}dialog .close{float:right;font-size:22px;margin-top:-12px;margin-right:-12px}dialog h2{font-weight:500;letter-spacing:-.8px;font-size:25px;margin:0 0 5px}dialog .intro{color:var(--theme-muted, #888);font-size:12px;margin-bottom:25px}dialog dl{font-size:12px}dialog dt{font-weight:500;margin:18px 0 4px}dialog dd{margin:0;color:var(--theme-muted, #777);line-height:1.7}dialog details{border-top:1px solid var(--theme-line, #ddd);padding-top:16px;margin-top:25px;font-size:12px}dialog summary{cursor:pointer}dialog label{display:block;font-size:11px;margin:12px 0;line-height:1.6}dialog input[type=checkbox]{width:auto;margin-right:8px;accent-color:var(--theme-ink, #222)}dialog textarea{border:1px solid var(--theme-line, #ddd);min-height:80px;padding:10px;margin:10px 0;font-size:12px}dialog #export{border:1px solid var(--theme-line, #bbb)}dialog .prototype-note{font-size:10px;color:var(--theme-muted, #999);line-height:1.7;margin-top:25px}dialog #reset{font-size:10px;color:var(--theme-muted, #999);padding:0;text-decoration:underline}.incoming-preview{outline:1px dashed var(--theme-line, #777)!important}body.connecting iframe{pointer-events:none}body.dragging-card iframe{pointer-events:none}
@media(hover:hover) and (pointer:fine){button:hover{background:var(--theme-raised, #f3f3f3)}.nib:hover{background:transparent}.resource:hover{color:var(--blue)}.context-chip:hover{border-color:var(--theme-line, #999)}.proposal-top:hover{background:var(--theme-canvas, #f8f8f8)}}
@media(prefers-reduced-motion:reduce){#notice{transition:none}.card{scroll-behavior:auto}}
@media(prefers-reduced-transparency:reduce){.topbar,#toolbar{background:var(--theme-surface, #fff);backdrop-filter:none}dialog::backdrop{background:var(--theme-surface, #fff)}}
@media(prefers-contrast:more){.card,.card-header,.context-chip{border-color:var(--theme-line, #444)}.node-status,.top-meta,.card-footer,.thread-empty,.search-help,footer{color:var(--theme-ink, #555)}}
@media(max-width:850px){#save-state,#canvas-hint{display:none}.topbar{padding:0 17px}.top-meta{gap:9px}#board-title{max-width:190px}#toolbar{bottom:25px}footer{bottom:80px;justify-content:flex-end}}
.context-detail input[type=checkbox]{width:auto;accent-color:var(--theme-ink, #222);vertical-align:middle;margin:0 5px 0 0}.context-detail label{display:block;margin:10px 0}.context-detail summary{cursor:pointer}.card-type,.card-number{pointer-events:none}
#world{z-index:1}#wires{z-index:0}
/* Soft, reflective edges; the content still owns the surface. */
.card{border-radius:10px;border:1px solid var(--theme-line, #d5d5d5);box-shadow:0 0 0 1px var(--theme-shine, #ffffff) inset,0 1px 2px var(--theme-shadow, #00000005),0 6px 18px var(--theme-shadow, #00000007);display:flex;flex-direction:column}
.card:before{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 1px 0 var(--theme-shine, #fff),inset 1px 0 0 color-mix(in srgb, var(--theme-shine, #ffffff) 60.0%, transparent)}
.card[data-kind=plan] .card-main{flex:1}.card-footer{margin-top:auto}.card-header{flex-shrink:0}.card.dragging{box-shadow:0 1px 0 var(--theme-shine, #fff) inset,0 12px 28px var(--theme-shadow, #00000010)}.card.focused{border-color:var(--theme-line, #bbb)}.messages{max-height:none;overflow:visible}.proposal{border-radius:6px}.context-chip{border-radius:5px}.composer{margin-top:auto}.resize-handle{position:absolute;right:-3px;bottom:-3px;width:23px;height:23px;padding:4px;cursor:nwse-resize;touch-action:none;z-index:7;opacity:.35}.resize-handle svg{width:15px;height:15px;stroke:var(--theme-muted, #777);stroke-width:1}.resize-handle:hover,.resize-handle:focus-visible{opacity:1;background:transparent}
#permanent-wires .wire-base{stroke:var(--theme-muted, #ccc);stroke-width:3;stroke-linecap:round}#permanent-wires .wire-flow{stroke:var(--theme-muted, #777);stroke-width:3;stroke-dasharray:3 23;stroke-linecap:round;animation:information-flow 1.7s linear infinite}#live-wire{stroke-width:3.5;stroke-linecap:round;stroke-dasharray:9 3;animation:information-flow .8s linear infinite}#wire-end{r:5}.nib:before{width:14px;height:14px}.drop-inline{inset:auto 14px 14px auto;width:27px;height:27px;border-radius:50%;padding:0;display:none;place-items:center;font-size:20px;background:var(--theme-accent-solid, #315bf4);box-shadow:0 2px 8px var(--theme-shadow, #315bf433)}.card.target .drop-inline{display:grid}#selection-nib{border-radius:50%;width:25px;height:25px}#selection-nib button{padding:0;display:grid;place-items:center;width:25px;height:25px;border-radius:50%}.nib-label{display:none}#drag-caption{display:none!important}
@keyframes information-flow{to{stroke-dashoffset:-52}}
#create-menu{width:0;height:0;border:0;padding:0;background:none;box-shadow:none;overflow:visible;border-radius:0}.radial-hub{position:absolute;left:-4px;top:-4px;width:8px;height:8px;border-radius:50%;background:var(--theme-control, #333);box-shadow:0 0 0 4px color-mix(in srgb, var(--theme-shine, #ffffff) 78.82%, transparent)}#create-menu button{position:absolute;left:0;top:0;width:68px;height:68px;display:flex;flex-direction:column;justify-content:center;gap:4px;padding:9px;border-radius:50%;background:linear-gradient(var(--theme-surface, #fff),var(--theme-canvas, #fafafa));border:1px solid var(--theme-line, #d8d8d8);box-shadow:0 1px 0 var(--theme-shine, #fff) inset,0 4px 15px var(--theme-shadow, #0000000d);font-size:10px;will-change:transform,opacity}#create-menu button:hover{background:var(--theme-accent-surface, #f1f4ff);border-color:var(--theme-accent, #b8c7ff)}#create-menu button svg{width:22px;height:22px;stroke-width:1.5}#create-menu button:active{background:var(--theme-accent-surface, #e9edff)}.file-image{width:100%;height:auto;display:block;border-radius:5px}.file-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.8}.file-pdf{width:100%;height:450px;border:1px solid var(--theme-line, #eee);border-radius:5px}.file-symbol{font-size:55px;color:var(--theme-muted, #aaa);text-align:center;padding:25px}.file-meta{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:var(--theme-muted, #999);margin-top:16px}.file-meta a{color:var(--theme-ink, #333);font-size:18px;text-decoration:none}.file-text:empty{display:none}
@media(prefers-reduced-motion:reduce){#permanent-wires .wire-flow,#live-wire{animation:none;stroke-dasharray:none}}
/* Reference node: floating name, uninterrupted content, controls at the foot. */
.card{border-radius:18px;border-color:var(--theme-line, #e0e0e0);box-shadow:inset 0 1px 1px var(--theme-shine, #fff),0 0 0 1px color-mix(in srgb, var(--theme-shine, #f5f5f5) 50.2%, transparent),0 4px 7px var(--theme-shadow, #00000004),0 12px 24px var(--theme-shadow, #00000007);min-height:210px;contain:layout style}.card:before{border-radius:18px;box-shadow:inset 0 2px 0 var(--theme-shine, #fff),inset 1px 0 0 var(--theme-shine, #fff)}
.card-header{position:absolute;left:0;right:0;top:-48px;height:36px;border:0;padding:0 14px;gap:10px;background:none}.node-label{margin:0;font-size:12px;line-height:1.4;font-weight:400;color:var(--theme-muted, #858585);letter-spacing:.05px;padding:6px 12px;background:color-mix(in srgb, var(--theme-surface, #ffffff) 92.55%, transparent);border:1px solid var(--theme-line, #e1e1e1);box-shadow:inset 0 1px 1px var(--theme-shine, #fff),0 1px 2px var(--theme-shadow, #00000003);border-radius:20px;max-width:calc(100% - 48px);min-width:58px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;outline:none;cursor:text}.node-label:focus{border-color:var(--theme-line, #aaa);color:var(--theme-ink, #333)}.drag-strip{flex:1;height:32px;min-width:18px;cursor:grab}.delete-card{margin-left:auto;font-size:18px}.card-main{padding:25px 24px 14px}.plan-body{font-size:15px;line-height:1.8;min-height:125px}.card-footer{display:none}.node-controls{display:flex;align-items:center;gap:10px;padding:10px 22px 18px;margin-top:auto;min-height:52px}.add-file{font-size:25px;font-weight:400;line-height:1;color:var(--theme-muted, #999);padding:0 4px;height:30px}.mode-chip{display:inline-flex;align-items:center;gap:7px;font-size:13px;line-height:1;padding:9px 13px;background:var(--theme-raised, #f5f5f5);color:var(--theme-ink, #535353);border-radius:22px;box-shadow:inset 0 1px 0 var(--theme-shine, #fafafa)}.mode-icon{font-size:17px;line-height:1}.node-byline{font-size:9px;color:var(--theme-muted, #aaa);margin-left:auto;max-width:130px;text-align:right}.composer{border:0;padding:20px 24px 0;margin-top:auto}.composer textarea{min-height:82px;font-size:15px;line-height:1.8}.card[data-kind=thread]:has(.messages:empty) .composer textarea{min-height:100px}.messages:empty{display:none}.messages .message:first-child{border-top:0}.context-list{padding:16px 24px 0}.context-list:empty{display:none}.context-chip{font-size:9px;border-radius:5px;background:var(--theme-surface, #fff)}.proposal{margin:10px 20px}.resize-handle{right:2px;bottom:2px;opacity:.2}.nib{right:-34px;top:62px}.nib:before{width:11px;height:26px;border-radius:8px;background:var(--theme-accent-solid, #e87924);border:0;box-shadow:0 1px 1px color-mix(in srgb, var(--theme-shine, #ffffff) 50.2%, transparent) inset,0 0 0 3px var(--theme-shine, #fff)}.nib:hover:before,.nib:focus-visible:before{background:var(--theme-accent-solid, #d45b11);box-shadow:0 0 0 4px var(--theme-shadow, #e8792418)}.socket{left:-23px;top:65px;width:11px;height:26px;border:0;border-radius:8px;background:var(--theme-accent-solid, #e87924);box-shadow:0 0 0 3px var(--theme-shine, #fff)}.card.target .socket{background:var(--theme-accent-solid, #d45b11)}.card.target{outline-color:var(--theme-line, #e87924)}.drop-inline{background:var(--theme-accent-solid, #e87924);box-shadow:0 2px 8px var(--theme-shadow, #e8792433)}#permanent-wires .wire-base{stroke:var(--theme-muted, #f4d3b9);stroke-width:4}#permanent-wires .wire-flow{stroke:var(--theme-danger, #e87924);stroke-width:4;stroke-dasharray:5 12;stroke-linecap:butt}#live-wire{stroke:var(--theme-danger, #e87924);stroke-width:4;stroke-dasharray:6 4;stroke-linecap:butt}#wire-end{fill:var(--theme-danger, #e87924)}
@media(prefers-contrast:more){.node-label{color:var(--theme-ink, #444);border-color:var(--theme-line, #888)}.mode-chip{color:var(--theme-ink, #222)}.node-byline{color:var(--theme-muted, #666)}}
.message-label{gap:8px}.message-branch{margin-left:auto;width:25px;height:25px;padding:3px;cursor:crosshair;touch-action:none;opacity:0}.message-branch svg{width:17px;height:17px;stroke:var(--theme-muted, #999);stroke-width:1.4}.message:hover .message-branch,.message-branch:focus-visible{opacity:1}
#branch-ghost{position:absolute;width:380px;min-height:210px;border:1px solid var(--theme-line, #dedede);border-radius:18px;background:color-mix(in srgb, var(--theme-surface, #ffffff) 85.1%, transparent);opacity:.42;pointer-events:none;z-index:9;box-shadow:0 8px 24px var(--theme-shadow, #00000008);transform-origin:0 0;padding:20px 24px 14px}.ghost-label{position:absolute;top:-44px;left:14px;border:1px solid var(--theme-line, #ddd);border-radius:20px;padding:6px 12px;font-size:12px;background:var(--theme-surface, #fff);max-width:350px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ghost-socket{position:absolute;left:-23px;top:65px;width:11px;height:26px;background:var(--theme-accent-solid, #e87924);border-radius:8px}.ghost-context{font-size:9px;border:1px solid var(--theme-line, #ddd);border-radius:5px;padding:5px 8px;display:inline-flex;align-items:center;gap:5px;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ghost-context i{width:4px;height:4px;background:var(--theme-control, #999);border-radius:50%}#branch-ghost p{font-size:13px;line-height:1.7;white-space:pre-wrap;color:var(--theme-muted, #777);max-height:90px;overflow:hidden}.ghost-input{height:28px}.ghost-bottom{display:flex;align-items:center;gap:12px;color:var(--theme-muted, #999)}.ghost-bottom>span:first-child{font-size:23px}
#branch-ghost{padding:16px 24px 18px}.ghost-input{height:120px;padding-top:20px;font-size:15px;color:var(--theme-muted, #999)}.ghost-context{max-width:330px}.ghost-bottom{min-height:34px}
/* Iconoir controls and reference conversation layout. */
:root,body{background:var(--theme-canvas, #f8f9fa)}#board{background:var(--theme-canvas, #f8f9fa);background-image:none}.topbar{background:color-mix(in srgb, var(--theme-canvas, #f8f9fa) 94.9%, transparent);border-bottom-color:var(--theme-line, #eceef0)}.icon{width:20px;height:20px;display:inline-block;vertical-align:middle;flex-shrink:0;color:inherit}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.top-meta button{display:grid;place-items:center;padding:3px}.top-meta button .icon{width:18px;height:18px}#help{border:0;width:25px;height:25px}#help .icon{width:20px;height:20px}footer button .icon{width:17px;height:17px}#toolbar button{width:45px;padding:11px;justify-content:center}#toolbar .icon{width:20px;height:20px}
.title-grip{display:grid;place-items:center;width:22px;height:30px;padding:0;cursor:grab;color:var(--theme-muted, #aaa);touch-action:none;flex-shrink:0}.title-grip:active{cursor:grabbing}.title-grip>span,.proposal-top .grip{display:flex;gap:0}.title-grip .icon,.proposal-top .grip .icon{width:18px;height:18px;margin:0 -5px}.title-grip:hover{color:var(--theme-ink, #555);background:var(--theme-raised, #e9eaec)}.card-header{padding-left:7px;gap:7px}.node-label{max-width:calc(100% - 70px);font-size:12px;letter-spacing:.25px;background:var(--theme-canvas, #f8f9fa)}.delete-card{padding:4px}.delete-card .icon{width:16px;height:16px}.mode-chip .icon,.mode-icon .icon{width:18px;height:18px}.add-file .icon{width:21px;height:21px}.resize-handle .icon{width:14px;height:14px}.drop-inline .icon{width:18px;height:18px}
.card[data-kind=thread]{background:transparent;border:0;box-shadow:none;border-radius:18px;gap:9px;min-height:280px}.card[data-kind=thread]:before{display:none}.chat-surface{background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #dbdcde);border-radius:18px;box-shadow:inset 1px 1px 0 var(--theme-shine, #fff),0 2px 3px var(--theme-shadow, #00000006),0 10px 20px var(--theme-shadow, #00000009);min-height:150px;flex:1;padding-bottom:6px}.card[data-kind=thread].focused .chat-surface{border-color:var(--theme-line, #a6a7aa);box-shadow:inset 1px 1px 0 var(--theme-shine, #fff),0 3px 4px var(--theme-shadow, #00000007),0 10px 25px var(--theme-shadow, #0000000b)}.chat-composer{margin:0;padding:20px 20px 14px;border:1px solid var(--theme-line, #ececef);border-radius:15px;background:var(--theme-surface, #fff);box-shadow:0 2px 8px var(--theme-shadow, #00000003)}.chat-composer textarea{font-size:15px;color:var(--theme-ink, #3e4655);line-height:1.8;min-height:65px!important;padding:3px 0 8px}.chat-composer textarea::placeholder{color:var(--theme-muted, #909094)}.composer-controls{display:flex;align-items:center;gap:10px;padding-top:12px}.composer-controls .mode-chip{background:var(--theme-raised, #f0f0f1);font-size:12px;padding:8px 11px}.model-label{font-size:10px;color:var(--theme-muted, #929297);margin-left:auto}.send-message{display:grid;place-items:center;background:var(--theme-control, #8e8e93);color:var(--theme-on-dark, #fff);border-radius:50%;height:31px;width:31px;padding:6px}.send-message:hover{background:var(--theme-control, #68686d)}.send-message .icon{width:18px;height:18px}.messages{padding:12px 14px 8px}.message{position:relative;border:0;padding:18px 7px;margin:0;color:var(--theme-ink, #3e4655);white-space:normal;font-size:15px;line-height:1.9;letter-spacing:.05px}.message.user{background:var(--theme-raised, #f0f0f1);border-radius:12px;padding:13px 15px;margin:0 0 17px}.message.assistant{padding:10px 7px 18px}.message-label{position:absolute;right:3px;top:3px;margin:0;height:22px}.message-branch{background:color-mix(in srgb, var(--theme-surface, #ffffff) 75.29%, transparent);border-radius:5px}.message [data-message-text] p{margin:0 0 18px}.message [data-message-text] p:last-child{margin-bottom:0}.message [data-message-text] ol{padding-left:24px;margin:18px 0}.message [data-message-text] li{padding-left:2px;margin:0 0 15px}.message [data-message-text] strong{font-weight:600}.chat-surface .proposal{margin:4px 20px 16px}.chat-surface .context-list{padding:14px 20px 2px}.chat-surface .context-chip{background:var(--theme-surface, #fff);font-size:9px;color:var(--theme-muted, #888)}.card[data-kind=thread]>.resize-handle{bottom:3px}.card[data-kind=thread]>.card-header{top:-45px}
#branch-ghost{width:520px}.ghost-label{left:38px;background:var(--theme-canvas, #f8f9fa)}.ghost-input{background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #ececef);border-radius:15px;margin:12px -24px -18px;padding:22px;height:140px}.ghost-bottom{position:relative;margin-top:-50px;padding-top:8px}.ghost-bottom .icon{width:18px;height:18px}
/* A single material and interaction language. */
:root{--r-card:16px;--r-inner:10px;--r-control:8px;--blue:var(--theme-accent, #4879f5);--metal-edge:linear-gradient(135deg,var(--theme-line, #fff) 0%,var(--theme-line, #e4e7ec) 28%,var(--theme-line, #b8bec9) 52%,var(--theme-line, #fff) 76%,var(--theme-line, #c9ced7) 100%)}
.topbar{background:var(--theme-canvas, #f8f9fa);backdrop-filter:none}#toolbar{background:var(--theme-surface, #fff);backdrop-filter:none;border-radius:12px;box-shadow:0 2px 4px var(--theme-shadow, #18243805),0 8px 24px var(--theme-shadow, #18243809);border-color:var(--theme-line, #dfe3e9)}.card:not([data-kind=thread]),.chat-surface{border:1px solid transparent;background:linear-gradient(var(--theme-surface, #fff),var(--theme-surface, #fff)) padding-box,var(--metal-edge) border-box;border-radius:var(--r-card);box-shadow:0 1px 1px var(--theme-shadow, #18243805),0 6px 16px var(--theme-shadow, #18243808),0 16px 36px var(--theme-shadow, #18243805)}.card:before{border-radius:var(--r-card)}.chat-composer{border-radius:var(--r-card);border:1px solid var(--theme-line, #e4e7ec);box-shadow:0 4px 14px var(--theme-shadow, #18243805);background:var(--theme-surface, #fff)}.card[data-kind=thread]{border-radius:var(--r-card);background:none;box-shadow:none}.card[data-kind=thread].focused .chat-surface{border-color:transparent;box-shadow:0 0 0 1px var(--theme-shine, #c3c9d4),0 8px 22px var(--theme-shadow, #1824380a)}.message.user{border-radius:var(--r-inner);background:var(--theme-raised, #f1f3f6)}.proposal{border-radius:var(--r-inner);border-color:var(--theme-line, #e0e4eb);box-shadow:none}.node-label{border-color:var(--theme-line, #e0e3e9);background:var(--theme-canvas, #f8f9fa);box-shadow:none}.mode-chip{border-radius:var(--r-control);background:linear-gradient(150deg,color-mix(in srgb, var(--theme-surface, #ffffff) 69.02%, transparent),color-mix(in srgb, var(--theme-raised, #e6eaf0) 62.75%, transparent));border:1px solid color-mix(in srgb, var(--theme-line, #ffffff) 75.29%, transparent);box-shadow:0 1px 3px var(--theme-shadow, #2530470b),inset 0 1px 0 var(--theme-shine, #fff);backdrop-filter:blur(8px);padding:7px!important;min-width:32px;justify-content:center}.mode-chip .icon{width:17px;height:17px}.title-grip,.small-tool{border-radius:var(--r-control);background:linear-gradient(145deg,color-mix(in srgb, var(--theme-surface, #ffffff) 50.2%, transparent),color-mix(in srgb, var(--theme-raised, #e3e7ee) 31.37%, transparent));backdrop-filter:blur(7px);box-shadow:inset 0 1px 0 color-mix(in srgb, var(--theme-shine, #ffffff) 60.0%, transparent);color:var(--theme-muted, #8c94a2)}.send-message{background:linear-gradient(145deg,var(--theme-control, #afb6c0),var(--theme-control, #727c8e) 55%,var(--theme-control, #939cab));box-shadow:inset 0 1px 1px color-mix(in srgb, var(--theme-shine, #ffffff) 73.33%, transparent),0 2px 4px var(--theme-shadow, #18243820)}.send-message:hover{background:linear-gradient(145deg,var(--theme-control, #9ca7b8),var(--theme-control, #5e6d83))}
.nib:before,.socket,.context-pill,.ghost-socket{background:linear-gradient(100deg,var(--theme-accent-surface, #9abbff) 0%,var(--theme-accent-solid, #4879f5) 35%,var(--theme-accent-solid, #3664dd) 80%,var(--theme-accent-surface, #89aafa));border:0;box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 1px 3px var(--theme-shadow, #2449a329)}.nib:before{width:10px;height:23px;border-radius:7px;box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 0 0 3px var(--theme-shine, #f8f9fa)}.nib:hover:before,.nib:focus-visible:before{background:linear-gradient(100deg,var(--theme-accent-surface, #bdd0ff),var(--theme-accent-solid, #4879f5) 50%,var(--theme-accent-solid, #2a55cd));box-shadow:0 0 0 4px var(--theme-shadow, #4879f51a)}.socket{width:10px;height:23px;border-radius:7px;top:66px}.context-pill{display:inline-block;width:7px;height:17px;border-radius:5px;flex-shrink:0}.message-branch{background:none!important;display:grid;place-items:center;width:28px;height:28px;border-radius:var(--r-control)}.proposal-top{gap:9px}.proposal-top .context-pill{width:7px;height:17px}.context-chip:before{background:var(--theme-accent-solid, #4879f5);width:4px;height:10px;border-radius:3px}.context-chip.stale:before{background:var(--theme-accent-solid, #243f85)}.card.target{outline-color:var(--theme-accent, #4879f5);outline-width:2px;outline-offset:5px}.card.target .socket{background:var(--theme-accent-solid, #4879f5)}.drop-inline{background:linear-gradient(145deg,var(--theme-accent-surface, #80a3ff),var(--theme-accent-solid, #4879f5));box-shadow:0 2px 7px var(--theme-shadow, #4879f530)}#selection-nib{background:transparent;box-shadow:none;width:25px;height:30px}#selection-nib button{width:25px;height:30px;background:transparent}#selection-nib .nib-mark{width:8px;height:20px;border:0;border-radius:6px;background:linear-gradient(100deg,var(--theme-accent-surface, #9abbff),var(--theme-accent-solid, #4879f5) 50%,var(--theme-accent-solid, #3664dd));box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 53.33%, transparent),0 1px 3px var(--theme-shadow, #2449a325)}#selection-nib button:active{background:transparent}
#permanent-wires .wire-base{stroke:var(--theme-muted, #d5e0fc);stroke-width:3.5}#permanent-wires .wire-flow{stroke:var(--theme-accent, #4879f5);stroke-width:3.5;stroke-dasharray:5 14;stroke-linecap:round}#live-wire{stroke:var(--theme-accent, #4879f5);stroke-width:3.5;stroke-linecap:round}#wire-end{fill:var(--theme-accent, #4879f5)}#branch-ghost{border-radius:var(--r-card);border-color:var(--theme-line, #cbd3e1);background:color-mix(in srgb, var(--theme-surface, #ffffff) 79.22%, transparent);box-shadow:0 8px 28px var(--theme-shadow, #2438550a)}.ghost-input{border-radius:var(--r-card)}
#create-menu button{width:46px;height:46px;border-radius:50%;padding:10px;border:1px solid color-mix(in srgb, var(--theme-line, #ffffff) 72.16%, transparent);background:linear-gradient(145deg,color-mix(in srgb, var(--theme-surface, #ffffff) 85.1%, transparent) 10%,color-mix(in srgb, var(--theme-raised, #e3e7ee) 90.2%, transparent) 60%,color-mix(in srgb, var(--theme-canvas, #f9fafb) 90.2%, transparent));backdrop-filter:blur(12px);box-shadow:inset 0 1px 1px var(--theme-shine, #fff),0 2px 4px var(--theme-shadow, #14233c10),0 5px 14px var(--theme-shadow, #14233c0c)}#create-menu button svg{width:21px;height:21px}#create-menu button:hover{background:linear-gradient(145deg,var(--theme-surface, #fff),var(--theme-accent-surface, #dce5fb));border-color:var(--theme-accent, #b0c5f8)}.radial-hub{width:5px;height:5px;left:-2.5px;top:-2.5px;background:var(--theme-control, #7a8597);box-shadow:0 0 0 3px color-mix(in srgb, var(--theme-shine, #ffffff) 50.2%, transparent)}
.flat-context{padding:12px 20px;border-bottom:1px solid var(--theme-line, #edf0f5);background:none}.context-tools{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--theme-muted, #6d7686)}.context-tools>span:first-child{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.context-version{font-size:9px;color:var(--theme-muted, #9a9faa)}.context-tools button,.icon-toggle{width:24px;height:24px;padding:4px;border-radius:6px;display:grid!important;place-items:center;margin:0!important}.context-tools .icon{width:15px;height:15px}.icon-toggle{cursor:pointer;position:relative}.icon-toggle input{position:absolute;opacity:0;width:100%!important;height:100%;margin:0!important;cursor:pointer}.icon-toggle span:has(svg){opacity:.3}.icon-toggle:has(input:checked) span:has(svg){opacity:1;color:var(--theme-accent, #4879f5)}.icon-toggle:focus-within{outline:2px solid var(--theme-accent, #4879f5)}.context-excerpt{white-space:pre-wrap;font-size:11px;line-height:1.8;color:var(--theme-muted, #7c8390);max-height:180px;overflow:auto;margin:10px 0 0}.upstream-flat{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.upstream-flat span{font-size:9px;color:var(--theme-muted, #9197a0);max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.media-search{padding:18px 20px 8px}.media-search-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.media-tabs{display:flex;gap:4px}.media-tabs button{width:33px;height:31px;padding:6px;border-radius:var(--r-control);color:var(--theme-muted, #9aa1ad)}.media-tabs button[aria-selected=true]{background:linear-gradient(145deg,var(--theme-surface, #fff),var(--theme-raised, #e9edf5));color:var(--theme-accent, #315fcd);box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 1px 4px var(--theme-shadow, #1a2b4610)}.media-tabs .icon,.small-tool .icon{width:19px;height:19px}.small-tool{width:29px;height:29px;padding:5px}.media-query{display:flex;align-items:center;gap:9px;border:1px solid var(--theme-line, #e3e7ee);border-radius:var(--r-inner);padding:6px 9px;background:var(--theme-accent-surface, #f8f9fc)}.media-query>.icon{width:17px;height:17px;color:var(--theme-muted, #9ba3b0)}.media-query input{font-size:13px;min-width:0;padding:5px 0}.media-query button{padding:4px;color:var(--theme-muted, #758094)}.media-query button .icon{width:17px;height:17px}.media-query input::placeholder{color:var(--theme-muted, #a1a7b1)}.media-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px;margin-top:14px}.media-result{padding:0;text-align:left;background:none!important;min-width:0}.thumbnail{position:relative;display:block;overflow:hidden;border-radius:var(--r-control);background:var(--theme-raised, #edf0f5);aspect-ratio:4/3;box-shadow:0 2px 5px var(--theme-shadow, #1d2c4510)}.thumbnail img{width:100%;height:100%;object-fit:cover;display:block}.video-result .thumbnail{aspect-ratio:16/9}.play-indicator{position:absolute;inset:0;display:grid;place-items:center;color:var(--theme-on-dark, white);background:color-mix(in srgb, var(--theme-control, #000000) 7.06%, transparent)}.play-indicator .icon{width:30px;height:30px;filter:drop-shadow(0 1px 3px var(--theme-shadow, #0008))}.result-title{display:block;font-size:10px;color:var(--theme-muted, #7b8390);margin-top:6px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.media-result:hover .thumbnail{outline:2px solid var(--theme-accent, #a7bef5);outline-offset:2px}.result-footer{display:flex;align-items:center;justify-content:space-between;margin-top:12px;font-size:9px}.result-footer a{color:var(--theme-muted, #a3a8b1);text-decoration:none}.result-footer button{padding:4px}.result-footer .icon{width:17px;height:17px}.key-field{display:flex;gap:6px;border-bottom:1px solid var(--theme-line, #e2e6ed);padding:8px 0}.key-field input{font-size:11px;min-width:0}.key-field button{padding:3px}.youtube-key-form p{font-size:10px;line-height:1.6;color:var(--theme-muted, #969eab)}.youtube-key-form a{color:var(--theme-muted, #617fb9)}.search-status{font-size:11px;color:var(--theme-muted, #8b94a3);margin:12px 0;line-height:1.7}.search-loading{display:grid;place-items:center;height:50px;color:var(--theme-muted, #8fa1c5)}.search-loading .icon{animation:loading-turn 1s linear infinite}.media-content{padding:10px}.source-image{display:block;width:100%;height:auto;border-radius:var(--r-inner)}.video-player{display:block;width:100%;aspect-ratio:16/9;border:0;border-radius:var(--r-inner);background:var(--theme-control, #101318)}.media-credit-bar{display:flex;gap:8px;align-items:center;padding:10px 5px 0;font-size:9px;color:var(--theme-muted, #9ba2ac)}.media-credit-bar>span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.media-credit-bar .icon{width:15px;height:15px}.media-credit-bar button{padding:2px;color:inherit}.media-credit-bar a{color:inherit}.source-credit{font-size:10px;color:var(--theme-muted, #8c94a2);padding:10px 5px;line-height:1.7}.source-credit a{color:var(--theme-muted, #617fb9)}@keyframes loading-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.search-loading .icon{animation:none}}@media(prefers-reduced-transparency:reduce){.mode-chip,.title-grip,.small-tool,#create-menu button{background:var(--theme-raised, #edf0f5);backdrop-filter:none}}

.media-result{cursor:grab;touch-action:none;user-select:none}.media-result:active{cursor:grabbing}.media-results:has(.video-result){grid-template-columns:1fr}#media-ghost{position:absolute;pointer-events:none;z-index:20;opacity:.48;border:1px solid var(--theme-line, #bcc8dd);border-radius:var(--r-card);background:var(--theme-surface, #fff);padding:14px;box-shadow:0 14px 35px var(--theme-shadow, #24385520)}#media-ghost.invalid{opacity:.22}#media-ghost>img{display:block;width:100%;max-height:360px;object-fit:contain;border-radius:var(--r-inner)}#media-ghost>.context-pill{position:absolute;right:-24px;top:65px}#media-ghost>.play-indicator{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
/* Compact, grounded surfaces; translucence is reserved for the branch hint. */
#board{background-color:var(--theme-canvas, #f8f9fa);background-image:radial-gradient(circle,color-mix(in srgb, var(--theme-control, #b5becb) 40.0%, transparent) .65px,transparent .85px);background-size:24px 24px}
#board.file-drop-active{box-shadow:inset 0 0 0 2px var(--theme-shadow, #4879f550)}
.card-main{padding:16px 16px 10px}.plan-body{line-height:1.65;min-height:90px}.node-controls{padding:8px 14px 12px;gap:8px;min-height:42px}
.card:not([data-kind=thread]),.chat-surface{box-shadow:0 1px 2px var(--theme-shadow, #18243812),0 4px 10px var(--theme-shadow, #1824380a),0 10px 22px var(--theme-shadow, #18243804)}
.card[data-kind=thread]{gap:6px;min-height:0}.chat-surface{min-height:0;padding-bottom:0}.chat-composer{padding:14px 16px 12px;box-shadow:0 1px 2px var(--theme-shadow, #1824380b),0 4px 10px var(--theme-shadow, #18243806)}
.chat-composer textarea{min-height:52px!important;line-height:1.6;padding:0 0 6px}.composer-controls{padding-top:6px;gap:8px}.messages{padding:10px}.message{line-height:1.7}.message.user{padding:10px 12px;margin-bottom:10px}.message.assistant{padding:8px 4px 12px}.message [data-message-text] p{margin-bottom:12px}.message [data-message-text] ol{margin:12px 0}.message [data-message-text] li{margin-bottom:10px}
.chat-surface .context-list{padding:10px 12px 0;gap:6px}.chat-surface .context-list:empty{display:none}.chat-surface .proposal{margin:2px 12px 12px}.card.empty-chat>.chat-surface{display:none}.card.empty-chat>.socket{display:none}.card.empty-chat>.chat-composer{flex:1}
.media-search{padding:14px 14px 6px}.media-search-head{margin-bottom:8px}.media-query{padding:6px 8px}.media-results{gap:8px}.media-content{padding:12px 12px 0}.file-meta{margin-top:8px}.context-detail{padding:10px 12px}.node-label{padding:5px 10px}
.nib-label{display:block;opacity:0;visibility:hidden;position:absolute;left:34px;top:2px;padding:5px 9px;border-radius:999px;color:var(--theme-ink, #455064);font-size:10px;font-weight:500;letter-spacing:.1px;background:linear-gradient(140deg,color-mix(in srgb, var(--theme-surface, #ffffff) 85.1%, transparent),color-mix(in srgb, var(--theme-raised, #edf1f5) 78.82%, transparent));border:1px solid color-mix(in srgb, var(--theme-line, #ffffff) 92.94%, transparent);box-shadow:0 1px 2px var(--theme-shadow, #1e2d4212),0 3px 10px var(--theme-shadow, #1e2d4214),inset 0 0 0 1px color-mix(in srgb, var(--theme-shine, #d9dfe5) 25.1%, transparent);backdrop-filter:blur(12px) saturate(130%);transition:opacity 100ms ease-out;pointer-events:none}
.nib:hover .nib-label,.nib:focus-visible .nib-label{opacity:1;visibility:visible}body.connecting .nib-label{opacity:0;visibility:hidden}
@media(prefers-reduced-transparency:reduce){.nib-label{background:var(--theme-canvas, #f5f7fa);backdrop-filter:none}}
@media(prefers-reduced-motion:reduce){.nib-label{transition:none}}
@media(prefers-contrast:more){.nib-label{background:var(--theme-surface, white);border-color:var(--theme-line, #697386);color:var(--theme-ink, #222)}}
/* Source references sit within the composer, without separate capsules or panes. */
.chat-surface:has(.messages:empty){display:none}
.chat-composer .context-list{padding:0 0 10px;gap:4px 12px;align-items:center}
.chat-composer .context-list:empty{display:none}
.context-list .context-chip{border:0!important;background:none!important;box-shadow:none;border-radius:4px;padding:2px 0;color:var(--theme-muted, #737e8e);font-size:11px;gap:5px;max-width:100%}
.context-list .context-chip:before{display:none}.context-chip .icon{width:13px;height:13px;opacity:.8}.context-chip .chip-title{max-width:260px}.context-chip:hover{color:var(--theme-accent, #315bd0);background:none}.source-updated{width:4px;height:4px;background:var(--blue);border-radius:50%}
.chat-composer .flat-context{padding:8px 0 12px;margin-bottom:10px;border-bottom:1px solid var(--theme-line, #edf0f4)}
.add-context{display:grid;place-items:center;padding:5px;color:var(--theme-muted, #8b929c)}.add-context .icon{width:19px;height:19px}
.nib .nib-label{display:none!important}
#branch-hint,#selection-nib{position:fixed;z-index:40;width:auto;height:auto;border-radius:999px;color:var(--theme-ink, #455064);background:linear-gradient(140deg,color-mix(in srgb, var(--theme-surface, #ffffff) 87.45%, transparent),color-mix(in srgb, var(--theme-raised, #edf1f5) 81.18%, transparent));border:1px solid color-mix(in srgb, var(--theme-line, #ffffff) 92.94%, transparent);box-shadow:0 1px 2px var(--theme-shadow, #1e2d4212),0 3px 10px var(--theme-shadow, #1e2d4214);backdrop-filter:blur(12px) saturate(130%);font-size:11px;font-weight:500;white-space:nowrap}
#branch-hint{padding:5px 10px;pointer-events:none}
#selection-nib button{width:auto;height:29px;display:flex;gap:7px;padding:5px 11px;border-radius:999px;color:inherit;font-size:11px;cursor:grab}
#selection-nib .nib-mark{width:5px;height:13px}#selection-nib button:active{cursor:grabbing;background:color-mix(in srgb, var(--theme-accent-surface, #e5ebf4) 53.33%, transparent)}.selection-draggable{cursor:grab!important}
@media(prefers-reduced-transparency:reduce){#branch-hint,#selection-nib{background:var(--theme-canvas, #f5f7fa);backdrop-filter:none}}
@media(prefers-contrast:more){#branch-hint,#selection-nib{background:var(--theme-surface, white);border-color:var(--theme-line, #697386);color:var(--theme-ink, #222)}}
.context-reference{display:inline-flex;align-items:center;gap:3px;max-width:100%;position:relative}.context-reference .context-chip{min-width:0}.context-output{width:23px;height:26px;padding:4px 7px;display:grid;place-items:center;cursor:grab;touch-action:none;flex-shrink:0}.context-output:active{cursor:grabbing}.context-output .context-pill{width:6px;height:15px}.context-output:hover .context-pill{box-shadow:0 0 0 4px var(--theme-shadow, #4879f515),inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent)}
.card[data-kind=thread]>.socket{display:none}
#context-menu{position:fixed;z-index:45;width:0;height:0}
#context-menu button{position:absolute;left:-18px;top:-18px;width:36px;height:36px;display:grid;place-items:center;border-radius:8px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e3e4e6);box-shadow:0 2px 5px var(--theme-shadow, #20273509),0 6px 16px var(--theme-shadow, #20273510);transform:translate(var(--dx),var(--dy));animation:context-menu-in 130ms ease-out both;color:var(--theme-ink, #55565a)}
@media(hover:hover){#context-menu button:hover{background:var(--theme-raised, #f3f4f5)}}
#context-menu button:active{background:var(--theme-raised, #eceef1)}#context-menu button:focus-visible{outline:2px solid var(--theme-accent, #4879f5);outline-offset:2px}#context-menu .icon{width:18px;height:18px}
@keyframes context-menu-in{from{opacity:0;transform:translate(0,0) scale(.85)}to{opacity:1;transform:translate(var(--dx),var(--dy)) scale(1)}}
#context-link{position:fixed;z-index:46;width:min(348px,calc(100vw - 24px));display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #dfe4ec);border-radius:12px;box-shadow:0 3px 8px var(--theme-shadow, #24385515),0 12px 30px var(--theme-shadow, #24385510)}#context-link> .icon{width:17px;height:17px;color:var(--theme-muted, #8993a2)}#context-link input{font-size:12px;min-width:0}#context-link button{padding:4px;display:grid;place-items:center}#context-link button .icon{width:16px;height:16px}
@media(prefers-reduced-motion:reduce){#context-menu button{animation:none}}


/* Saved and dragged connections share the same blue wavy pipe treatment. */
#permanent-wires .wire-flow,#live-wire{fill:none;stroke:var(--theme-accent, #4879f5);stroke-width:3.5;stroke-dasharray:6 4;stroke-linecap:round;stroke-linejoin:round;animation:information-flow .8s linear infinite}
#permanent-wires .wire-base{fill:none;stroke:var(--theme-muted, #aebedc);stroke-width:3.5;stroke-dasharray:6 4;stroke-linecap:round;stroke-linejoin:round;animation:none}
@media(prefers-reduced-motion:reduce){#permanent-wires .wire-flow,#live-wire{animation:none}}

/* November reference: quiet white surfaces, graphite controls and rounded frames. */
:root{--r-card:23px;--r-inner:16px;--r-control:10px;--metal-edge:linear-gradient(135deg,var(--theme-line, #e9e9e8) 8%,var(--theme-line, #eeeeed) 35%,var(--theme-muted, #b5b5b4) 76%,var(--theme-line, #f5f5f4) 100%)}
#board{background-color:var(--theme-canvas, #f8f9fa);background-image:radial-gradient(circle,color-mix(in srgb, var(--theme-control, #989b9f) 50.2%, transparent) .7px,transparent .9px)}
.card:not([data-kind=thread]),.chat-surface,.chat-composer{border:1.5px solid transparent;background:linear-gradient(var(--theme-canvas, #fcfcfc),var(--theme-canvas, #fcfcfc)) padding-box,var(--metal-edge) border-box;border-radius:var(--r-card);box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 2px 3px var(--theme-shadow, #20202006),0 8px 16px var(--theme-shadow, #20202008)}
.card:before{display:none}.card[data-kind=thread]{gap:8px}.card[data-kind=thread].focused .chat-surface,.card.focused:not([data-kind=thread]),.card[data-kind=thread].focused .chat-composer{border-color:transparent;box-shadow:0 0 0 .5px var(--theme-shadow, #a8a8a7),0 3px 5px var(--theme-shadow, #20202008),0 10px 20px var(--theme-shadow, #2020200c)}
.card-header{top:-47px;padding:0 10px;gap:10px;height:33px}.card[data-kind=thread]>.card-header{top:-47px}.node-label{order:0;font-size:13px;line-height:1.35;color:var(--theme-muted, #5c5c5a);letter-spacing:.1px;padding:6px 12px;border:1.5px solid var(--theme-line, #e5e5e3);border-radius:999px;background:var(--theme-canvas, #f8f9fa);max-width:calc(100% - 100px);box-shadow:inset 0 1px 0 color-mix(in srgb, var(--theme-shine, #ffffff) 53.33%, transparent)}.title-grip{order:1;width:31px;height:25px;border:1px solid var(--theme-line, #e2e2e0);border-radius:999px;background:var(--theme-canvas, #f8f9fa);box-shadow:inset 0 1px 0 var(--theme-shine, #fff);backdrop-filter:none;color:var(--theme-muted, #969693)}.drag-strip{order:2}.delete-card{order:3;color:var(--theme-muted, #777772)}
.chat-composer{padding:18px 18px 15px}.chat-composer textarea{font-size:16px;line-height:1.6;min-height:72px!important;padding:2px 0 10px;color:var(--theme-ink, #333641)}.chat-composer textarea::placeholder{color:var(--theme-muted, #999995)}.composer-controls{padding-top:9px;gap:10px;align-items:center}.composer-controls .mode-chip{padding:7px 11px!important;border:0;background:var(--theme-raised, #efefee);backdrop-filter:none;box-shadow:none;border-radius:999px;font-size:12px;gap:6px;color:var(--theme-muted, #62625f)}.composer-controls .mode-chip .icon{width:19px;height:19px}.model-label{font-size:10px;color:var(--theme-muted, #8b8b86)}.send-message{width:auto;height:34px;min-width:73px;padding:7px 12px;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:999px;background:var(--theme-control, #222220);color:var(--theme-on-dark, #fff);box-shadow:inset 0 1px 0 color-mix(in srgb, var(--theme-shine, #ffffff) 12.55%, transparent),0 1px 2px var(--theme-shadow, #00000015);font-size:12px;font-weight:500}.send-message:hover{background:var(--theme-control, #343431)}.send-message:active{background:var(--theme-control, #111110)}.send-message .icon{width:17px;height:17px}
.messages{padding:13px}.message{font-size:15px;line-height:1.75;color:var(--theme-ink, #3f424c)}.message.user{background:var(--theme-raised, #ededed);padding:13px 15px;border-radius:16px;margin-bottom:14px;width:fit-content;max-width:100%;min-width:100px}.message.assistant{padding:8px 6px 13px}.message-branch{right:0}.chat-surface{padding-bottom:0}.chat-composer .context-list{padding-bottom:11px}.context-list .context-chip{color:var(--theme-muted, #85857f);font-size:10px}
.card-main{padding:18px 18px 12px}.node-controls{padding:9px 16px 15px}.plan-body{font-size:15px;line-height:1.7}.media-content{padding:13px 13px 7px}.source-image,.file-image{border-radius:14px}.media-search{padding:16px 16px 8px}.media-query{border-radius:12px}.resize-handle{right:5px;bottom:4px}
/* Title and action rail follow the reference's left/right hierarchy. */
.card-header,.card[data-kind=thread]>.card-header{top:-49px;height:34px;padding:0 12px;gap:12px}
.card-header .node-label{order:0;flex:0 1 auto;min-width:45px;max-width:calc(100% - 52px);padding:6px 12px;font-size:13px;line-height:18px}
.card[data-kind=thread] .node-label{max-width:calc(100% - 192px)}
.card-header .drag-strip{order:1;min-width:0;height:30px}
.header-actions{order:2;display:flex;align-items:center;gap:12px;flex:0 0 auto;cursor:default}
.header-actions button{order:unset;display:grid;place-items:center;flex-shrink:0;width:26px;height:28px;padding:3px;color:var(--theme-muted, #62625e);border-radius:7px;opacity:1;margin:0}
.header-actions .title-grip{width:31px;height:24px;border-radius:999px;margin-right:13px;color:var(--theme-muted, #92928d);background:var(--theme-canvas, #f8f9fa);border:1.5px solid var(--theme-line, #e4e4e1)}
.header-actions button:hover{background:var(--theme-raised, #e9eae8);color:var(--theme-ink, #30302e)}.header-actions .icon{width:18px;height:18px}.header-actions .title-grip .icon{width:17px;height:17px}
.collapse-card[aria-expanded=true] .icon{transform:rotate(180deg)}.collapsed-summary{padding:17px 20px;border:1.5px solid var(--theme-line, #e0e0de);border-radius:var(--r-card);background:var(--theme-canvas, #fcfcfc);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--theme-muted, #777772)}.card.collapsed{min-height:0!important}.card.collapsed>.nib,.card.collapsed>.resize-handle{display:none}
.context-list .context-chip{cursor:pointer;touch-action:auto;user-select:none}.context-list .context-chip:active{cursor:pointer}
/* Message branch handles share the external right-hand rail with card ports. */
.message{width:100%;overflow:visible}
.message.user{width:100%;max-width:none;min-width:0;padding:0;background:none;border-radius:0}
.message.user>[data-message-text]{display:inline-block;max-width:100%;min-width:100px;padding:13px 15px;background:var(--theme-raised, #ededed);border-radius:16px}
.message-label{left:auto;right:-49px;top:7px;width:32px;height:32px;margin:0;display:grid;place-items:center}
.message-branch{position:static;width:32px;height:32px;padding:0;margin:0;display:grid;place-items:center;opacity:1;cursor:grab}
.message-branch:active{cursor:grabbing}
.message-branch .context-pill{width:10px;height:23px;border-radius:7px;box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 0 0 3px var(--theme-shine, #f8f9fa)}
.message-branch:hover .context-pill{box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 0 0 4px var(--theme-shadow, #4879f51a)}
.card[data-kind=thread]:has(.message)>.nib{top:auto;bottom:24px}

footer{justify-content:flex-end}
/* Ports reveal their local drag region, without cluttering idle text. */
.card>.nib,.message-branch,.context-output{opacity:0;transition:opacity 100ms ease-out}
.card:has(>.card-main:hover)>.nib,.card:has(>.media-content:hover)>.nib,.card:has(>.chat-composer:hover)>.nib,.card>.nib:hover,.card>.nib:focus-visible,.card>.nib:active{opacity:1}
/* Notes are one editable context region, including the path to their output. */
.card[data-kind=plan]:hover>.nib,.card[data-kind=plan]:focus-within>.nib{opacity:1}
.card[data-kind=plan]>.nib:after{content:'';position:absolute;right:100%;top:0;width:4px;height:100%}
.message:hover .message-branch,.message:focus-within .message-branch,.message-branch:hover,.message-branch:focus-visible,.message-branch:active{opacity:1}
.context-reference:hover .context-output,.context-reference:focus-within .context-output,.context-output:hover,.context-output:active{opacity:1}
.rounded-selection::selection,.rounded-selection *::selection{background:transparent;color:inherit}
#selection-highlight{position:fixed;inset:0;width:100%;height:100%;z-index:25;pointer-events:none;mix-blend-mode:multiply;opacity:.4}
#selection-highlight path{fill:var(--theme-muted, #a9c8fb);pointer-events:none}
@media(prefers-reduced-motion:reduce){.card>.nib,.message-branch,.context-output{transition:none}}

/* Six-dot grip: two horizontal rows inside a quiet outlined capsule. */
.header-actions .title-grip{width:35px;height:24px;padding:0;border:1.5px solid var(--theme-line, #e4e5e3);border-radius:999px;background:var(--theme-canvas, #f8f9fa);box-shadow:inset 0 1px 0 color-mix(in srgb, var(--theme-shine, #ffffff) 62.75%, transparent),0 1px 2px var(--theme-shadow, #20202003);color:var(--theme-muted, #969791)}
.title-grip>.grip-dots{display:grid;grid-template-columns:repeat(3,2.5px);grid-template-rows:repeat(2,2.5px);gap:2px;margin:0;align-content:center;justify-content:center}
.grip-dots i{display:block;width:2.5px;height:2.5px;border-radius:50%;background:currentColor}
.header-actions .title-grip:hover{background:var(--theme-raised, #f0f1ef);border-color:var(--theme-line, #d6d8d4);color:var(--theme-muted, #747670)}
/* Interactive pages keep a browser escape hatch for sites that block embedding. */
.card.web-card{border-radius:19px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e6e7e5);box-shadow:0 1px 2px var(--theme-shadow, #20202005),0 5px 12px var(--theme-shadow, #20202006)}
.card.web-card:has(>.website-preview){height:var(--page-height,469px)}
.website-preview{display:flex;flex-direction:column;flex:1;min-height:110px;width:100%;overflow:hidden;border-radius:18px;background:var(--theme-surface, #fff)}
.website-viewport{position:relative;flex:1;min-height:80px;width:100%;overflow:hidden;background:var(--theme-surface, #fff)}
.website-viewport iframe{position:absolute;inset:0;display:block;width:100%!important;height:100%!important;max-width:none;border:0!important;border-radius:0!important;background:var(--theme-surface, #fff)}
.website-preview>.website-source{flex-shrink:0}
.website-source{display:flex;align-items:center;gap:6px;height:27px;padding:0 10px;border-top:1px solid var(--theme-line, #eeefed);color:var(--theme-muted, #92958e);font-size:10px;text-decoration:none;background:var(--theme-canvas, #fcfcfb)}
.website-source>.icon{width:12px;height:12px;flex-shrink:0}.website-source>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.website-source>.icon:last-child{opacity:0}.website-preview:hover .website-source>.icon:last-child,.website-source:focus-visible>.icon:last-child{opacity:1}
.website-source a{display:flex;align-items:center;gap:5px;flex-shrink:0;color:var(--theme-muted, #6f747b);text-decoration:none}.website-source a .icon{width:12px;height:12px}
.card.web-card:has(.website-preview:hover)>.nib{opacity:1}
.card.web-card .header-actions{opacity:0}.card.web-card:hover .header-actions,.card.web-card:focus-within .header-actions{opacity:1}
.card.web-card>.resize-handle{bottom:5px;right:4px}.website-source{padding-right:27px}

/* Video cards: uninterrupted poster, one play affordance, quiet source strip. */
.card:has(>.youtube-content){border:1px solid var(--theme-line, #e6e7e5);border-radius:19px;background:var(--theme-surface, #fff);box-shadow:0 1px 2px var(--theme-shadow, #20202005),0 5px 12px var(--theme-shadow, #20202006)}
.youtube-content{overflow:hidden;border-radius:18px;background:var(--theme-surface, #fff)}
.youtube-screen{position:relative;width:100%;aspect-ratio:16/9;overflow:hidden;background:var(--theme-control, #151515)}
.youtube-poster{position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;border:0;border-radius:0;overflow:hidden;background:var(--theme-control, #151515);color:var(--theme-on-dark, #fff)}
.youtube-poster>img{width:100%;height:100%;object-fit:cover;display:block}
.youtube-poster:after{content:'';position:absolute;inset:55% 0 0;background:linear-gradient(transparent,color-mix(in srgb, var(--theme-control, #000000) 60.0%, transparent));pointer-events:none}
.youtube-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:54px;height:54px;border-radius:50%;background:color-mix(in srgb, var(--theme-control, #151515) 78.82%, transparent);display:grid;place-items:center;box-shadow:0 2px 8px var(--theme-shadow, #0004);z-index:1}
.youtube-play .icon{width:33px;height:33px;padding:6px;border:2px solid var(--theme-line, #fff);border-radius:50%;stroke:var(--theme-on-dark, #fff);stroke-width:2}
.youtube-poster:hover .youtube-play{background:color-mix(in srgb, var(--theme-control, #080808) 90.98%, transparent);box-shadow:0 0 0 3px color-mix(in srgb, var(--theme-shine, #ffffff) 15.69%, transparent),0 3px 10px var(--theme-shadow, #0005)}
.youtube-caption{position:absolute;bottom:11px;left:12px;right:12px;text-align:left;z-index:1;font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--theme-on-dark, #fff);text-shadow:0 1px 3px var(--theme-shadow, #0008)}
.youtube-screen .video-player{position:absolute;inset:0;width:100%!important;height:100%!important;border:0;border-radius:0;display:block}
.youtube-footer{height:29px;padding:0 11px;display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--theme-muted, #8d9189);background:var(--theme-canvas, #fcfcfb)}
.youtube-footer a{display:grid;place-items:center;width:23px;height:25px;color:inherit}.youtube-footer .icon{width:13px;height:13px}
.card:has(>.youtube-content:hover)>.nib{opacity:1}.card:has(>.youtube-content)>.resize-handle{bottom:1px;right:27px}
.card:has(>.youtube-content) .header-actions{opacity:0}.card:has(>.youtube-content):hover .header-actions,.card:has(>.youtube-content):focus-within .header-actions{opacity:1}

/* Context flow is activity, not idle decoration. */
#permanent-wires .wire-base{stroke:var(--theme-muted, #a8b3c5);stroke-dasharray:none;stroke-width:2.5;animation:none}
#permanent-wires .wire-flow{stroke:var(--theme-accent, #4879f5);stroke-width:3.5;stroke-dasharray:6 4;animation:information-flow .8s linear infinite}
@media(prefers-reduced-motion:reduce){#permanent-wires .wire-flow{animation:none}}

.card>.nib.connected-nib,.message-branch.connected-nib,.context-output.connected-nib{opacity:1}

/* Persistent connection endpoints override all idle/hover treatments. */
.card .nib.connected-nib,.card .message-branch.connected-nib,.card .context-output.connected-nib{opacity:1!important;visibility:visible!important}

.message-error{font-size:12px;color:var(--theme-danger, #9c433b);padding:10px 0}.message-error button{font-size:12px;text-decoration:underline;color:inherit}

/* Inputs land on the left edge, separate from the source-reference labels. */
.card[data-kind=thread]>.socket,.card.empty-chat>.socket{display:block;position:absolute;left:-23px;top:54px;width:10px;height:23px;border-radius:7px;opacity:0;pointer-events:none;background:linear-gradient(100deg,var(--theme-accent-surface, #9abbff),var(--theme-accent-solid, #4879f5) 40%,var(--theme-accent-solid, #3664dd) 85%,var(--theme-accent-surface, #89aafa));border:0;box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 0 0 3px var(--theme-shine, #f8f9fa)}
.card[data-kind=thread]>.socket.has-context,.card[data-kind=thread].connection-candidate>.socket,.card[data-kind=thread].target>.socket{opacity:1}
.card[data-kind=thread].target>.socket{box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 0 0 4px var(--theme-shadow, #4879f525)}
.card[data-kind=thread].collapsed>.socket{top:14px}

.stream-token{animation:stream-word-in 130ms ease-out both}
@keyframes stream-word-in{from{opacity:.25}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.stream-token{animation:none}}

/* Inspect source material in place, without replacing media playback. */
.source-context-detail{margin:0;padding:16px 20px 18px;border-top:1px solid var(--theme-line, #e4e6e9);background:var(--theme-surface, #fff);border-radius:0 0 22px 22px;cursor:auto;user-select:text}
.source-context-detail h3{margin:0 0 10px;font-size:12px;font-weight:600;color:var(--theme-ink, #444952)}
.source-context-detail pre{margin:12px 0;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.65 inherit;font-family:inherit;font-size:13px;line-height:1.65;color:var(--theme-ink, #444952);user-select:text}
.source-context-status,.source-context-footnote{margin:0;font-size:12px;line-height:1.5;color:var(--theme-muted, #858991)}
.source-context-footnote{padding-top:12px;border-top:1px solid var(--theme-line, #eff0f2);font-size:11px}
.header-actions [data-source-info][aria-expanded=true]{background:var(--theme-raised, #e9edf4);color:var(--theme-accent, #4879f5)}

.model-picker{position:relative;margin-left:auto;color:var(--theme-muted, #686d76)}
.model-picker > summary{list-style:none;display:flex;align-items:center;gap:7px;padding:5px 4px;border-radius:5px;cursor:pointer;user-select:none;font-size:13px;font-weight:500;color:var(--theme-ink, #55565a)}
.model-picker > summary::-webkit-details-marker{display:none}
.model-picker > summary>.icon{width:18px;height:18px}.model-picker > summary>.icon:last-child{width:12px;height:12px}
.model-picker > summary:hover,.model-picker[open] > summary{background:var(--theme-raised, #eceef1)}
.model-picker > summary:focus-visible{outline:2px solid var(--theme-accent, #4879f5);outline-offset:2px}
.model-popover{position:absolute;z-index:30;right:0;bottom:calc(100% + 7px);width:192px;padding:8px;border-radius:8px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e3e4e6);box-shadow:0 2px 5px var(--theme-shadow, #20273509),0 6px 16px var(--theme-shadow, #20273510);transform-origin:bottom right}
.model-picker[open] .model-popover{animation:model-open 130ms ease-out}
.model-slider-row{display:flex;align-items:center;gap:8px}.model-slider-row>span{display:flex;color:var(--theme-muted, #858a93)}.model-slider-row .icon{width:18px;height:18px}
.model-slider-track{position:relative;flex:1;min-width:0;height:32px;display:flex;align-items:center}
.model-slider-track input{appearance:none;-webkit-appearance:none;width:100%;height:26px;padding:3px;margin:0;border-radius:999px;border:1px solid var(--theme-line, #e0e3e8);background:var(--theme-raised, #f0f2f5);box-shadow:none;cursor:ew-resize;touch-action:pan-y;box-sizing:border-box}
.model-slider-track input::-webkit-slider-thumb{appearance:none;width:26px;height:18px;border:1px solid var(--theme-line, #dce0e6);border-radius:999px;background:var(--theme-surface, #fff);box-shadow:0 1px 2px var(--theme-shadow, #20273510);transition:transform 120ms ease-out}
.model-slider-track input::-moz-range-thumb{width:24px;height:16px;border:1px solid var(--theme-line, #dce0e6);border-radius:999px;background:var(--theme-surface, #fff);box-shadow:0 1px 2px var(--theme-shadow, #20273510);transition:transform 120ms ease-out}
.model-slider-track input:active::-webkit-slider-thumb{transform:scale(1.08,.94)}
.model-slider-track input:active::-moz-range-thumb{transform:scale(1.08,.94)}
.model-slider-track input:focus-visible{outline:2px solid var(--theme-accent, #4879f5);outline-offset:3px}
.model-select{position:relative;margin-top:5px;border-top:1px solid var(--theme-line, #f0f0f1);padding-top:5px}
.model-select>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;padding:6px 4px;border-radius:4px;cursor:pointer;font-size:12px;color:var(--theme-muted, #515762);gap:20px}
.model-select>summary::-webkit-details-marker{display:none}
.model-select>summary .icon{width:13px;height:13px}
.model-select>summary:focus-visible,.model-options button:focus-visible{outline:2px solid var(--theme-accent, #4879f5);outline-offset:2px}
.model-options{position:absolute;top:calc(100% + 5px);left:-9px;right:-9px;padding:4px;border:1px solid var(--theme-line, #e3e4e6);background:var(--theme-surface, #fff);border-radius:6px;box-shadow:0 3px 10px var(--theme-shadow, #20273512);z-index:2}
.model-options button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;background:transparent;border:0;border-radius:3px;padding:7px 5px;font:inherit;font-size:12px;color:var(--theme-muted, #515762);cursor:pointer}
.model-selected{color:var(--theme-accent, #4879f5)}
@media(hover:hover){.model-select>summary:hover{background:var(--theme-raised, #f2f3f5)}}
@media(prefers-reduced-motion:reduce){.model-slider-track input::-webkit-slider-thumb,.model-slider-track input::-moz-range-thumb{transition:none;transform:none}}
.card:has(.model-picker[open]){z-index:40}
@keyframes model-open{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.model-picker[open] .model-popover{animation:none}}

/* Vector grid follows canvas coordinates without fractional CSS tile rounding. */
#board{background-image:none}
#board-grid{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:0}

[data-expand-idea][aria-busy=true]{opacity:.5;cursor:progress}
.card[data-bottom-ports=true]>.socket{left:calc(50% - 22px);top:auto;bottom:-23px;width:23px;height:10px}
.card[data-bottom-ports=true]>.nib{left:calc(50% + 12px);right:auto;top:auto;bottom:-32px;width:32px;height:28px;transform:none}
.card[data-bottom-ports=true]>.nib:before{width:23px;height:10px}

.shared-editing .chat-composer,.shared-editing>.card-main{box-shadow:0 0 0 2px var(--theme-shadow, #8b79dc60),0 0 16px var(--theme-shadow, #8b79dc18)}
.editing-presence{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:50%;background:var(--theme-accent-surface, #eeeaf9);color:var(--theme-muted, #7561ae);font-size:10px;margin-right:2px}
.send-message:disabled{opacity:.38;cursor:not-allowed}

.shared-starting #board{pointer-events:none;opacity:.65}

/* A website's human perspective stays editable alongside the source. */
.card.web-card .website-preview{border-radius:18px}
.card.web-card:has(.website-perspective:not([hidden])) .website-preview{border-radius:18px 18px 0 0}
.website-perspective[hidden]{display:none}
.website-perspective-toggle[aria-expanded="true"]{background:var(--theme-raised, #eef0f2);color:var(--theme-ink, #303740)}
.website-perspective{padding:14px 18px 18px;border-top:1px solid var(--theme-line, #edf0f3)}
.website-perspective>label{display:block;margin-bottom:7px;font-size:11px;line-height:16px;color:var(--theme-muted, #7b8593);font-weight:500}
.website-notes{min-height:44px;outline:none;font-size:14px;line-height:22px;color:var(--theme-ink, #424b59);white-space:pre-wrap;overflow-wrap:anywhere;cursor:text}
.website-notes:empty:before{content:attr(data-placeholder);color:var(--theme-muted, #9aA2ae);pointer-events:none}
.website-notes:focus-visible{outline:none}
.website-perspective:focus-within>label{color:var(--theme-muted, #647aa9)}
.card.web-card:has(.website-perspective:hover)>.nib,.card.web-card:has(.website-perspective:focus-within)>.nib{opacity:1}
body.board-viewer .website-perspective:has(.website-notes:empty){display:none}
.website-notes:has(>br:only-child):before{content:attr(data-placeholder);color:var(--theme-muted, #9aa2ae);pointer-events:none}

/* A bounded decorative patch, behind cards and wires. */
#reactive-grid{position:absolute;left:0;top:0;width:224px;height:224px;pointer-events:none;z-index:0;contain:strict}

.response-citation { color: var(--theme-accent, #3165c9); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.response-citation:focus-visible { outline: 2px solid var(--theme-accent, #487cff); outline-offset: 3px; border-radius: 3px; }

/* Idea expansion stays attached to the point that opened it. */
.card:has(>.idea-preview){z-index:8}
.idea-preview{position:absolute;z-index:9;width:248px;cursor:default;transform-origin:-64px 110px}
.idea-twigs{position:absolute;left:-64px;top:24px;overflow:visible;pointer-events:none;fill:none;stroke:var(--theme-accent, #6d9cf4);stroke-width:1.5;stroke-linecap:round;stroke-dasharray:3 5}
.idea-preview-heading{height:24px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:var(--theme-muted, #73777c);white-space:nowrap}
.idea-preview-heading button{display:grid;place-items:center;width:24px;height:24px;padding:4px;border-radius:50%}
.idea-option{position:relative;height:62px;display:flex;align-items:flex-start;padding-top:3px}
.idea-topic{display:flex;align-items:center;gap:9px;width:100%;height:42px;padding:0 14px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e1e3e6);border-radius:999px;box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 2px 3px var(--theme-shadow, #00000009);font-size:12px;text-align:left}
.idea-topic-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.idea-topic>svg{width:13px;height:13px;opacity:.4;flex-shrink:0}
.idea-topic:hover,.idea-topic[aria-expanded=true]{border-color:var(--theme-accent, #a7bce3);background:var(--theme-accent-surface, #fcfdff)}
.idea-dot{width:7px;height:7px;flex-shrink:0;border-radius:99px;background:var(--theme-accent-solid, #528df0)}
.idea-preview-actions{display:flex;justify-content:flex-end;margin-top:-8px}
.idea-preview .launch-ideas{display:flex;gap:8px;align-items:center;padding:8px 13px;background:var(--theme-control, #343536);color:var(--theme-on-dark, #fff);border-radius:999px;font-size:11px}
.launch-ideas svg{width:14px;height:14px}
.idea-editor,.idea-error{margin-top:10px;padding:12px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e1e3e6);border-radius:14px;box-shadow:0 3px 7px var(--theme-shadow, #0000000b)}
.idea-editor label{display:block;font-size:12px;font-weight:500;margin-bottom:8px}
.idea-editor textarea{display:block;width:100%;font-size:12px;line-height:1.5;min-height:90px;resize:vertical}
.idea-editor button{display:block;margin:8px 0 0 auto;padding:5px 11px;border-radius:99px;background:var(--theme-raised, #f0f1f2);font-size:11px}
.idea-error p{font-size:12px;color:var(--theme-muted, #777)}
.idea-preview button:active,[data-expand-idea]:active{transform:scale(.97)}
.idea-preview button:focus-visible{outline:2px solid var(--theme-accent, #528df0);outline-offset:3px}
.idea-option:not(:has(.idea-loading)) .idea-topic{padding-left:43px}
.idea-select{position:absolute;z-index:1;left:7px;top:10px;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;padding:5px}
.idea-select::before{content:"";position:absolute;inset:5px;border:1px solid var(--theme-line, #c9cdd3);border-radius:50%;background:var(--theme-surface, #fff)}
.idea-select svg{position:relative;width:15px;height:15px;color:var(--theme-on-dark, #fff);opacity:0}
.idea-select[aria-pressed=true]::before{background:var(--theme-accent-solid, #528df0);border-color:var(--theme-accent, #528df0)}
.idea-select[aria-pressed=true] svg{opacity:1}
.idea-option.is-selected .idea-topic{border-color:var(--theme-accent, #a8c3f2);background:var(--theme-accent-surface, #f7faff)}
.idea-preview .launch-ideas:disabled{background:var(--theme-raised, #e6e8eb);color:var(--theme-muted, #888d94);cursor:default;transform:none}
.idea-loading{position:relative;overflow:hidden;isolation:isolate}
.idea-loading i{height:7px;background:var(--theme-raised, #e5e9ef);border-radius:99px}
.idea-loading .idea-dot{animation:idea-signal 1.6s ease-in-out infinite;animation-delay:var(--idea-delay)}
.idea-shimmer{position:absolute;pointer-events:none;inset:0;width:70%;background:linear-gradient(100deg,transparent,color-mix(in srgb, var(--theme-surface, #ffffff) 95.0%, transparent),transparent);transform:translateX(-150%);animation:idea-sweep 1.6s cubic-bezier(.4,0,.2,1) infinite;animation-delay:var(--idea-delay)}
.is-loading .idea-twigs{animation:idea-wire-pulse 1.6s ease-in-out infinite}
@keyframes idea-sweep{0%{transform:translateX(-150%)}75%,100%{transform:translateX(160%)}}
@keyframes idea-signal{0%,100%{opacity:.35;transform:scale(.85)}45%{opacity:1;transform:scale(1)}}
@keyframes idea-wire-pulse{0%,100%{opacity:.35}50%{opacity:.85}}
@media(prefers-reduced-motion:reduce){.idea-loading .idea-dot,.is-loading .idea-twigs{animation:none;opacity:.65}.idea-shimmer{display:none}}
body.board-viewer .idea-preview{display:none!important}
.chat-activity {display:flex;align-items:center;gap:7px;padding:8px 22px 14px;color:var(--theme-muted, #858991);font-size:12px;line-height:18px;}
.chat-activity svg {width:14px;height:14px;}
.chat-activity i {width:4px;height:4px;border-radius:50%;background:currentColor;animation:activity-breathe 1s ease-in-out infinite alternate;}
@keyframes activity-breathe {from{opacity:.25}to{opacity:.85}}
@media(prefers-reduced-motion:reduce){.chat-activity i{animation:none;opacity:.6}}

/* Expanded canvas conversations grow naturally so trackpad scrolling pans the board. */
.card[data-kind=thread] .chat-surface{max-height:none;overflow:visible;background-color:var(--theme-surface, #fff)}
.card.compact-chat .chat-surface{max-height:180px;min-height:0;overflow:hidden;position:relative;mask-image:none}
.card.compact-chat .messages{max-height:178px;overflow:hidden;mask-image:linear-gradient(to bottom,#000 0%,#000 48%,#000b 65%,#0004 83%,transparent 98%)}
.card.compact-chat .message-branch{display:none}
.chat-preview-toggle{align-self:center;display:flex;align-items:center;gap:5px;margin:-5px 0 2px;padding:5px 12px;font-size:11px;color:var(--theme-muted, #73767b);background:color-mix(in srgb, var(--theme-surface, #ffffff) 80.0%, transparent);border:1px solid var(--theme-line, #e6e7e9);border-radius:999px;box-shadow:0 1px 3px var(--theme-shadow, #00000007)}
.chat-preview-toggle svg{width:13px;height:13px}.chat-preview-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
.card[data-kind=thread].compact-chat{min-height:0!important}
.card.empty-chat .chat-surface:has(.messages:empty){display:none}
/* Markdown has the same typography in previews, full cards, and the panel. */
[data-message-text]{overflow-wrap:anywhere;min-width:0}
[data-message-text] :is(h1,h2,h3,h4,h5,h6){font-size:1.04em;font-weight:600;line-height:1.4;margin:1.25em 0 .55em;letter-spacing:-.01em}
[data-message-text]>:first-child{margin-top:0!important}
[data-message-text] :is(ul,ol){padding-left:1.4em;margin:.7em 0}
[data-message-text] li{margin:.3em 0!important;padding-left:.15em!important}
[data-message-text] li>p{margin:.25em 0}
[data-message-text] blockquote{margin:1em 0;padding:0 0 0 14px;border-left:3px solid var(--theme-line, #dce1e8);color:var(--theme-muted, #656b75)}
[data-message-text] pre{max-width:100%;overflow:auto;padding:14px;background:var(--theme-raised, #f3f4f6);border:1px solid var(--theme-line, #e8e9ec);border-radius:9px;font-size:12px;line-height:1.6;white-space:pre;overscroll-behavior:contain}
[data-message-text] code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em;background:var(--theme-raised, #eff1f4);border-radius:4px;padding:2px 4px}
[data-message-text] pre code{padding:0;background:none;font-size:inherit}
[data-message-text] hr{border:0;border-top:1px solid var(--theme-line, #e8e9ec);margin:1.2em 0}
[data-message-text] a{color:var(--theme-accent, #315bf4);text-decoration:underline;text-underline-offset:3px}
/* Keep inline previews separated from prose, including wrapped link fragments.
   Spacing is reserved at rest so hover never moves the surrounding text. */
.card a[data-node-link]{
 padding:3px 7px;margin-inline:2px;border-radius:6px;
 line-height:1.95;overflow-wrap:anywhere;
 -webkit-box-decoration-break:clone;box-decoration-break:clone;
 color:var(--theme-accent, #285ab8);text-decoration-color:var(--theme-accent, #a6bee5);text-decoration-thickness:1px;text-underline-offset:3px;
 outline-offset:3px;cursor:pointer;
 --link-surface:linear-gradient(180deg,var(--theme-accent, #f9fcff) 0%,var(--theme-accent, #eaf2ff) 48%,var(--theme-accent, #d9e8fc) 52%,var(--theme-accent, #eaf3ff) 100%);
 --link-edge:0 0 0 1px var(--theme-accent, #74a0df),inset 0 1px 0 var(--theme-line, #fff),inset 0 -1px 0 var(--theme-accent, #c2d6f2),0 2px 4px color-mix(in srgb, var(--theme-accent, #285493) 12.55%, transparent);
}
.card a[data-node-link]:focus-visible{
 color:var(--theme-accent, #174b9f);background:var(--link-surface);box-shadow:var(--link-edge);
 outline:2px solid var(--theme-accent, #487cff);text-decoration:none;
}
@media (hover:hover) and (pointer:fine){
 .card a[data-node-link]:hover{
  color:var(--theme-accent, #174b9f);background:var(--link-surface);box-shadow:var(--link-edge);text-decoration:none;
 }
}
.card a[data-node-link]:active{
 color:var(--theme-accent, #153e80);background:var(--theme-accent-surface, #d8e7fc);box-shadow:0 0 0 1px var(--theme-shadow, #5687d0),inset 0 1px 2px var(--theme-shadow, #245a9c26);text-decoration:none;
}
.markdown-table{max-width:100%;overflow-x:auto;margin:14px 0;border:1px solid var(--theme-line, #e2e5e9);border-radius:8px;overscroll-behavior:contain}
.markdown-table table{border-collapse:collapse;width:100%;font-size:12px;line-height:1.5;white-space:normal}
.markdown-table :is(th,td){min-width:100px;padding:9px 11px;text-align:left;vertical-align:top;border-bottom:1px solid var(--theme-line, #e6e8ec);border-right:1px solid var(--theme-line, #e6e8ec)}
.markdown-table th{font-weight:600;background:var(--theme-canvas, #f5f6f8)}.markdown-table tr:last-child td{border-bottom:0}.markdown-table :is(th,td):last-child{border-right:0}
/* One live card is portaled into this local reading view; no copied composer. */
#chat-panel{position:fixed;z-index:12;right:20px;top:80px;bottom:20px;width:min(820px,calc(100vw - 40px));background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #ffffff);border-radius:22px;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--theme-shine, #dfe2e6) 50.2%, transparent),0 0 0 1px color-mix(in srgb, var(--theme-shine, #d5d8dc) 43.92%, transparent),0 4px 10px var(--theme-shadow, #2027350a),0 18px 52px var(--theme-shadow, #2027351c),0 0 24px color-mix(in srgb, var(--theme-shine, #ffffff) 50.2%, transparent);display:flex;flex-direction:column;overflow:hidden}
.chat-panel-toolbar{display:flex;align-items:center;justify-content:space-between;padding:10px 18px 0;border-bottom:0;font-size:10px;color:var(--theme-muted, #747780)}
.chat-panel-toolbar button{display:grid;place-items:center;width:28px;height:28px;border-radius:7px}
.chat-panel-content{flex:1;min-height:0;padding:4px 18px 18px;overflow:hidden}
#chat-panel .card{position:relative!important;transform:none!important;width:100%!important;height:100%;min-height:0!important;display:flex;flex-direction:column;gap:10px;outline:none}
#chat-panel .card-header{position:relative;top:auto;left:auto;right:auto;padding:0;height:auto;min-height:34px;flex-shrink:0}
#chat-panel .node-label{max-width:100%;background:var(--theme-surface, #fff);border:0;padding-left:0;font-size:14px;color:var(--theme-ink, #292d33)}
#chat-panel .header-actions{gap:5px}
#chat-panel :is([data-expand-idea],.idea-preview,.idea-twigs,.title-grip,.open-chat-panel,.collapse-card,.resize-handle,.chat-preview-toggle,.nib,.socket,.message-branch){display:none!important}
#chat-panel .chat-surface{flex:1;min-height:0;max-height:none;overflow-y:auto;border:0;border-radius:12px;box-shadow:none;overscroll-behavior:contain;mask-image:linear-gradient(to bottom,transparent,#000 10px,#000 calc(100% - 14px),transparent);scrollbar-width:thin;scrollbar-color:#d9dce1 transparent}
#chat-panel .messages{padding:8px 0 4px}#chat-panel .message{font-size:13px;line-height:1.65}
#chat-panel .message-label{position:absolute;width:1px;height:1px;overflow:hidden}
#chat-panel .chat-activity{padding:8px 4px 12px}
#chat-panel .chat-composer{flex-shrink:0;padding:10px 12px;border:1px solid var(--theme-line, #e9ebee);border-radius:16px;box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 2px 6px var(--theme-shadow, #20273508)}
#chat-panel .chat-composer textarea{font-size:13px;line-height:1.6;min-height:58px!important;max-height:130px;overflow:auto}
#chat-panel .idea-preview{left:auto!important;right:12px;top:44px!important;width:248px;max-height:calc(100% - 60px);overflow:auto;background:var(--theme-canvas, #f8f9fa);padding:12px;border-radius:16px}
#chat-panel .idea-twigs{display:none}
.panel-placeholder{position:absolute;display:flex;align-items:center;gap:12px;padding:22px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e2e5e9);border-radius:16px;box-shadow:0 2px 5px var(--theme-shadow, #00000006);text-align:left}
.panel-placeholder span{flex:1}.panel-placeholder small{font-size:11px;color:var(--theme-muted, #7b8089)}
@media(min-width:900px){body.chat-panel-open #creation-dock{left:max(180px,calc((100% - 840px)/2))}body.chat-panel-open footer{right:860px}}
@media(prefers-reduced-motion:reduce){#chat-panel,.chat-preview-toggle{animation:none;transition:none}}
.card.compact-chat .message:nth-last-child(n+3){display:none}

/* Keep the last manipulated card above its neighbors after release. */
.card.last-held{z-index:9}

/* One clear glass envelope for chats, agents, and every context card. */
.card[data-kind]{
 padding:14px;gap:12px;border:1px solid color-mix(in srgb, var(--theme-line, #ffffff) 85.1%, transparent);border-radius:26px;
 background:color-mix(in srgb, var(--theme-surface, #ffffff) 48.0%, transparent);
 -webkit-backdrop-filter:blur(12px) saturate(115%);
 backdrop-filter:blur(12px) saturate(115%);
 box-shadow:inset 0 1px 0 var(--theme-shine, #fff),inset 0 -1px 0 color-mix(in srgb, var(--theme-shine, #ffffff) 50.2%, transparent),0 0 0 1px color-mix(in srgb, var(--theme-shine, #dce0e3) 40.0%, transparent),0 3px 6px var(--theme-shadow, #25304708),0 12px 28px var(--theme-shadow, #2530470a);
}
.card[data-kind].focused{border-color:var(--theme-line, #fff);box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 0 0 1px color-mix(in srgb, var(--theme-shine, #bfc7d1) 50.2%, transparent),0 4px 8px var(--theme-shadow, #25304709),0 12px 28px var(--theme-shadow, #2530470c)}
.card[data-kind]>.card-header{position:relative;top:auto;left:auto;right:auto;flex-shrink:0;padding:0 2px;height:34px}
.card[data-kind=thread]>.chat-surface,.card[data-kind=thread].focused>.chat-surface{background:transparent;border:0;box-shadow:none;border-radius:14px}
.card[data-kind=thread]>.chat-surface>.messages{padding:4px 6px}
.card[data-kind=thread]>.chat-composer,.card[data-kind=thread].focused>.chat-composer{background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #e4e7eb);border-radius:18px;box-shadow:0 1px 2px var(--theme-shadow, #25304706),0 3px 8px var(--theme-shadow, #25304705)}
.card[data-kind]>.resize-handle{bottom:4px;right:4px}
@media(prefers-reduced-transparency:reduce){
 .card[data-kind]{background:var(--theme-canvas, #f8f9fa);-webkit-backdrop-filter:none;backdrop-filter:none}
}
@media(prefers-contrast:more){
 .card[data-kind]{background:var(--theme-surface, #fff);border-color:var(--theme-line, #737b86);-webkit-backdrop-filter:none;backdrop-filter:none}
}
.card.compact-chat .message.user{max-height:none;overflow:visible}
.card.compact-chat .user-message-copy{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.card.compact-chat .user-message-copy>:first-child{margin-top:0}
.card.compact-chat .user-message-copy>:last-child{margin-bottom:0}
.markdown-table [align=right]{text-align:right}.markdown-table [align=center]{text-align:center}
.markdown-task{font-family:system-ui,sans-serif;color:var(--theme-muted, #616975)}

.model-trigger-mark{display:flex;align-items:center;justify-content:center;width:19px;height:19px;border-radius:50%;background:var(--theme-control, #62615f);color:var(--theme-on-dark, white)}
.model-trigger-mark .icon{width:12px;height:12px}
@media(hover:hover){.model-options button:hover{background:var(--theme-raised, #f3f4f5)}}
#chat-panel .card.empty-chat .chat-surface:has(.messages:empty){display:block}

/* Keep the note surface intact; only its overflowing text fades away. */
.card[data-kind=plan] .note-preview-toggle{display:none;margin:0 auto 10px}
.card[data-kind=plan].long-note .note-preview-toggle{display:flex}
.card.compact-note.long-note .note-content{max-height:270px;overflow:hidden}
.card.compact-note.long-note .plan-body{max-height:240px;overflow:hidden;mask-image:linear-gradient(to bottom,#000 45%,#000c 65%,#0005 85%,transparent 100%)}
.card.compact-note.long-note:has(.plan-body:focus) .note-content{max-height:none}
.card.compact-note.long-note .plan-body:focus{max-height:none;mask-image:none}

@media(max-width:900px){#chat-panel{right:12px;top:76px;bottom:12px;width:calc(100vw - 24px);border-radius:18px}.chat-panel-content{padding:4px 14px 12px}body.chat-panel-open #creation-dock,body.chat-panel-open footer{visibility:hidden}}
#chat-panel .message.user{padding:0;margin-bottom:12px}
#chat-panel .message.user>[data-message-text]{padding:10px 12px;border-radius:14px}
#chat-panel [data-message-text] :is(h1,h2){font-size:1.15em}
#chat-panel [data-message-text] :is(h3,h4){font-size:1.05em}
#chat-panel .flat-context{border-bottom:0}

/* Context media share the same quiet, opaque card surface. */
.file-content{padding:10px!important}.file-image-link{display:block;background:var(--theme-canvas, #f6f7f8);border-radius:12px;overflow:hidden}.file-image-link .file-image,.media-content .source-image{display:block;width:100%;height:auto;max-height:460px;object-fit:contain;border-radius:12px}.file-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 4px 2px;color:var(--theme-muted, #83878d);font-size:11px}.file-meta a{display:grid;place-items:center;width:28px;height:28px;border-radius:7px}.file-meta a:hover{background:var(--theme-raised, #f0f1f3)}.file-meta .icon{width:16px;height:16px}.file-unavailable{padding:36px 20px;text-align:center;color:var(--theme-muted, #83878d);font-size:12px;line-height:1.6}.file-unavailable>.icon{width:28px;height:28px}.file-unavailable button,[data-share-file]{border:0;background:var(--theme-raised, #f1f2f3);color:var(--theme-muted, #545960);border-radius:7px;padding:6px 10px;font:inherit;cursor:pointer}.file-content .file-text{max-height:360px;overflow:auto;white-space:pre-wrap;padding:12px;font-size:12px;line-height:1.65}.context-image-preview{display:block;width:100%;max-height:260px;object-fit:contain;border-radius:10px;background:var(--theme-raised, #f5f6f7);margin:8px 0}.context-availability{font-size:11px;color:var(--theme-muted, #797f88);line-height:1.5}.context-detail branch-pdf{margin:10px 0}.youtube-screen{aspect-ratio:16/9;background:var(--theme-control, #151619);overflow:hidden;border-radius:12px}.youtube-screen .video-player,.youtube-screen .youtube-poster{width:100%;height:100%;border:0;display:block}.youtube-poster img{width:100%;height:100%;object-fit:cover}.youtube-footer{font-size:11px;color:var(--theme-muted, #858990)}.file-content branch-pdf{width:100%}

/* Equations keep their own typesetting and scroll within narrow cards. */
[data-math="display"]{display:block;max-width:100%;overflow-x:auto;overscroll-behavior:contain}
[data-math] .katex-display{margin:.75em 0;padding:2px 0}
[data-math] .katex{font-size:1.1em}
.video-transcript-button{display:flex;align-items:center;gap:6px;border:0;background:transparent;font:inherit;font-size:11px;color:var(--theme-muted, #777d85);padding:6px 12px 12px;cursor:pointer}.video-transcript-button .icon{width:14px;height:14px}.video-transcript-button:hover{color:var(--theme-ink, #30343a)}.video-transcript-error{padding:4px 12px 12px;display:flex;gap:10px;align-items:flex-start;color:var(--theme-muted, #777d85);font-size:11px;line-height:1.5}.video-transcript-error button{flex:none;border:1px solid var(--theme-line, #e3e5e8);border-radius:7px;background:var(--theme-surface, white);padding:5px 8px;font:inherit;cursor:pointer}.source-context-detail pre{max-height:320px;overflow:auto;white-space:pre-wrap;overscroll-behavior:contain}

/* Named research agents: opaque surfaces, reflective edges, functional motion. */
.card.agent-card { border:1px solid var(--theme-line, #cbd0d8); box-shadow:0 1px 2px var(--theme-shadow, #15223612),0 6px 18px var(--theme-shadow, #172b4510),inset 0 1px 0 var(--theme-shine, #fff); }
#chat-panel .card.agent-card{border:0;box-shadow:none}
#chat-panel .agent-identity{flex-shrink:0;margin:0;padding:12px 14px;border-radius:12px}
.agent-card .chat-surface { max-height:none; overflow:visible; }
.agent-identity { margin:12px 12px 3px; padding:12px 14px; border-radius:12px; background:var(--theme-canvas, #f8f9fa); border:1px solid var(--theme-line, #e5e7eb); display:grid; grid-template-columns:32px minmax(0,1fr) auto auto; gap:6px 12px; align-items:center; }
.agent-avatar { grid-row:1;width:32px;height:32px;position:relative;display:grid;place-items:center;border-radius:10px;background:var(--theme-surface, white);box-shadow:0 1px 3px var(--theme-shadow, #00000012),inset 0 1px 0 var(--theme-shine, white); }
.agent-avatar img { display:block;width:30px;height:30px;object-fit:contain;border-radius:8px; }
.agent-avatar > i { position:absolute;right:-2px;bottom:-2px;width:10px;height:10px;background:var(--theme-control, #8c929a);border:3px solid var(--theme-line, #f8f9fa);border-radius:50%; }
.agent-identity[data-running="true"] .agent-avatar > i { background:var(--theme-accent-solid, #4979ed);animation:agent-pulse 1.6s ease-in-out infinite; }
.agent-identity[data-running="true"] .agent-avatar img { animation:agent-breathe 2.4s ease-in-out infinite; }
.agent-heading { grid-column:2;grid-row:1;min-width:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;line-height:18px; }
.agent-heading strong { display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;font-size:13px;font-weight:600; }
.agent-heading > span { font-size:13px;color:var(--theme-muted, #636b78); }
.agent-identity button { grid-column:3;grid-row:1;border:1px solid var(--theme-line, #dce0e5);border-radius:50%;width:28px;height:28px;padding:0;display:grid;place-items:center;background:var(--theme-surface, #fff);cursor:pointer; }
.agent-identity button .icon { width:14px;height:14px; }
.agent-identity button:active { transform:scale(.97); }
.agent-progress { grid-column:2/-1;height:3px;overflow:hidden;border-radius:3px;background:var(--theme-raised, #e2e6ed); }
.agent-progress[hidden] { display:none; }
.agent-progress i { display:block;width:35%;height:100%;border-radius:inherit;background:var(--theme-accent-solid, #6083c8);animation:agent-progress 1.5s ease-in-out infinite; }
@keyframes agent-progress { from { transform:translateX(-100%); } to { transform:translateX(386%); } }
.research-source-body { display:flex;flex-direction:column;gap:12px;padding:8px 20px 20px; }
.research-source-body > span { display:flex;align-items:center;gap:6px;color:var(--theme-muted, #707887);font-size:11px; }
.research-source-body .icon { width:14px;height:14px; }
.research-source-body a { color:var(--theme-ink, #343e50);font-size:13px;overflow-wrap:anywhere; }
.research-source-body small { color:var(--theme-muted, #8a909a);font-size:10px;line-height:1.5; }
#auto-groups { position:absolute;inset:0;pointer-events:none;z-index:-1; }
.auto-group-outline { position:absolute;border:1px dashed var(--theme-line, #ccd4e1);border-radius:24px;background:color-mix(in srgb, var(--theme-raised, #edf1f6) 14.9%, transparent);padding:12px 20px;font-size:11px;color:var(--theme-muted, #758095);box-sizing:border-box; }
@keyframes agent-pulse { 50% { opacity:.4; } }
@keyframes agent-breathe { 50% { transform:translateY(-2px) rotate(-4deg); } }
@media(prefers-reduced-motion:reduce) { .agent-identity * { animation:none!important;transition:none!important; } }

/* Fold research context into an opaque paper stack behind its agent. */
#agent-stacks{position:absolute;inset:0;pointer-events:none;z-index:1}
.agent-source-stack{position:absolute;height:92px;pointer-events:auto;isolation:isolate}
.agent-source-stack::before,.agent-source-stack::after{content:"";position:absolute;inset:0;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #dfe3e9);border-radius:14px;z-index:-1;pointer-events:none}
.agent-source-stack::before{transform:translate(14px,-14px) rotate(2deg)}
.agent-source-stack::after{transform:translate(7px,-7px) rotate(1deg)}
.agent-stack-toggle{display:flex;align-items:center;gap:12px;width:100%;height:100%;padding:18px 20px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #d4dbe5);border-radius:14px;box-shadow:0 2px 5px var(--theme-shadow, #23334b0b),inset 0 1px 0 var(--theme-shine, #fff);text-align:left}
.agent-stack-toggle>span{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}
.agent-stack-toggle strong{font-size:13px;font-weight:500}
.agent-stack-toggle small{font-size:11px;color:var(--theme-muted, #858c98);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.agent-stack-toggle>.icon{width:17px;height:17px;color:var(--theme-muted, #7a879b);flex-shrink:0}
.agent-source-stack.is-expanded::before,.agent-source-stack.is-expanded::after{display:none}
.agent-source-stack.is-expanded .agent-stack-toggle>.icon:last-child{transform:rotate(180deg)}
.agent-stack-toggle:hover{background:var(--theme-surface, #fcfcfd)}
.agent-stack-toggle:active{background:var(--theme-canvas, #f5f6f8)}
.auto-group-outline{padding:18px 28px;border-radius:28px}
/* Compact source nodes beside the agent retain their measured blue ports. */
.agent-source-stack{height:auto;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #dce1e8);border-radius:14px;box-shadow:0 2px 6px var(--theme-shadow, #23334b09);padding-bottom:8px}
.agent-source-stack::before,.agent-source-stack::after{display:none}
.agent-stack-toggle{height:58px;padding:10px 14px;border:0;box-shadow:none;background:transparent}
.agent-stack-toggle strong{font-size:12px}.agent-stack-toggle small{font-size:10px}
.agent-source-rows{display:flex;flex-direction:column;padding:0 10px;gap:4px}
.agent-source-row{position:relative;display:flex;align-items:center;gap:7px;height:30px;padding:5px 10px;border:1px solid var(--theme-line, #eceef2);border-radius:7px;color:var(--theme-muted, #626c7b);text-decoration:none;background:var(--theme-canvas, #fafbfc);font-size:11px}
.agent-source-row>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-source-row .icon{width:13px;height:13px;flex-shrink:0}
.source-row-port{position:absolute;right:-7px;top:9px;width:6px;height:12px;border-radius:8px;background:var(--theme-accent-surface, #6488f2);box-shadow:inset 1px 0 1px var(--theme-shine, #c7d6ff)}
.agent-identity .workspace-toggle{grid-column:4;grid-row:1}
.agent-identity[data-running="false"]{grid-template-columns:32px minmax(0,1fr) auto}
.agent-identity[data-running="false"] .workspace-toggle{grid-column:3}
.workspace-folded>.chat-surface,.workspace-folded>.composer,.workspace-folded>.chat-preview-toggle,.workspace-folded>.nib,.workspace-folded>.socket,.workspace-folded>.resize-handle{display:none!important}
.workspace-folded .agent-identity{margin-bottom:12px}.workspace-folded{min-height:0!important}
.workspace-folded .workspace-toggle .icon{transform:rotate(-90deg)}

/* Board context menu: ordered actions, anchored to the click. */
#create-menu{position:fixed;z-index:100;width:228px;height:auto;max-width:calc(100vw - 16px);max-height:calc(100dvh - 81px);overflow:auto;padding:5px;background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #dfe1e5);border-radius:12px;box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 3px 6px var(--theme-shadow, #19202b0a),0 12px 30px var(--theme-shadow, #19202b12);backdrop-filter:none;transform:none}
#create-menu button{position:static;display:flex;flex-direction:row;justify-content:flex-start;will-change:auto;align-items:center;gap:10px;width:100%;height:34px;padding:0 10px;border:0;border-radius:7px;background:transparent;box-shadow:none;backdrop-filter:none;transform:none;opacity:1;text-align:left;font-size:12px;font-weight:400;color:var(--theme-ink, #373a40);transition:none}
#create-menu button img{width:16px;height:16px;opacity:.65;flex-shrink:0}
#create-menu button span{flex:1}
#create-menu button kbd{font:inherit;font-size:10px;color:var(--theme-muted, #92969e)}
#create-menu button:hover:not(:disabled),#create-menu button:focus-visible{background:var(--theme-raised, #f0f1f3);outline:none}
#create-menu button:active:not(:disabled){background:var(--theme-raised, #e7e9ec)}
#create-menu button:first-child{font-weight:500;color:var(--theme-ink, #181b20)}
#create-menu button:disabled{opacity:.35}
#create-menu .menu-divider{height:1px;background:var(--theme-raised, #eceef0);margin:5px 7px}

/* Below 25%, counter-scale summaries so organizing labels remain readable.
   Absolute positioning preserves the underlying node and wire layout. */
.node-overview{display:none}
#world.zoomed-out .card{cursor:grab;touch-action:none;user-select:none}
#world.zoomed-out .card>:not(.node-overview):not(.nib):not(.socket){visibility:hidden!important;pointer-events:none!important}
#world.zoomed-out .card>.node-overview{position:absolute;left:50%;top:50%;width:max(100%,calc(144px * var(--overview-scale, 1)));min-height:calc(56px * var(--overview-scale, 1));transform:translate(-50%,-50%);display:flex;align-items:center;gap:calc(8px * var(--overview-scale, 1));padding:calc(8px * var(--overview-scale, 1));overflow:hidden;border-radius:calc(8px * var(--overview-scale, 1));background:var(--theme-surface, #fff);box-shadow:0 0 0 calc(1px * var(--overview-scale, 1)) var(--theme-line, #e8eaed);pointer-events:auto}
.overview-icon{display:grid;place-items:center;width:calc(24px * var(--overview-scale, 1));height:calc(24px * var(--overview-scale, 1));flex:none;color:var(--theme-muted, #626973);background:var(--theme-raised, #f3f4f5);border:1px solid var(--theme-line, #e8eaed);border-radius:calc(6px * var(--overview-scale, 1))}
.overview-icon svg{width:calc(16px * var(--overview-scale, 1));height:calc(16px * var(--overview-scale, 1));stroke-width:1.5}
.overview-label{min-width:0;display:flex;flex-direction:column;gap:calc(3px * var(--overview-scale, 1))}
.overview-type{font-size:calc(10px * var(--overview-scale, 1));line-height:1.2;color:var(--theme-muted, #858b94)}
.overview-label strong{font-size:calc(14px * var(--overview-scale, 1));line-height:1.2;font-weight:500;letter-spacing:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;color:var(--theme-ink, #30353c)}
#world.zoomed-out .card:is(:active,.dragging){cursor:grabbing}
#world.zoomed-out .card:focus-visible{outline:3px solid var(--theme-accent, #4879f5);outline-offset:6px}
#world.zoomed-out .card>.nib,#world.zoomed-out .card>.socket{pointer-events:none!important}
/* Preview provenance shares the canvas pipe geometry and remains static at rest. */
#permanent-wires .preview-wire{stroke:var(--theme-accent, #4879f5);stroke-width:3.5;stroke-dasharray:6 4;stroke-linecap:round;animation:none}
.card a[data-node-link].preview-link-connected{background:var(--theme-accent-surface, #edf4ff);box-shadow:0 0 0 1px var(--theme-shine, #9bbbea);text-decoration:none}
@media (hover:hover) and (pointer:fine){
 .card a[data-node-link].preview-link-connected:hover{background:var(--link-surface);box-shadow:var(--link-edge)}
}
.card a[data-node-link].preview-link-connected:focus-visible{background:var(--link-surface);box-shadow:var(--link-edge)}
.card>.socket.preview-input{display:block;position:absolute;left:-23px;top:54px;width:10px;height:23px;border-radius:7px;opacity:1;pointer-events:none;background:linear-gradient(100deg,var(--theme-accent-surface, #9abbff),var(--theme-accent-solid, #4879f5) 40%,var(--theme-accent-solid, #3664dd) 85%,var(--theme-accent-surface, #89aafa));border:0;box-shadow:inset 1px 0 1px color-mix(in srgb, var(--theme-shine, #ffffff) 66.67%, transparent),0 0 0 3px var(--theme-shine, #f8f9fa)}
.card a[data-node-link]{cursor:grab;touch-action:none}
.card a[data-node-link]:active,body.dragging-link,body.dragging-link *{cursor:grabbing!important}
#link-ghost{position:absolute;left:0;top:0;display:flex;align-items:center;padding:3px 7px;pointer-events:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;color:var(--theme-accent, #174b9f);font-size:14px;background:linear-gradient(180deg,var(--theme-accent-surface, #f9fcff) 0%,var(--theme-accent-surface, #eaf2ff) 48%,var(--theme-accent-surface, #d9e8fc) 52%,var(--theme-accent-surface, #eaf3ff) 100%);box-shadow:0 0 0 1px var(--theme-shadow, #74a0df),inset 0 1px 0 var(--theme-shine, #fff),inset 0 -1px 0 var(--theme-shine, #c2d6f2),0 2px 4px var(--theme-shadow, #28549320)}
#link-ghost.invalid{opacity:.45}
.website-source [data-embed-help]{font-size:10px;padding:3px 5px;color:var(--theme-muted, #617492);white-space:nowrap}
.website-fallback{height:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:30px;gap:12px;background:var(--theme-surface, #fff);color:var(--theme-ink, #48566a)}
.website-fallback>.icon{width:28px;height:28px;color:var(--theme-muted, #7391b9)}
.website-fallback strong{font-size:18px;color:var(--theme-ink, #27364a);overflow-wrap:anywhere}
.website-fallback p{font-size:13px;line-height:1.6;max-width:340px;margin:0 0 6px}
.website-fallback a{display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border-radius:8px;background:var(--theme-accent-surface, #edf4ff);box-shadow:inset 0 0 0 1px var(--theme-shine, #bbd0ee);color:var(--theme-accent, #285ab8);text-decoration:none;font-size:13px}
.website-fallback a .icon{width:16px;height:16px}
.website-fallback button{font-size:12px;color:var(--theme-muted, #6c7a8c);padding:5px 0}
body.dragging-link #live-wire{animation:none}
#link-ghost.excerpt-ghost{display:block;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}
#creation-dock [data-dock="agent"]{touch-action:none;cursor:grab;padding:0}
#creation-dock [data-dock="agent"]:active{cursor:grabbing}
.dock-agent-avatar{display:grid;place-items:center;width:36px;height:36px;transform-origin:center bottom}
.dock-agent-avatar img{display:block;width:100%;height:100%;object-fit:contain}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 #creation-dock:not(.agent-in-hand) [data-dock="agent"]:hover .dock-agent-avatar{animation:dock-agent-jiggle 280ms cubic-bezier(.45,0,.55,1)}
 #creation-dock [data-dock="agent"]:active .dock-agent-avatar{animation:none}
}
@keyframes dock-agent-jiggle{
 0%,100%{transform:rotate(0deg)}
 25%{transform:rotate(-5deg)}
 55%{transform:rotate(3.5deg)}
 80%{transform:rotate(-1.5deg)}
}
#creation-dock.agent-in-hand .dock-agent-avatar{visibility:hidden}
#creation-dock.agent-in-hand [data-dock="agent"] .dock-tooltip{opacity:0}
#agent-drag-preview,.agent-return-preview{position:absolute;inset:0;pointer-events:none;z-index:30}
#agent-drag-preview *,.agent-return-preview *{pointer-events:none!important}
#agent-drag-preview .card{box-shadow:0 5px 18px var(--theme-shadow, #24355020)}
#agent-drag-preview.invalid{opacity:.5}
/* Agent presence is quiet between real actions and never captures input. */
.dock-agent-avatar,.agent-avatar{color:var(--agent-color,var(--theme-muted, #5375b3))}
.agent-identity[data-running="true"] .agent-avatar > i,.agent-progress i{background:var(--agent-color,var(--theme-control, #5375b3))}


/* Context content sits inside the same padded glass frame as conversations. */
.card[data-kind]:not([data-kind=thread])>.card-main{padding:4px 6px 8px}
.card[data-kind]:not([data-kind=thread])>.media-content{padding:0}
.card[data-kind]:not([data-kind=thread])>.file-content{padding:0!important}
.card[data-kind]:not([data-kind=thread])>.media-search{padding:4px 2px}
.card[data-kind]:not([data-kind=thread])>.node-controls{padding:4px 6px 2px}
.card[data-kind=web]>.website-preview{border-radius:16px;border:1px solid var(--theme-line, #e4e7eb)}
.card[data-kind=web]>.website-perspective{padding:4px 6px 8px;border-top:0}

.agent-avatar{background:transparent;box-shadow:none}

/* Top-edge move target: generous hit area, compact visible grip. */
.card>.title-grip{position:absolute;left:50%;top:-26px;transform:translateX(-50%);z-index:12;width:112px;height:44px;margin:0;padding:0;border:0;border-radius:12px;background:transparent;box-shadow:none;backdrop-filter:none;color:var(--theme-muted, #858b94);cursor:grab;touch-action:none;user-select:none}
.card>.title-grip:hover,.card>.title-grip:active{background:transparent}
.card>.title-grip>.grip-dots{width:76px;height:28px;border:1px solid var(--theme-line, #dce0e5);border-radius:999px;background:color-mix(in srgb, var(--theme-surface, #ffffff) 85.88%, transparent);box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 2px 4px var(--theme-shadow, #25304712);backdrop-filter:blur(8px);opacity:0;transition:opacity 120ms ease-out,transform 90ms cubic-bezier(.2,.8,.2,1);pointer-events:none}
.card>.title-grip:hover>.grip-dots,.card>.title-grip:focus-visible>.grip-dots,.card.dragging>.title-grip>.grip-dots{opacity:1}
.card>.title-grip:active,.card.dragging>.title-grip{cursor:grabbing}
@media(hover:none){.card>.title-grip>.grip-dots{opacity:1}}
@media(prefers-reduced-motion:reduce){.card>.title-grip>.grip-dots{transition:none}}
@media(prefers-reduced-transparency:reduce){.card>.title-grip>.grip-dots{background:var(--theme-surface, #fff);backdrop-filter:none}}

#context-inspector{width:min(780px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--theme-line, #dce0e5);border-radius:18px;background:var(--theme-surface, #fff);box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 20px 70px var(--theme-shadow, #18243824);color:var(--theme-ink, #343840);overflow:hidden}
#context-inspector[open]{display:flex;flex-direction:column}
#context-inspector::backdrop{background:color-mix(in srgb, var(--theme-control, #202735) 18.82%, transparent);backdrop-filter:none}
.inspector-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 26px 20px;border-bottom:1px solid var(--theme-line, #eceef1)}
.inspector-header p{margin:0 0 7px;font-size:10px;letter-spacing:1px;color:var(--theme-muted, #828994)}
#context-inspector h2{margin:0;font-size:23px;font-weight:500;letter-spacing:-.7px;overflow-wrap:anywhere}
.inspector-header button{flex-shrink:0;width:30px;height:30px;padding:5px;border-radius:8px;color:var(--theme-muted, #707783)}
.inspector-body{overflow:auto;overscroll-behavior:contain;padding:0 26px 26px;min-height:0}
.inspector-intro,.inspector-help,.inspector-boundary p{font-size:12px;line-height:1.7;color:var(--theme-muted, #727984)}
.inspector-intro{margin:20px 0}
.inspector-summary{display:flex;flex-wrap:wrap;gap:20px;padding-bottom:20px;border-bottom:1px solid var(--theme-line, #eceef1);font-size:11px;color:var(--theme-muted, #737b87)}
.inspector-summary b{font-weight:500;font-size:16px;color:var(--theme-ink, #353c46);margin-right:4px}
.inspector-body h3{font-size:14px;font-weight:500;margin:24px 0 6px}
.inspector-tree,.inspector-tree ol{list-style:none;padding:0;margin:12px 0}
.inspector-tree ol{margin:12px 0 0 6px;padding-left:16px;border-left:1px solid var(--theme-accent, #dce4f3)}
.inspector-tree li{padding:8px 0}
.inspector-source-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px}
.inspector-source-row strong{font-weight:500;overflow-wrap:anywhere}
.inspector-source-row span,.inspector-meta{font-size:10px;color:var(--theme-muted, #7d8592)}
.inspector-source-row span{flex-shrink:0;max-width:50%}
.inspector-meta{margin:4px 0 0}
.inspector-input{border-top:1px solid var(--theme-line, #e8ebef);padding:16px 0 8px}
.inspector-input h4{display:flex;gap:9px;align-items:baseline;font-size:13px;font-weight:500;margin:0 0 12px;overflow-wrap:anywhere}
.inspector-input h4 span{color:var(--theme-muted, #9198a3);font-size:11px}
.inspector-input h5{font-size:11px;font-weight:500;margin:16px 0 8px}
.inspector-text{font:12px/1.8 BDO,Arial,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:14px 16px;border-radius:9px;background:var(--theme-canvas, #f6f7f9);color:var(--theme-ink, #424a56)}
.inspector-notice{font-size:12px;line-height:1.7;color:var(--theme-muted, #536887);padding:10px 0;margin:6px 0}
.inspector-boundary{border-top:1px solid var(--theme-line, #e8ebef);margin-top:18px}
#context-inspector .inspector-footer{position:static;display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;align-items:center;padding:14px 26px;border-top:1px solid var(--theme-line, #eceef1);pointer-events:auto;color:var(--theme-muted, #59616e);font-size:11px;flex-shrink:0}
#context-inspector .inspector-footer label{display:flex;align-items:center;gap:7px;font-size:11px;margin:0}
#context-inspector .inspector-footer input{width:auto;margin:0;accent-color:var(--theme-accent, #4879f5)}
#context-inspector .inspector-footer button{font-size:11px;padding:7px 9px;border-radius:7px}
@media(max-width:600px){.inspector-header{padding:18px}.inspector-body{padding:0 18px 18px}#context-inspector .inspector-footer{padding:12px 18px}.inspector-summary{gap:12px}}

/* A glanceable stack: inherited nodes feed down into the selected item. */
#context-inspector{width:min(440px,calc(100vw - 28px));max-height:min(680px,calc(100dvh - 40px));border-radius:16px}
#context-inspector .inspector-header{padding:16px 18px 12px;align-items:center}
#context-inspector h2{font-size:16px;letter-spacing:-.3px}
#context-inspector .inspector-header p{font-size:11px;letter-spacing:0;margin:4px 0 0;color:var(--theme-muted, #838995)}
#context-inspector .inspector-body{padding:14px 18px 18px;background:var(--theme-canvas, #f8f9fa)}
#context-inspector .inspector-tree,#context-inspector .inspector-tree ol{list-style:none;padding:0;margin:0;border:0}
#context-inspector .inspector-tree li{padding:0}
#context-inspector .inspector-upstream{display:grid;gap:10px;padding:0 10px}
#context-inspector .inspector-flow{text-align:center;color:var(--theme-accent, #7295df);height:25px;line-height:25px;font-size:17px}
#context-inspector .inspector-node{padding:12px 14px;border:1px solid var(--theme-line, #dfe3e9);border-radius:12px;background:var(--theme-surface, #fff);box-shadow:inset 0 1px 0 var(--theme-shine, #fff),0 2px 4px var(--theme-shadow, #18243806)}
#context-inspector .inspector-selected{border-color:var(--theme-accent, #b5c8ef);box-shadow:0 0 0 2px var(--theme-shadow, #4879f508),0 2px 5px var(--theme-shadow, #18243808)}
.inspector-node-heading{display:flex;align-items:center;gap:7px;font-size:12px}
.inspector-node-heading>.icon{width:16px;height:16px;color:var(--theme-muted, #7b879a)}
.inspector-node-heading strong{font-weight:500;flex:1;min-width:0;overflow-wrap:anywhere}
.inspector-node-heading>span{font-size:9px;color:var(--theme-muted, #7e8aa0);flex-shrink:0}
.inspector-node-description{font-size:11px;line-height:1.6;color:var(--theme-muted, #747d8b);margin:7px 0 0}
.inspector-snippet{font-size:12px;line-height:1.6;color:var(--theme-ink, #424b59);margin:9px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap}
#context-inspector details{margin:9px 0 0;padding:0;border:0;font-size:10px}
#context-inspector summary{color:var(--theme-muted, #637ca4);width:fit-content}
#context-inspector details[open] .inspector-text{margin-top:9px;padding:10px;font-size:11px}
.inspector-snapshot-status{font-size:10px;color:var(--theme-muted, #8d7957);margin:9px 0 0}
.inspector-excluded{opacity:.65}
#context-inspector .inspector-footer{padding:10px 14px;gap:6px}
#context-inspector .inspector-footer label,#context-inspector .inspector-footer button{font-size:10px}

/* Human cursor presence sits in canvas coordinates and never intercepts input. */
.human-cursors{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:9}
.human-cursor{position:absolute;left:0;top:0;pointer-events:none}
.human-cursor svg{display:block;filter:drop-shadow(0 1px 1px #0002)}
.human-cursor span{position:absolute;left:17px;top:22px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 7px;border-radius:5px;background:var(--theme-surface,#fff);border:1px solid currentColor;font-size:11px;line-height:17px;box-shadow:0 1px 3px #0001}
body.account-mode .human-cursors,body.shared-starting .human-cursors{display:none}

/* Account-backed model choice stays on each composer. */
.model-popover{width:224px}
.model-options{max-height:240px;overflow-y:auto;overscroll-behavior:contain}
.model-account{display:block;width:100%;margin-top:8px;padding:6px 4px;border:0;background:none;color:var(--theme-muted,#68707b);font:inherit;font-size:11px;text-align:left;cursor:pointer}
.model-account:focus-visible{outline:2px solid var(--theme-accent,#4879f5);outline-offset:2px}
.model-slider-row[hidden]{display:none}
/* GitHub cards: server-fetched files, issues and pull requests. */
.github-content{padding:14px 16px 10px;display:flex;flex-direction:column;gap:8px;min-width:0}
.gh-head{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--theme-muted, #777d85);min-width:0}
.gh-head .icon{width:16px;height:16px;flex-shrink:0;color:var(--theme-ink, #373940)}
.gh-repo{font-weight:500;color:var(--theme-ink, #373940);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-kind{white-space:nowrap}
.gh-state{margin-left:auto;padding:2px 8px;border-radius:999px;font-size:11px;text-transform:capitalize;border:1px solid var(--theme-line, #dcdfe3);color:var(--theme-muted, #6a7079)}
.gh-state[data-state=open]{color:#1f7a3d;border-color:#1f7a3d55}.gh-state[data-state=merged]{color:#7146b8;border-color:#7146b855}.gh-state[data-state=closed]{color:#a23b3b;border-color:#a23b3b55}
.gh-meta{font-size:12px;color:var(--theme-muted, #777d85);line-height:1.5}
.gh-label{display:inline-block;padding:0 6px;border-radius:6px;background:var(--theme-raised, #f0f2f5);font-size:11px}
.gh-add{color:#1f7a3d}.gh-del{color:#a23b3b}
.gh-code{margin:0;max-height:340px;overflow:auto;padding:10px 12px;border-radius:10px;background:var(--theme-canvas, #f8f9fb);border:1px solid var(--theme-line, #e3e5e8);font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre;tab-size:2}
.gh-body{max-height:340px;overflow:auto;font-size:13px;line-height:1.65}
.gh-body pre{white-space:pre;overflow-x:auto;font-size:11px}
.gh-note{margin:0;font-size:11px;color:var(--theme-muted, #858b93)}
.gh-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:var(--theme-muted, #858b93)}
.gh-actions{display:flex;align-items:center;gap:4px}
.gh-actions a,.gh-actions button{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:8px;font:inherit;color:var(--theme-ink, #4a4f57);background:none;border:0;cursor:pointer;text-decoration:none}
.gh-actions .icon{width:13px;height:13px}
.gh-actions a:hover,.gh-actions button:hover{background:var(--theme-raised, #f0f2f5)}
.gh-actions button:disabled{opacity:.5;cursor:default}
/* Repository cards */
.github-repo .gh-desc{margin:0;font-size:13px;line-height:1.55;color:var(--theme-ink, #4a4f57)}
.gh-meta .icon{width:13px;height:13px;vertical-align:-2px;margin-right:4px}
.gh-scope{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px}
.gh-scope-label{color:var(--theme-muted, #858b93);margin-right:2px}
.gh-scope-chip{padding:2px 8px;border-radius:999px;background:var(--theme-raised, #f0f2f5);color:var(--theme-ink, #373940);font:11px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace}
.gh-scope-chip.gh-scope-all{font-family:inherit;font-size:12px}
.gh-scope-edit,.gh-scope-actions button{font:inherit;font-size:12px;padding:4px 9px;border-radius:8px;border:1px solid var(--theme-line, #dcdfe3);background:var(--theme-surface, #fff);color:var(--theme-ink, #373940);cursor:pointer}
.gh-scope-edit{margin-left:auto}
.gh-scope-editor{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid var(--theme-line, #e3e5e8);border-radius:10px;background:var(--theme-canvas, #f8f9fb)}
.gh-scope-editor p{margin:0;font-size:12px;line-height:1.5;color:var(--theme-muted, #6a7079)}
.gh-scope-options{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:2px 8px;max-height:150px;overflow:auto}
.gh-scope-options label{display:flex;align-items:center;gap:6px;padding:3px 2px;font:12px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer;min-width:0}
.gh-scope-options label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-scope-editor input[name=custom]{font:12px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;padding:7px 9px;border-radius:8px;border:1px solid var(--theme-line, #dcdfe3);background:var(--theme-surface, #fff);color:inherit}
.gh-scope-actions{display:flex;justify-content:flex-end;gap:6px}
.gh-scope-actions .gh-scope-save{background:var(--theme-control, #373a40);color:var(--theme-on-control, #fff);border-color:transparent}
.gh-scope-actions button:disabled{opacity:.55;cursor:default}
.gh-scope-error{color:var(--theme-danger, #b33c3c)!important}
.gh-readme summary,.gh-reads summary{cursor:pointer;font-size:12px;color:var(--theme-muted, #6a7079);display:flex;align-items:center;gap:6px;list-style:none}
.gh-readme summary::-webkit-details-marker,.gh-reads summary::-webkit-details-marker{display:none}
.gh-readme[open] .gh-body{margin-top:8px}
.gh-reads{margin-top:8px}.gh-reads summary .icon{width:13px;height:13px}
.gh-reads ul{margin:6px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:3px}
.gh-reads li{display:flex;gap:8px;align-items:baseline;font-size:12px;min-width:0}
.gh-reads a{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--theme-ink, #373940);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-reads li span{color:var(--theme-muted, #858b93);font-size:11px;white-space:nowrap}
html body #cards .gh-scope-options input[type=checkbox]{width:14px;height:14px;min-width:14px;flex:none;margin:0;padding:0;display:inline-block}
html body #cards .gh-scope-options label span{flex:1 1 auto;min-width:0}
