.shelf-items{display:flex;flex-wrap:nowrap;gap:8px;height:68px;max-height:none;overflow-x:auto;overflow-y:hidden;align-items:stretch;padding-bottom:2px}
.shelf-item{flex:0 0 176px;width:176px;min-width:0;border-left:4px solid currentColor;background:#fff}
.chat-shelf.expanded .shelf-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(175px,1fr));height:auto;max-height:250px;overflow:auto}
.shelf-heading{align-items:center}.shelf-heading .row{gap:7px}.shelf-heading button{padding:4px 8px}
.shelf-item.type-flow{color:#ab5b1a;background:#fff5e8}.shelf-item.type-funnel{color:#774fba;background:#f4eefb}
.shelf-item.type-audio{color:#216da8;background:#ecf6ff}.shelf-item.type-image{color:#27835e;background:#eaf7ef}
.shelf-item.type-text{color:#64736d;background:#f0f3f1}.shelf-item.type-document{color:#ac4776;background:#fff0f6}
.shelf-item strong{color:#253e35}.shelf-item .shelf-icon{background:#ffffffb8;color:inherit}.shelf-item small{color:#60746b}
.flow-workspace{display:grid;grid-template-columns:190px minmax(0,1fr);gap:18px}.flow-palette{align-self:start;position:sticky;top:12px}
.flow-palette h3{margin-bottom:15px}.flow-palette-item{display:flex;justify-content:flex-start;width:100%;margin-bottom:8px;text-align:left}
.flow-palette-item.type-audio{color:#216da8}.flow-palette-item.type-image{color:#27835e}.flow-palette-item.type-document{color:#ac4776}.flow-palette-item.type-wait_reply{color:#a66430}
.flow-canvas-wrap{border:1px solid #d8e5dd;border-radius:14px;overflow:auto;min-height:650px;background-color:#fbfdfb;background-image:radial-gradient(#d6e5db 1px,transparent 1px);background-size:18px 18px}
.flow-canvas{position:relative;min-width:1150px}.flow-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:0}
.flow-lines path{fill:none;stroke:#73977f;stroke-width:2.5}.flow-lines .edge-reply{stroke:#26946b}.flow-lines .edge-timeout{stroke:#d07a3d;stroke-dasharray:6 4}
.flow-node{position:absolute;width:275px;background:white;border:1px solid #d7e3dd;border-top:5px solid #14795b;border-radius:12px;padding:13px;box-shadow:0 8px 28px #274a3417;z-index:1;cursor:grab}
.flow-node{cursor:default}.flow-node.moving{z-index:3;box-shadow:0 16px 42px #274a3440}.flow-node.type-start{border-top-color:#6954a1}.flow-node.type-audio{border-top-color:#216da8}.flow-node.type-image{border-top-color:#27835e}.flow-node.type-document{border-top-color:#ac4776}.flow-node.type-wait{border-top-color:#a2672c}.flow-node.type-wait_reply{border-top-color:#d07a3d}
.flow-node-head{display:flex;align-items:center;justify-content:space-between;font-weight:750;font-size:.9rem;color:#263e33;margin-bottom:12px}.flow-node label{margin-bottom:10px;font-size:.78rem}
.flow-drag-handle{display:inline-flex;align-items:center;min-height:24px;cursor:grab;touch-action:none;user-select:none}.flow-node.moving .flow-drag-handle{cursor:grabbing}
.flow-port{display:block;width:18px;height:18px;min-width:18px;padding:0;border:3px solid #fff;border-radius:50%;background:#19a678;box-shadow:0 0 0 2px #7dc9a4;cursor:crosshair;touch-action:none;transition:transform .15s,box-shadow .15s}
.flow-port:hover,.flow-port:focus-visible,.flow-port.selected{transform:scale(1.22);box-shadow:0 0 0 3px #38a77d,0 0 0 7px #bce8cc}
.flow-port-in{position:absolute;left:-10px;top:24px;background:#fff;border:3px solid #178868;box-shadow:0 0 0 2px #a4d5bd}
.flow-outputs{border-top:1px solid #e3eee7;padding-top:5px;margin-top:10px;display:grid;gap:2px}.flow-output-row{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:30px;font-size:.72rem;color:#62786d}
.flow-output-row>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.flow-output-row.timeout .flow-port-out{background:#d8893e;box-shadow:0 0 0 2px #e4b78b}
.flow-lines .edge-onReply{stroke:#26946b}.flow-lines .edge-onTimeout{stroke:#d07a3d;stroke-dasharray:6 4}.flow-lines .edge-pending{stroke:#2087b7;stroke-width:3;stroke-dasharray:7 5}
.flow-node input,.flow-node select,.flow-node textarea{padding:7px;font-size:.82rem}.flow-node textarea{min-height:60px}.flow-node .row{flex-wrap:nowrap}.flow-node .row input{width:90px}
.flow-node .flow-accounts{max-height:115px;overflow:auto}.flow-node .flow-accounts label{margin:0 0 5px}.flow-node-foot{display:block;margin-top:8px;color:#85958a;font-size:.68rem}
.flow-fields{display:grid;gap:2px}.flow-fields small{color:#718276}.flow-canvas .check{display:flex;align-items:center}.flow-canvas .check input{width:16px;height:16px}
.funnel-card .card-actions{flex-wrap:wrap}.funnel-card .card-actions button{flex:1 1 auto}.asset-card>a{display:block;margin:20px 0}.attachment-auto-help{color:#216da8}
@media(max-width:900px){.flow-workspace{grid-template-columns:1fr}.flow-palette{position:static;display:flex;flex-wrap:wrap;gap:7px}.flow-palette h3,.flow-palette p{width:100%}.flow-palette-item{width:auto;margin:0}.chat-shelf.expanded .shelf-items{max-height:180px}}
.library-toolbar{display:grid;gap:18px}.library-toolbar-title,.library-toolbar-controls,.library-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.library-toolbar-controls{justify-content:flex-start}.library-toolbar-controls>label{margin:0}.library-toolbar-controls>label:first-child{min-width:190px}.library-select-all,.asset-selection{display:flex;align-items:center;gap:8px}.library-select-all input,.asset-selection input{width:18px;height:18px;margin:0;flex-shrink:0}.library-group{border-radius:13px;padding:19px;margin:0 0 22px;border:1px solid #dfe7e4;background:#f9fcfa}.library-group-head{margin-bottom:16px}.library-group-head h2{font-size:1.1rem}.library-group.type-audio{border-top:4px solid #216da8;background:#f2f8ff}.library-group.type-image{border-top:4px solid #27835e;background:#f1faf4}.library-group.type-document{border-top:4px solid #ac4776;background:#fff4f9}.library-group.type-audio .library-group-head h2{color:#216da8}.library-group.type-image .library-group-head h2{color:#27835e}.library-group.type-document .library-group-head h2{color:#ac4776}.library-group .asset-card{display:flex;flex-direction:column;border-left:4px solid}.library-group .asset-card.type-audio{border-left-color:#216da8}.library-group .asset-card.type-image{border-left-color:#27835e}.library-group .asset-card.type-document{border-left-color:#ac4776}.asset-card.selected{outline:3px solid #19a678;outline-offset:1px}.asset-selection{align-self:flex-start;margin:0 0 12px;cursor:pointer}.asset-card .meta{margin:4px 0 12px}.asset-card>.row{margin-top:auto}.asset-card audio{margin:20px 0}.library-group .help{margin:0}
.chat-chips{display:grid;gap:5px;padding:10px 12px;border-bottom:1px solid var(--border);max-height:155px;overflow:auto}.chat-chip{display:flex;align-items:center;gap:7px;min-width:0;color:var(--chip-color);font-size:.76rem;font-weight:700}.chat-chip i{width:10px;height:10px;flex:none;border:2px solid var(--chip-color);border-radius:50%;opacity:.6}.chat-chip.connected i{background:var(--chip-color);opacity:1}.chat-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-chip small{margin-left:auto;background:var(--chip-tint);border-radius:20px;padding:2px 7px;color:var(--chip-color)}.chat-item{border-left:5px solid var(--chip-color);padding:12px 45px 12px 13px}.chat-item.unread,.chat-item.unread.active,.chat-item.active{border-left-color:var(--chip-color);background:var(--chip-tint)}.chat-item .unread-badge{background:var(--chip-color)}.chat-item .chat-account-tag{color:var(--chip-color);font-weight:700;font-size:.72rem;margin-top:5px}.chat-shell .chat-title{border-top:4px solid var(--chip-color)}.chat-shell .chat-title .pill{background:var(--chip-tint);color:var(--chip-color)}.chat-shell .bubble.out{background:var(--chip-tint);border-color:var(--chip-color)}.chat-shell .composer button.primary{background:var(--chip-color);border-color:var(--chip-color)}
.shelf-item.type-video{color:#79613c;background:#fff6e8}.library-group.type-video{border-top:4px solid #a47a32;background:#fffaef}.library-group.type-video .library-group-head h2{color:#8c6425}.library-group .asset-card.type-video{border-left-color:#a47a32}.asset-card video{display:block;width:100%;max-height:170px;border-radius:8px;background:#111}.flow-node.type-video{border-top-color:#a47a32}.flow-palette-item.type-video{color:#8c6425}

/* Compact chat library: one persistent row and an overlay drawer. */
.chat-main{position:relative}.chat-shelf{height:54px;padding:6px 10px;overflow:visible}.shelf-heading{height:41px;margin:0;align-items:center;gap:8px}.shelf-label{border:0;background:transparent;padding:5px 7px;display:flex;flex-direction:column;align-items:flex-start;gap:0;min-width:91px}.shelf-label strong{font-size:.8rem}.shelf-label span{font-size:.68rem;color:var(--muted);font-weight:500}.shelf-schedule{width:34px;height:34px;border:1px solid var(--border);border-radius:8px;display:grid;place-items:center;text-decoration:none;font-size:1rem!important;flex-shrink:0}.shelf-quick{display:flex;gap:6px;min-width:0;flex:1;overflow:hidden}.shelf-quick-item{height:36px;min-width:0;max-width:130px;padding:4px 8px 4px 5px;justify-content:flex-start;overflow:hidden;border-left:3px solid currentColor}.shelf-quick-item .shelf-icon{width:27px;height:27px;font-size:.8rem}.shelf-quick-item .shelf-icon img{width:27px;height:27px}.shelf-quick-item>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.72rem;color:#28493e}.shelf-quick-item.type-flow{color:#ab5b1a;background:#fff5e8}.shelf-quick-item.type-funnel{color:#774fba;background:#f4eefb}.shelf-quick-item.type-audio{color:#216da8;background:#ecf6ff}.shelf-quick-item.type-image{color:#27835e;background:#eaf7ef}.shelf-quick-item.type-video{color:#79613c;background:#fff6e8}.shelf-quick-item.type-text{color:#64736d;background:#f0f3f1}.shelf-quick-item.type-document{color:#ac4776;background:#fff0f6}
.shelf-drawer{display:none;position:absolute;left:12px;right:12px;bottom:58px;z-index:8;max-height:min(390px,calc(100% - 85px));padding:15px;background:white;border:1px solid var(--border);border-radius:14px;box-shadow:0 18px 55px #173d3138;grid-template-rows:auto auto minmax(0,1fr)}.chat-shelf.expanded .shelf-drawer{display:grid}.shelf-drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.shelf-drawer .shelf-tools{margin-bottom:10px}.shelf-drawer .shelf-items,.chat-shelf.expanded .shelf-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));height:auto;max-height:270px;overflow:auto;align-content:start}.shelf-item{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:center;flex:auto;width:auto;padding:0;min-height:55px}.shelf-open{border:0;background:transparent;border-radius:0;padding:8px;text-align:left;justify-content:start;min-width:0;overflow:hidden}.shelf-open>span:last-child{min-width:0}.shelf-star{border:0;background:transparent;padding:5px;color:#8b948f;font-size:1.1rem}.shelf-star.active{color:#d99616}.shelf-star:hover{background:#ffffff80}.chat-record-status{align-self:center;color:#b22e39;font-size:.8rem;font-weight:700;margin-right:auto}.chat-mic{font-size:1.05rem;padding-inline:13px}.chat-mic.recording{color:white;background:#bd3542;border-color:#bd3542;animation:recordPulse 1.2s ease-in-out infinite}.chat-record-preview audio{width:100%;margin:10px 0}.chat-record-preview p{text-align:center}@keyframes recordPulse{50%{box-shadow:0 0 0 5px #bd354225}}
@media(max-width:900px){.shelf-quick-item:nth-child(n+3){display:none}.shelf-drawer{left:8px;right:8px}.shelf-drawer .shelf-items,.chat-shelf.expanded .shelf-items{max-height:230px}}
@media(max-width:600px){.shelf-quick-item{max-width:88px}.shelf-quick-item>span:last-child{display:none}.shelf-label{min-width:82px}.shelf-drawer{bottom:58px;max-height:65%}.shelf-drawer .shelf-items{grid-template-columns:1fr 1fr}.composer .chat-record-status{flex:1}}
.backup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.backup-grid .panel{min-width:0}.backup-grid p{font-size:.9rem}.backup-grid input[type=file]{margin-top:6px}.backup-grid .help{font-size:.8rem}.backup-grid .button{margin-top:8px}.backup-grid button.primary{margin-top:4px}.panel details li{padding:5px 0;overflow-wrap:anywhere}@media(max-width:850px){.backup-grid{grid-template-columns:1fr}}
.bubble video{max-width:100%;max-height:260px;border-radius:8px}

.shelf-tools{flex-wrap:wrap}.shelf-tools input{flex:1 1 180px;min-width:0}.shelf-tools #shelf-folder{width:auto;max-width:100%;flex:0 1 210px}

.flow-canvas-wrap,.flow-canvas{cursor:grab}.flow-canvas-wrap.panning,.flow-canvas-wrap.panning .flow-canvas{cursor:grabbing;user-select:none}

.flow-canvas-wrap{position:relative;overflow:hidden;min-height:0;height:clamp(480px,72vh,850px);align-self:start;overscroll-behavior:contain}
.flow-canvas{position:absolute;left:0;top:0;transform-origin:0 0}
.flow-zoom-controls{position:absolute;right:14px;bottom:14px;z-index:10;display:flex;align-items:center;gap:4px;padding:6px;border:1px solid var(--border,#d8e5dd);border-radius:10px;background:var(--surface,#fff);color:var(--text-strong,#17382d);box-shadow:0 4px 16px #0002;cursor:default;user-select:none}
.flow-zoom-controls button{height:34px;min-width:34px;padding:4px 8px;justify-content:center}.flow-zoom-controls [data-action="flow-zoom-reset"]{min-width:60px;font-variant-numeric:tabular-nums}.flow-zoom-controls span{padding:0 7px;font-size:.72rem;color:var(--muted,#718276)}
@media(max-width:600px){.flow-zoom-controls{right:8px;bottom:8px}.flow-zoom-controls span{display:none}}
.flow-lines{z-index:4;pointer-events:none}
.flow-image-preview{margin:10px 0;min-height:24px}
.flow-image-preview img{display:block;width:100%;height:150px;object-fit:contain;border:1px solid var(--border);border-radius:8px;background:var(--panel,transparent);user-select:none}
.flow-image-preview .help{margin:0;font-size:.75rem}
.flow-video-preview{margin:10px 0;min-height:24px;cursor:default}.flow-video-preview video{display:block;width:100%;height:150px;object-fit:contain;border:1px solid var(--border);border-radius:8px;background:#111;cursor:default}.flow-video-preview .help{margin:0;font-size:.75rem}
.flow-bulk-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding-top:12px;border-top:1px solid var(--border);margin-top:12px}
.flow-bulk-toolbar .check,.flow-selection{margin:0}.flow-selection{margin-bottom:12px}
.funnel-card.selected{outline:2px solid var(--green);outline-offset:-2px}
.flow-bulk-summary{max-height:200px;overflow:auto;padding-left:22px}
.funnel-bulk-toolbar{margin-bottom:22px;padding-bottom:12px}.panel-head:has(#funnel-folder-filter){flex-wrap:wrap}
.category-select-all{display:flex;align-items:center;gap:8px;margin:0;cursor:pointer}.category-select-all input{width:18px;height:18px;flex-shrink:0;margin:0}.library-text-row.selected{outline:2px solid var(--green);outline-offset:-2px;border-radius:8px}.library-group.type-text{border-top:4px solid #597b65}
.flow-palette-item{cursor:grab;touch-action:none;user-select:none}.flow-palette-item.dragging{cursor:grabbing;opacity:.55}.flow-palette-ghost{position:fixed;z-index:1000;pointer-events:none;min-width:170px;padding:15px 20px;border:1px solid var(--border);border-top:4px solid var(--green);border-radius:10px;background:var(--surface,#fff);color:var(--text-strong,#17382d);box-shadow:0 12px 32px #0004;font-weight:700}.flow-canvas-wrap.drop-target{outline:2px solid var(--green);outline-offset:-3px}
.flow-node.type-ai_router{border-top-color:#825eb2}.flow-palette-item.type-ai_router{color:#825eb2}.flow-node.type-call_flow{border-top-color:#168d78}.flow-palette-item.type-call_flow{color:#168d78}.flow-ai-routes{max-height:340px;overflow:auto;margin:10px 0}.flow-ai-route{padding:10px 0;border-bottom:1px solid var(--border)}.flow-ai-route:first-child{padding-top:0}.flow-node.type-ai_router .flow-output-row{white-space:normal}.flow-node.type-ai_router .flow-output-row>span{white-space:normal;overflow-wrap:anywhere}.flow-lines .edge-onUnknown{stroke:#b66b43;stroke-dasharray:6 4}
.flow-ai-chat{flex-shrink:0;max-height:200px;overflow:auto;display:flex;flex-wrap:wrap;gap:6px 12px;padding:8px 14px;background:var(--surface);border-bottom:1px solid var(--border);font-size:.76rem}.flow-ai-chat details{width:100%}.flow-ai-chat p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}

.flow-node.type-confirmation{border-top-color:#b88845}.flow-palette-item.type-confirmation{border-left:3px solid #b88845}
.asset-search-picker{margin:0 0 14px;min-width:0}.asset-picker-label{display:block;font-size:.875rem;color:#476355;margin:0 0 8px}.asset-picker-search{position:relative;min-width:0}.asset-picker-search>svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:18px;height:18px;stroke:#71877c;stroke-width:1.7;fill:none;stroke-linecap:round;pointer-events:none}.asset-picker-search>input{display:block;width:100%;height:46px;padding:10px 12px 10px 42px;background:#fff;border:1px solid #cedbd4;border-radius:9px;color:#254c3c}.asset-picker-search>input::placeholder{color:#7a8e83}.asset-picker-current{font-size:.78rem;margin:7px 0;color:#71877c;line-height:1.5}.asset-picker-results{max-height:230px;overflow-y:auto;margin-top:8px;border:1px solid #cedbd4;border-radius:9px;background:#fff;box-shadow:0 8px 22px #183b3614}.asset-picker-results[hidden]{display:none}.asset-picker-option{display:flex;width:100%;justify-content:flex-start;text-align:left;border:0;border-radius:0;background:#fff;padding:10px 12px;color:#254c3c;font-size:.86rem;font-weight:500}.asset-picker-option+.asset-picker-option{border-top:1px solid #eff3f0}.asset-picker-option:hover,.asset-picker-option:focus-visible{background:#edf6f2}.asset-picker-results-empty{margin:0;padding:12px 14px;color:#71877c;font-size:.82rem;line-height:1.5}.asset-picker-status{margin:6px 0 0;min-height:0}
