#canvasView { color:var(--v2-ink); min-width:0; }
#canvasView * { box-sizing:border-box; letter-spacing:0; }
#canvasView [hidden],#canvasNav[hidden] { display:none!important; }
#canvasView button,#canvasView input,#canvasView select,#canvasView textarea { font:inherit; color:inherit; }
#canvasView button { cursor:pointer; border:1px solid var(--v2-line); border-radius:6px; background:var(--v2-surface); }
#canvasView button:hover { background:var(--v2-surface-muted); }
#canvasView button:disabled { opacity:.5; cursor:default; }
#canvasView button:focus-visible,#canvasView input:focus-visible,#canvasView textarea:focus-visible { outline:2px solid var(--v2-primary); outline-offset:2px; }
#canvasView svg { width:17px; height:17px; flex-shrink:0; }
.cv-toolbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
#canvasView .cv-project-select { max-width:230px; min-width:120px; height:34px; border:1px solid var(--v2-line); border-radius:6px; background:var(--v2-surface); padding:0 8px; }
#canvasView .cv-title { width:190px; min-width:0; height:34px; padding:0 8px; border:1px solid transparent; border-radius:4px; background:transparent; }
#canvasView .cv-title:hover,#canvasView .cv-title:focus { border-color:var(--v2-line); }
#canvasView .cv-icon { width:34px; height:34px; padding:0; display:inline-grid; place-items:center; flex-shrink:0; }
.cv-save-status { font-size:12px; color:var(--v2-muted); margin-left:auto; }
.cv-stage { position:relative; height:calc(100dvh - 210px); min-height:560px; overflow:clip; border:1px solid var(--v2-line); border-radius:8px; background-color:var(--v2-bg); background-image:radial-gradient(var(--v2-line-strong) .8px,transparent .8px); background-size:22px 22px; touch-action:none; }
.cv-stage.cv-panning { cursor:grabbing; }
#canvasView .cv-stage { background-color:var(--cv-background,var(--v2-bg)); background-image:var(--cv-grid-image,radial-gradient(var(--cv-grid-color,var(--v2-line-strong)) .8px,transparent .8px)); }
.cv-background-panel { position:absolute; z-index:21; width:280px; max-width:calc(100% - 16px); padding:12px; border:1px solid var(--v2-line-strong); border-radius:8px; background:var(--v2-surface); box-shadow:0 10px 30px #00000025; }
.cv-background-panel header,.cv-background-panel footer { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; }
.cv-background-panel header { height:auto; margin:0; border:0; }
.cv-background-swatches { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:12px 0; }
#canvasView .cv-background-swatches button { height:32px; background:var(--swatch); border:1px solid var(--v2-line-strong); }
#canvasView .cv-background-swatches button[aria-pressed=true] { background:var(--swatch); outline:2px solid var(--v2-primary); outline-offset:2px; }
.cv-background-custom { display:flex; gap:8px; margin-bottom:12px; }
#canvasView .cv-background-custom input { height:34px; min-width:0; border:1px solid var(--v2-line-strong); border-radius:4px; background:var(--v2-surface); }
.cv-background-custom input[type=color] { width:42px; padding:3px; cursor:pointer; }
.cv-background-custom input[type=text] { flex:1; width:0; padding:0 8px; }
.cv-background-panel footer button { padding:5px 8px; }
.cv-background-panel footer span { font-size:12px; color:var(--v2-muted); }
.cv-background-grid { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 12px; font-size:13px; cursor:pointer; }
#canvasView .cv-background-grid input { appearance:none; width:32px; height:18px; flex-shrink:0; padding:2px; margin:0; border:1px solid var(--v2-line-strong); border-radius:9px; background:var(--v2-line); cursor:pointer; }
.cv-background-grid input:before { content:''; display:block; width:12px; height:12px; border-radius:50%; background:var(--v2-surface); transition:transform .15s; }
#canvasView .cv-background-grid input:checked { background:var(--v2-primary); border-color:var(--v2-primary); }
.cv-background-grid input:checked:before { transform:translateX(14px); }
.cv-world { position:absolute; inset:0; transform-origin:0 0; }
#canvasView .cv-node { position:absolute; width:240px; padding:0; overflow:visible; text-align:left; background:var(--v2-surface); border:1px solid var(--v2-line-strong); border-radius:8px; box-shadow:0 5px 18px #0000000c; user-select:none; }
#canvasView .cv-node[aria-pressed=true] { border-color:var(--v2-primary); box-shadow:0 0 0 1px var(--v2-primary); }
.cv-node-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--v2-line); font-size:13px; min-height:40px; }
.cv-node-head b { font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cv-node-head small { font-size:11px; color:var(--v2-muted); margin-left:auto; white-space:nowrap; }
.cv-node-body { position:relative; height:var(--cv-body-height,136px); padding:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; font-size:12px; color:var(--v2-muted); overflow:hidden; }
.cv-node-body p { margin:0; width:100%; overflow:hidden; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
#canvasView .cv-node-body:has(.cv-node-text) { align-items:stretch; justify-content:flex-start; }
#canvasView .cv-node-text { display:block; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; -webkit-line-clamp:unset; user-select:text; -webkit-user-select:text; cursor:text; padding-right:4px; scrollbar-width:thin; }
#canvasView .cv-node-body:has(.cv-node-preview) .cv-node-text { padding-right:36px; }
#canvasView .cv-node:has(.cv-node-text) .cv-resize { display:block; width:16px; height:16px; }
.cv-node-body img { width:100%; height:100%; object-fit:contain; }
.cv-node-body:has(img) { padding:5px; }
.cv-node-foot { height:32px; padding:4px 8px; font-size:11px; line-height:1.5; color:var(--v2-muted); border-top:1px solid var(--v2-line); display:flex; align-items:center; gap:5px; }
.cv-node-foot>span:first-child { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; flex:1; min-width:0; }
.cv-result-pager { display:flex; align-items:center; gap:3px; flex-shrink:0; }
#canvasView .cv-result-pager button { width:22px; height:22px; display:grid; place-items:center; padding:0; border:0; }
#canvasView .cv-node-preview { position:absolute; right:8px; top:8px; width:30px; height:30px; display:grid; place-items:center; padding:0; z-index:1; }
.cv-inline-video { position:absolute; inset:0; overflow:hidden; background:#151719; }
.cv-inline-video video,.cv-inline-video .cv-video-poster { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; pointer-events:none; }
.cv-inline-video video { visibility:hidden; }
.cv-inline-video.cv-video-started video { visibility:visible; }
.cv-inline-video.cv-video-started .cv-video-poster { visibility:hidden; }
#canvasView .cv-video-toggle { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:44px; height:44px; padding:0; display:grid; place-items:center; border-radius:50%; border:1px solid #ffffff85; background:#111111b8; color:#fff; z-index:1; }
#canvasView .cv-video-toggle:hover { background:#111111e6; }
.cv-video-toggle span { display:grid; place-items:center; }
#canvasView .cv-video-toggle svg { width:22px; height:22px; }
#canvasView .cv-video-toggle .cv-video-pause { display:none; }
#canvasView .cv-video-playing .cv-video-toggle { opacity:0; }
#canvasView .cv-video-playing:hover .cv-video-toggle,#canvasView .cv-video-toggle:focus-visible { opacity:1; }
#canvasView .cv-video-playing .cv-video-play { display:none; }
#canvasView .cv-video-playing .cv-video-pause { display:grid; }
.cv-video-controls { position:absolute; left:0; right:0; bottom:0; padding:6px 9px; display:flex; align-items:center; gap:8px; background:#111111d9; color:#fff; z-index:1; }
.cv-video-time { flex-shrink:0; font-size:11px; font-variant-numeric:tabular-nums; line-height:20px; white-space:nowrap; }
#canvasView [data-cv-video-seek] { min-width:0; width:0; flex:1; height:20px; padding:0; margin:0; accent-color:#4edce4; cursor:pointer; touch-action:none; }
.cv-video-error { position:absolute; left:6px; right:6px; bottom:38px; padding:4px; text-align:center; background:#111111dd; color:#fff; font-size:11px; pointer-events:none; }
.cv-video-loading .cv-video-toggle { opacity:.65; cursor:progress; }
.cv-port { position:absolute; top:50%; transform:translateY(-50%); width:26px; height:30px; cursor:crosshair; z-index:2; }
.cv-port:after { content:''; position:absolute; top:9px; left:7px; width:12px; height:12px; border-radius:50%; border:2px solid var(--v2-surface); background:var(--v2-primary); box-shadow:0 0 0 1px var(--v2-primary); }
.cv-port:hover:after { transform:scale(1.3); }
.cv-port-in { left:-14px; }.cv-port-out { right:-14px; }
#canvasView .cv-link-target { outline:3px solid var(--v2-primary); outline-offset:4px; }
.cv-wire-preview { background:var(--v2-primary)!important; z-index:1; }
.cv-wire { position:absolute; height:2px; background:var(--v2-line-strong); transform-origin:left center; pointer-events:none; }
.cv-rail { position:absolute; top:14px; left:12px; padding:5px; display:grid; gap:5px; background:var(--v2-surface); border:1px solid var(--v2-line); border-radius:8px; z-index:3; }
#canvasView .cv-rail button,#canvasView .cv-zoom button { border-color:transparent; background:transparent; }
.cv-zoom { position:absolute; bottom:12px; left:12px; padding:4px; display:flex; align-items:center; background:var(--v2-surface); border:1px solid var(--v2-line); border-radius:8px; z-index:3; }
.cv-zoom output { width:43px; text-align:center; font-size:12px; }
.cv-stage-status { position:absolute; right:12px; bottom:15px; max-width:45%; font-size:12px; line-height:1.5; color:var(--v2-muted); text-align:right; pointer-events:none; }
.cv-editor { position:absolute; z-index:4; width:650px; max-width:calc(100% - 24px); border:1px solid var(--v2-line-strong); border-radius:8px; background:var(--v2-surface); box-shadow:0 12px 38px #00000024; touch-action:auto; }
.cv-editor-head { display:flex; gap:8px; align-items:center; padding:5px 8px 5px 14px; border-bottom:1px solid var(--v2-line); font-size:12px; color:var(--v2-muted); }
.cv-editor-actions { margin-left:auto; display:flex; gap:4px; }
#canvasView .cv-editor-actions button { border:0; width:28px; height:28px; }
.cv-compose { display:flex; align-items:flex-start; padding:12px 14px 5px; gap:10px; }
#canvasView .cv-reference { width:42px; height:42px; background:var(--v2-surface-soft); }
#canvasView .cv-prompt { min-width:0; width:100%; height:90px; min-height:90px; resize:vertical; max-height:200px; border:0; background:transparent; font-size:14px; line-height:1.65; padding:2px; }
.cv-controls { position:relative; display:flex; gap:4px; align-items:center; flex-wrap:wrap; padding:7px 10px 10px; }
#canvasView .cv-setting { display:flex; gap:6px; align-items:center; min-height:32px; padding:5px 8px; border-color:transparent; font-size:12px; max-width:100%; }
#canvasView .cv-setting span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#canvasView .cv-setting svg { width:13px; height:13px; }
.cv-price { font-size:11px; color:var(--v2-muted); margin-left:auto; max-width:230px; line-height:1.5; }
#canvasView .cv-generate { width:34px; height:34px; background:var(--v2-primary); color:var(--v2-surface); border:0; border-radius:50%; display:grid; place-items:center; }
.cv-pop { position:absolute; z-index:6; bottom:53px; left:12px; width:calc(100% - 24px); max-width:490px; padding:14px; border:1px solid var(--v2-line-strong); border-radius:8px; background:var(--v2-surface); box-shadow:0 10px 32px #00000024; max-height:min(400px,50dvh); overflow:auto; }
.cv-pop fieldset { border:0; margin:0 0 12px; padding:0; min-width:0; }
.cv-pop legend { margin-bottom:7px; font-size:12px; color:var(--v2-muted); }
.cv-options { display:flex; flex-wrap:wrap; gap:5px; }
#canvasView .cv-options button { min-height:32px; min-width:45px; padding:4px 8px; font-size:12px; }
#canvasView .cv-options button[aria-pressed=true] { border-color:var(--v2-primary); background:var(--v2-primary-soft); color:var(--v2-primary); }
.cv-duration { display:flex; align-items:center; gap:12px; }
.cv-duration input { flex:1; min-width:0; accent-color:var(--v2-primary); }.cv-duration output { min-width:40px; font-size:13px; }
.cv-duration-track { flex:1; min-width:0; padding:0 8px 20px; }
#canvasView .cv-duration-track input { width:100%; padding:0; margin:0; height:24px; border:0; background:transparent; box-shadow:none; }
.cv-duration-ticks { position:relative; margin:0 7px; color:var(--v2-muted); font-size:10px; }
.cv-duration-ticks span { position:absolute; transform:translateX(-50%); top:3px; }
.cv-duration-value { display:flex; align-items:center; gap:4px; width:84px; flex-shrink:0; padding:0 9px; border:1px solid var(--v2-line); border-radius:6px; background:var(--v2-surface-muted); }
#canvasView .cv-duration-value input { width:42px; height:34px; padding:0; border:0; background:transparent; appearance:textfield; -moz-appearance:textfield; box-shadow:none; }
.cv-duration-value input::-webkit-inner-spin-button,.cv-duration-value input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.cv-duration-value span { font-size:12px; color:var(--v2-muted); }
.cv-reference-menu { display:grid; gap:3px; }
#canvasView .cv-reference-menu button { display:flex; align-items:center; gap:10px; padding:10px; text-align:left; border:0; background:transparent; }
#canvasView .cv-reference-menu button:hover { background:var(--v2-surface-muted); }
.cv-source-list { display:grid; gap:5px; }.cv-source-list label { display:flex; gap:8px; align-items:center; font-size:12px; padding:6px; overflow-wrap:anywhere; }
.cv-source-list input { accent-color:var(--v2-primary); }.cv-pop-title { display:flex; gap:6px; align-items:center; margin-bottom:10px; font-size:13px; }
#canvasView .cv-pop-title button { padding:5px 9px; display:flex; align-items:center; gap:5px; margin-left:auto; font-size:12px; }
.cv-result-actions { display:flex; flex-wrap:wrap; gap:8px; padding:12px; }
#canvasView .cv-result-actions button { display:flex; align-items:center; gap:6px; padding:7px 10px; font-size:12px; }
.cv-asset-picker { width:min(720px,calc(100% - 24px)); color:var(--v2-ink); background:var(--v2-surface); border:1px solid var(--v2-line); border-radius:8px; padding:18px; }
.cv-asset-picker header { height:auto; display:flex; align-items:center; justify-content:space-between; margin:0 0 14px; border:0; }.cv-asset-picker h3 { font-size:16px; margin:0; }
.cv-asset-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:8px; max-height:60dvh; overflow:auto; }
.cv-asset-grid button { border:1px solid var(--v2-line); background:var(--v2-surface-soft); color:var(--v2-ink); border-radius:6px; padding:8px; display:grid; gap:6px; min-width:0; text-align:left; cursor:pointer; }
.cv-asset-grid button img { height:80px; width:100%; object-fit:contain; }.cv-asset-grid button span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
@media(max-width:700px) { .cv-stage { height:calc(100dvh - 230px); min-height:600px; }.cv-toolbar { gap:5px; }.cv-save-status { width:100%; margin-left:0; }#canvasView .cv-title { width:130px; }#canvasView .cv-project-select { max-width:140px; }.cv-rail { left:7px; top:8px; }.cv-compose { padding:10px 10px 4px; }#canvasView .cv-prompt { font-size:16px; height:95px; }.cv-controls { gap:2px; }#canvasView .cv-setting { padding:5px; }.cv-price { max-width:180px; }.cv-pop { padding:12px; }.cv-stage-status { font-size:11px; max-width:40%; } }

/* The canvas occupies the viewport; shared model and result dialogs stay native. */
#canvasView.cv-active { position:fixed; inset:0; z-index:40; background:var(--v2-bg); animation:none; }
html:has(#canvasView.cv-active:not([hidden])),body:has(#canvasView.cv-active:not([hidden])) { overflow:hidden!important; }
#appView:has(#canvasView.cv-active:not([hidden])) { transform:none!important; filter:none!important; animation:none!important; }
#canvasView { --v2-bg:#f4f5f7; --v2-surface:#ffffff; --v2-surface-muted:#e9ecf0; --v2-surface-soft:#f6f7f9; --v2-line:#dce1e6; --v2-line-strong:#c5ccd4; --v2-ink:#20272e; --v2-muted:#65717d; }
.theme-dark #canvasView { --v2-bg:#141517; --v2-surface:#242628; --v2-surface-muted:#2c2e31; --v2-surface-soft:#202224; --v2-line:#373a3e; --v2-line-strong:#53585e; --v2-ink:#f0f2f5; --v2-muted:#a1a8b1; }
#canvasView .cv-toolbar { position:absolute; inset:0 0 auto; height:64px; margin:0; padding:12px 18px; gap:9px; flex-wrap:nowrap; background:var(--v2-bg); z-index:8; border-bottom:1px solid var(--v2-line); }
.cv-logo { width:26px; height:26px; object-fit:contain; }
#canvasView .cv-project-select { width:26px; min-width:26px; max-width:26px; padding:0; font-size:0; border:0; background:transparent; }
#canvasView .cv-project-select option { font-size:13px; }
#canvasView .cv-title { width:180px; }
#canvasView .cv-node-count { border:0; background:transparent; font-size:12px; white-space:nowrap; padding:6px; color:var(--v2-muted); }
.cv-top-actions { display:flex; gap:4px; margin-left:auto; }
#canvasView .cv-top-actions>.cv-icon { background:transparent; border-color:transparent; }
.cv-save-status { margin-left:0; white-space:nowrap; }
#canvasView .cv-stage { position:absolute; inset:64px 0 0; height:auto; min-height:0; border:0; border-radius:0; }
#canvasView .cv-file-over { outline:3px solid var(--v2-primary); outline-offset:-8px; }
#canvasView .cv-world { inset:0 auto auto 0; width:100%; height:100%; pointer-events:none; }
#canvasView .cv-node { pointer-events:auto; isolation:isolate; border-radius:6px; box-shadow:0 2px 8px #00000012; cursor:grab; }
#canvasView .cv-node img { -webkit-user-drag:none; user-select:none; }
#canvasView .cv-dragging-node,#canvasView .cv-dragging-node .cv-node,#canvasView .cv-dragging-node .cv-node * { cursor:grabbing; }
.cv-alignment-guides { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:2; }
.cv-alignment-guides span { position:absolute; pointer-events:none; }
.cv-align-horizontal { height:0; border-top:1px dashed #00a8c6; }
.cv-align-vertical { width:0; border-left:1px dashed #00a8c6; }
.cv-text-preview { width:min(900px,calc(100% - 24px)); }
.cv-text-preview pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:14px; line-height:1.8; max-height:70dvh; overflow:auto; user-select:text; }
.theme-dark .cv-align-horizontal,.theme-dark .cv-align-vertical { border-color:#36d5ef; }
#canvasView .cv-node-head { position:absolute; left:0; right:0; bottom:calc(100% + 5px); padding:0; gap:5px; border:0; min-height:34px; height:34px; color:var(--v2-ink); font-size:15px; }
.cv-node-heading { min-width:0; flex:1; display:flex; align-items:center; gap:6px; height:34px; padding:5px 8px; border:1px solid var(--v2-line); border-radius:5px; background:var(--v2-surface); box-shadow:0 1px 4px #00000008; }
#canvasView .cv-node-heading b { font-weight:600; }
.cv-node-heading svg { flex-shrink:0; width:16px; height:16px; }
#canvasView .cv-node-label { display:flex; justify-content:center; align-items:center; flex-shrink:0; gap:0; min-width:30px; height:30px; padding:4px; border:1px solid var(--v2-line); border-radius:5px; background:var(--v2-surface); color:var(--v2-muted); cursor:pointer; }
#canvasView .cv-node-label svg { width:16px; height:16px; }
.cv-color-dot { display:block; flex-shrink:0; width:16px; height:16px; border-radius:50%; background:var(--cv-label-color); box-shadow:inset 0 0 0 1px #00000012; }
.cv-node-label .cv-color-dot+.cv-color-dot { margin-left:-6px; }
.cv-label-pop,.cv-color-panel { position:absolute; z-index:20; width:280px; max-width:calc(100% - 16px); padding:8px; border:1px solid var(--v2-line-strong); border-radius:8px; background:var(--v2-surface); color:var(--v2-ink); box-shadow:0 10px 30px #00000025; }
.cv-label-caption { font-size:12px; color:var(--v2-muted); margin-bottom:8px; }
.cv-label-swatches { display:flex; justify-content:space-between; gap:6px; }
#canvasView .cv-label-swatches button { position:relative; display:grid; place-items:center; width:36px; height:36px; padding:4px; border:1px solid transparent; border-radius:6px; background:var(--v2-surface-soft); }
#canvasView .cv-label-swatches button[aria-pressed=true] { border-color:var(--v2-line-strong); background:var(--v2-surface-muted); }
.cv-label-swatches .cv-color-dot { width:24px; height:24px; }
.cv-label-swatches svg { position:absolute; width:14px; height:14px; color:#fff; stroke-width:3; pointer-events:none; }
.cv-label-swatches [data-cv-label-color="yellow"] svg { color:#343434; }
#canvasView .cv-label-swatches [data-cv-label-color="clear"] svg { width:24px; height:24px; color:var(--v2-muted); stroke-width:2; }
#canvasView .cv-label-tags { width:100%; min-width:0; height:32px; padding:5px 7px; border:1px solid var(--v2-line); border-radius:4px; font-size:12px; background:var(--v2-surface-soft); color:var(--v2-ink); }
.cv-color-nav { display:flex; align-items:center; gap:2px; border-right:1px solid var(--v2-line); padding-right:5px; margin-right:2px; }
#canvasView .cv-color-nav button { display:grid; place-items:center; width:30px; height:30px; padding:5px; border:0; border-radius:5px; background:transparent; color:var(--v2-muted); }
.cv-color-nav .cv-color-dot { width:18px; height:18px; }
#canvasView .cv-color-nav button:hover { background:var(--v2-surface-muted); }
.cv-color-panel { width:320px; padding:8px; max-height:calc(100dvh - 110px); display:flex; flex-direction:column; }
.cv-color-panel header { display:flex; align-items:center; justify-content:space-between; gap:8px; height:36px; min-height:36px; margin:0; padding:0 4px; border:0; }
.cv-color-panel header strong { font-size:14px; }
#canvasView .cv-color-panel header button { width:28px; height:28px; padding:4px; border:0; }
.cv-color-tabs { display:flex; gap:6px; padding:4px 4px 8px; }
#canvasView .cv-color-tabs button { display:flex; align-items:center; gap:6px; padding:5px 8px; height:30px; font-size:12px; border:1px solid var(--v2-line); border-radius:5px; }
.cv-color-nodes { overflow:auto; min-height:0; }
#canvasView .cv-color-nodes>button { display:flex; align-items:center; gap:10px; width:100%; padding:8px; border:0; border-radius:5px; background:transparent; text-align:left; }
#canvasView .cv-color-nodes>button:hover { background:var(--v2-surface-muted); }
.cv-color-thumb { width:44px; height:44px; display:grid; place-items:center; flex-shrink:0; border:1px solid var(--v2-line); border-radius:5px; background:var(--v2-surface-muted); overflow:hidden; }
.cv-color-thumb img { width:100%; height:100%; object-fit:cover; }
.cv-color-node-info { display:grid; flex:1; min-width:0; gap:4px; }
.cv-color-node-info strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:500; }
.cv-color-node-info small { font-size:11px; color:var(--v2-muted); }
.cv-color-nodes>button>svg { width:16px; height:16px; flex-shrink:0; color:var(--v2-muted); }
#canvasView .cv-node[aria-pressed=true] .cv-node-head { color:var(--v2-ink); }
#canvasView .cv-node-head small { max-width:50%; overflow:hidden; text-overflow:ellipsis; }
#canvasView .cv-node-body { border-radius:5px; background:var(--v2-surface-muted); height:var(--cv-body-height); }
#canvasView .cv-node-body:has(img) { padding:0; }
#canvasView .cv-node-body img { border-radius:5px 5px 0 0; }
#canvasView .cv-node-foot { border:0; height:32px; }
#canvasView .cv-node-body>svg { width:22px; height:22px; opacity:.6; }
.cv-port { height:36px; width:28px; }
.cv-port:after { top:11px; left:7px; width:13px; height:13px; background:var(--v2-surface); border:1px solid var(--v2-line-strong); box-shadow:none; }
.cv-port:hover:after,.cv-node[aria-pressed=true] .cv-port:after { background:var(--v2-primary-soft); border-color:var(--v2-primary); }
.cv-port:before { content:'+'; position:absolute; z-index:1; left:10px; top:7px; font-size:12px; color:var(--v2-muted); }
.cv-wire { overflow:visible; background:none; height:auto; pointer-events:none; transform:none; }
#canvasView svg.cv-wire { position:absolute; flex-shrink:0; }
.cv-wire path { fill:none; stroke:var(--v2-primary); stroke-width:2; opacity:.6; vector-effect:non-scaling-stroke; }
.cv-edge path { pointer-events:stroke; cursor:pointer; stroke-width:3; }
.cv-edge:hover path,.cv-edge-selected path { opacity:1; stroke-width:4; }
.cv-wire-preview { background:none!important; }
.cv-wire-preview path { stroke-dasharray:5 4; opacity:1; }
.cv-edge .cv-wire-flow { display:none; pointer-events:none; stroke:#fff; stroke-width:2.5; stroke-linecap:round; stroke-dasharray:14 22; opacity:1; animation:none; }
.cv-edge.cv-edge-active .cv-wire-base { stroke:var(--v2-primary); stroke-width:5; opacity:1; }
.cv-edge.cv-edge-active .cv-wire-flow { display:block; animation:cv-wire-flow .8s linear infinite; }
html.theme-dark .cv-edge.cv-edge-active .cv-wire-base { stroke:#168897; }
html.theme-dark .cv-edge .cv-wire-flow { stroke:#c8fbff; }
#canvasView .cv-edge .cv-wire-hit { pointer-events:stroke; stroke:transparent; stroke-width:16; opacity:1; }
.cv-edge:hover .cv-wire-base,.cv-edge-selected .cv-wire-base { opacity:1; stroke-width:4; }
@keyframes cv-wire-flow { to { stroke-dashoffset:-36; } }
@media(prefers-reduced-motion:reduce){.cv-edge.cv-edge-active .cv-wire-flow { animation:none; }}
.cv-edge-tools { position:absolute; z-index:5; padding:3px; border:1px solid var(--v2-line-strong); border-radius:6px; background:var(--v2-surface); box-shadow:0 3px 12px #00000025; }
#canvasView .cv-edge-tools button { color:var(--v2-danger,#d64755); border:0; width:30px; height:30px; }
.cv-edges-hidden .cv-edge { display:none; }
.cv-rail { top:50%; transform:translateY(-50%); left:16px; gap:9px; padding:8px 6px; box-shadow:0 4px 18px #00000010; }
#canvasView .cv-rail button { width:36px; height:36px; }
#canvasView .cv-rail button svg { width:20px; height:20px; }
.cv-zoom { bottom:16px; left:16px; box-shadow:0 4px 18px #00000010; }
#canvasView .cv-zoom-value { border:0; background:none; padding:0; }
#canvasView button[aria-pressed=true] { color:var(--v2-primary); background:var(--v2-primary-soft); }
.cv-hand { cursor:grab; }.cv-hand .cv-node { cursor:grab; }
.cv-stage.cv-panning,.cv-stage.cv-panning .cv-node { cursor:grabbing; }
.cv-editor { width:680px; border-radius:8px; box-shadow:0 10px 40px #00000024; }
#canvasView .cv-editor[data-node-kind="text"] { width:820px; }
#canvasView .cv-editor[data-node-kind="text"] .cv-price { min-width:0; max-width:calc(100% - 44px); flex-shrink:0; white-space:nowrap; overflow-x:auto; }
.cv-editor-head { border-bottom:0; padding:5px 8px 0 14px; }
#canvasView .cv-node-title { font-size:12px; border:0; background:transparent; min-width:0; flex:1; height:28px; outline-offset:0; }
.cv-compose { padding:8px 14px; }
#canvasView [data-cv-action="mentions"] { width:30px; height:30px; border:0; align-self:center; margin-right:24px; }
.cv-mention-list { display:grid; gap:3px; max-height:240px; overflow:auto; }
#canvasView .cv-mention-list button { display:flex; align-items:center; gap:10px; padding:7px; border:1px solid transparent; text-align:left; min-height:52px; }
#canvasView .cv-mention-list button[aria-selected=true] { background:var(--v2-primary-soft); border-color:var(--v2-primary); }
.cv-mention-thumb { display:grid; place-items:center; width:40px; height:40px; flex-shrink:0; background:var(--v2-surface-muted); border-radius:4px; overflow:hidden; }
.cv-mention-thumb img { width:100%; height:100%; object-fit:cover; }
.cv-mention-list button>span:last-child { min-width:0; display:grid; gap:4px; }
.cv-mention-list strong,.cv-mention-list small { font-size:12px; font-weight:400; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.cv-mention-list small { color:var(--v2-muted); font-size:11px; }
#canvasView .cv-prompt { height:80px; min-height:80px; }
#canvasView .cv-prompt[contenteditable] { font:inherit; font-size:14px; line-height:1.9; white-space:pre-wrap; overflow-wrap:anywhere; overflow-y:auto; cursor:text; outline:none; }
#canvasView .cv-prompt[contenteditable]:empty::before { content:attr(data-placeholder); color:var(--v2-muted); pointer-events:none; }
#canvasView .cv-prompt[contenteditable]:focus-visible { outline:1px solid var(--v2-line-strong); outline-offset:3px; border-radius:3px; }
#canvasView .cv-inline-reference { display:inline-flex; vertical-align:middle; align-items:center; gap:5px; max-width:min(180px,100%); height:28px; padding:2px 7px 2px 3px; margin:0 2px; border:1px solid #86cbd7; border-radius:5px; background:#e0f7fa; color:#075265; font-size:12px; line-height:1; user-select:all; }
.cv-inline-reference img { width:22px; height:22px; flex-shrink:0; object-fit:cover; border-radius:3px; }
.cv-inline-reference>span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
@media(max-width:700px){#canvasView .cv-prompt[contenteditable] { font-size:16px; }}
.cv-controls { padding:6px 10px 10px; gap:6px; }
.cv-reference-strip { display:flex; gap:7px; padding:0 14px; overflow-x:auto; max-height:88px; }
.cv-reference-strip:not(:empty) { padding-top:6px; padding-bottom:4px; }
.cv-ref-item { position:relative; flex:0 0 64px; min-width:0; }
#canvasView .cv-ref-item>button:first-child { width:64px; height:64px; padding:0; display:flex; flex-direction:column; justify-content:center; align-items:center; background:var(--v2-surface-muted); overflow:hidden; }
.cv-ref-item img { width:100%; height:44px; object-fit:cover; }
.cv-ref-item span { font-size:10px; width:100%; padding:2px 4px; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
#canvasView .cv-ref-item>button:last-child { position:absolute; right:-4px; top:-4px; width:18px; height:18px; padding:0; border-radius:50%; display:grid; place-items:center; }
#canvasView .cv-ref-item>button:last-child svg { width:12px; height:12px; }
.cv-result-actions { padding:0 12px 10px; gap:5px; }
#canvasView .cv-result-actions button { font-size:11px; padding:5px 7px; background:transparent; }
.cv-minimap { position:absolute; bottom:70px; left:16px; width:212px; height:147px; background:var(--v2-surface); border:1px solid var(--v2-line); border-radius:6px; z-index:5; overflow:hidden; }
#canvasView .cv-minimap button { position:absolute; min-width:4px; min-height:4px; border-radius:1px; border:0; padding:0; background:var(--v2-line-strong); }
#canvasView .cv-minimap button.selected { background:var(--v2-primary); }
.cv-map-viewport { position:absolute; border:1px solid var(--v2-primary); background:var(--v2-primary-soft); opacity:.35; pointer-events:none; }
.cv-multi { position:absolute; top:15px; left:50%; transform:translateX(-50%); display:flex; gap:6px; align-items:center; padding:5px 8px; background:var(--v2-surface); border:1px solid var(--v2-line); border-radius:6px; z-index:5; font-size:12px; white-space:nowrap; }
.cv-marquee { position:absolute; z-index:2; pointer-events:none; border:1px solid var(--v2-primary); background:var(--v2-primary-soft); opacity:.6; }
.cv-context { position:absolute; z-index:12; width:190px; padding:5px; background:var(--v2-surface); border:1px solid var(--v2-line-strong); border-radius:6px; box-shadow:0 8px 28px #00000020; touch-action:auto; }
#canvasView .cv-context button { display:flex; gap:12px; align-items:center; width:100%; border:0; text-align:left; padding:8px 10px; font-size:12px; background:transparent; }
#canvasView .cv-context button:hover { background:var(--v2-surface-muted); }
.cv-resize { position:absolute; right:-6px; bottom:-6px; width:13px; height:13px; background:var(--v2-surface); border:1px solid var(--v2-primary); border-radius:2px; cursor:nwse-resize; display:none; }
.cv-node[aria-pressed=true] .cv-resize { display:block; }
.cv-progress { position:absolute; bottom:0; left:0; right:0; height:3px; background:var(--v2-line); }
.cv-progress i { display:block; height:100%; background:var(--v2-primary); transition:width .5s; }
.cv-running .cv-node-body>svg { animation:cv-pulse 1.5s ease-in-out infinite; }
@keyframes cv-pulse { 50% { opacity:.25; } }
@media(prefers-reduced-motion:reduce){.cv-running .cv-node-body>svg { animation:none; }}
.cv-drawer { position:absolute; right:12px; top:12px; bottom:70px; z-index:7; width:330px; max-width:calc(100% - 80px); border:1px solid var(--v2-line); border-radius:8px; background:var(--v2-surface); box-shadow:0 8px 30px #0000001a; touch-action:auto; display:flex; flex-direction:column; }
.cv-drawer header { height:52px; min-height:52px; flex-shrink:0; margin:0; display:flex; align-items:center; justify-content:space-between; padding:9px 12px; border-bottom:1px solid var(--v2-line); font-size:14px; }
#canvasView .cv-drawer header button { width:30px; height:30px; }
#canvasView .cv-history-retry { display:flex; align-items:center; justify-content:center; gap:8px; margin:auto; padding:7px 12px; font-size:12px; }
.cv-drawer-content { flex:1; overflow:auto; padding:12px; min-height:0; }
#canvasView .cv-search,#canvasView .cv-tags { width:100%; min-width:0; height:34px; border:1px solid var(--v2-line); border-radius:5px; background:var(--v2-bg); padding:6px 8px; font-size:12px; }
.cv-node-list { display:grid; gap:3px; margin-top:10px; }
#canvasView .cv-node-list button { border:0; padding:9px 6px; display:flex; gap:9px; align-items:center; text-align:left; }
.cv-node-list button span { min-width:0; display:grid; gap:4px; }.cv-node-list strong { font-size:12px; font-weight:500; }.cv-node-list small { font-size:11px; color:var(--v2-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cv-history-item { display:flex; align-items:center; gap:8px; padding:10px 0; border-bottom:1px solid var(--v2-line); }
#canvasView .cv-history-item>button:first-child { width:54px; height:54px; flex-shrink:0; padding:0; display:grid; place-items:center; overflow:hidden; }
.cv-history-item img { width:100%; height:100%; object-fit:cover; }.cv-history-item>div { flex:1; min-width:0; }.cv-history-item strong { display:block; font-size:12px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }.cv-history-item p { font-size:11px; margin:4px 0; color:var(--v2-muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }.cv-history-item small { font-size:10px; color:var(--v2-muted); }
#canvasView .cv-history-item>button:last-child:not(:first-child) { width:26px; height:26px; display:grid; place-items:center; padding:0; }
.cv-empty { text-align:center; font-size:12px; color:var(--v2-muted); padding:20px 0; }
.cv-tag-editor { display:grid; gap:8px; font-size:12px; }
.cv-media-preview { background:var(--v2-surface); color:var(--v2-ink); border:1px solid var(--v2-line); border-radius:8px; max-width:92vw; max-height:92dvh; padding:16px; }
.cv-media-preview header { height:auto; border:0; display:flex; gap:30px; align-items:center; justify-content:space-between; margin:0 0 12px; font-size:14px; }.cv-media-preview header button { border:0; background:transparent; color:inherit; cursor:pointer; }.cv-media-preview img,.cv-media-preview video { display:block; max-width:85vw; max-height:75dvh; object-fit:contain; }.cv-media-preview audio { width:min(500px,80vw); }
.cv-stage-status { padding:5px 8px; border-radius:4px; background:var(--v2-bg); max-width:55%; }
.cv-stage-status:empty { display:none; }
@media(max-width:1000px){#canvasView .cv-title { width:130px; }.cv-top-actions { gap:1px; }#canvasView .cv-top-actions .cv-icon { width:30px; }.cv-logo { display:none; }}
@media(max-width:700px){
  #canvasView .cv-toolbar { height:100px; padding:8px; align-content:center; flex-wrap:wrap; gap:3px; }
  #canvasView .cv-stage { top:100px; }
  #canvasView .cv-project-select { width:26px; max-width:26px; }.cv-save-status { width:auto; font-size:10px; margin-left:auto; }
  #canvasView .cv-title { width:115px; font-size:12px; }#canvasView .cv-node-count { display:none; }
  .cv-top-actions { width:100%; margin-left:0; justify-content:flex-end; gap:2px; }.cv-top-actions:before { display:none; }
  #canvasView .cv-color-nav button { width:20px; padding:2px; }.cv-color-nav { margin-right:auto; padding-right:3px; gap:0; }.cv-color-nav .cv-color-dot { width:16px; height:16px; }
  #canvasView .cv-top-actions .cv-icon { width:30px; height:30px; }
  .cv-rail { left:8px; padding:4px; gap:4px; }#canvasView .cv-rail button { width:30px; height:30px; }
  .cv-zoom { left:8px; bottom:10px; padding:3px; }#canvasView .cv-zoom .cv-icon { width:29px; height:30px; }.cv-zoom output { width:38px; }
  #canvasView .cv-editor { max-height:calc(100% - 80px); overflow:auto; }#canvasView .cv-prompt { font-size:16px; height:72px; min-height:72px; }
  .cv-compose { padding:6px 10px; }#canvasView .cv-reference { width:32px; height:32px; }.cv-controls { padding:6px 8px 9px; gap:4px; }.cv-price { max-width:210px; }.cv-stage-status { bottom:54px; right:8px; max-width:75%; }#canvasView .cv-generate { margin-left:auto; }
  .cv-minimap { left:8px; bottom:61px; }.cv-drawer { right:8px; top:8px; }.cv-pop { position:fixed; left:12px; right:12px; bottom:65px; width:auto; max-width:none; max-height:50dvh; }.cv-multi { top:9px; }
}
