/* Visual authoring workspace. All rules are scoped to this editor. */
.block-library{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:16px 0}
.block-choice{display:flex;align-items:flex-start;gap:10px;min-width:0;text-align:left;border:1px solid var(--line);border-radius:13px;background:var(--card);color:var(--ink);padding:13px;cursor:pointer}
.block-choice[aria-pressed=true]{border-color:var(--green);background:var(--green-soft);box-shadow:inset 0 0 0 1px var(--green)}
.block-choice-icon{display:flex;align-items:center;justify-content:center;flex:0 0 30px;height:30px;background:var(--green-soft);border-radius:8px;color:var(--green);font-size:19px}
.block-choice strong,.block-choice small{display:block}.block-choice strong{font-size:13px;margin-bottom:5px}.block-choice small{font-size:11px;line-height:1.5;color:var(--muted)}
.block-insert-option{display:flex;align-items:flex-start;gap:9px;font-size:12px;line-height:1.5;margin:12px 0}.block-insert-option[hidden]{display:none}
.block-insert-option input{width:auto;flex-shrink:0;margin-top:3px}
@media(max-width:420px){.block-library{grid-template-columns:1fr}.block-choice{padding:12px}.block-choice strong{font-size:14px}.block-choice small{font-size:12px}}
.automatic-block-config{padding:15px;border:1px solid var(--line);background:var(--bg);border-radius:12px;margin:15px 0}
.automatic-block-config .field{margin-bottom:13px}.automatic-block-config textarea{min-height:100px}
.node-type-icon.action{background:#efe8f5;color:#76529b}.node-type-icon.delay{background:#fbefd6;color:#977126}.node-type-icon.stop{background:#f7e4e0;color:#b66252}
.preview-trace{border-left:3px solid var(--green);padding:4px 10px;margin-bottom:12px;background:var(--green-soft);font-size:11px;overflow-wrap:anywhere}.preview-trace p{margin:6px 0}
#preview-skip-delay{width:100%;margin-top:12px}
.visual-editor-active .live-notice:not(.error){display:none}
.editor-v2 [data-b=options]{display:none}
.editor-v2 .page-heading{margin-bottom:16px;align-items:center}
.editor-v2 .page-heading .eyebrow{display:none}
.editor-v2 .page-heading h1{font-size:30px;letter-spacing:-1px}
.editor-v2 .page-heading p{font-size:12px;margin-top:4px}
.editor-v2 .builder-savebar{position:static;padding:8px 0 12px;margin-bottom:0}
.editor-v2 .builder-global{margin:14px 0 18px;padding:16px 18px}
.editor-v2 .builder-flowbar{flex-direction:row;align-items:end;gap:15px}
.editor-v2 .builder-flowbar>.field{min-width:0;flex:1}
.editor-v2 .builder-tools{justify-content:flex-end;gap:5px}
.editor-v2 .builder-tools .button{padding:9px;font-size:10px}
.editor-v2 .builder-global details{padding-top:10px;margin-top:12px}
.editor-v2 .builder-global details summary{font-size:11px}
.editor-v2 details{margin-bottom:0}
.editor-v2 details>summary{min-height:28px;padding:4px 0}
.editor-commandbar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:10px}
.editor-commandbar>div{display:flex;gap:6px;align-items:center}
.editor-commandbar .button{padding:7px 12px;font-size:12px;min-height:36px}
.editor-commandbar .button:disabled{opacity:.35;cursor:default}
.editor-shortcut{font-size:10px;color:var(--muted);margin-left:5px}
.editor-commandbar .has-errors{background:var(--amber-soft);color:var(--amber)}
.editor-v2 .builder-layout{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 370px;gap:18px;align-items:start}
.editor-v2 .builder-steps{grid-column:1;grid-row:1;position:relative;top:auto;padding:0;overflow:hidden;border-radius:18px}
.editor-v2 .builder-steps>.section-head{padding:18px 18px 0;margin-bottom:13px;align-items:center}
.editor-v2 .builder-steps h2{display:flex;align-items:baseline;gap:10px;margin-top:4px;font-size:21px}
.editor-v2 .builder-steps h2 small{font-size:11px;font-weight:400}
.editor-v2 .builder-editor,.editor-v2 .builder-preview{grid-column:2;grid-row:1;margin-top:48px;max-width:none;width:100%;max-height:calc(100dvh - 340px);min-height:480px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;position:static;border:1px solid var(--line);border-radius:18px;background:var(--card);padding:20px}
.editor-v2 .builder-editor>.section-head{margin-bottom:16px}
.editor-v2 .builder-editor h2{font-size:21px;margin-top:4px}
.editor-v2 .builder-node-tools .button{padding:8px 10px;min-height:34px}
.editor-v2 .builder-editor>.form-pair{grid-template-columns:minmax(0,1fr) 116px;gap:10px}
.editor-v2 .builder-editor>.form-pair label{font-size:10px;min-width:0}
.editor-v2 .builder-editor input,.editor-v2 .builder-editor select{padding:10px;font-size:12px}
.editor-v2 .builder-inline-help{display:flex;align-items:center;justify-content:space-between;margin-top:16px;padding-top:14px}
.editor-v2 .builder-inline-help .button{padding:7px 10px;font-size:10px}
.start-tag{font-size:11px;font-weight:600;color:var(--green)}
.inspector-tabs{grid-column:2;grid-row:1;display:flex;gap:5px;z-index:1;height:37px;background:var(--green-soft);padding:3px;border-radius:11px}
.inspector-tabs .button{flex:1;border:0;background:transparent;font-size:11px;padding:6px;box-shadow:none}
.inspector-tabs [aria-pressed=true]{background:var(--card);box-shadow:0 2px 6px #203e2c0b}
@media(min-width:1101px){.editor-v2[data-inspector=editor] .builder-preview,.editor-v2[data-inspector=preview] .builder-editor{display:none}}
@media(min-width:1101px){
 .editor-v2{position:relative}.editor-v2 .page-heading{min-height:65px;margin-right:420px;padding-top:3px;margin-bottom:0}
 .editor-v2 .page-heading h1{font-size:27px}.editor-v2 .page-heading p{font-size:10px;max-width:340px}
 .editor-v2 .builder-savebar{position:absolute;top:0;right:0;flex-direction:column;align-items:flex-end;gap:6px;padding:0;border:0}
 .editor-v2 .builder-savebar small{font-size:10px}.editor-v2 .builder-savebar .button{min-height:38px;padding:8px 12px;font-size:11px}
}
.flow-search{padding:0 18px 14px;position:relative;z-index:3}
.flow-search input{width:100%;border:1px solid var(--line);border-radius:10px;background:var(--bg);padding:10px 12px;color:var(--ink);font-size:12px}
#flow-search-results{position:absolute;left:18px;right:18px;top:43px;max-height:250px;overflow:auto;background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:7px}
#flow-search-results .button{width:100%;display:block;text-align:left;border:0;white-space:normal;margin:2px 0}
.flow-viewport{width:100%;height:max(470px,calc(100dvh - 420px));max-height:750px;overflow:auto;background-color:#eef1e9;background-image:radial-gradient(#cbd3c9 1px,transparent 1px);background-size:19px 19px;position:relative;overscroll-behavior:contain;cursor:grab;scrollbar-width:thin;touch-action:pan-x pan-y;isolation:isolate}
.flow-viewport.dragging{cursor:grabbing;user-select:none}
.flow-frame{position:relative}
.flow-world{position:absolute;top:0;left:0;transform-origin:0 0}
.flow-lines{position:absolute;inset:0;overflow:visible;pointer-events:none;color:#8ba797}
.flow-edge{fill:none;stroke:#9bae9e;stroke-width:2.2}
.flow-edge.danger{stroke:#c17a6e}.flow-edge.success{stroke:#679476}.flow-edge.primary{stroke:#669ba7}
.flow-card{position:absolute;display:flex;flex-direction:column;border:1.5px solid #d6ded3;background:var(--card);border-radius:16px;box-shadow:0 5px 14px #23332b09;cursor:default;overflow:hidden;transition:box-shadow .12s,border-color .12s,opacity .12s}
.flow-card.selected{border-color:var(--green);box-shadow:0 0 0 4px #28524015,0 8px 20px #203e2c0c}
.flow-card.link-target{border-style:dashed}.flow-card.link-target:hover{border-color:var(--green);background:var(--green-soft)}
.flow-card.dimmed{opacity:.24}
.flow-card-main{display:block;flex:none;width:100%;padding:16px;text-align:left;background:none;border:0;color:var(--ink);cursor:pointer}
.flow-card-heading{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.flow-card-heading>span:last-child{min-width:0;flex:1}
.flow-card-heading small{font-size:9px;display:block;color:var(--muted);letter-spacing:.7px;text-transform:uppercase;margin-bottom:3px}
.flow-card-heading strong{font-size:14px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.node-type-icon{width:33px;height:33px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:20px;background:var(--green-soft);color:var(--green);flex-shrink:0}
.node-type-icon.input{background:#e8edf8;color:#456494}.node-type-icon.condition{background:#f7edd4;color:#957629}
.flow-card-copy{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line;line-height:1.55;min-height:50px;height:55px;font-size:11px;color:#68746b;overflow-wrap:anywhere}
.flow-media-tag{display:block;font-size:9px;color:var(--green);margin-top:4px}
.flow-ports{padding:0 9px;display:grid;gap:4px}
.flow-port{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:30px;max-height:30px;border:0;border-radius:7px;background:#edf0e9;color:#486452;padding:5px 10px;font-size:10px;text-align:left;cursor:crosshair}
.flow-port>span:first-child{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.flow-port>span:last-child{font-size:14px;flex-shrink:0}.flow-port.primary{background:#e9f0f5;color:#386b8a}.flow-port.success{background:#e4efe6;color:#347343}.flow-port.danger{background:#faeae7;color:#a15544}.flow-port.unconnected{outline:1px dashed #c39158;outline-offset:-1px}
.flow-card-foot{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:9px;margin-top:auto;min-height:40px}
.flow-card-foot .button{background:transparent;border:0;padding:5px;font-size:10px;min-height:25px;color:var(--green)}
.flow-card-foot small,.flow-card-foot>span{font-size:9px;color:var(--muted);max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.flow-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;border-top:1px solid var(--line)}
.flow-controls>div{display:flex;align-items:center;gap:5px}.flow-controls .button{font-size:10px;min-height:32px;padding:6px 9px}.flow-controls span{font-size:10px;min-width:30px;text-align:center}.flow-controls small{font-size:9px;color:var(--muted);max-width:150px;text-align:right}
.flow-connect-banner{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:var(--green);color:white;font-size:11px}.flow-connect-banner[hidden]{display:none}.flow-connect-banner .button{padding:6px 8px;font-size:10px;flex-shrink:0}
.message-composer{border:1px solid var(--line);border-radius:13px;overflow:hidden;margin:10px 0 14px}
.composer-title{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;background:#f8f8f2;border-bottom:1px solid var(--line)}
.composer-title strong{font-size:11px}.composer-title .button{font-size:9px;padding:4px 7px;border:0;background:transparent;color:var(--muted)}
.editor-v2 .builder-formatbar{gap:2px;padding:7px;border-bottom:1px solid var(--line);margin:0;background:var(--card)}
.editor-v2 .builder-formatbar .button{width:30px;height:31px;min-height:31px;padding:5px;border:0;border-radius:6px;font-size:12px;background:transparent}
.editor-v2 .builder-formatbar .button{min-width:0}
.editor-v2 .builder-formatbar .button:hover{background:var(--green-soft)}
.richtext{outline:0;min-height:170px;max-height:320px;overflow:auto;padding:16px 13px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.7;cursor:text;color:var(--ink);background:var(--card)}
.richtext:focus{box-shadow:inset 0 0 0 2px #4f806c25}
.richtext a{color:var(--blue);text-decoration:underline}.richtext blockquote{margin:8px 0;border-left:3px solid var(--green);padding-left:10px;background:var(--green-soft)}.richtext code,.richtext pre{font-family:monospace;background:var(--bg)}.richtext tg-spoiler{background:#d7dfd2;border-radius:3px}
.editor-v2 #node-text{min-height:210px;border:0;border-radius:0;font:12px/1.6 monospace;padding:13px}
.composer-footer{display:flex;justify-content:space-between;gap:5px;padding:8px 11px;font-size:9px;color:var(--muted);border-top:1px solid var(--line)}
.composer-footer .over-limit{color:var(--red);font-weight:600}
.variable-picker{padding:9px 11px;border-top:1px solid var(--line);font-size:10px}.variable-picker summary{cursor:pointer;color:var(--green);font-weight:600}.variable-picker>div{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}.variable-picker .button{padding:6px 9px;font-size:10px}
.attachment-control{border:1px dashed #ccd6c7;border-radius:11px;margin:12px 0;padding:11px;font-size:11px;color:var(--green)}
.attachment-control summary{cursor:pointer}.attachment-control>div{padding-top:10px}.attachment-control .field{margin:0 0 8px}.attachment-control small{display:block;color:var(--muted);font-size:9px;margin-top:8px}.attachment-control .builder-upload{padding:7px;min-height:34px;margin:0;font-size:10px}
.input-step-config{padding:13px;border-radius:12px;background:#edf1f8;margin:13px 0}.input-step-config>strong{font-size:11px;display:block;margin-bottom:10px}.input-step-config .field{font-size:10px;margin-bottom:9px}
.button-composer .section-head{margin-top:18px;margin-bottom:7px}.button-composer h3{font-size:13px}.button-composer .section-head .button{padding:6px 9px;font-size:10px}.button-composer>.setting-note{font-size:10px;margin-bottom:10px}
.compact-button-row{border:1px solid var(--line);border-radius:11px;padding:8px;margin-top:8px;background:#f8f8f3}
.compact-keys{display:flex;gap:4px;min-width:0}.compact-keys .edit-key{min-width:0;flex:1;width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:48px;padding:7px 4px}
.edit-key span{font-size:11px;line-height:1.3;overflow-wrap:anywhere}.edit-key small{font-size:8px;opacity:.8;line-height:1.2;overflow-wrap:anywhere}
.compact-row-tools{display:flex;align-items:center;justify-content:flex-end;gap:2px;margin-top:4px}.compact-row-tools>span{margin-right:auto;font-size:9px;color:var(--muted)}.compact-row-tools .button{padding:3px 7px;font-size:9px;background:none;border:0;min-height:25px}
.button-empty{padding:15px;border:1px dashed var(--line);border-radius:10px;font-size:11px;color:var(--muted);text-align:center}
.color-picker{border:0;padding:0;margin:15px 0;display:grid;grid-template-columns:1fr 1fr;gap:8px}.color-picker legend{font-size:12px;font-weight:600;margin-bottom:9px}
.color-choice{display:flex;align-items:center;gap:8px;border:2px solid transparent;border-radius:11px;padding:13px;font-size:12px;cursor:pointer;background:#e6ece3;color:#3a5140}.color-choice input{accent-color:currentColor}.color-choice.primary{background:#e1edf8;color:#276b9d}.color-choice.success{background:#e0eee2;color:#2a7140}.color-choice.danger{background:#f8e1de;color:#a13e34}.color-choice:has(input:checked){border-color:currentColor}
.issue-row{display:flex;flex-direction:column;gap:5px;text-align:left;padding:14px;margin:8px 0;border:1px solid #e5d9bd;border-radius:11px;background:var(--amber-soft);color:var(--amber);width:100%;cursor:pointer;font-size:12px}.issue-row span{font-size:11px}
.editor-v2 .builder-phone{min-height:300px;padding:16px}.editor-v2 .builder-preview>.setting-note{font-size:10px}.editor-v2 .builder-preview h2{font-size:19px}
.editor-expanded .sidebar,.editor-expanded .topbar,.editor-expanded .live-notice:not(.error),.editor-expanded .page-footer,.editor-expanded #bottom-nav{display:none!important}
.editor-expanded .shell{margin-left:0}.editor-expanded main{padding:20px}.editor-expanded .editor-v2 .builder-editor,.editor-expanded .editor-v2 .builder-preview{max-height:calc(100dvh - 300px)}
.editor-expanded .flow-viewport{height:calc(100dvh - 375px);max-height:none}
[data-theme=dark] .flow-viewport{background-color:#202a24;background-image:radial-gradient(#3b4b40 1px,transparent 1px)}
[data-theme=dark] .composer-title,[data-theme=dark] .compact-button-row{background:#242f28}
[data-theme=dark] .flow-card-copy{color:#b4c1b7}[data-theme=dark] .flow-card{border-color:#506355}
@media(max-width:1300px){.editor-v2 .builder-layout{grid-template-columns:minmax(0,1fr) 330px;gap:12px}.editor-v2 .builder-flowbar{flex-direction:column;align-items:stretch}.editor-v2 .builder-tools{justify-content:flex-start}.editor-v2 .builder-editor,.editor-v2 .builder-preview{padding:16px}.flow-controls small{display:none}}
@media(max-width:1100px){
 .editor-v2 .builder-layout{display:block}.inspector-tabs{display:none}.editor-v2 .builder-mobile-tabs{display:flex;gap:5px}.editor-v2 .builder-mobile-tabs .button{flex:1}
 .editor-v2 .builder-editor,.editor-v2 .builder-preview{margin-top:0;max-height:none;min-height:0;overflow:visible}.editor-v2 .builder-steps{position:static}
 .editor-v2[data-tab=steps] .builder-editor,.editor-v2[data-tab=steps] .builder-preview,.editor-v2[data-tab=editor] .builder-steps,.editor-v2[data-tab=editor] .builder-preview,.editor-v2[data-tab=preview] .builder-steps,.editor-v2[data-tab=preview] .builder-editor{display:none}
 .editor-v2 .builder-editor>.form-pair{grid-template-columns:minmax(0,1fr) 130px}.editor-v2 .builder-flowbar{flex-direction:row;align-items:end}.editor-v2 .builder-tools{max-width:50%;justify-content:end}
 .flow-viewport{height:560px;max-height:65dvh}.editor-v2 .builder-phone{max-width:420px}.editor-v2 .builder-preview{padding:20px}
}
@media(max-width:760px){
 .visual-editor-active .topbar{height:59px}.visual-editor-active main{padding-top:10px}
 .editor-v2 .page-heading p{display:none}.editor-v2 .page-heading{margin-bottom:10px}
 .editor-v2 .builder-global:not(.options-open) .builder-tools,.editor-v2 .builder-global:not(.options-open)>details{display:none}
 .editor-v2 .builder-flowbar{position:relative;padding-right:43px!important}
 .editor-v2 [data-b=options]{display:inline-flex;position:absolute;right:0;bottom:0;min-height:42px;min-width:35px;padding:6px;font-size:14px}
 .editor-v2 .builder-global.options-open .builder-tools{margin-right:-43px}
 .editor-v2 .page-heading h1{font-size:27px}.editor-v2 .page-heading p{font-size:11px}.editor-v2 .builder-savebar{flex-direction:column;gap:10px;align-items:stretch}
 .editor-v2 .builder-savebar>div .button{padding:11px 7px}.editor-commandbar .button{min-height:40px;padding:7px 11px;font-size:11px}.editor-shortcut{display:none}
 .editor-v2 .builder-global{padding:13px;margin:12px 0}.editor-v2 .builder-flowbar{display:block}.editor-v2 .builder-tools{max-width:none;margin-top:10px;flex-wrap:wrap;justify-content:start}.editor-v2 .builder-tools .button{min-height:36px;padding:8px 6px;flex:1;font-size:10px}
 .editor-v2 .builder-mobile-tabs{margin:13px 0}.editor-v2 .builder-mobile-tabs>.button{padding:10px 5px;min-height:43px;font-size:11px}
 .editor-v2 .builder-steps>.section-head{padding:15px 12px 0}.editor-v2 .builder-steps h2{font-size:20px}.editor-v2 .builder-steps>.section-head .button{padding:9px 12px;font-size:11px}
 .flow-search{padding:0 12px 12px}.flow-search input{font-size:16px;padding:10px}.flow-viewport{height:500px;max-height:62dvh}.flow-controls{padding:9px 10px}.flow-controls .button{min-height:38px;font-size:10px;padding:7px 9px}.flow-controls>div{width:100%;justify-content:space-between}
 .flow-connect-banner{flex-wrap:wrap}.flow-connect-banner>span{flex-basis:100%}.flow-connect-banner .button{min-height:36px;flex:1}
 .editor-v2 .builder-editor{padding:16px 13px}.editor-v2 .builder-editor>.form-pair{grid-template-columns:1fr}.editor-v2 .builder-editor input,.editor-v2 .builder-editor select{font-size:16px;padding:11px}
 .editor-v2 .builder-editor>.form-pair label{font-size:11px}.editor-v2 .builder-node-tools .button{min-height:40px;min-width:40px}
 .richtext{font-size:16px;min-height:185px;max-height:360px;padding:14px 11px}.editor-v2 .builder-formatbar{padding:5px;gap:1px}.editor-v2 .builder-formatbar .button{width:29px;min-height:39px;height:39px;padding:4px;font-size:12px}
 .composer-title{padding:9px 11px}.composer-title .button{min-height:35px}.composer-footer{font-size:9px}.variable-picker summary{min-height:26px;line-height:26px}.variable-picker .button{min-height:38px}
 .attachment-control summary{padding:4px 0}.attachment-control .builder-upload{min-height:42px}.button-composer .section-head .button{min-height:39px}.compact-keys .edit-key{min-height:55px}.compact-row-tools .button{min-height:34px}.edit-key span{font-size:12px}.edit-key small{font-size:9px}
 .editor-expanded main{padding:12px}.editor-expanded .flow-viewport{height:58dvh;max-height:none}.editor-expanded .editor-v2 .builder-editor,.editor-expanded .editor-v2 .builder-preview{max-height:none}.editor-expanded .editor-v2{padding-bottom:30px}
}
@media(max-width:360px){.editor-v2 .builder-formatbar .button{width:25px;font-size:11px}.editor-commandbar .button{padding:7px 9px}.color-picker{grid-template-columns:1fr}.flow-controls .button{padding:7px}.editor-v2 .builder-tools .button{font-size:9px}}
