/* Telegram-inspired chat view, visual format menu, compact automation editor. */
.simple-stage{max-width:820px;border-radius:12px;background:#dce7d4;border:1px solid #53646e;box-shadow:0 18px 55px #0005}
.simple-chat-header{background:#f7fafc;color:#172e40;border-bottom:1px solid #c6d4db;padding:10px 15px;min-height:58px}
.simple-chat-header small{color:#72899a}.simple-chat-header strong{color:#18384c;font-size:14px}
.simple-chat-avatar{background:linear-gradient(140deg,#5ba2dc,#2a79ae);width:41px;height:41px}
.simple-chat-dot{background:#47b599;box-shadow:none}.simple-chat-back{font-size:32px;font-weight:300;color:#6a91aa;line-height:1;margin-right:4px}
.simple-chat-body{min-height:245px;padding:20px clamp(15px,5vw,45px) 25px;background-color:#dce7d4;background-image:radial-gradient(#a9c8a731 1.5px,transparent 2px),radial-gradient(#bdcdb744 1.5px,transparent 2px);background-size:31px 31px,47px 47px;background-position:0 0,15px 15px}
.simple-message{background:#fff;color:#172d38;max-width:min(94%,640px);padding:13px 13px 9px;border-radius:3px 12px 12px 12px;border:1px solid #e4edf0;box-shadow:0 4px 14px #2b49321b}
.simple-message-input{color:#203644}.simple-message-input:focus{background:#fff}
.message-eyebrow{font-size:9px;margin-bottom:8px;letter-spacing:.7px;color:#7695a5}
.canvas-inline-keyboard{width:min(94%,640px);gap:2px;margin-top:5px}
.canvas-inline-button{background:#f7fafce8;border:1px solid #dce9ef;color:#2686b9;min-height:41px;font-weight:600;border-radius:6px;box-shadow:0 2px 4px #425a5422;transform:none!important}
.canvas-inline-button:hover{background:#edf7fe}.canvas-inline-button.muted-button{background:#eef3f7;color:#5785a1}
.canvas-plus-tile{border-color:#74a4b1;background:#eff8fa80;color:#2b879e}
.tg-composer{background:#fff;border-top:1px solid #dae4eb;display:flex;align-items:center;gap:12px;padding:10px 16px;color:#8aa4b4;min-height:47px;font-size:18px}
.tg-composer span:nth-child(2){font-size:13px;color:#9cadb8;flex:1}
.reply-keyboard{background:#d4dfe7;border-top:1px solid #c6d5dc;padding:9px 12px 12px;min-height:72px}
.reply-keyboard-caption{color:#526f81}.reply-keyboard-caption span{color:#718d9e}
.reply-key,.reply-key-add{color:#304c5f;background:#f8fafc;border:1px solid #d1dbe1;border-radius:6px;box-shadow:0 1px 3px #51636b33}
.reply-key-add{background:#f2f8fc;border-style:dashed;color:#438da8}
.tg-format-float{display:flex;justify-content:center;align-items:center;gap:2px;padding:5px;background:#293544;color:#eef6ff;border-radius:11px;box-shadow:0 8px 18px #0004;margin:4px auto 11px;width:max-content;max-width:100%;flex-wrap:wrap}
.tg-format-float[hidden]{display:none!important}
.tg-format-float button{background:transparent;border:0;color:#f6f8fd;cursor:pointer;border-radius:7px;min-width:32px;height:32px;font-size:13px}
.tg-format-float button:hover,.tg-format-float button:focus{background:#516477}
.tg-spoiler{background:#bac5cf;color:transparent;border-radius:3px;cursor:help}.tg-spoiler:hover{color:#1d2c37}
.workflow-intro{border:1px dashed #59708b;border-radius:12px;padding:12px;margin:12px 0}.workflow-intro p{font-size:11px;margin:5px 0 0}
.workflow-builder{border:1px solid #455c76;border-radius:14px;overflow:hidden;margin:12px 0;background:#1a293a}
.workflow-header{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 13px;background:#243751;color:#eef7ff}
.workflow-section{padding:13px;border-bottom:1px solid #344962;display:grid;gap:10px}
.workflow-section h4{color:#c0b9ff;font-size:12px;letter-spacing:.5px;margin:0}
.workflow-section h4 small{font-size:11px;color:#a2b1c3;font-weight:400;letter-spacing:0;margin-left:5px}
.workflow-entry{border:1px solid #39516d;background:#1f3145;border-radius:9px;padding:9px;display:grid;gap:8px}
.workflow-entry-row{display:flex;gap:6px;align-items:center}.workflow-entry-row .input{flex:1;min-width:0}
.workflow-entry-row button{border:0;background:#344760;color:#dce9f5;border-radius:7px;font-size:18px;min-width:33px;height:35px}
.workflow-number{border-radius:100%;background:#445474;color:#e8f3fe;display:grid;place-items:center;min-width:23px;height:23px;font-size:11px}
.workflow-add{padding:9px 12px;border:1px dashed #6f87a3;background:#263e58;color:#d8e8f8;border-radius:8px;font-weight:600}
.workflow-builder .field{margin:0}.workflow-builder .field span{font-size:11px}
.workflow-builder .input{font-size:12px;padding:9px}.workflow-and-row .input{width:100%}
@media(max-width:680px){.simple-chat-header{padding:9px}.simple-message{max-width:99%}.canvas-inline-keyboard{width:99%}.simple-chat-body{padding:12px 10px}.workflow-header{padding:10px}.workflow-section{padding:10px}}
/* R8: Pages and routes are separate; selecting a page never opens settings. */
.page-nav{display:grid;gap:7px}.page-nav-caption{font-size:10px;letter-spacing:.12em;font-weight:800;color:#91a2b9;display:flex;justify-content:space-between;padding:5px 7px}
.page-entry{border-radius:11px;background:#1b293b;border:1px solid #344256;overflow:hidden}
.page-entry .page-select{width:100%;padding:12px 11px;border-radius:0;display:flex;align-items:center;gap:9px}
.page-entry .page-select.active{background:#29456a;color:#eefaff}
.page-branches{padding:3px 10px 8px 21px;border-top:1px solid #3a4c63;background:#202e43}
.page-branch{display:flex;align-items:center;gap:7px;font-size:11px;line-height:1.5;padding:5px 0;color:#afbed1;min-width:0}
.page-corner{color:#72a9db;font-size:18px}.page-route-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-weight:600;color:#f0f5fb}
.page-branch-dest{margin-left:auto;color:#8db5ce;font-size:10px;white-space:nowrap;max-width:42%;text-overflow:ellipsis;overflow:hidden}.muted-branch{opacity:.65;font-style:italic}
.page-new{width:100%;padding:13px;background:#293a54;border:1px dashed #728baa;border-radius:10px;color:#eef6ff;cursor:pointer;font-weight:700}
.page-new:hover{background:#344d6d}
.canvas-button-wrap{position:relative;display:flex;width:100%}.canvas-button-wrap>.canvas-inline-button{flex:1;min-width:0}
.canvas-button-edit{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:0;background:#e0eff7;color:#1c719d;font-size:14px;cursor:pointer;width:30px;height:30px;border-radius:6px}
.canvas-button-wrap .canvas-inline-button{padding-right:42px}
.reply-key-wrap{display:flex;position:relative;flex:1;min-width:0}.reply-key-wrap>.reply-key{flex:1;min-width:0;padding-right:35px}
.reply-key-edit{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:0;background:#e1eef6;color:#386b8c;cursor:pointer;width:25px;height:29px;border-radius:5px}
.flow-advanced[open]{padding-bottom:10px}.flow-advanced-filters{display:grid;gap:12px;padding:14px}
@media(max-width:680px){.page-branch-dest{max-width:38%}.canvas-button-edit{opacity:1}}
.simple-message-input{min-height:86px;max-height:310px;resize:vertical}
@media(max-width:740px){.simple-screens{order:1}.simple-canvas{order:2}.simple-screens .page-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.page-nav-caption,.page-new{grid-column:1/-1}.page-entry .page-select{padding:9px 7px}.page-branches{padding:4px 5px 7px}.page-branch-dest{display:none}}
/* R8.1: clickable preview buttons expose simple actions; only tiny navigation icons switch screens. */
.page-nav{gap:8px}.page-entry{background:#1e2b3d;transition:background .16s}.page-entry:hover{background:#263952}
.page-entry .page-select{padding:12px 13px;min-height:48px}.page-entry .page-select.active{background:#2d486b}
.screen-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.screen-current-dot{font-size:7px;color:#65d3aa;margin-left:auto}.simple-rail-hint{line-height:1.5}
.canvas-button-wrap{position:relative;min-width:0}.canvas-button-wrap>.canvas-inline-button{padding:9px 40px 9px 10px;flex:1;min-width:0;justify-content:center}
.canvas-button-navigate,.reply-key-navigate{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:1px solid #cfdfec;background:#edf6fb;color:#267caf;cursor:pointer;border-radius:7px;min-width:29px;height:29px;display:grid;place-items:center;font-size:16px;line-height:1;z-index:2}
.canvas-button-navigate:hover,.reply-key-navigate:hover{background:#d9edf8;color:#115c85}
.reply-key-wrap>.reply-key{padding:9px 37px 9px 9px}.reply-key-navigate{right:5px;min-width:27px;height:27px}
.button-quick-menu{position:absolute;left:50%;top:calc(100% + 7px);transform:translateX(-50%);z-index:70;background:#fff;border:1px solid #d2dce4;box-shadow:0 18px 40px #1e345044,0 3px 8px #243c4c22;border-radius:15px;padding:6px;min-width:min(275px,85vw);max-width:90vw;color:#293b4d;display:grid;gap:2px;text-align:left}
.button-quick-menu:before{content:'';position:absolute;top:-6px;left:calc(50% - 5px);height:10px;width:10px;background:#fff;border-top:1px solid #d2dce4;border-left:1px solid #d2dce4;transform:rotate(45deg)}
.button-quick-head{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e9edf3;padding:8px 7px 9px;margin-bottom:3px;gap:5px}.button-quick-head strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;color:#5c6b7c}.button-quick-head button{border:0;background:#edf2f6;color:#38526b;border-radius:50%;width:27px;height:27px;font-size:19px;cursor:pointer}
.button-quick-menu>button{border:0;border-radius:9px;background:transparent;color:#263e53;text-align:left;font-size:13px;font-weight:600;padding:10px 12px;display:flex;align-items:center;gap:9px;cursor:pointer;min-height:41px}
.button-quick-menu>button:hover,.button-quick-menu>button:focus-visible{background:#eef5fa}.button-quick-menu .quick-delete{color:#a54c57;border-top:1px solid #e9edf3;border-radius:0 0 8px 8px;margin-top:3px}
.screen-picker-wrap{margin-left:auto;position:relative;z-index:90}.chat-screen-switcher{display:flex;align-items:center;justify-content:center;gap:6px;background:#e4eff5;border:1px solid #d2e3ee;border-radius:9px;color:#23648b;padding:8px 10px;cursor:pointer;font-size:12px;font-weight:700}.chat-screen-switcher:hover{background:#d4e9f7}
.screen-picker-popover{position:absolute;right:0;top:calc(100% + 5px);z-index:99;width:min(270px,80vw);max-height:290px;overflow:auto;background:#fff;color:#263b4f;border:1px solid #d5e1eb;box-shadow:0 15px 38px #15283b30;border-radius:12px;display:grid;gap:2px;padding:7px}
.screen-picker-popover button{border:0;background:transparent;color:#2c4c67;text-align:left;padding:11px 10px;border-radius:7px;cursor:pointer;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.screen-picker-popover button:hover{background:#edf4fb}.screen-picker-popover button.current{background:#e0effb;font-weight:800}
@media(max-width:680px){.button-quick-menu{left:8px;transform:none;min-width:min(270px,82vw)}.button-quick-menu:before{left:22px}.chat-screen-switcher span{display:none}.simple-rail-hint{font-size:11px}}

/* Keep lightweight menus visible beyond chat rows and improve mobile editing order. */
.simple-stage{overflow:visible}.simple-chat-header{border-radius:12px 12px 0 0}.reply-keyboard{border-radius:0 0 12px 12px}
@media(max-width:740px){.simple-canvas{order:1}.simple-screens{order:2}.button-quick-menu{max-width:calc(100vw - 48px)}.simple-editor-grid{gap:13px}}
/* R9 — page-first editor, independently editable Telegram messages. */
.page-nav{display:block}.page-tree-root,.page-tree-row{display:flex;align-items:center;gap:6px;min-height:43px;border:1px solid #344760;border-radius:10px;background:#1e2e44;margin:3px 0;padding:3px 6px;position:relative}
.page-tree-root{padding:4px}.page-tree-root>.screen-link,.page-tree-row>.screen-link{flex:1;width:auto;min-width:0;text-align:left;min-height:37px;padding:8px;border-radius:8px;font-size:12px}
.page-tree-row .page-select.active,.page-tree-root .page-select.active{background:#31547f;color:#fff}
.page-tree-children{margin-left:19px;padding-left:13px;border-left:2px solid #6c87a7}.page-tree-node{min-width:0;position:relative}.page-tree-children .page-tree-node:before{content:'';position:absolute;left:-13px;top:20px;width:12px;border-top:2px solid #6c87a7}
.page-grip{color:#9fb2ca;font-size:18px;cursor:grab;user-select:none}.page-tree-row:active .page-grip{cursor:grabbing}
.tree-expander,.tree-expander-spacer{color:#9fc9ed;border:0;background:transparent;min-width:18px;padding:4px;cursor:pointer;font-size:13px;text-align:center}
.tree-drag-hint{color:#6984a3;padding-right:4px;font-size:11px}.page-tree-help{font-size:10px;line-height:1.55;color:#a3b7d0;margin:11px 4px 13px}
.page-tree-row.drag-inside,.page-tree-root.drag-inside{outline:2px solid #60b4ed;background:#28476b}.page-tree-row.drag-before{border-top:3px solid #67d8ff}.page-tree-row.drag-after{border-bottom:3px solid #67d8ff}.page-tree-row.is-dragging{opacity:.5}
.page-new{margin-top:4px}
.screen-message-sequence{display:grid;gap:0}.screen-message-unit{display:grid;gap:4px;position:relative;margin-top:5px}.screen-message-unit .simple-message{max-width:min(94%,640px);width:100%;margin:0}
.screen-message-unit .canvas-inline-keyboard{margin-top:0;width:min(94%,640px)}.screen-message-unit .canvas-inline-button{padding:8px 12px;min-height:39px}
.screen-message-unit .simple-message-input{min-height:80px;width:100%}.screen-message-unit .message-helper{display:flex;align-items:center;justify-content:space-between;padding-top:6px;font-size:10px;color:#6c8496}
.screen-message-unit .mini-message-remove{border:0;background:#eff4f7;color:#687b88;cursor:pointer;padding:5px 9px;border-radius:6px}
.screen-insert-slot{display:flex;justify-content:flex-start;align-items:center;padding:12px 0 10px 20px;max-width:min(94%,640px);position:relative}
.screen-insert-slot:before{content:'';position:absolute;left:34px;top:0;height:100%;border-left:1px dashed #7d9d99;z-index:0}
.screen-insert-slot button{position:relative;z-index:1;border:1px dashed #82aab0;color:#2b7c8f;background:#ecfafafa;width:30px;height:30px;border-radius:50%;font-size:20px;font-weight:600;cursor:pointer;box-shadow:0 2px 8px #375d4e1d}
.screen-insert-slot button:hover{background:#ddf3fa}
.screen-timeline-chip{display:flex;align-items:center;gap:9px;background:#f2f8f7e8;color:#3f6671;border-radius:13px;padding:10px 13px;width:max-content;max-width:95%;margin:7px 0;font-size:12px;border:1px dashed #b5cbd0}
.screen-timeline-chip input{max-width:65px;padding:5px 6px;background:white;color:#30475b;height:30px}
.screen-timeline-chip button{margin-left:auto;border:0;background:#e5eeee;color:#5f727f;border-radius:50%;width:24px;height:24px;cursor:pointer}
.page-choice-modal{max-height:min(85vh,690px);display:flex;flex-direction:column;overflow:hidden}.page-choice-list{display:grid;gap:5px;overflow-y:auto;max-height:420px;margin:12px 0;padding-right:5px}
.page-choice-list>button{display:flex;align-items:center;gap:10px;text-align:left;padding:13px;border:1px solid #3c5268;background:#22344b;color:#e4f1ff;border-radius:11px;cursor:pointer;font-size:13px;font-weight:600}
.page-choice-list>button:hover{background:#335377}.page-choice-list>button span:nth-last-child(1){margin-left:auto}.page-choice-icon{background:#324e6f;border-radius:8px;padding:8px}
.screen-config-details{margin:14px 0 18px;border:1px solid #526a84;border-radius:13px;background:#162434;overflow:hidden}.screen-config-details>summary{padding:14px 16px;cursor:pointer;color:#dfeaf8;display:flex;align-items:center;gap:7px;font-weight:700}
.screen-config-details>summary span{margin-left:auto;color:#8cabc4}.screen-config-details[open]>summary{border-bottom:1px solid #425c79;background:#20344e}
.screen-config-body{padding:14px;display:grid;gap:12px}.screen-config-body>.field{margin:0}.screen-config-body .advanced-details{background:#1d2b3e;border:1px solid #344b65;border-radius:9px;margin:0;padding:0}
.screen-config-body .advanced-details>summary{padding:11px 12px;font-size:12px;cursor:pointer}.page-function-settings{display:grid;gap:12px}.page-function-settings .advanced-body{padding:12px;display:grid;gap:10px}
.screen-config-body .action-panel{padding:12px;margin:0}.screen-config-body .workflow-builder{margin:0}
.page-function-settings .field{margin:0}.page-function-settings .input{width:100%}
@media(max-width:740px){.simple-screens{order:2}.simple-canvas{order:1}.simple-screens .page-nav{display:block}.page-tree-children{margin-left:13px;padding-left:10px}.screen-message-unit .simple-message,.screen-message-unit .canvas-inline-keyboard{max-width:100%;width:100%}.screen-insert-slot{padding-left:11px}.screen-insert-slot:before{left:25px}.page-choice-list{max-height:50vh}}
.screen-message-unit .canvas-inline-keyboard{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:3px}
.screen-message-unit .canvas-inline-button{width:100%;font-weight:650}
.screen-message-unit .canvas-plus-tile{min-height:40px;max-width:75px;justify-self:start;border-radius:8px}
.message-media-details{color:#47708b;font-size:11px;margin:2px 0 5px;background:#e9f1f4;border-radius:8px;padding:5px 8px}
.message-media-details summary{cursor:pointer;font-weight:650;padding:5px;color:#3a759a}.message-media-details .field{margin:8px 0;color:#374f64}.message-media-details input,.message-media-details select{background:white;color:#293c52;font-size:12px;padding:8px;width:100%}

/* R10 — Telegram-style chat surface and interactive draft simulator. */
.r10-editor .simple-stage.telegram-simulator{max-width:660px;overflow:visible;background:#dce5d6;border:1px solid #b5c6d0;border-radius:14px;box-shadow:0 10px 35px #070f1928;color:#1b2e39}
.r10-editor .simple-chat-header{position:relative;z-index:60;display:flex;gap:10px;min-height:59px;padding:7px 11px;background:#fff;border-bottom:1px solid #e2e9ee;border-radius:14px 14px 0 0}
.r10-editor .simple-chat-back{appearance:none;border:0;background:transparent;cursor:pointer;color:#829cad;border-radius:50%;font-size:33px;line-height:1;width:35px;height:40px;padding:0;display:grid;place-items:center;flex:none;transition:background .12s}
.r10-editor .simple-chat-back:hover{background:#eaf1f8;color:#3684bd}
.r10-editor .simple-chat-avatar{width:41px;height:41px;flex:none;border-radius:50%;display:grid;place-items:center;font-size:22px;background:linear-gradient(135deg,#70befb,#2683c5)}
.r10-editor .tg-chat-identity{min-width:0;display:grid;align-content:center;gap:2px}
.r10-editor .tg-chat-identity strong{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;color:#172c3c}
.r10-editor .tg-chat-identity small{color:#6f9fb9;font-size:11px}
.r10-editor .screen-picker-wrap{display:flex;gap:5px;align-items:center}
.r10-editor .chat-screen-switcher,.r10-editor .tg-sound-btn{min-width:34px;height:34px;border:0;border-radius:50%;background:transparent;color:#668fac;cursor:pointer;display:grid;place-items:center;font-size:19px;padding:0}
.r10-editor .tg-sound-btn{font-size:16px}.r10-editor .chat-screen-switcher:hover,.r10-editor .tg-sound-btn:hover{background:#eaf3f8}
.r10-editor .simple-chat-body{height:clamp(340px,58vh,560px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;position:relative;padding:13px 14px 22px;background-color:#d7e4d8;background-image:radial-gradient(ellipse at 7% 24%,#d8e9cf 0 3%,transparent 3.1%),radial-gradient(ellipse at 85% 81%,#c5dbc5 0 2.5%,transparent 2.6%),linear-gradient(140deg,#dce9da,#d5e3dd 48%,#e4e9d9);background-size:180px 170px,220px 220px,cover}
.r10-editor .tg-day-label{font-size:10px;font-weight:600;letter-spacing:.2px;color:#fff;text-align:center;background:#99b1b0b0;border-radius:13px;width:max-content;max-width:140px;padding:4px 12px;margin:0 auto 16px}
.r10-editor .screen-message-unit.tg-edit-unit{gap:0;max-width:370px;min-width:0;margin:9px 0 2px;position:relative}
.r10-editor .tg-message-preview{position:relative;width:max-content;max-width:100%;min-width:62px}
.r10-editor .tg-bubble{position:relative;min-width:65px;max-width:min(335px,100%);width:max-content;padding:8px 11px 6px;background:#fff;color:#162c38;border-radius:4px 12px 12px 12px;box-shadow:0 1px 3px #334f5130;font-size:13px;line-height:1.38;overflow-wrap:anywhere}
.r10-editor .tg-bubble p{margin:0}.r10-editor .tg-bubble-content{white-space:normal;min-width:0}.r10-editor .tg-bubble-content a{color:#188ace;text-decoration:underline}.r10-editor .tg-bubble-content blockquote{border-left:3px solid #5b9bbc;margin:4px 0;padding:3px 8px;color:#426279;background:#e8f2f8}
.r10-editor .tg-bubble-meta{display:flex;justify-content:flex-end;align-items:center;gap:4px;margin-top:3px;color:#8c9ca6;font-size:9px;line-height:1;white-space:nowrap}
.r10-editor .tg-double-check{color:#57a1d0;font-size:13px;font-weight:700;letter-spacing:-4px;padding-right:4px}
.r10-editor .tg-bubble.tg-sim-outgoing{background:#e3ffdb;border-radius:12px 4px 12px 12px}
.r10-editor .tg-sim-outgoing .tg-bubble-meta{color:#7caa7a}
.r10-editor .tg-media{display:block;max-width:300px;max-height:270px;width:auto;height:auto;border-radius:8px;margin-bottom:5px;object-fit:cover}
.r10-editor .tg-media-file{background:#e9f2f8;border-radius:8px;padding:9px;margin-bottom:6px;font-size:11px}.r10-editor .tg-media-file a{color:#298dcc}
.r10-editor .screen-message-unit .canvas-inline-keyboard{width:min(100%,335px);grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin:3px 0 0}
.r10-editor .screen-message-unit .canvas-inline-button,.r10-editor .screen-message-unit .canvas-plus-tile{background:#f7fcffdb;color:#2789c0;border:0;border-radius:5px;min-height:33px;height:auto;padding:6px 8px;font-size:11px;font-weight:600;box-shadow:0 1px 2px #174b6330}
.r10-editor .canvas-inline-button:hover,.r10-editor .canvas-plus-tile:hover{background:#e5f5ff}
.r10-editor .screen-message-unit .canvas-plus-tile{border:1px dashed #83b5cd;max-width:75px}
.r10-editor .tg-message-edit-trigger{position:absolute;top:2px;right:-35px;border:0;background:#f8fcffdc;border-radius:50%;width:29px;height:29px;color:#408ab3;cursor:pointer;box-shadow:0 2px 6px #25455822;font-size:15px;display:grid;place-items:center;opacity:.72}
.r10-editor .tg-message-edit-trigger:hover,.r10-editor .tg-message-edit-trigger:focus{opacity:1;background:#fff}
.r10-editor .tg-floating-editor{position:relative;z-index:25;max-width:370px;min-width:min(310px,100%);width:100%;margin:9px 0 6px;padding:11px;background:#fff;border-radius:12px;border:1px solid #b5d6e9;box-shadow:0 10px 29px #243d5270;color:#29445a}
.r10-editor .tg-floating-editor:before{content:"";position:absolute;top:-6px;left:15px;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff}
.r10-editor .tg-floating-editor-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;font-size:11px;color:#56839e}
.r10-editor .tg-floating-editor-header button{border:0;background:transparent;color:#7894a7;font-size:23px;line-height:1;cursor:pointer}
.r10-editor .tg-edit-text{display:block;box-sizing:border-box;width:100%;resize:vertical;min-height:70px;max-height:180px;border:1px solid #c8dde9;border-radius:8px;background:#f9fcff;color:#20374d;padding:9px 10px;font:13px/1.45 inherit;outline:none;scrollbar-width:thin}
.r10-editor .tg-edit-text:focus{border-color:#50a3d9;box-shadow:0 0 0 2px #80c6f733}
.r10-editor .tg-edit-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px}
.r10-editor .tg-edit-tools .tg-edit-done{border:0;background:#309ddd;color:#fff;border-radius:8px;padding:8px 15px;font-size:12px;font-weight:650;cursor:pointer}
.r10-editor .tg-edit-tools .tg-media-tool{font-size:11px;color:#537b96;position:relative;flex:1}
.r10-editor .tg-media-tool summary{cursor:pointer;width:max-content;padding:7px;border-radius:7px;list-style:none}
.r10-editor .tg-media-tool[open]{display:grid;gap:6px}.r10-editor .tg-media-tool label{display:grid;gap:3px;font-size:11px}
.r10-editor .tg-media-tool .input{background:#fff;color:#243c53;padding:6px;font-size:11px;width:100%}
.r10-editor .tg-floating-editor .tg-format-float{position:relative;z-index:1;display:flex;align-items:center;gap:1px;flex-wrap:nowrap;max-width:100%;overflow-x:auto;scrollbar-width:none;margin:0 0 8px;padding:4px;border-radius:9px;background:#263a4c;box-shadow:0 4px 12px #15253633}
.r10-editor .tg-floating-editor .tg-format-float button{min-width:27px;width:28px;height:29px;font-size:12px;padding:0}
.r10-editor .tg-chat-history{display:flex;flex-direction:column;gap:8px;align-items:stretch;padding-top:2px}
.r10-editor .tg-chat-line{display:flex;flex-direction:column;gap:3px;max-width:100%;align-items:flex-start}
.r10-editor .tg-chat-line.outgoing{align-items:flex-end}
.r10-editor .tg-chat-line .tg-bubble{max-width:min(335px,85vw)}
.r10-editor .tg-sim-inline-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;width:min(335px,86%)}
.r10-editor .tg-sim-inline-row button{background:#f8fcffee;color:#268ac2;border:0;border-radius:5px;min-height:32px;font-size:11px;font-weight:650;cursor:pointer;padding:6px}
.r10-editor .tg-sim-inline-row button:active,.r10-editor .tg-live-keyboard button:active{transform:scale(.98);background:#d5ebfa}
.r10-editor .tg-sim-notice{text-align:center;align-self:center;max-width:min(310px,95%);background:#91a4a4bc;color:#fff;border-radius:15px;padding:7px 12px;font-size:10px;line-height:1.45}
.r10-editor .tg-typing-bubble{display:flex;gap:3px;background:#fff;border-radius:13px 13px 13px 3px;padding:12px 14px;width:max-content;box-shadow:0 1px 3px #2a53602a}
.r10-editor .tg-typing-bubble i{width:6px;height:6px;background:#79a4bc;border-radius:50%;animation:tgTyping 1s infinite alternate}.r10-editor .tg-typing-bubble i:nth-child(2){animation-delay:.2s}.r10-editor .tg-typing-bubble i:nth-child(3){animation-delay:.4s}
@keyframes tgTyping{to{opacity:.2;transform:translateY(-3px)}}
.r10-editor .tg-composer{margin:0;min-height:48px;display:flex;align-items:center;padding:6px 10px;gap:8px;background:#f7fbfd;border:0;border-top:1px solid #d7e3eb;border-radius:0}
.r10-editor .tg-composer input{font:13px/1.3 inherit;border:0;outline:none;background:#fff;border-radius:22px;flex:1;min-width:0;min-height:35px;color:#294459;padding:8px 14px}
.r10-editor .tg-composer input:disabled{background:#f0f4f6;color:#71899a;cursor:default}
.r10-editor .tg-composer button{border:0;cursor:pointer;display:grid;place-items:center;flex:none;border-radius:50%;min-width:32px;height:32px}
.r10-editor .tg-composer .tg-emoji{font-size:23px;color:#8a9fad;background:transparent}
.r10-editor .tg-composer .tg-send{color:#fff;background:#339bd7;font-size:18px}
.r10-editor .tg-composer .tg-send:disabled{opacity:.45;cursor:default}
.r10-editor .reply-keyboard{padding:7px 10px 10px;min-height:52px;background:#d9e4e9;border-top:1px solid #cbdae1;border-radius:0 0 14px 14px}
.r10-editor .reply-keyboard-caption{font-weight:600;font-size:10px;margin-bottom:5px;color:#67879e}.r10-editor .reply-keyboard-caption span{font-size:9px}
.r10-editor .reply-key,.r10-editor .reply-key-add{min-height:35px;border:0;border-radius:6px;background:#fafcfe;color:#3e6178;font-size:11px;box-shadow:0 1px 2px #61768933}
.r10-editor .tg-live-keyboard{padding:7px 10px 10px;background:#dde7ed;border-top:1px solid #cadbe3;border-radius:0 0 14px 14px;display:grid;gap:5px}
.r10-editor .tg-live-keyboard-row{display:flex;gap:5px}.r10-editor .tg-live-keyboard button{flex:1;border:0;border-radius:6px;min-height:36px;background:#fff;color:#365b74;box-shadow:0 1px 3px #496b8033;cursor:pointer;font-size:12px}
.r10-editor .simple-hint{font-size:11px}
@media(max-width:740px){
  .r10-editor .simple-stage.telegram-simulator{max-width:100%}
  .r10-editor .simple-chat-body{height:clamp(360px,55vh,580px);padding:12px 11px}
  .r10-editor .tg-bubble{max-width:min(305px,81vw);font-size:13px}
  .r10-editor .tg-chat-line .tg-bubble{max-width:80vw}
  .r10-editor .screen-message-unit.tg-edit-unit{max-width:calc(100% - 22px)}
  .r10-editor .tg-floating-editor{width:min(100%,360px);min-width:0}
  .r10-editor .tg-sim-inline-row{width:min(320px,86%)}
}
@media(prefers-reduced-motion:reduce){.r10-editor .tg-typing-bubble i{animation:none}}

/* R11 — compact, phone-width editing and one contextual circular add action for buttons. */
.r10-editor .simple-stage.telegram-simulator{width:min(100%,365px);max-width:365px;margin:0 auto;border:5px solid #263646;border-radius:29px;box-shadow:0 14px 32px #0003;overflow:visible}
.r10-editor .simple-chat-header{min-height:51px;padding:5px 8px;border-radius:23px 23px 0 0}
.r10-editor .simple-chat-avatar{width:34px;height:34px;font-size:18px}
.r10-editor .simple-chat-body{height:clamp(300px,52vh,540px);padding:9px 10px 15px}
.r10-editor .reply-keyboard,.r10-editor .tg-live-keyboard{border-radius:0 0 23px 23px}
.r10-editor .simple-heading.tg-compact-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0 10px;max-width:420px;margin:0 auto}
.r10-editor .tg-compact-heading h2{font-size:17px;margin:2px 0}
.r10-editor .tg-edit-screen-button{border:1px solid #41576f;background:#1c3046;color:#d4e8fa;border-radius:18px;padding:7px 11px;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap}
.r10-editor .tg-edit-screen-button:hover{background:#2b4767}
.r10-editor .tg-screen-tools{width:min(100%,365px);margin:12px auto 0;display:flex;flex-wrap:wrap;gap:7px;align-items:center;justify-content:space-between}
.r10-editor .tg-add-message-control{background:#1c3046;border:1px solid #476680;color:#d4e8fa;border-radius:11px;padding:9px 10px;font-size:11px;font-weight:650;cursor:pointer}
.r10-editor .tg-add-message-control:hover{background:#274562}
.r10-editor .tg-screen-tools>span{font-size:10px;color:#8eacc0}
.r10-editor .screen-config-details{width:min(100%,480px);margin:14px auto 15px}
.r10-editor .tg-edit-button-rows{width:min(100%,330px);display:flex;flex-direction:column;gap:3px}
.r10-editor .tg-edit-button-row{display:flex;align-items:stretch;gap:3px;min-height:33px}
.r10-editor .tg-edit-button-row .canvas-button-wrap,.r10-editor .tg-edit-button-row .reply-key-wrap{min-width:0;flex:1;position:relative}
.r10-editor .tg-edit-button-row .canvas-inline-button,.r10-editor .tg-edit-button-row .reply-key{width:100%;height:100%;min-height:33px;padding:6px 18px 6px 8px;word-break:break-word}
.r10-editor .tg-edit-button-row .tg-round-add{display:grid;place-items:center;width:32px;height:32px;min-width:32px;max-width:32px;align-self:center;flex:0 0 32px;border-radius:50%;border:1px solid #86b5cc;background:#eefaff;color:#2683b4;font-size:21px;font-weight:600;line-height:1;cursor:pointer;box-shadow:0 1px 3px #174b6330;padding:0}
.r10-editor .tg-edit-button-row .tg-round-add:hover,.r10-editor .tg-edit-button-row .tg-round-add:focus-visible{background:#d6f1fe;border-color:#308fbd}
.r10-editor .tg-edit-button-row .tg-button-remove{position:absolute;top:0;right:0;z-index:3;width:16px;height:16px;padding:0;border-radius:0 5px 0 6px;background:#e6edf2;border:0;color:#6a7580;font-size:13px;font-weight:700;line-height:1;cursor:pointer}
.r10-editor .tg-edit-button-row .tg-button-remove:hover{background:#fce0df;color:#be3434}
.r10-editor .tg-edit-button-row .button-quick-menu{z-index:45}
.r10-editor .screen-message-unit .canvas-inline-keyboard{display:flex;max-width:335px;grid-template-columns:none;width:min(100%,335px);margin-top:3px}
.r10-editor .screen-message-sequence .tg-message-more{display:block;margin:0 0 4px 6px;background:transparent;color:#5c8797;cursor:pointer;border:0;border-radius:10px;font-size:16px;line-height:1;letter-spacing:1px;padding:3px 9px;width:max-content}
.r10-editor .screen-message-sequence .tg-message-more:hover{background:#c2d6dc}
.r10-editor .screen-insert-slot{display:none}
.r10-editor .tg-message-edit-trigger{right:-27px;width:24px;height:24px;font-size:13px}
.r10-editor .tg-bubble{font-size:12px;max-width:min(295px,100%);padding:7px 9px 5px}
.r10-editor .tg-chat-line .tg-bubble{max-width:min(295px,85%)}
.r10-editor .tg-sim-inline-row{width:min(295px,86%)}
.r10-editor .tg-floating-editor{max-width:min(310px,calc(100vw - 58px));min-width:0}
.r10-editor .simple-chat-header .tg-chat-identity strong{max-width:144px}
@media(max-width:740px){.r10-editor .simple-stage.telegram-simulator{max-width:min(365px,100%)}.r10-editor .simple-chat-body{height:clamp(295px,50vh,470px);padding:9px 9px 12px}.r10-editor .tg-bubble{font-size:12px}.r10-editor .tg-floating-editor{width:100%}.r10-editor .tg-compact-heading{padding:4px 2px 9px}.r10-editor .simple-stage .tg-chat-line .tg-bubble{max-width:85%}}
@media(max-width:430px){.main{padding:13px 12px}.simple-topline .simple-name h1{font-size:21px;margin:4px 0}.simple-topline .simple-name p{display:none}.simple-topline .simple-name .eyebrow{font-size:10px}.simple-topline{gap:8px}.simple-save-actions{margin-top:2px}.simple-editor-grid{margin-top:9px}.simple-editor{padding:10px}.simple-toolbar{margin:0 0 6px;padding:0}.r10-editor .simple-chat-body{height:clamp(250px,40vh,340px)}.r10-editor .simple-stage.telegram-simulator{max-width:min(342px,100%)}.r10-editor .tg-add-message-control{padding:7px 9px}.r10-editor .tg-screen-tools>span{display:none}}

/* R11.1 usability polish: direct message editing, per-screen quick settings, compact chat, plus below rows. */
.r10-editor .tg-message-edit-trigger{display:none!important}
.r10-editor .tg-tap-to-edit{cursor:text;border-radius:12px;outline-offset:2px}
.r10-editor .tg-tap-to-edit:hover .tg-bubble{box-shadow:0 0 0 2px #68b9ec66,0 1px 3px #334f5130}
.r10-editor .tg-tap-to-edit:focus-visible{outline:2px solid #4caaeb}
.r10-editor .tg-direct-edit-bubble{display:block;width:min(300px,100%);max-width:100%;padding:7px 8px 6px;position:relative}
.r10-editor .tg-direct-edit-bubble .tg-edit-text{display:block;width:100%;min-height:38px;max-height:230px;resize:none;font:12px/1.4 inherit;background:transparent;color:#172d3a;border:0;border-radius:3px;padding:2px 1px;outline:none;box-shadow:none;overflow-y:auto;white-space:pre-wrap}
.r10-editor .tg-direct-edit-bubble .tg-edit-text:focus{box-shadow:none;border:0;outline:none}
.r10-editor .tg-direct-edit-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.r10-editor .tg-direct-edit-footer .tg-edit-done{border:0;background:#e6f2f9;border-radius:9px;padding:4px 9px;font-size:10px;font-weight:700;color:#237ba8;cursor:pointer}
.r10-editor .tg-direct-edit-footer .tg-media-tool{font-size:12px;color:#5490ae;position:relative}
.r10-editor .tg-direct-media-fields{display:grid;gap:6px;width:210px;position:absolute;left:0;top:100%;z-index:55;background:white;border:1px solid #b7ccda;border-radius:9px;padding:9px;box-shadow:0 7px 18px #162e4340}
.r10-editor .tg-direct-media-fields label{display:grid;gap:4px;font-size:10px}
.r10-editor .tg-direct-media-fields .input{min-width:0;width:100%;color:#25394d;background:#f8fafb;font-size:11px;padding:5px 7px}
.r10-editor .tg-direct-edit-bubble .tg-format-float{position:absolute;bottom:calc(100% + 5px);left:0;z-index:56;display:flex;gap:2px;padding:4px;border-radius:10px;background:#22384b;box-shadow:0 5px 20px #172b4966;white-space:nowrap;max-width:min(320px,90vw);overflow-x:auto}
.r10-editor .tg-direct-edit-bubble .tg-format-float[hidden]{display:none!important}
.r10-editor .tg-direct-edit-bubble .tg-format-float button{flex:0 0 auto;border:0;background:transparent;border-radius:5px;color:white;font-size:11px;width:27px;height:26px;cursor:pointer}
.r10-editor .tg-direct-edit-bubble .tg-format-float button:hover{background:#46677e}
.page-tree-row .tree-screen-edit,.page-tree-root .tree-screen-edit{flex:0 0 29px;width:29px;height:29px;display:grid;place-items:center;border-radius:8px;border:1px solid #47617d;background:#2a405c;color:#bddbf1;font-size:14px;cursor:pointer;padding:0}
.page-tree-row .tree-screen-edit:hover,.page-tree-root .tree-screen-edit:hover{background:#37699a;color:white}
.r10-editor .tg-bottom-add-row{justify-content:center!important;min-height:29px;margin-top:1px}
.r10-editor .tg-bottom-add-row .tg-round-add{height:29px;width:29px;min-width:29px;flex:0 0 29px;border:1px dashed #83b5cd;background:#edf8fd}
.r10-editor .screen-message-unit.tg-edit-unit{margin-top:5px;margin-bottom:0}
.r10-editor .tg-day-label{margin-bottom:7px}
.r10-editor .simple-chat-body{height:auto;min-height:150px;max-height:min(420px,54vh);padding-bottom:9px}
@media(max-width:740px){.r10-editor .simple-chat-body{height:auto;min-height:140px;max-height:46vh;padding-bottom:8px}}
@media(max-width:430px){.r10-editor .simple-chat-body{height:auto;min-height:120px;max-height:40vh;padding-bottom:7px}}

/* R11.2: simple add-one-at-a-time screen settings and automatic linked-page branches. */
.page-tree-list{display:grid;gap:3px}
.page-auto-depth{margin-left:calc(min(var(--auto-depth),3) * 9px);position:relative}
.page-auto-depth .screen-link-source{display:block;color:#8ea6c3;font-size:9px;line-height:1.2;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.page-auto-depth .page-select{display:block;min-width:0;text-align:left}
.page-auto-depth .tree-auto-corner{color:#73aed8;font-size:15px;flex:none}
.page-tree-row.drag-before{border-top:3px solid #66c7fc}
.page-tree-row.drag-after{border-bottom:3px solid #66c7fc}
.page-tree-row.drag-inside,.page-tree-root.drag-inside{outline:none}
.r10-editor .simple-stage.telegram-simulator{position:relative;isolation:isolate}
.r10-editor .simple-chat-header{z-index:3;position:relative;min-height:54px}
.r10-editor .simple-chat-body{position:relative;z-index:1}
.r10-editor .tg-composer,.r10-editor #editorReplyButtons{position:relative;z-index:1}
.r10-editor .screen-picker-popover{z-index:10}
.r10-editor .tg-sim-inline-group{display:grid;gap:3px;width:min(295px,86%)}
.r10-editor .tg-sim-inline-group .tg-sim-inline-row{width:100%}
.r10-editor .tg-edit-button-row{max-width:100%;flex-wrap:nowrap}
.r10-editor .tg-bottom-add-row{justify-content:center!important}
.easy-screen-modal{max-width:510px;max-height:min(88vh,720px);overflow-y:auto}
.easy-screen-modal .modal-head{margin-bottom:14px}
.easy-screen-modal .modal-head h2{font-size:19px;line-height:1.25}
.easy-screen-name{margin:0 0 14px!important}
.easy-screen-name label{font-size:12px}
.easy-screen-modal .easy-settings-stack{display:grid;gap:10px;margin-bottom:16px}
.easy-screen-modal .easy-setting-card{padding:11px 12px;border:1px solid #34495f;background:#1c2c40;border-radius:12px}
.easy-screen-modal .easy-setting-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:9px}
.easy-screen-modal .easy-setting-head b{font-size:13px;color:#e4edf8}
.easy-screen-modal .easy-setting-head button{width:27px;height:27px;border:0;border-radius:50%;background:#344760;color:#e3f0fd;font-size:19px;cursor:pointer}
.easy-screen-modal .easy-setting-card .field{margin:0}
.easy-screen-modal .easy-add-new{padding:14px;border:1px dashed #7eace0;background:#213b5b;color:#e5f1ff;border-radius:12px;font-weight:750;font-size:14px;cursor:pointer}
.easy-screen-modal .easy-add-new:hover{background:#304e74}
.easy-screen-modal .easy-add-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;background:#182739;padding:9px;border-radius:12px}
.easy-screen-modal .easy-add-picker button{background:#283f5c;border:1px solid #425d79;color:#eaf2ff;padding:10px;border-radius:10px;text-align:left;cursor:pointer;font-size:12px}
.easy-screen-modal .easy-add-picker button:hover{background:#34577d}
.easy-screen-modal .easy-delete-screen{background:transparent;border:0;color:#c38a93;width:100%;padding:8px;cursor:pointer;font-size:11px}
.easy-screen-modal .workflow-builder{margin:0}
.easy-screen-modal .action-panel{margin:0;border:0}
@media(max-width:490px){.easy-screen-modal .easy-add-picker{grid-template-columns:1fr 1fr}.page-auto-depth{margin-left:calc(min(var(--auto-depth),3)*6px)}.r10-editor .simple-chat-header{min-height:51px}}

/* R12 — simplified phone, no nested overlapping popovers, and reusable action tools. */
.r10-editor .simple-stage.telegram-simulator{width:min(100%,354px);max-width:354px;height:594px;min-height:594px;display:flex;flex-direction:column;margin-inline:auto;overflow:visible}
.r10-editor .simple-chat-header{flex:none;z-index:12}
.r10-editor .simple-chat-body{height:auto;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.r10-editor .tg-composer,.r10-editor #editorReplyButtons{flex:none}
.button-quick-menu,.screen-picker-popover{position:absolute;z-index:150;max-height:min(320px,50vh);overflow-y:auto;overscroll-behavior:contain;box-shadow:0 16px 35px #0d263855}
.modal-backdrop{position:fixed;inset:0;z-index:600;display:flex;align-items:center;justify-content:center;padding:12px;overflow:auto;overscroll-behavior:contain}
.modal-backdrop>.modal{max-height:min(90dvh,850px);overflow-y:auto;overscroll-behavior:contain}
.r12-modal .field{display:grid;gap:6px;margin-bottom:13px}.r12-modal .field .input{width:100%}.r12-modal p{line-height:1.55;margin:8px 0 16px}.r12-warning{background:#fff5d6;color:#563c04;border:1px solid #f2d38e;border-radius:11px;padding:12px;font-size:12px}.r12-divider{height:1px;background:#3c526a;margin:18px 0}.r12-tip{font-size:12px;color:#7f9bb6;line-height:1.6;padding:9px 0}.r12-tip code{background:#243f5d;border-radius:4px;padding:2px 4px}.r12-link-list{display:grid;gap:8px;max-height:50vh;overflow-y:auto}.r12-link-list>div{padding:10px;background:#1a2c43;border-radius:12px;display:grid;gap:8px}.r12-link-list code{font-size:11px;word-break:break-all;white-space:normal}.r12-link-list button,.r12-action-row button,.r12-attached-action button{border:1px solid #4b6684;border-radius:8px;background:#2c4664;color:#fff;padding:6px 10px;cursor:pointer}.r12-actions-list{display:grid;gap:8px;max-height:50vh;overflow:auto;margin:12px 0 18px}.r12-action-row{background:#1b2e43;border:1px solid #3c536c;padding:12px;border-radius:11px;display:flex;align-items:center;gap:7px}.r12-action-row>div{flex:1;min-width:0;display:grid;gap:4px}.r12-action-row small{color:#9eb5cf}.r12-empty{padding:20px;color:#9aafc8;text-align:center}.r12-automation-options{display:grid;gap:12px;padding:10px 0}.r12-automation-options select{width:100%}.r12-short-note{color:#9eb3c7;font-size:12px}.r12-advanced{border:1px solid #3d536d;border-radius:10px;padding:10px;margin:15px 0}.r12-advanced summary{cursor:pointer}.r12-advanced-inner{padding:14px 0 5px}.r12-attached-action{display:flex;align-items:center;justify-content:space-between;background:#1a2f4b;border-radius:9px;padding:7px;margin-top:6px;gap:8px}.r12-list-choices{display:grid;gap:6px;margin:10px 0}.r12-list-choices button{border:1px solid #4c627c;background:#253e59;color:#eaf3fe;padding:10px;border-radius:9px;text-align:left;cursor:pointer}.r12-timeline-menu{position:relative;border:1px solid #42627f;border-radius:10px;background:#1a314c;color:#d5e8ff;font-size:12px}.r12-timeline-menu>summary{padding:9px 12px;cursor:pointer}.r12-timeline-menu>div{padding:7px;display:flex;gap:5px;flex-wrap:wrap}.r12-timeline-menu button{padding:7px 9px;border:1px solid #54718a;border-radius:8px;background:#314e6d;color:#fff;cursor:pointer}.r12-external-item{display:flex;justify-content:space-between;align-items:center;border:1px solid #40546b;background:#1c3047;border-radius:9px;font-size:12px;padding:9px;margin:4px 0;color:#b9dbff}.r12-external-item button{background:transparent;color:#8ad1fa;cursor:pointer;border:0}
@media(max-width:740px){.r10-editor .simple-stage.telegram-simulator{height:min(590px,calc(100dvh - 135px));min-height:440px}.r12-modal .fieldrow{display:grid;grid-template-columns:1fr}.r12-modal{width:min(100%,470px)}}

/* R12.1: the bot flow owns each screen's configured items. Reorder controls change
   only the builder outline, never security-check execution order. */
.flow-feature-list{margin:1px 7px 8px 19px;padding-left:11px;border-left:1px solid #bbd7dc;display:flex;flex-direction:column;gap:2px}
.flow-feature-row{display:flex;align-items:center;min-width:0;gap:5px;border-radius:9px;padding:3px 3px 3px 0;color:#476774}
.flow-feature-row:hover,.flow-feature-row:focus-within{background:#e6f2f4}
.flow-feature-branch{color:#83abb3;font-size:12px;flex:0 0 14px}
.flow-feature-label{flex:1;min-width:0;padding:6px 1px;text-align:left;border:0;background:transparent;color:inherit;font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.flow-feature-controls{display:flex;gap:1px;flex-shrink:0}
.flow-feature-controls button{width:24px;height:25px;border:0;border-radius:7px;background:#dcecef;color:#496878;cursor:pointer;font-weight:700}
.flow-feature-controls button:disabled{opacity:.28;cursor:default}
.r10-editor .simple-chat-body{display:flex;flex-direction:column;justify-content:flex-start}
.r10-editor #messageSequence{margin-top:auto}
@media(max-width:500px){.flow-feature-row{gap:3px}.flow-feature-controls button{width:28px;height:28px}}

/* On small phones, the workspace nav should scroll away instead of covering the bot preview. */
@media(max-width:850px){.sidebar{position:relative;top:auto;z-index:0}}

/* R12.2 — child features have their own compact settings popups. */
.flow-one-modal{max-width:460px}
.flow-one-modal .field{margin:0 0 16px}
.flow-one-modal .action-panel,.flow-one-modal .workflow-builder{margin-bottom:16px}
.flow-one-modal .flow-one-feature{display:grid;gap:12px;margin-bottom:16px}
.flow-one-modal .flow-one-feature p{margin:0}
.flow-feature-label:focus-visible{outline:2px solid #74aaf7;outline-offset:2px;border-radius:4px}


/* R12.4 — connected screens are compact branches, never full-size menu cards. */
.page-tree-node.flow-linked-screen{margin-top:0;margin-bottom:0}
.page-tree-node.flow-linked-screen .page-tree-row.flow-linked-row{min-height:32px;margin:0 0 1px;padding:2px 3px 2px 1px;gap:5px;background:transparent;border:1px solid transparent;border-radius:8px;box-shadow:none}
.page-tree-node.flow-linked-screen .page-tree-row.flow-linked-row:hover,.page-tree-node.flow-linked-screen .page-tree-row.flow-linked-row:focus-within{background:#253e58;border-color:#385573}
.page-tree-node.flow-linked-screen .flow-linked-row>.screen-link{flex:1;min-height:26px;padding:4px 3px;background:transparent!important;font-size:12px;font-weight:500;color:#bcd6ef;border-radius:6px;line-height:1.25}
.page-tree-node.flow-linked-screen .flow-linked-row>.screen-link.active{color:#eaf8ff!important;background:#315477!important}
.page-tree-node.flow-linked-screen .flow-linked-row>.tree-screen-edit{width:25px;height:25px;flex:0 0 25px;border-color:transparent;background:transparent;color:#91b9d7;font-size:12px}
.page-tree-node.flow-linked-screen .flow-linked-row>.tree-screen-edit:hover{background:#3e5b7a;color:white}
.page-tree-node.flow-linked-screen .flow-linked-row>.page-grip{font-size:13px;opacity:.65}
.page-tree-node.flow-linked-screen .flow-linked-row .tree-auto-corner{color:#75b1ce;font-size:13px}
.page-tree-node.flow-linked-screen .flow-feature-list{margin-top:0;margin-bottom:4px}
/* Keep features legible alongside linked screens in the dark flow panel. */
.simple-screens .flow-feature-list{border-left-color:#466782}
.simple-screens .flow-feature-row{color:#aac8e0}
.simple-screens .flow-feature-row:hover,.simple-screens .flow-feature-row:focus-within{background:#253e58}
.simple-screens .flow-feature-branch{color:#6c9dbb}
.simple-screens .flow-feature-controls button{background:#304d68;color:#d9eafa}
/* Remove message directly from its corner; never create an extra editing toolbar. */
.r10-editor .tg-message-preview .tg-message-remove{position:absolute;right:-10px;top:-8px;z-index:9;display:grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid #dfedf4;border-radius:50%;background:#fff;color:#b44555;box-shadow:0 2px 6px #23364d42;font-size:16px;font-weight:700;line-height:1;cursor:pointer}
.r10-editor .tg-message-preview .tg-message-remove:hover,.r10-editor .tg-message-preview .tg-message-remove:focus-visible{background:#ffeced;color:#a01d34;outline:2px solid #99b9df;outline-offset:1px}
@media(max-width:490px){.page-tree-node.flow-linked-screen .page-tree-row.flow-linked-row{min-height:34px}.r10-editor .tg-message-preview .tg-message-remove{width:24px;height:24px;right:-11px}}

/* R12.5: Small, predictable × beside each screen, never on the required Welcome root. */
.page-tree-row>.tree-screen-delete{flex:0 0 24px;width:24px;height:24px;display:grid;place-items:center;padding:0;border:1px solid transparent;background:transparent;color:#99b1c6;border-radius:8px;font-size:17px;line-height:1;cursor:pointer}
.page-tree-row>.tree-screen-delete:hover,.page-tree-row>.tree-screen-delete:focus-visible{background:#6c2944;color:white;border-color:#b65a6f;outline:2px solid #91bedc;outline-offset:1px}
.page-tree-row>.tree-screen-edit{flex:0 0 26px;width:26px;height:26px}
.page-tree-node.flow-linked-screen .page-tree-row>.tree-screen-delete{flex:0 0 22px;width:22px;height:22px;font-size:15px}
.page-tree-row>.screen-link{min-width:0;flex:1}
.r125-existing-picker .page-choice-list{overscroll-behavior:contain;max-height:min(55vh,400px)}
.r125-existing-picker .page-choice-list>button:focus-visible{outline:2px solid #7dcbff;outline-offset:2px}
@media(max-width:540px){.page-tree-row>.tree-screen-delete{flex:0 0 29px;width:29px;height:29px}.page-tree-node.flow-linked-screen .page-tree-row>.tree-screen-delete{flex:0 0 27px;width:27px;height:27px}}

/* R12.6: distraction-free bot editor, nested flow by drag/drop, useful start menu. */
.editor-focused-shell{display:block!important;min-height:100vh;max-width:100%;}
.editor-focused-shell>.main{width:100%!important;max-width:none!important;margin:0!important;padding:clamp(12px,2vw,27px)!important;}
.editor-focused-shell>.main>.view{max-width:none!important;}
.editor-focused-shell .simple-editor-grid{grid-template-columns:minmax(220px,310px) minmax(0,1fr);max-width:1300px;margin-left:auto;margin-right:auto;}
.editor-focused-shell .simple-screens{min-width:0;}
.editor-focused-shell .r126-drop-top{font-size:11px;padding:11px 10px;border-radius:10px;border:1px dashed #698aa8;color:#afcee5;text-align:center;margin-top:10px;cursor:default;}
.editor-focused-shell .r126-drop-top.drag-inside{background:#24466c;color:white;outline:2px solid #53b4e4;}
.editor-focused-shell .page-tree-root.drag-inside{outline:2px solid #53b4e4;background:#24466c;}
.editor-focused-shell .page-tree-node{margin-left:calc(var(--auto-depth,0)*10px)!important;}
.editor-focused-shell .page-tree-node .page-tree-row .screen-link{padding:4px 1px;min-height:26px;}
.editor-focused-shell .r126-move-controls{display:flex;gap:0;align-items:center;flex:0 0 auto;}
.editor-focused-shell .r126-move-controls>button{background:transparent;border:0;color:#a9c8dc;cursor:pointer;padding:3px;border-radius:5px;font-size:12px;line-height:1;min-width:17px;}
.editor-focused-shell .r126-move-controls>button:hover,.editor-focused-shell .r126-move-controls>button:focus-visible{background:#3e6183;color:white;}
.editor-focused-shell .page-tree-row.drag-inside{background:#203c5f!important;outline:2px solid #53b4e4!important;}
.editor-focused-shell .tg-screen-tools.r126-start-tool{justify-content:center;margin-top:8px;}
.editor-focused-shell .r126-start-tool .tg-edit-screen-button{font-size:11px;padding:7px 14px;}
@media(max-width:760px){.editor-focused-shell .simple-editor-grid{display:flex!important;flex-direction:column;max-width:100%;}.editor-focused-shell .simple-canvas{order:1}.editor-focused-shell .simple-screens{order:2}.editor-focused-shell>.main{padding:9px!important}.editor-focused-shell .r126-move-controls>button{padding:6px;min-width:26px}}

/* R13 — simple builder controls and a real, editable white-space bot map. */
.editor-focused-shell .r126-move-controls{display:none!important}
.tg-flow-open{display:block;width:100%;min-height:38px;border:1px solid #83b7eb;border-radius:11px;background:#315b87;color:white;cursor:pointer;font-size:13px;font-weight:750;margin-top:9px}
.tg-flow-open:hover,.tg-flow-open:focus-visible{background:#3c73a4;outline:2px solid #9accfb}
.tg-flow-open-light{background:#193653;color:#d4edff;border-color:#477597}
.tg-flow-overlay{position:fixed;inset:0;z-index:580;background:rgba(13,29,51,.64);display:flex;align-items:center;justify-content:center;padding:clamp(4px,2vw,18px)}
.tg-flow-window{height:min(94dvh,950px);width:min(98vw,1600px);display:flex;flex-direction:column;background:#fff;color:#1c3452;border-radius:19px;overflow:hidden;box-shadow:0 26px 80px #09182f75}
.tg-flow-toolbar{display:flex;align-items:center;gap:9px;min-height:72px;padding:14px 19px;background:#fff;border-bottom:1px solid #e5ecf4;flex:none}
.tg-flow-toolbar>div{flex:1;min-width:0;display:grid;gap:4px}.tg-flow-toolbar strong{font-size:17px;color:#173c60}.tg-flow-toolbar small{font-size:11px;color:#72859c}
.tg-flow-toolbar-add{padding:10px 13px;border-radius:10px;background:#e7f1fe;color:#245380;border:1px solid #c5dcf6;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap}
.tg-flow-toolbar-close{width:37px;height:37px;border-radius:50%;background:#edf2f7;border:0;color:#355472;font-size:22px;cursor:pointer}
.tg-flow-viewport{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;background-color:#fff;background-image:radial-gradient(#d4e1ee 1px,transparent 1px);background-size:23px 23px;touch-action:pan-x pan-y}
.tg-flow-paper{position:relative;min-width:100%;min-height:100%}.tg-flow-paper>svg{position:absolute;inset:0;overflow:visible;pointer-events:none}
.tg-flow-node{position:absolute;width:236px;min-height:112px;padding:13px;background:#fff;border:1.5px solid #c8dcf2;border-radius:14px;box-shadow:0 6px 22px #2e5f9330;display:flex;flex-direction:column;gap:7px}
.tg-flow-node-top{display:flex;align-items:center;gap:9px;min-width:0}.tg-flow-node-top span{background:#e6f2ff;width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none}
.tg-flow-node-top strong{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;color:#17354d}.tg-flow-node-sub{font-size:11px;color:#71889a}
.tg-flow-node-actions{display:flex;gap:5px;margin-top:auto}.tg-flow-node-actions button{background:#f2f7fc;border:1px solid #d5e2f1;color:#315576;border-radius:7px;padding:5px 8px;font-size:11px;cursor:pointer}
.tg-flow-node-actions button:hover{background:#daebff}.tg-flow-node-actions .tg-flow-node-plus{margin-left:auto;border-radius:50%;width:29px;height:29px;padding:0;background:#327ad0;color:#fff;font-size:18px}
.tg-flow-footer{font-size:11px;padding:12px 20px;color:#73869d;border-top:1px solid #e7eff7;flex:none;background:#fff}
.tg-template-dialog{max-width:790px!important;width:min(96vw,790px)!important}.tg-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:58vh;overflow-y:auto;overscroll-behavior:contain;padding:5px}
.tg-template-tile{display:grid;grid-template-columns:33px 1fr;align-items:start;gap:4px 8px;text-align:left;padding:13px;border-radius:12px;border:1px solid #446080;background:#203952;color:#edf7ff;cursor:pointer}
.tg-template-tile:hover,.tg-template-tile:focus-visible{border-color:#80bcf8;background:#2d5176;outline:2px solid #7ab0ee}
.tg-template-tile>span{grid-row:span 3;font-size:24px}.tg-template-tile strong{font-size:13px}.tg-template-tile small{font-size:11px;color:#b7cbdc;line-height:1.4}.tg-template-tile em{font-size:10px;color:#91cfff;font-style:normal}
.tg-template-help{font-size:12px;color:#9cafc4;line-height:1.5;margin:8px 0 14px}.tg-template-place{width:min(96vw,480px)!important}
.tg-template-standalone{max-height:none;margin-top:14px}.tg-template-standalone .tg-template-tile{background:#eaf2fb;color:#25435d;border-color:#d2e1f1}.tg-template-standalone .tg-template-tile small{color:#557087}.tg-template-standalone .tg-template-tile:hover{background:#d6e9fc}
@media(max-width:680px){.tg-flow-toolbar{padding:10px;gap:6px;min-height:62px}.tg-flow-toolbar small{display:none}.tg-flow-toolbar-add{font-size:10px;padding:9px 8px}.tg-flow-window{height:96dvh;width:100%;border-radius:11px}.tg-flow-footer{font-size:10px;padding:9px}.tg-template-grid{grid-template-columns:1fr}}

/* R13.2 — Deterministic, edge-aware tree rearrangement. */
.editor-focused-shell .page-nav{position:relative;isolation:isolate;}
.editor-focused-shell .page-tree-list{min-height:24px;}
.editor-focused-shell .page-tree-row{transition:background .1s ease,border-color .1s ease;}
.editor-focused-shell .page-grip{min-width:23px;min-height:29px;display:grid;place-items:center;touch-action:none;cursor:grab;}
.editor-focused-shell .page-tree-row .page-grip:active{cursor:grabbing;}
.editor-focused-shell .page-tree-node .page-tree-row.drag-before{border-top:3px solid #6ed3ff!important;box-shadow:0 -4px 0 -2px #6ed3ff!important;}
.editor-focused-shell .page-tree-node .page-tree-row.drag-after{border-bottom:3px solid #6ed3ff!important;box-shadow:0 4px 0 -2px #6ed3ff!important;}
.editor-focused-shell .page-tree-node .page-tree-row.drag-inside{outline:2px solid #76d4ff!important;outline-offset:0!important;background:#305777!important;}
.editor-focused-shell .flow-outdent-edge{display:none;position:sticky;bottom:8px;margin:9px 0 0;padding:8px;border:2px dashed #88c7ec;border-radius:9px;color:#b7e3ff;font-size:11px;letter-spacing:.04em;font-weight:800;background:#1b3752;pointer-events:none;z-index:4;text-align:center;}
.editor-focused-shell .flow-is-dragging .flow-outdent-edge{display:block;}
.editor-focused-shell .flow-root-active .flow-outdent-edge{border-style:solid;background:#dff3ff;color:#123d5b;}
.editor-focused-shell .flow-is-dragging .page-tree-root{border-color:#739fc1;}
.editor-focused-shell .page-tree-row.is-dragging{opacity:.34;}
@media(hover:none){.editor-focused-shell .page-grip{min-width:35px;min-height:36px;font-size:19px!important;}}

/* R13.3 complete template previews */
.tg-template-replace{max-width:min(650px,94vw);max-height:min(88vh,840px);overflow-y:auto;}
.tg-template-preview{border:1px solid #d7e3ee;background:#f8fbff;border-radius:14px;max-height:310px;overflow:auto;padding:10px;margin:12px 0;color:#23354a;}
.tg-template-preview-screen{margin:5px 0 4px calc(var(--template-depth,0) * 17px);padding:7px 9px;background:#fff;border-left:2px solid #76a6dd;border-radius:7px;display:flex;align-items:center;gap:6px;font-size:13px;}
.tg-template-preview-screen small{font-size:10px;background:#eef5fd;padding:2px 6px;border-radius:6px;}
.tg-template-preview-button{margin:2px 0 2px calc(var(--template-depth,0) * 17px + 18px);font-size:11px;color:#536a80;padding:2px 4px;display:flex;justify-content:space-between;gap:10px;}
.tg-template-preview-button span{opacity:.75;}
.tg-template-merge-option{margin-top:11px;font-size:13px;border-top:1px solid #dae2ed;padding-top:12px;}
.tg-template-merge-option summary{cursor:pointer;}
.tg-template-merge-option form{padding-top:12px;}
.tg-template-undo{width:100%;border:1px solid #c1dbf0;background:#eef6ff;border-radius:9px;padding:8px 10px;cursor:pointer;color:#23486d;font-size:12px;margin-top:6px;}
.tg-flow-node-links{font-size:10px;color:#466380;max-height:75px;overflow:auto;margin:5px 0;padding:2px 6px;}
.tg-flow-node-links div{display:flex;justify-content:space-between;gap:5px;margin-bottom:2px;}
.tg-flow-node-links small{font-size:9px;}
.tg-flow-node{min-height:112px;height:auto!important;}

/* R13.4 - Default first message action is visible, with no extra new-user clutter. */
.easy-message-default{border:1px solid #bad5f6;background:#f4f9ff;border-radius:12px;padding:12px 13px;display:grid;gap:6px;margin-bottom:8px;color:#163957}
.easy-message-default-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;font-weight:750}
.easy-message-default-title small,.easy-message-default>small{font-weight:450;font-size:11px;color:#557490}
.easy-message-default .field{margin:5px 0 0}
.easy-add-picker button.is-already-selected{background:#e5f3ff;border-color:#89bbfa;color:#16508a;font-weight:700}

/* R13.5: compact consistent plus controls */
.r10-editor .tg-edit-button-row .tg-round-add{width:27px;height:27px;min-width:27px;max-width:27px;flex:0 0 27px;border-radius:50%;font-size:17px;transition:background .12s,border-color .12s,transform .12s} 
.r10-editor .tg-bottom-add-row{display:flex!important;justify-content:center!important;align-items:center!important;width:100%;} 
.r10-editor .tg-bottom-add-row .tg-round-add{width:27px!important;height:27px!important;min-width:27px!important;max-width:27px!important;flex:0 0 27px!important;} 
.r10-editor .reply-keyboard .tg-bottom-add-row{justify-content:center!important;}
.r10-editor .tg-round-add:hover{transform:scale(1.07)}
.easy-add-picker button.is-already-selected,.easy-add-picker button.is-already-selected:hover,.easy-add-picker button.is-already-selected:focus-visible{background:#e9f6ff!important;color:#154973!important;border-color:#7fb4e1!important;}
.easy-message-default,.easy-message-default:hover{background:#eaf5ff!important;border-color:#aacdec!important;color:#183a54!important;}
.easy-message-default-title{color:#153a59!important;}
/* R13.5 free-canvas drag with responsive live SVG curves */
.tg-flow-node-top[data-flow-grip]{cursor:grab;touch-action:none;user-select:none;min-height:32px;}
.tg-flow-node-top[data-flow-grip]:active,.tg-node-moving .tg-flow-node-top{cursor:grabbing;}
.tg-node-moving{box-shadow:0 16px 40px #2d638449!important;border-color:#4f97e9!important;z-index:4;}
.tg-flow-viewport{cursor:grab;touch-action:none;}
.tg-flow-viewport:active{cursor:grabbing;}
.tg-flow-node{cursor:default;}
.tg-flow-drag-symbol{margin-left:auto;color:#7292ad;font-size:17px;}
.logic-capabilities{display:flex;flex-wrap:wrap;gap:7px;padding:8px 0 14px;}
.logic-capabilities span{display:inline-flex;border:1px solid #d7e5f3;background:#edf5fc;color:#285674;padding:6px 10px;border-radius:14px;font-size:12px;}
.r12-attached-action{display:flex;align-items:center;gap:6px;}.r12-attached-action span{flex:1;}
.r12-attached-action button{flex:0 0 auto;}
.tg-flow-layout-reset{background:#f7fafc!important;}
@media(max-width:640px){.tg-flow-toolbar{flex-wrap:wrap}.tg-flow-toolbar-add{font-size:11px;}.tg-flow-layout-reset{display:none}.r10-editor .tg-bottom-add-row{justify-content:center!important;}}
/* Empty Telegram reply keyboard: the only + should be centred. */
.r10-editor .reply-keyboard .tg-edit-button-row:has(>.tg-round-add:only-child){justify-content:center!important;}

/* R14: all controls and button labels stay inside a narrow phone preview */
.r10-editor .simple-stage.telegram-simulator,.r10-editor .simple-chat-header,.r10-editor .simple-chat-body,.r10-editor .reply-keyboard,.r10-editor .tg-live-keyboard{box-sizing:border-box;max-width:100%;min-width:0;overflow-x:hidden!important;}
.r10-editor .simple-stage.telegram-simulator{width:min(360px,100%)!important;min-width:0!important;}
.r10-editor .simple-chat-body>*,.r10-editor .tg-chat-history,.r10-editor .tg-chat-line,.r10-editor .tg-message-preview,.r10-editor .screen-inline-buttons,.r10-editor .canvas-inline-keyboard,.r10-editor .tg-sim-inline-group{box-sizing:border-box;min-width:0;max-width:100%;}
.r10-editor .tg-sim-inline-group,.r10-editor .tg-sim-inline-row{max-width:100%;width:100%;grid-template-columns:minmax(0,1fr);}
.r10-editor .tg-sim-inline-row button,.r10-editor .tg-live-keyboard button,.r10-editor .canvas-inline-button,.r10-editor .reply-key{min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word;white-space:normal;line-height:1.3;}
.r10-editor .tg-edit-button-row{max-width:100%;min-width:0;box-sizing:border-box;}
.r10-editor .tg-bubble,.r10-editor .tg-bubble-content{min-width:0;overflow-wrap:anywhere;word-break:break-word;}
.r10-editor .tg-media{max-width:100%;height:auto;}
.r10-editor .tg-live-keyboard-row{min-width:0;max-width:100%;}
.r10-editor .tg-live-keyboard-row button{flex:1 1 0;}
.r14-flow-link{display:flex!important;gap:4px;align-items:center;justify-content:stretch!important;max-width:100%;}
.r14-flow-link>button:first-child{display:flex;flex:1;justify-content:space-between;gap:6px;align-items:center;background:#f4f8fc;border:1px solid #dfe8f2;border-radius:6px;padding:5px;min-width:0;cursor:pointer;color:#2d577e;font:inherit;font-size:10px;}
.r14-flow-link>button:first-child span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.r14-flow-link>button:first-child small{white-space:normal;min-width:0;text-align:right;flex:1;overflow-wrap:anywhere;}
.r14-flow-link-remove{flex:none;background:#fff2f3;border:1px solid #ffe0e1;border-radius:50%;color:#b0363e;font-size:15px;width:20px;height:20px;cursor:pointer;}
.r14-quick-create .r14-action-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:4px 0;}
.r14-quick-create .r14-action-options button{min-width:0;display:flex;text-align:left;align-items:center;gap:6px;white-space:normal;background:#f6faff;border:1px solid #d6e4f5;border-radius:10px;color:#254967;padding:12px 10px;cursor:pointer;font-weight:600;}
.r14-quick-create .r14-action-options small{display:block;font-size:10px;font-weight:400;opacity:.75;margin-top:3px;}
.r14-quick-create .r14-action-options button:hover,.r14-quick-create .r14-action-options button:focus-visible{background:#e9f4ff;border-color:#8fbde6;}
.r14-modal{max-width:800px;max-height:90vh;overflow-y:auto;}
.r14-provider-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;}
.r14-provider,.r14-app{background:#f9fcff;color:#245079;border:1px solid #cfdff0;border-radius:10px;cursor:pointer;text-align:left;padding:10px;}
.r14-provider span,.r14-provider b,.r14-provider small,.r14-app small{display:block;}
.r14-provider span{font-size:24px;margin-bottom:5px;}
.r14-provider small,.r14-app small{font-size:10px;opacity:.75;margin-top:3px;}
.r14-directory{max-height:260px;overflow-y:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:9px;}
.r14-app{overflow-wrap:anywhere;font-size:12px;}
.r14-app[hidden]{display:none!important;}
.r14-connected-row{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f5f9fd;border-radius:8px;padding:10px;margin:5px 0;}
.r14-connected-row b,.r14-connected-row small{display:block;}.r14-connected-row small{font-size:11px;color:#6c8195;}
.r14-connected-row>button{background:#fff;border-radius:50%;border:1px solid #e0e6ed;color:#c13b44;font-size:17px;cursor:pointer;}
.r14-return{border:0;color:#2f6ca8;background:transparent;padding:8px;cursor:pointer;}
.r14-check{display:flex;align-items:center;gap:8px;margin:12px 0;}
.r14-search{width:100%;margin-top:8px;}
@media(max-width:540px){.r14-provider-grid,.r14-quick-create .r14-action-options{grid-template-columns:repeat(2,minmax(0,1fr));}.r14-directory{grid-template-columns:repeat(2,minmax(0,1fr));}.r10-editor .simple-stage.telegram-simulator{width:100%!important;}}
/* Let the full-flow card grow to fit its real button labels; never crop links. */
.tg-flow-node-links{max-height:none!important;overflow:visible!important;min-height:0;padding:1px 0;margin:4px 0;}
.tg-flow-node{height:auto!important;min-height:112px;}
.tg-flow-node-links .r14-flow-link{margin:3px 0;max-width:100%;}
.tg-flow-node-links .r14-flow-link button:first-child{min-height:28px;min-width:0;}
.tg-flow-node-links .r14-flow-link button:first-child small{max-width:42%;overflow-wrap:anywhere;line-height:1.15;}

/* R14.2: direct, single-column screen-action workflow; no competing choice dialog. */
.easy-screen-modal .easy-add-picker{display:flex!important;flex-direction:column!important;gap:5px!important;max-height:52dvh;overflow-y:auto;overscroll-behavior:auto;background:#f5f8fc!important;border:1px solid #d8e4ef;padding:9px;border-radius:12px}
.easy-screen-modal .easy-add-picker>button{display:block;min-width:0!important;width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere;background:#fff!important;border:1px solid #d5e0ef!important;color:#183d60!important;font-weight:650;padding:10px 12px;box-sizing:border-box}
.easy-screen-modal .easy-add-picker>button:hover,.easy-screen-modal .easy-add-picker>button:focus-visible{background:#e6f3ff!important;color:#17395e!important;border-color:#93bde7!important}
.easy-screen-modal .easy-add-picker>button.is-already-selected{background:#e0f3e9!important;color:#155a37!important;border-color:#80bba5!important}
.easy-screen-modal .easy-add-picker>button.is-already-selected:hover{background:#d0ebdf!important;color:#155a37!important}
.easy-screen-modal .easy-add-picker>button small{display:block;margin-left:1.65em;font-size:11px;font-weight:400;color:#526985}
.easy-screen-modal .r142-action-group-label{padding:12px 6px 4px;letter-spacing:.02em;font-size:11px;font-weight:800;text-transform:uppercase;color:#476380}
.r10-editor .simple-stage.telegram-simulator{overscroll-behavior:auto!important}
.r10-editor:not(.is-chat-testing) .simple-chat-body{overscroll-behavior-y:auto!important}
@media(max-width:540px){.easy-screen-modal .easy-add-picker{max-height:48dvh}.easy-screen-modal .easy-add-picker>button{font-size:13px;padding:10px}}

/* Flow editing: integrated root drop target and draggable action ordering */
.flow-outdent-edge{display:none!important}
.flow-feature-grip{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;min-height:30px;cursor:grab;touch-action:none;user-select:none;color:#8bb6d6;font-size:19px}
.flow-feature-grip:active{cursor:grabbing}
.flow-feature-row.feature-drop-target{outline:2px solid #50a8f3;outline-offset:-2px;background:#254f70!important}
.page-tree-row.is-dragging{opacity:.58;outline:2px dashed #67b7f7;outline-offset:2px;transform:scale(1.015);transition:transform .12s,opacity .12s}
.page-nav.flow-root-active .page-tree-list{box-shadow:inset 5px 0 #64bbff;border-radius:8px}

/* R15 — separate navigation from behavior; transactional live branch movement. */
.editor-focused-shell .page-nav.flow-v15{display:flex!important;flex-direction:column;gap:7px;isolation:auto}
.editor-focused-shell .flow-v15 .page-tree-list{display:flex;flex-direction:column;gap:4px;min-height:18px}
.editor-focused-shell .flow-v15 .page-tree-node{position:relative;min-width:0;margin-left:calc(min(var(--auto-depth,0),5)*12px)!important;margin-top:0;margin-bottom:0}
.editor-focused-shell .flow-v15 .page-tree-node[style*="--auto-depth:0"]{margin-top:8px}
.editor-focused-shell .flow-v15 .page-tree-row,.editor-focused-shell .flow-v15 .page-tree-root{display:flex;align-items:center;gap:3px;min-height:50px;padding:4px;border:1px solid #354d67;border-radius:10px;background:#1b2b40;box-sizing:border-box;position:relative;min-width:0;transition:background .12s,border-color .12s}
.editor-focused-shell .flow-v15 .page-tree-row:hover{background:#253e58;border-color:#507293}
.editor-focused-shell .flow-v15 .page-tree-row.is-selected{background:#24445d;border-color:#66abc9}
.editor-focused-shell .flow-v15 .page-tree-row .screen-link,.editor-focused-shell .flow-v15 .page-tree-root .screen-link{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;min-width:0;flex:1;border:0;background:transparent!important;padding:5px 3px;line-height:1.35;text-align:left;font-size:12px;color:#d5e8f4}
.editor-focused-shell .flow-v15 .screen-label{white-space:normal;overflow-wrap:anywhere;line-height:1.3}
.editor-focused-shell .flow-v15 .screen-link.active{color:#fff!important}
.flow-parent-label{font-size:9px;font-weight:400;color:#8eb3c9;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.editor-focused-shell .flow-v15 .page-grip,.flow-home-icon{flex:0 0 25px;display:grid;place-items:center;width:25px;min-height:36px;padding:0;border:0;border-radius:6px;background:transparent;color:#93b4ce;font-size:20px;line-height:1;touch-action:none;cursor:grab;user-select:none;opacity:1}
.editor-focused-shell .flow-v15 .page-grip:disabled{cursor:default;font-size:16px;color:#7396af}
.editor-focused-shell .flow-v15 .page-grip:hover:not(:disabled){background:#3b5c7b;color:#fff}
.editor-focused-shell .flow-v15 .tree-screen-edit,.editor-focused-shell .flow-v15 .tree-screen-options{width:25px;min-height:30px;flex:0 0 25px;padding:0;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:#b1cee2;font-size:16px;cursor:pointer}
.editor-focused-shell .flow-v15 .tree-screen-edit:hover,.editor-focused-shell .flow-v15 .tree-screen-options:hover{background:#3b5c7b;color:white}
.flow-action-count{flex:0 0 auto;background:#344553;border:1px solid #526577;border-radius:7px;color:#f1dba6;font-size:9px;padding:4px;cursor:pointer;min-height:27px}
.flow-move-status{font-size:11px;line-height:1.5;padding:9px 3px 0;color:#b2d0e5;min-height:35px;overflow-wrap:anywhere}
.flow-help-row{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:10px;color:#89a7be}
.flow-help-row button{border:1px solid #587d9c;background:#2b4760;color:#effaff;cursor:pointer;border-radius:7px;padding:7px;font-size:11px;flex-shrink:0}
.flow-moving-placeholder>.page-tree-row{opacity:.32!important;outline:2px dashed #88cee9!important;outline-offset:-2px;background:#284c65!important}
.flow-nest-target{outline:2px solid #7cdec1!important;background:#1e594f!important}
.flow-pointer-active{cursor:grabbing!important;user-select:none!important}
.flow-pointer-active *{cursor:grabbing!important}
.flow-drag-ghost{position:fixed;left:0;top:0;z-index:1500;pointer-events:none;background:#eaf7ff;border:1px solid #83c3dc;color:#14334a;box-shadow:0 12px 35px #06192560;border-radius:11px;will-change:transform;overflow:hidden;box-sizing:border-box}
.flow-drag-ghost .page-tree-row{display:flex;align-items:center;gap:4px;padding:6px;background:#264c68;color:white;min-height:42px;box-sizing:border-box}
.flow-drag-ghost button{background:transparent;border:0;color:inherit;font:inherit;padding:3px;opacity:1}
.flow-drag-ghost .page-grip{font-size:22px;flex:0 0 24px}
.flow-drag-ghost .screen-link{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px;text-align:left;font-size:12px;overflow-wrap:anywhere}
.flow-drag-ghost .tree-screen-edit,.flow-drag-ghost .tree-screen-options,.flow-drag-ghost .flow-action-count{display:none}
.flow-ghost-hint{font-size:11px;font-weight:650;padding:8px 9px;line-height:1.4;overflow-wrap:anywhere}
.flow-ghost-count{display:block;padding:0 9px 8px;color:#4a6576;font-size:10px}
.flow-drag-ghost[data-valid="false"]{border-color:#d99170;background:#fff0e8;color:#813e20}
.flow-move-modal .flow-move-actions{display:flex;flex-wrap:wrap;gap:7px;margin:15px 0}
.flow-move-modal .flow-move-actions button{background:#253e58;border:1px solid #4d6b86;border-radius:8px;padding:10px 12px;color:#d8eafa;cursor:pointer}
.flow-move-modal button:disabled{opacity:.35;cursor:not-allowed}
.flow-move-modal .btn{margin-top:10px}
/* Message-owned controls remain inside the narrow phone, never clipped at its edge. */
.r10-editor .screen-owned-actions{width:min(100%,460px);margin:0 auto 10px;border:1px solid #41566b;background:#172b3f;border-radius:11px;color:#c6dce9}
.screen-owned-actions summary{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 12px;cursor:pointer;list-style:none;font-size:12px;font-weight:650}
.screen-owned-actions summary::-webkit-details-marker{display:none}
.screen-owned-actions summary:after{content:'▾';font-size:12px;color:#8eadc4}
.screen-owned-actions[open] summary:after{content:'▴'}
.screen-owned-actions summary small{margin-left:auto;color:#93b3c6;font-size:10px;font-weight:400}
.screen-owned-body{padding:0 12px 12px;border-top:1px solid #304d64}
.screen-owned-body p{font-size:11px;line-height:1.5;color:#a1bbce;margin:10px 0}
.screen-owned-chips{display:flex;gap:6px;flex-wrap:wrap}
.screen-owned-chips button,.screen-owned-add{background:#263f54;border:1px solid #486780;border-radius:8px;padding:8px 10px;color:#d3e5f2;font-size:12px;cursor:pointer;text-align:left;line-height:1.3}
.screen-owned-chips button span{margin-left:5px;color:#94c4dd}
.screen-owned-add{margin-top:9px;background:transparent;color:#aad8f3}
.tg-editor-mode-note{max-width:360px;margin:8px auto 10px!important;font-size:11px!important;line-height:1.5;color:#a9bfce!important}
.r10-editor .screen-message-unit.tg-edit-unit{max-width:100%;width:100%;margin-top:8px}
.r10-editor .tg-message-preview{position:relative;width:100%;max-width:100%}
.r10-editor .tg-edit-unit .tg-bubble{max-width:100%;width:100%;box-sizing:border-box;padding:12px 38px 7px 11px}
.r10-editor .tg-message-settings-trigger{position:absolute;top:5px;right:5px;z-index:5;display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid #c3d9e4;border-radius:7px;background:#f1f8fb;color:#42647a;font-size:16px;cursor:pointer}
.r10-editor .tg-message-settings-trigger:hover,.r10-editor .tg-message-settings-trigger[aria-expanded="true"]{background:#d7edf8;color:#17567b;border-color:#6ca2be}
.r10-editor .tg-message-settings{position:relative;width:100%;box-sizing:border-box;border:1px solid #92b9cc;background:#f6fbfd;color:#214054;border-radius:10px;padding:10px;margin:6px 0 8px;box-shadow:0 4px 12px #1d4d6620;font-size:12px}
.tg-message-settings-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.tg-message-settings-head button{background:transparent;border:0;color:#547187;cursor:pointer;font-size:20px;line-height:1;padding:4px}
.tg-setting-line{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0;font-size:11px;line-height:1.35;color:#244a61}
.tg-setting-line input[type="checkbox"]{width:19px;height:19px;accent-color:#287b9b;flex:0 0 19px;cursor:pointer}
.tg-setting-line select{max-width:112px;flex:0 1 112px;min-width:85px;border:1px solid #b4cdd8;border-radius:7px;background:white;color:#204257;font-size:11px;padding:7px 4px}
.tg-message-settings p{font-size:10px!important;color:#597183!important;line-height:1.4!important;margin:6px 0!important}
.tg-message-settings-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.tg-message-settings-actions button{border:1px solid #a9c5d3;background:#e7f2f7;color:#2d536a;border-radius:7px;cursor:pointer;font-size:11px;min-height:30px;padding:6px 9px}
.tg-message-settings-actions button:first-child{background:#287b9b;color:white;border-color:#287b9b}
.tg-message-settings-actions .danger{color:#943e46;background:#fff2f3;margin-left:auto}
.r10-editor .tg-timing-summary{display:block;margin:5px 0;padding:4px 7px;background:#e1edf0;color:#476575;border:0;border-radius:6px;font-size:10px;cursor:pointer;text-align:left}
.tg-variable-chip{display:inline;padding:1px 4px;border:1px solid #c2d6ed;border-radius:5px;background:#e8f1ff;color:#285690;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.94em;overflow-wrap:anywhere;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.r10-editor .tg-direct-edit-footer{flex-wrap:wrap;align-items:center;gap:6px;margin-right:-25px}
.tg-variable-tool{min-width:0;max-width:100%;flex:1 1 100%;position:relative}
.tg-variable-tool summary{display:inline-block;font-size:11px;padding:6px 8px;border-radius:7px;background:#e1edf7;color:#305876;border:1px solid #c1d5e4;cursor:pointer;list-style:none}
.tg-variable-tool summary::-webkit-details-marker{display:none}
.tg-variable-picker{background:#f5faff;border:1px solid #b9d1e1;border-radius:8px;padding:7px;margin-top:6px;color:#2d506b;max-width:100%;box-sizing:border-box}
.tg-variable-picker p{font-size:10px!important;line-height:1.4!important;color:#536f84!important;margin:2px 0 7px!important}
.tg-variable-options{max-height:210px;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:3px}
.tg-variable-options button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;border:1px solid #d9e5ef;background:white;color:#355972;border-radius:6px;padding:6px 8px;cursor:pointer;text-align:left;min-width:0}
.tg-variable-options button code{font-size:11px;color:#285b96;background:transparent;white-space:normal;overflow-wrap:anywhere}
.tg-variable-options button span{font-size:10px;color:#6c8293}
.tg-variable-options button:hover{background:#dfedfa}
.flow-v15 button:focus-visible,.screen-owned-actions button:focus-visible,.tg-message-settings-trigger:focus-visible,.tg-variable-tool summary:focus-visible,.tg-message-settings button:focus-visible{outline:2px solid #88ccee;outline-offset:2px}
@media(max-width:760px){
 .editor-focused-shell .simple-screens{max-height:none;overflow:visible}
 .editor-focused-shell .flow-v15 .page-tree-row{min-height:54px}
 .editor-focused-shell .flow-v15 .page-grip{width:30px;flex-basis:30px;min-height:42px}
 .editor-focused-shell .flow-v15 .tree-screen-options,.editor-focused-shell .flow-v15 .tree-screen-edit{min-height:38px;width:28px;flex-basis:28px}
 .editor-focused-shell .flow-v15 .page-tree-node{margin-left:calc(min(var(--auto-depth,0),4)*10px)!important}
 .screen-owned-actions summary{font-size:11px;padding:10px}
 .screen-owned-actions summary small{font-size:9px}
 .r10-editor .tg-message-settings-trigger{width:30px;height:30px}
}
@media(prefers-reduced-motion:reduce){.flow-v15 *,.tg-message-settings-trigger{transition:none!important}}
.r10-editor .simple-chat-body{overflow-y:auto!important;overscroll-behavior-y:auto!important;scrollbar-width:thin;scrollbar-color:#88a8b3 transparent}
.r10-editor .tg-variable-options{overscroll-behavior:contain}

/* R15.1: compact navigation outline. Children are smaller single-line L branches. */
.editor-focused-shell .page-nav.flow-compact{gap:4px}
.editor-focused-shell .flow-compact .page-tree-list{gap:2px}
.editor-focused-shell .flow-compact .page-tree-node{margin-left:calc(min(var(--auto-depth,0),6)*10px)!important}
.editor-focused-shell .flow-compact .page-tree-node[style*="--auto-depth:0"]{margin-top:6px}
.editor-focused-shell .flow-compact .page-tree-row{min-height:34px;padding:1px 2px;gap:1px;border-color:transparent;border-radius:7px;background:transparent}
.editor-focused-shell .flow-compact .page-tree-root{min-height:42px;border-radius:8px;padding:3px 2px}
.editor-focused-shell .flow-compact .page-tree-row:hover{background:#223c54;border-color:#42617b}
.editor-focused-shell .flow-compact .page-tree-row.is-selected{background:#25465f;border-color:#67a4c1}
.editor-focused-shell .flow-compact .page-tree-row .screen-link{flex-direction:row;align-items:center;justify-content:flex-start;gap:0;padding:4px 2px;font-size:11.5px;min-height:28px}
.editor-focused-shell .flow-compact .page-tree-root .screen-link{font-size:12px}
.editor-focused-shell .flow-compact .screen-label{display:block;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;line-height:1.4}
.editor-focused-shell .flow-compact .tree-auto-corner{position:absolute;left:-9px;top:50%;transform:translateY(-54%);width:10px;color:#789ab7;font-family:ui-monospace,Consolas,monospace;font-size:16px;line-height:1;pointer-events:none}
.editor-focused-shell .flow-compact .page-grip{width:20px;flex-basis:20px;min-height:30px;font-size:18px;border-radius:5px}
.editor-focused-shell .flow-compact .tree-screen-edit,.editor-focused-shell .flow-compact .tree-screen-options{width:22px;flex-basis:22px;min-height:28px;font-size:14px}
.editor-focused-shell .flow-compact .flow-action-count{font-size:9px;padding:2px 3px;border:0;background:transparent;min-height:26px;color:#d4b979}
.editor-focused-shell .flow-compact .page-nav-caption{font-size:9px;letter-spacing:.08em;margin-bottom:2px}
.editor-focused-shell .flow-compact .flow-move-status{padding:7px 2px 0;font-size:10px;min-height:30px}
.editor-focused-shell .flow-compact .flow-help-row{font-size:9px;margin-bottom:3px}
.flow-drag-ghost .tree-auto-corner{display:none}
.flow-drag-ghost .screen-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.flow-drag-ghost .page-tree-row{min-height:34px;padding:4px}
.r10-editor .flow-button-moving{outline:2px solid #168bb8!important;outline-offset:-2px;background:#d4edf9!important;box-shadow:0 2px 10px #246c8e24}
.flow-preview-active .tg-editor-mode-note{color:#c2e9fa!important}
.button-quick-menu button:disabled{opacity:.4;cursor:default}
@media(max-width:760px){
 .editor-focused-shell .flow-compact .page-tree-row{min-height:38px}
 .editor-focused-shell .flow-compact .page-grip{min-height:36px;width:23px;flex-basis:23px}
 .editor-focused-shell .flow-compact .tree-screen-edit,.editor-focused-shell .flow-compact .tree-screen-options{min-height:34px;width:24px;flex-basis:24px}
 .editor-focused-shell .flow-compact .page-tree-node{margin-left:calc(min(var(--auto-depth,0),6)*8px)!important}
}

/* R15.2 — every visible Telegram button has a corresponding compact outline row. */
.editor-focused-shell .flow-compact .flow-button-row{min-height:32px;opacity:.92}
.editor-focused-shell .flow-compact .flow-button-row .screen-link{font-size:11.5px}
.editor-focused-shell .flow-compact .flow-button-row .flow-alias-button{color:#b6d5e9}
.editor-focused-shell .flow-compact .flow-inline-icon{flex:0 0 20px;text-align:center;font-size:12px;line-height:1.2;color:#7dbcd9}
.editor-focused-shell .flow-compact .flow-button-only .tree-screen-options{opacity:.7}
.editor-focused-shell .flow-compact .flow-unlinked-hint{font-size:9px;line-height:1;padding:3px 4px;border:1px solid #57718a;border-radius:4px;color:#a9c3d6}
.editor-focused-shell .flow-compact .flow-unlinked-screen .screen-label{color:#9cbdce}
.editor-focused-shell .flow-compact .flow-button-row .page-grip{visibility:hidden}
/* Message timing belongs in a floating dialog, not inside the Telegram bubble. */
.tg-timing-layer{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:16px;box-sizing:border-box}
.tg-timing-scrim{position:absolute;inset:0;background:rgba(5,15,26,.64);backdrop-filter:blur(3px)}
.tg-timing-layer .tg-timing-dialog{position:relative;z-index:1;margin:0;width:min(100%,380px);max-height:calc(100dvh - 32px);overflow:auto;border-radius:16px;padding:20px;box-shadow:0 24px 80px rgba(0,0,0,.36);border:1px solid #b7d5e7;background:#f6fbfe;color:#244158;font-size:13px;box-sizing:border-box}
.tg-timing-layer .tg-message-settings-head{margin-bottom:16px}
.tg-timing-layer .tg-message-settings-head h2{font-size:17px;line-height:1.3;color:#213e53;margin:0;font-weight:700}
.tg-timing-layer .tg-setting-line{font-size:13px;min-height:46px;padding:9px 0;border-bottom:1px solid #dce9f0;margin:0}
.tg-timing-layer .tg-setting-line select{font-size:12px;min-width:118px;max-width:135px}
.tg-timing-layer .tg-message-settings-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:16px}
.tg-timing-layer .tg-message-settings-actions button{font-size:13px;padding:11px;min-height:42px}
.tg-timing-layer .tg-message-settings p{margin:13px 0 0!important;font-size:11px!important}
@media(max-width:490px){.tg-timing-layer{padding:12px}.tg-timing-layer .tg-timing-dialog{padding:16px}}
/* R15.3: focused Bot Flow is a one-to-one mirror of the open preview. */
.editor-focused-shell .flow-one-screen .page-tree-list{gap:2px}
.editor-focused-shell .flow-one-screen .flow-return-welcome{background:transparent;color:#a8d7fa;border:0;padding:5px 8px;cursor:pointer;text-align:left;font-size:11px}
.editor-focused-shell .flow-one-screen .flow-empty-buttons{color:#91a9bb;font-size:11px;padding:10px 8px}
.editor-focused-shell .flow-one-screen .flow-all-screens{margin-top:7px;border-top:1px solid #354e64;padding:8px 0 1px}
.editor-focused-shell .flow-one-screen .flow-all-screens summary{cursor:pointer;display:flex;justify-content:space-between;color:#b2cadb;align-items:center;padding:7px 9px;border-radius:7px;background:#243c51;font-size:11px;font-weight:600}
.editor-focused-shell .flow-one-screen .flow-all-screens summary span{font-size:10px;color:#88b9d8}
.editor-focused-shell .flow-one-screen .flow-screen-directory{display:grid;gap:2px;margin-top:5px;max-height:190px;overflow:auto}
.editor-focused-shell .flow-one-screen .flow-screen-directory button{background:transparent;border:0;border-radius:6px;text-align:left;color:#d6e9f7;cursor:pointer;padding:7px 10px;font-size:11px;min-height:29px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.editor-focused-shell .flow-one-screen .flow-screen-directory button:hover,.editor-focused-shell .flow-one-screen .flow-screen-directory button.current{background:#294963}
.editor-focused-shell .flow-one-screen .page-tree-node{margin-left:12px!important}

/* R15.4: keep the exact Welcome button order, expand the opened branch inline. */
.editor-focused-shell .flow-one-screen .page-tree-node{margin-left:calc(6px + (var(--auto-depth,1) - 1) * 16px)!important;transition:margin-left .14s ease}
.editor-focused-shell .flow-one-screen .page-tree-node[style*="--auto-depth:2"] .tree-auto-corner,
.editor-focused-shell .flow-one-screen .page-tree-node[style*="--auto-depth:3"] .tree-auto-corner{color:#6dbfdb}
.editor-focused-shell .flow-one-screen .page-tree-row.is-selected{background:#304d6b;border-color:#69a8d0}
/* Controls sit ~80% above the message's top edge. They do not cover its content. */
.r10-editor .screen-message-unit.tg-edit-unit{margin-top:30px;overflow:visible}
.r10-editor .tg-message-preview{overflow:visible}
.r10-editor .tg-message-top-controls{position:absolute;right:4px;top:-23px;z-index:12;display:flex;align-items:center;gap:5px;pointer-events:none}
.r10-editor .tg-message-top-controls>button{position:relative;top:auto;right:auto;pointer-events:auto;display:grid;place-items:center;width:28px;height:28px;margin:0;padding:0;border-radius:8px;border:1px solid #b7cfdd;background:#eff8fc;color:#385e77;box-shadow:0 2px 6px #142f4050;cursor:pointer;line-height:1;font-size:17px}
.r10-editor .tg-message-top-controls>.tg-message-delete-screen{color:#a33c4a;border-color:#e6bfc4;background:#fff1f2;font-size:23px}
.r10-editor .tg-message-top-controls>.tg-message-delete-screen:hover,.r10-editor .tg-message-top-controls>.tg-message-delete-screen:focus-visible{background:#ffdbe0;color:#8e1828}
.r10-editor .tg-message-top-controls>.tg-message-settings-trigger:hover{background:#d8eff9;color:#17567b}
@media(max-width:490px){.r10-editor .tg-message-top-controls{top:-24px;right:4px}.r10-editor .tg-message-top-controls>button{width:30px;height:30px}}

/* R15.5: every actual Telegram button moves; indentation conveys parent-child branches. */
.editor-focused-shell .flow-one-screen .page-tree-node{
 margin-left:calc(12px + (min(var(--auto-depth,1),8) - 1)*22px)!important;
 position:relative;
}
.editor-focused-shell .flow-one-screen .page-tree-node .tree-auto-corner{
 left:-16px;width:15px;font-size:17px;color:#8dc9e8;
}
.editor-focused-shell .flow-one-screen .page-tree-node[style*="--auto-depth:2"]::before,
.editor-focused-shell .flow-one-screen .page-tree-node[style*="--auto-depth:3"]::before,
.editor-focused-shell .flow-one-screen .page-tree-node[style*="--auto-depth:4"]::before,
.editor-focused-shell .flow-one-screen .page-tree-node[style*="--auto-depth:5"]::before{
 content:"";position:absolute;left:-18px;top:-5px;height:calc(50% + 5px);
 border-left:1px solid #557e9b;pointer-events:none;
}
.editor-focused-shell .flow-compact .flow-button-row .page-grip{
 visibility:visible!important;display:grid!important;place-items:center;
 color:#acd8f3;background:transparent;opacity:.95;cursor:grab;
}
.editor-focused-shell .flow-compact .flow-button-row .page-grip:hover,
.editor-focused-shell .flow-compact .page-tree-row .page-grip:hover{background:#345d78;color:#fff}
.editor-focused-shell .flow-compact .flow-button-row .flow-inline-icon{flex-basis:15px;font-size:11px}
.editor-focused-shell .flow-compact .flow-button-row{opacity:1}
.editor-focused-shell .flow-one-screen .page-tree-node.flow-moving-placeholder .page-tree-row{outline:2px dashed #88cee9!important;opacity:.45}
@media(max-width:600px){
 .editor-focused-shell .flow-one-screen .page-tree-node{
  margin-left:calc(9px + (min(var(--auto-depth,1),8) - 1)*14px)!important;
 }
}


/* R15.6: screen records survive clearing, with inactive links visibly marked. */
.editor-focused-shell .flow-one-screen .flow-hidden-screen .page-tree-row{opacity:.62;border-style:dashed}
.editor-focused-shell .flow-one-screen .flow-hidden-screen .screen-label{text-decoration:line-through;text-decoration-color:#8493aa}
.editor-focused-shell .flow-one-screen .flow-hidden-tag{font-size:9px;white-space:nowrap;color:#f5c77a;background:#544928;border-radius:5px;padding:2px 4px;letter-spacing:.1px}
/* Square + creates a button in exactly the same row slot as an actual Telegram
   button. No + is superimposed on existing buttons; use their options popup. */
.r10-editor .tg-edit-button-rows .tg-square-add{
 box-sizing:border-box;display:flex;align-items:center;justify-content:center;
 align-self:stretch;flex:1 1 0%;min-width:0;width:auto;height:auto;min-height:33px;
 padding:0;border:0;outline:2px dotted #6d9fbd;outline-offset:-2px;border-radius:6px;
 background:#edf7fc;color:#247eac;font-size:21px;font-weight:650;line-height:1;
 cursor:pointer;box-shadow:none;transition:background .14s ease,border-color .14s ease;
}
.r10-editor .tg-edit-button-rows .tg-square-add:hover,
.r10-editor .tg-edit-button-rows .tg-square-add:focus-visible{
 background:#d7eef9;outline-color:#267dae;outline-offset:-2px;
}
/* A new row is a full-width placeholder, exactly matching a future full-width
   button. Beside an existing button, the placeholder shares its row equally. */
.r10-editor .tg-edit-button-rows .tg-bottom-add-row{
 align-items:stretch!important;justify-content:stretch!important;width:100%;min-height:33px;
}
.r10-editor .tg-edit-button-rows .tg-bottom-add-row .tg-square-add{
 flex:1 1 100%;width:100%;min-width:0;min-height:33px;
}
.r10-editor .reply-keyboard .tg-bottom-add-row{justify-content:stretch!important}
.r10-editor .tg-chat-insert-round{display:grid;place-items:center;width:38px;height:38px;min-width:38px;border-radius:50%;border:1px solid #8bbbd1;background:#e9f8ff;color:#2087b5;font-size:27px;line-height:1;padding:0;cursor:pointer;margin:9px auto 12px;box-shadow:0 2px 6px #112b3b2b;transition:transform .15s,background .15s}
.r10-editor .tg-chat-insert-round:hover,.r10-editor .tg-chat-insert-round:focus-visible{transform:scale(1.08);background:#c7eafa}
.r10-editor .tg-empty-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:220px;gap:6px;text-align:center;padding:26px 12px;background:#eaf1f8;border-radius:12px;border:1px dashed #acc4d4;color:#536d82}
.r10-editor .tg-empty-screen p{font-size:13px;font-weight:600;margin:0}
.r10-editor .tg-empty-screen small{font-size:11px;color:#6e8292}
.r10-editor .tg-empty-screen .tg-chat-insert-round{width:52px;height:52px;min-width:52px;font-size:34px;margin:7px auto}
@media(max-width:400px){.r10-editor .tg-chat-insert-round{width:36px;height:36px;min-width:36px}}

/* R15.8: explicit per-button removal, without the redundant three-dot menu. */
.editor-focused-shell .flow-compact .tree-screen-remove {
  flex:0 0 23px;width:23px;min-height:29px;display:grid;place-items:center;
  border:0;border-radius:7px;background:transparent;color:#ecadba;
  font-size:19px;line-height:1;cursor:pointer;padding:0;
}
.editor-focused-shell .flow-compact .tree-screen-remove:hover,
.editor-focused-shell .flow-compact .tree-screen-remove:focus-visible {
  color:#fff;background:#8d344f;outline-offset:1px;
}
.r158-timeline-picker .page-choice-list button:disabled {opacity:.46;cursor:not-allowed;}
.r158-timeline-picker .page-choice-list {max-height:min(54vh,390px);overflow-y:auto;}
@media(max-width:760px){.editor-focused-shell .flow-compact .tree-screen-remove {
 min-height:36px;flex-basis:28px;width:28px;
}}

/* R15.9: linked screens display the real message/button content in place. */
.r10-editor .tg-linked-screen-unit{position:relative;width:min(100%,335px);max-width:100%;margin:7px 0 10px;box-sizing:border-box}
.r10-editor .tg-linked-screen-preview{min-width:0;max-width:100%;padding:8px;border:1px solid #a7c6d8;background:#e9f4fa;border-radius:11px;box-sizing:border-box}
.r10-editor .tg-linked-screen-title{border:0;background:transparent;color:#286b91;padding:2px 4px 8px;font-size:11px;font-weight:700;cursor:pointer;text-align:left}
.r10-editor .tg-linked-screen-content{display:flex;flex-direction:column;gap:7px;min-width:0}
.r10-editor .tg-linked-preview-message{max-width:100%;min-width:0}
.r10-editor .tg-linked-preview-message .tg-bubble{max-width:100%}
.r10-editor .tg-linked-preview-message .tg-edit-button-row,.r10-editor .tg-linked-keyboard .tg-edit-button-row{display:flex;gap:3px;min-height:33px;margin-top:3px}
.r10-editor .tg-linked-preview-message .canvas-button-wrap,.r10-editor .tg-linked-keyboard .canvas-button-wrap{flex:1;min-width:0}
.r10-editor .tg-linked-preview-message .canvas-inline-button,.r10-editor .tg-linked-keyboard .canvas-inline-button{width:100%;min-height:33px;font-size:11px;padding:6px 8px;border:0;border-radius:5px;background:#fff;color:#2689b9;font-weight:600}
.r10-editor .tg-linked-nested{margin-left:11px;min-width:0}
.r10-editor .tg-linked-keyboard{border-top:1px solid #c3dce9;padding-top:7px}
.r10-editor .tg-linked-step-remove{position:absolute;right:-7px;top:-7px;z-index:4;width:23px;height:23px;border-radius:50%;border:1px solid #d5e4ec;background:#fff;color:#a74756;font-size:15px;cursor:pointer;box-shadow:0 2px 5px #26465a33}
.r10-editor .tg-linked-screen-warning{color:#895b2b;font-size:11px;padding:7px;background:#fff6e3;border-radius:5px}

/* R16: linked-screen inserts are indistinguishable in layout from ordinary
   Telegram message blocks. No blue card, heading, or separately nested column. */
.r10-editor .tg-linked-screen-unit,
.r10-editor .tg-linked-screen-preview{display:contents}
.r10-editor .tg-linked-edit-unit{width:100%;max-width:100%;margin-top:30px;overflow:visible}
.r10-editor .tg-linked-edit-unit .tg-bubble{width:100%;max-width:100%}
.r10-editor .tg-linked-edit-unit .screen-inline-buttons{width:100%}
.r10-editor .tg-linked-edit-unit .canvas-inline-keyboard{width:min(100%,335px);max-width:100%}
.r10-editor .tg-linked-keyboard{margin-top:8px;border:0;padding:0;background:transparent}
.r10-editor .tg-linked-edit-unit .tg-linked-step-remove{position:relative;top:auto;right:auto;z-index:12;width:28px;height:28px;border-radius:8px;font-size:23px}
@media(max-width:490px){.r10-editor .tg-linked-edit-unit .tg-linked-step-remove{width:30px;height:30px}}

/* A hidden, missing or empty linked screen still needs a safe remove control. */
.r10-editor .tg-linked-screen-unit:has(.tg-linked-edit-unit)>.tg-linked-fallback-remove{display:none}
.r10-editor .tg-linked-screen-unit:not(:has(.tg-linked-edit-unit)){display:block;position:relative;min-height:32px}
.r10-editor .tg-linked-screen-unit:not(:has(.tg-linked-edit-unit))>.tg-linked-fallback-remove{right:0;top:0}

/* R16.1 — connected native templates. Keep cards readable in both app themes. */
.tg-template-grid{gap:14px;padding:7px;align-items:stretch;scrollbar-gutter:stable}
.tg-template-dialog{max-width:920px!important;width:min(96vw,920px)!important}
.tg-template-v2.tg-template-tile{
  display:flex;flex-direction:column;align-items:flex-start;gap:9px;position:relative;min-height:224px;
  border:1px solid #3b597b;border-radius:17px;padding:19px;
  background:linear-gradient(150deg,#1e354d 0%,#213d5b 82%,#254966 100%);
  color:#f1f8ff;box-shadow:0 7px 20px rgba(10,25,43,.12);
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.tg-template-v2.tg-template-tile:hover,.tg-template-v2.tg-template-tile:focus-visible{
  transform:translateY(-2px);border-color:#76baf4;background:linear-gradient(150deg,#254361,#2d5378);
  box-shadow:0 12px 28px rgba(15,44,75,.22);outline:2px solid #86bfff;outline-offset:1px;
}
.tg-template-v2.tg-template-tile>.tg-template-icon{display:inline-flex;align-items:center;justify-content:center;grid-row:auto;font-size:25px;width:46px;height:46px;border-radius:14px;background:rgba(174,219,255,.13);border:1px solid rgba(171,218,255,.16)}
.tg-template-v2.tg-template-tile>.tg-template-category{position:absolute;top:21px;right:18px;grid-row:auto;font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:#c8e5ff;background:rgba(152,205,249,.13);border-radius:999px;padding:6px 9px}
.tg-template-v2.tg-template-tile>strong{font-size:16px;letter-spacing:-.02em;line-height:1.2}
.tg-template-v2.tg-template-tile>small{font-size:12px;line-height:1.5;color:#c2d7ea;min-height:35px}
.tg-template-v2.tg-template-tile>.tg-template-journey{grid-row:auto;font-size:11px;font-weight:650;line-height:1.45;color:#a8dbff}
.tg-template-v2.tg-template-tile>.tg-template-stats{display:flex;grid-row:auto;flex-wrap:wrap;gap:5px;width:100%;margin-top:auto}
.tg-template-v2.tg-template-tile>.tg-template-stats em{font-style:normal;font-size:10px;font-weight:700;border:1px solid rgba(159,203,236,.22);border-radius:7px;padding:4px 6px;color:#d3e9f8;background:rgba(14,36,55,.25)}
.tg-template-v2.tg-template-tile>.tg-template-explore{grid-row:auto;width:100%;display:flex;justify-content:space-between;align-items:center;border-top:1px solid rgba(178,213,244,.16);padding-top:9px;font-size:11px;font-weight:800;color:#b9e5ff}
.tg-template-standalone .tg-template-v2.tg-template-tile{background:linear-gradient(150deg,#f9fcff,#edf5ff);color:#243b56;border-color:#cfdff2;box-shadow:0 8px 22px rgba(55,88,127,.08)}
.tg-template-standalone .tg-template-v2.tg-template-tile:hover{background:linear-gradient(150deg,#fff,#e1efff);border-color:#7eafe4;box-shadow:0 14px 25px rgba(55,88,127,.15)}
.tg-template-standalone .tg-template-v2.tg-template-tile>.tg-template-icon{background:#e0edfc;border-color:#cfdef2}
.tg-template-standalone .tg-template-v2.tg-template-tile>.tg-template-category{background:#e5f0fd;color:#47749e}
.tg-template-standalone .tg-template-v2.tg-template-tile>small{color:#546c86}
.tg-template-standalone .tg-template-v2.tg-template-tile>.tg-template-journey{color:#3c719d}
.tg-template-standalone .tg-template-v2.tg-template-tile>.tg-template-stats em{background:#f0f6fe;border-color:#d4e4f4;color:#50769b}
.tg-template-standalone .tg-template-v2.tg-template-tile>.tg-template-explore{color:#23659a;border-top-color:#dbe8f7}
.tg-template-library-intro{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:15px 18px;margin-top:16px;background:#eef5fe;border:1px solid #d9e6f5;border-radius:14px;color:#385475}
.tg-template-library-intro strong{font-size:15px;white-space:nowrap}
.tg-template-library-intro span{font-size:12px;line-height:1.45;max-width:540px}
.tg-template-action{color:#366087}
@media(max-width:680px){.tg-template-grid{grid-template-columns:1fr;max-height:66vh}.tg-template-standalone{max-height:none}.tg-template-v2.tg-template-tile{min-height:202px}.tg-template-library-intro{flex-direction:column;align-items:flex-start}}
@media(prefers-reduced-motion:reduce){.tg-template-v2.tg-template-tile{transition:none}.tg-template-v2.tg-template-tile:hover{transform:none}}
/* R16.2 — the new-screen modal contains a real, editable single-screen Telegram preview. */
.screen-builder-modal{width:min(690px,100%);max-width:690px;max-height:min(94dvh,920px);overflow-y:auto;overscroll-behavior:contain}
.screen-builder-modal #pageForm{display:grid;gap:13px}
.screen-builder-modal .easy-screen-name{display:grid;gap:7px;margin:0!important;font-weight:650;font-size:13px}
.screen-builder-modal .easy-screen-name small{font-weight:400;color:#a5b7cb}
.screen-builder-modal .screen-builder-chat{display:flex;justify-content:center;min-width:0}
.screen-builder-modal .simple-stage.telegram-simulator{width:min(385px,100%);max-width:100%;margin:0 auto;overflow:visible}
.screen-builder-modal .simple-chat-body{height:clamp(260px,42dvh,430px);overflow-y:auto;overscroll-behavior:contain;min-width:0}
.screen-builder-modal .tg-edit-unit{width:100%;min-width:0}
.screen-builder-modal .tg-edit-unit .tg-message-preview{width:100%;min-width:0}
.screen-builder-modal .tg-edit-unit .tg-tap-to-edit{cursor:text}
.screen-builder-modal .tg-direct-edit-bubble{max-width:100%;width:100%;box-sizing:border-box}
.screen-builder-modal .tg-edit-text{width:100%;min-height:66px;resize:vertical;box-sizing:border-box}
.screen-builder-modal .screen-builder-choice{background:#203248;border:1px solid #4c6787;border-radius:14px;padding:13px;display:grid;gap:11px;color:#ebf2ff}
.screen-builder-modal .screen-builder-choice-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.screen-builder-modal .screen-builder-choice-head button{background:#314864;border:0;border-radius:8px;color:#fff;font-size:19px;cursor:pointer;width:32px;height:32px}
.screen-builder-modal .screen-builder-choice .field{display:grid;gap:5px;margin:0}
.screen-builder-modal .screen-builder-choice .page-choice-list{max-height:200px;overflow-y:auto;display:grid;gap:4px}
.screen-builder-modal .screen-builder-choice .page-choice-list button{width:100%;padding:10px 12px;display:flex;gap:12px;align-items:center;text-align:left;border-radius:9px;background:#f3f8fc;color:#18334d;border:1px solid #c7d9e8;cursor:pointer}
.screen-builder-modal .screen-builder-choice .page-choice-list button span:last-child{margin-left:auto}
.screen-builder-modal .screen-builder-footer-note{text-align:center;font-size:11px;color:#a9c0d7}
.screen-builder-modal .reply-keyboard{width:min(385px,100%);margin:0 auto;box-sizing:border-box}
.screen-builder-modal .screen-builder-linked{position:relative;min-width:0;padding:2px 0 8px}
.screen-builder-modal .screen-builder-linked .tg-bubble{margin:4px 0;max-width:100%}
.screen-builder-modal .screen-builder-linked small{display:block;color:#516e83;margin-top:4px}
.screen-builder-modal .screen-builder-linked .tg-message-delete-screen{position:absolute;top:0;right:0}
.screen-builder-modal .screen-builder-linked-buttons{display:flex;flex-wrap:wrap;gap:5px}
.screen-builder-modal .screen-builder-linked-buttons span{display:inline-block;background:#eef7fe;color:#26618c;border-radius:7px;padding:7px;font-size:12px}
.screen-builder-modal .tg-timing-layer{z-index:999}
.screen-builder-modal .tg-round-add{margin:9px auto 12px}
.screen-builder-modal .tg-square-add{min-width:0}
@media(max-width:550px){.screen-builder-modal{width:100%;padding:14px!important;max-height:96dvh}.screen-builder-modal .simple-chat-body{height:clamp(230px,40dvh,350px)}.screen-builder-modal .screen-builder-choice{padding:10px}}
.screen-builder-modal .screen-builder-actions{border:1px solid #385472;background:#1b2b3e;border-radius:12px;padding:10px 12px}
.screen-builder-modal .screen-builder-actions>summary{cursor:pointer;font-size:13px;font-weight:700;color:#e0edff;list-style-position:inside}
.screen-builder-modal .screen-builder-actions>summary span{float:right;font-size:11px;color:#96abc3;font-weight:500}
.screen-builder-modal .screen-builder-actions .easy-settings-stack{margin:12px 0 0}
.screen-builder-modal .screen-builder-actions-toggle{display:flex;width:100%;padding:2px 0;background:none;border:0;justify-content:space-between;align-items:center;gap:10px;text-align:left;cursor:pointer;font-size:13px;font-weight:700;color:#e0edff}
.screen-builder-modal .screen-builder-actions-toggle span{font-size:11px;color:#96abc3;font-weight:500}

/* R16.3 — NEW SCREEN shows only editable messages, inline buttons and round insert controls. */
.screen-builder-modal .screen-builder-chat.screen-builder-fragment{
  display:block;width:min(100%,490px);max-width:100%;min-width:0;
  margin:0 auto;padding:10px 14px 12px;box-sizing:border-box;
  background:#dcebf3;border:1px solid #c9dce8;border-radius:15px;
  max-height:min(52dvh,530px);overflow-y:auto;overscroll-behavior:contain;
}
.screen-builder-modal .screen-builder-fragment .screen-message-sequence{display:grid;gap:0;min-width:0}
.screen-builder-modal .screen-builder-fragment .screen-message-unit.tg-edit-unit{
  width:100%;max-width:100%;min-width:0;
}
.screen-builder-modal .screen-builder-fragment .screen-message-unit .canvas-inline-keyboard{
  max-width:100%;width:100%;
}
.screen-builder-modal .screen-builder-fragment .tg-message-preview{width:100%}
.screen-builder-modal .screen-builder-fragment .tg-bubble{max-width:100%}
.screen-builder-modal .screen-builder-fragment .tg-chat-insert-round{
  display:grid;place-items:center;margin:12px auto;
}
@media(max-width:550px){
  .screen-builder-modal .screen-builder-chat.screen-builder-fragment{width:100%;padding:9px 11px;max-height:46dvh}
}

/* R17C: animate newly delivered chat entries, without replaying old history.
   Test chat only: editing surfaces, buttons and their layouts remain unchanged. */
.r10-editor.is-chat-testing .tg-chat-line.tg-sim-enter{
 animation:tgR17CIncoming .27s cubic-bezier(.18,.8,.3,1) both;
 transform-origin:12% 100%;
}
.r10-editor.is-chat-testing .tg-chat-line.outgoing.tg-sim-enter{
 animation-name:tgR17COutgoing;
 transform-origin:88% 100%;
}
.r10-editor.is-chat-testing .tg-sim-notice.tg-sim-enter{
 animation:tgR17CNotice .22s ease-out both;
}
@keyframes tgR17CIncoming{
 0%{opacity:0;transform:translate3d(-9px,9px,0) scale(.96)}
 70%{opacity:1;transform:translate3d(1px,-1px,0) scale(1.008)}
 100%{opacity:1;transform:translate3d(0,0,0) scale(1)}
}
@keyframes tgR17COutgoing{
 0%{opacity:0;transform:translate3d(9px,9px,0) scale(.96)}
 70%{opacity:1;transform:translate3d(-1px,-1px,0) scale(1.008)}
 100%{opacity:1;transform:translate3d(0,0,0) scale(1)}
}
@keyframes tgR17CNotice{
 from{opacity:0;transform:translateY(5px)}
 to{opacity:1;transform:translateY(0)}
}
@media(prefers-reduced-motion:reduce){
 .r10-editor.is-chat-testing .tg-chat-line.tg-sim-enter,
 .r10-editor.is-chat-testing .tg-sim-notice.tg-sim-enter{animation:none!important}
}

/* R17K — the sidebar now shows the complete connected button hierarchy.
   Nested containers provide real uninterrupted branch rails at EVERY depth,
   rather than indenting only the currently opened path. */
.editor-focused-shell .flow-one-screen .page-tree-list{
  gap:5px;
  overflow-x:auto;
  overflow-y:visible;
  padding:2px 3px 8px 0;
  scrollbar-width:thin;
  scrollbar-color:#507d9c transparent;
}
.editor-focused-shell .flow-one-screen .page-tree-node{
  margin-left:0!important;
  position:relative;
  min-width:0;
}
.editor-focused-shell .flow-one-screen .page-tree-node::before{
  content:none!important;
}
.editor-focused-shell .flow-one-screen .flow-tree-children{
  display:flex;
  flex-direction:column;
  gap:3px;
  margin:2px 0 8px 10px;
  padding:4px 0 3px 11px;
  border-left:2px dotted #5aabc9;
  border-radius:0 0 0 7px;
  background:linear-gradient(90deg,rgba(71,155,193,.105),transparent 25px);
  position:relative;
}
.editor-focused-shell .flow-one-screen .flow-tree-children>.page-tree-node::before{
  content:""!important;
  position:absolute;
  top:17px;
  left:-11px;
  width:10px;
  border-top:2px dotted #5aabc9;
  height:0;
  pointer-events:none;
}
.editor-focused-shell .flow-one-screen .flow-tree-children>.page-tree-node:last-child::after{
  content:"";
  position:absolute;
  bottom:-10px;
  left:-13px;
  width:2px;
  height:calc(100% - 18px);
  background:#17283c;
  pointer-events:none;
  z-index:0;
}
.editor-focused-shell .flow-one-screen .page-tree-row{
  z-index:1;
  min-height:36px;
  border:1px solid #38566d;
  border-radius:8px;
  background:#1b3045;
  padding:2px 3px;
  gap:2px;
}
.editor-focused-shell .flow-one-screen .flow-tree-branch>.page-tree-row{
  background:#253e57;
  border-color:#568ab0;
  border-left:3px solid #6ec5e7;
  font-weight:600;
}
.editor-focused-shell .flow-one-screen .flow-tree-branch>.page-tree-row:hover{
  background:#315979;
}
.editor-focused-shell .flow-one-screen .page-tree-row.is-selected{
  background:#315b78!important;
  border-color:#9bd5f2!important;
  box-shadow:inset 0 0 0 1px rgba(153,212,241,.25);
}
.editor-focused-shell .flow-one-screen .page-tree-node .tree-auto-corner{
  display:none;
}
.editor-focused-shell .flow-one-screen .flow-tree-shared>.page-tree-row{
  border-style:dashed;
  border-color:#55738b;
  background:#203347;
}
.editor-focused-shell .flow-one-screen .flow-tree-shared .flow-inline-icon{
  color:#98c9ea;
}
.editor-focused-shell .flow-one-screen .flow-branch-total{
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:3px;
  justify-content:center;
  min-width:26px;
  padding:3px 4px;
  border-radius:6px;
  background:#315e78;
  color:#d6f3ff;
  font-size:10px;
  font-weight:700;
  line-height:1;
}
.editor-focused-shell .flow-one-screen .flow-branch-total span{
  color:#8fd3f1;
  font-size:10px;
}
.editor-focused-shell .flow-one-screen .flow-shared-tag{
  color:#9fc5e3;
  font-size:13px;
  flex:0 0 auto;
  padding:0 2px;
}
.editor-focused-shell .flow-one-screen .flow-tree-shared .flow-shared-tag{
  border:1px solid #446b85;
  border-radius:5px;
}
.editor-focused-shell .flow-one-screen .flow-branch-total,
.editor-focused-shell .flow-one-screen .flow-shared-tag{user-select:none}
.editor-focused-shell .flow-one-screen .flow-tree-branch>.page-tree-row .screen-label{
  color:#eaf8ff;
}
.editor-focused-shell .flow-one-screen .flow-tree-children .page-grip{
  color:#87b4d1;
}
.editor-focused-shell .flow-one-screen .page-tree-node.flow-moving-placeholder>.page-tree-row{
  outline:2px dashed #88cee9!important;
  opacity:.45;
}
@media(max-width:600px){
  .editor-focused-shell .flow-one-screen .flow-tree-children{
    margin-left:6px;
    padding-left:8px;
  }
  .editor-focused-shell .flow-one-screen .flow-tree-children>.page-tree-node::before{
    left:-8px;
    width:7px;
  }
  .editor-focused-shell .flow-one-screen .flow-tree-children>.page-tree-node:last-child::after{
    left:-10px;
  }
  .editor-focused-shell .flow-one-screen .page-tree-row{min-height:38px}
}

/* R17M — The Telegram chat remains a representation of messages actually sent.
   Silent rewards, conditions and integrations are explained OUTSIDE the chat. */
.tg-preview-effects{padding:10px 14px;background:var(--surface,rgba(130,150,170,.09));border-bottom:1px solid rgba(120,140,160,.24);color:var(--muted,#516273);font-size:12px;line-height:1.45}
.tg-preview-effects b{display:block;font-weight:700;margin-bottom:5px;color:inherit}
.tg-preview-effects p{margin:3px 0}
.tg-form-preview .tg-sim-inline-row{margin:2px 0 7px;display:grid;grid-template-columns:1fr}
.tg-preview-static-button{background:rgba(104,146,185,.14);border:1px solid rgba(104,146,185,.35);border-radius:8px;text-align:center;padding:9px 7px;font-weight:600;font-size:13px}
.tg-preview-poll{display:grid;gap:5px;padding:9px 0}
.tg-preview-poll>div{padding:8px 11px;border:1px solid rgba(90,110,140,.32);border-radius:6px}
.screen-builder-modal .screen-builder-chat{min-height:110px}

/* R17N: inline/message buttons and bottom reply keyboard are different Telegram
   controls. Make the placement explicit and provide dependable up/down moves. */
.editor-focused-shell .flow-one-screen .flow-button-placement{
  flex:0 0 auto; font-size:9px; color:#acc9de; border:1px solid #45647b;
  border-radius:6px; padding:2px 4px; white-space:nowrap;
}
.editor-focused-shell .flow-one-screen [data-flow-placement="keyboard"]>.page-tree-row .flow-button-placement{
  color:#d4c2f5; border-color:#7867a3; background:rgba(118,88,170,.13);
}
.editor-focused-shell .flow-one-screen .flow-order-buttons{
  display:flex; flex:0 0 auto; gap:1px;
}
.editor-focused-shell .flow-one-screen .flow-order-buttons button{
  background:transparent; color:#c6e2f0; border:1px solid #526b7e;
  border-radius:5px; height:25px; width:20px; cursor:pointer; font-size:13px;
}
.editor-focused-shell .flow-one-screen .flow-order-buttons button:disabled{
  opacity:.3; cursor:default;
}
.editor-focused-shell .flow-one-screen .flow-order-buttons button:not(:disabled):hover{
  background:#41627d; color:white;
}
@media(max-width:660px){
 .editor-focused-shell .flow-one-screen .flow-button-placement{font-size:0; padding:3px 4px}
 .editor-focused-shell .flow-one-screen .flow-button-placement::first-letter{font-size:12px}
 .editor-focused-shell .flow-one-screen .flow-order-buttons button{width:19px; height:27px}
}
/* R17M: Telegram placement changes only on a physical drop in the phone preview. */
.flow-pointer-active .reply-keyboard[data-keyboard-owner],
.flow-pointer-active .canvas-inline-keyboard[data-inline-owner]{
  outline:2px dashed #45a6c6;outline-offset:2px;
  transition:outline-color .12s,background-color .12s;
}
.flow-pointer-active .reply-keyboard[data-keyboard-owner]::before{
  content:'Drop here → bottom Telegram keyboard';display:block;
  text-align:center;font-size:11px;font-weight:750;color:#21566e;
  padding:6px;border-radius:7px;background:#d8f4fc;margin-bottom:5px;
}
.flow-pointer-active .canvas-inline-keyboard[data-inline-owner]::before{
  content:'Drop here → inline buttons under this message';display:block;
  text-align:center;font-size:10px;font-weight:750;color:#21566e;
  padding:4px;border-radius:6px;background:#d8f4fc;margin-bottom:4px;
}
.flow-pointer-active .flow-preview-drop-active{
  outline:3px solid #0d8fc3!important;outline-offset:2px;
  background-color:#bcebf8!important;
  box-shadow:0 0 0 5px #2caad62b;
}

/* R17O — One read-only, FULL Telegram screen on Bot Flow row hover.
   Chat content scrolls; the composer and reply keyboard remain docked below.
   No editing controls appear in this miniature Telegram rendering. */
.flow-hover-card,.flow-hover-card *{box-sizing:border-box}
.flow-hover-card{
  position:fixed;z-index:10050;width:min(364px,calc(100vw - 16px));
  max-height:calc(100dvh - 16px);display:flex;flex-direction:column;
  padding:9px;background:#172b41;color:#e9f5ff;
  border:1px solid #4c708a;border-radius:19px;
  box-shadow:0 20px 60px #0008,0 5px 15px #0005;
  font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  pointer-events:auto;isolation:isolate;
}
.flow-hover-hint{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:2px 5px 9px;min-width:0}
.flow-hover-hint strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.flow-hover-hint span{font-size:10px;background:#32546d;color:#cfeaff;padding:3px 7px;border-radius:7px;white-space:nowrap}
.flow-hover-phone{
  display:flex;flex-direction:column;flex:1;min-height:180px;
  height:min(540px,calc(100dvh - 118px));
  min-width:0;background:#d7e4dd;border:1px solid #64859b;
  border-radius:14px;overflow:hidden;color:#162e40;
}
.flow-hover-chat-head{display:flex;align-items:center;gap:9px;flex:none;min-height:51px;padding:7px 10px;background:#f8fbfe;border-bottom:1px solid #d2e0e8}
.flow-hover-back{font-size:27px;line-height:1;color:#668b9d}
.flow-hover-avatar{display:grid;place-items:center;flex:none;background:#d8ebf5;color:#3179a1;border-radius:50%;font-size:21px;width:35px;height:35px}
.flow-hover-identity{display:flex;flex-direction:column;gap:0;min-width:0;flex:1}
.flow-hover-identity strong{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#1c3748}
.flow-hover-identity small{font-size:10px;color:#7191a4}
.flow-hover-head-menu{font-size:21px;color:#7495aa;line-height:1}
.flow-hover-chat-body{
  min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;
  display:flex;flex-direction:column;gap:9px;
  padding:10px 9px 15px;
  background:radial-gradient(ellipse at 15% 26%,#dceada,transparent 54%),linear-gradient(135deg,#d2e2d8,#e2eada 75%);
  scrollbar-width:thin;scrollbar-color:#95b1b5 transparent;
}
.flow-hover-today{align-self:center;background:#9cb5ad9c;color:#fff;font-size:10px;border-radius:12px;padding:3px 11px}
.flow-hover-chat-line{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0}
.flow-hover-chat-line .tg-bubble,.flow-hover-special{
  display:block;max-width:95%;min-width:58px;width:max-content;
  color:#1a3443;background:white;border-radius:5px 12px 12px 12px;
  box-shadow:0 1px 3px #2d525128;padding:8px 10px 6px;
  font-size:12px;line-height:1.4;overflow-wrap:anywhere;white-space:normal;
}
.flow-hover-chat-line .tg-bubble p{margin:0}
.flow-hover-chat-line .tg-bubble-content{min-width:0}
.flow-hover-chat-line .tg-bubble-content a{color:#157fb3;text-decoration:underline}
.flow-hover-chat-line .tg-bubble-content blockquote{border-left:2px solid #6e9fba;padding:3px 7px;margin:4px 0;color:#426279;background:#ecf5f9}
.flow-hover-chat-line .tg-bubble-meta{display:flex;justify-content:flex-end;gap:4px;color:#93a4ae;font-size:9px;margin-top:4px}
.flow-hover-chat-line .tg-media{display:block;max-width:100%;max-height:170px;object-fit:cover;border-radius:7px;margin-bottom:5px}
.flow-hover-chat-line .tg-media-file{font-size:11px;padding:8px;background:#ebf2f6;border-radius:6px;margin-bottom:5px}
.flow-hover-chat-line .tg-media-file a{color:#1679ab}
.flow-hover-buttons{width:min(290px,94%);display:flex;flex-direction:column;gap:3px}
.flow-hover-button-row{display:grid;gap:3px;width:100%;min-width:0}
.flow-hover-button-row span{min-width:0;min-height:30px;padding:7px 4px;display:flex;align-items:center;justify-content:center;text-align:center;
  border-radius:5px;background:#f9fcff;color:#2286b7;font-size:11px;font-weight:650;box-shadow:0 1px 3px #2c536122;overflow-wrap:anywhere}
.flow-hover-special{width:95%}
.flow-hover-poll-option{background:#ebf3f8;border-radius:5px;padding:5px 8px;margin-top:6px}
.flow-hover-empty{padding:13px;margin:auto 0;background:#ffffffe8;color:#476578;border-radius:10px;text-align:center;font-size:12px}
.flow-hover-composer{flex:none;display:flex;gap:9px;align-items:center;min-height:44px;padding:6px 9px;
  background:#f7fbfe;border-top:1px solid #cbdde7;color:#88a1b1;font-size:19px}
.flow-hover-input{flex:1;min-width:0;border-radius:20px;background:#fff;border:1px solid #ebf1f4;font-size:11px;color:#a5b4c0;padding:7px 11px}
.flow-hover-composer>span:last-child{display:grid;place-items:center;color:#fff;background:#2899d9;border-radius:50%;width:27px;height:27px;font-size:15px}
.flow-hover-keyboard{flex:none;background:#d8e3e9;border-top:1px solid #c2d4dd;padding:7px 9px 9px}
.flow-hover-keyboard-label{color:#658497;font-size:10px;margin-bottom:5px;font-weight:700}
.flow-hover-reply{width:100%;gap:5px}
.flow-hover-reply .flow-hover-button-row{gap:5px}
.flow-hover-reply .flow-hover-button-row span{min-height:33px;color:#315a71;background:#fff;box-shadow:0 1px 3px #5b798633;font-size:11px;border-radius:6px}
.flow-hover-notes{flex:none;max-height:91px;overflow:auto;border-top:1px solid #476174;margin-top:7px;padding:6px 5px 0;color:#b9d6e5;font-size:10px;line-height:1.4}
.flow-hover-notes strong{display:block;color:#e5eff8;font-size:10px;margin-bottom:2px}
.flow-hover-notes p{margin:2px 0}
.flow-placement-divider{display:flex;align-items:center;gap:6px;padding:8px 6px 3px;margin:3px 0 0;color:#a6d6f7;min-width:0}
.flow-placement-divider>span{font-size:9px;font-weight:850;letter-spacing:.05em;white-space:nowrap}
.flow-placement-divider>small{font-size:9px;color:#849fb6}
.flow-placement-divider:before{content:"";width:9px;height:1px;background:#719fbe}
.flow-placement-keyboard{margin-top:6px;border-top:1px dashed #6775a1;color:#d9c5ff}
.flow-placement-keyboard:before{background:#aa90e4}
@media(max-width:450px){
  .flow-hover-card{width:min(320px,calc(100vw - 16px));padding:6px;border-radius:14px}
  .flow-hover-phone{height:min(450px,calc(100dvh - 110px))}
  .flow-hover-chat-body{padding:8px 7px;gap:7px}
  .flow-hover-hint{padding-bottom:6px}
}
@media(prefers-reduced-motion:reduce){.flow-hover-card{transition:none}}

/* R17P — Bot Flow is the exact Telegram button-name tree. Placement is
   represented by existing nesting and a dotted boundary, never label rows. */
.editor-focused-shell .flow-one-screen .flow-keyboard-boundary{
  border-top:2px dotted #748eaf;
  padding-top:5px;
  margin-top:5px;
}
.editor-focused-shell .flow-one-screen .page-tree-row .screen-label{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
}
.editor-focused-shell .flow-one-screen .page-tree-row .screen-link{
  overflow:visible!important;
  min-width:0;
}

/* R17Q: exactly handle, button label, pencil and × in Bot Flow. Dotted
   connectors carry all hierarchy; no icon, branch count or placement pills. */
.editor-focused-shell .flow-one-screen .page-tree-row{display:flex;align-items:center;gap:3px;min-width:0}
.editor-focused-shell .flow-one-screen .page-tree-row>.screen-link{flex:1 1 auto;min-width:0}
.editor-focused-shell .flow-one-screen .page-tree-row>.page-grip,
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-edit,
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-remove{flex-shrink:0}
.editor-focused-shell .flow-one-screen .page-tree-row .tree-auto-corner,
.editor-focused-shell .flow-one-screen .page-tree-row .flow-inline-icon,
.editor-focused-shell .flow-one-screen .page-tree-row .flow-order-buttons,
.editor-focused-shell .flow-one-screen .page-tree-row .flow-branch-total,
.editor-focused-shell .flow-one-screen .page-tree-row .flow-shared-tag,
.editor-focused-shell .flow-one-screen .page-tree-row .flow-hidden-tag,
.editor-focused-shell .flow-one-screen .page-tree-row .flow-action-count{display:none!important}
.editor-focused-shell .flow-one-screen .page-tree-root>.flow-home-icon,
.editor-focused-shell .flow-one-screen .page-tree-root>.flow-action-count{display:none!important}
.editor-focused-shell .flow-one-screen .flow-unplaced{margin-top:13px;border-top:1px dotted #7492a9;padding-top:9px}
.editor-focused-shell .flow-one-screen .flow-unplaced>summary{cursor:pointer;display:flex;justify-content:space-between;align-items:center;color:#b5d1e5;font-size:11px;font-weight:650;padding:7px 6px}
.editor-focused-shell .flow-one-screen .flow-unplaced>summary span{color:#8db4cd}
.editor-focused-shell .flow-one-screen .flow-unplaced-list{display:grid;gap:3px;padding:3px 0}
.editor-focused-shell .flow-one-screen .flow-unplaced-row{display:flex;align-items:center;gap:3px;padding:3px 2px;min-height:34px;border-radius:7px;background:#1a3147;border:1px dotted #496781}
.editor-focused-shell .flow-one-screen .flow-unplaced-row:hover{background:#29445e}
.editor-focused-shell .flow-one-screen .flow-unplaced-row .screen-link{flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;white-space:normal;overflow-wrap:anywhere;color:#c7deef;background:transparent;border:0;padding:5px 3px;cursor:pointer}
.editor-focused-shell .flow-one-screen .flow-unplaced-row .screen-label{white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere}
.editor-focused-shell .flow-one-screen .flow-unplaced-row .page-grip{display:grid;place-items:center;flex:0 0 22px;min-height:28px;color:#aacfe6;border:0;background:transparent;cursor:grab;font-size:18px}
.editor-focused-shell .flow-one-screen .flow-unplaced-row .tree-screen-edit,
.editor-focused-shell .flow-one-screen .flow-unplaced-row .tree-screen-remove{flex:0 0 24px;min-height:28px}
.flow-unplaced-ghost{position:fixed;z-index:1700;pointer-events:none;width:max-content;max-width:210px;padding:9px 12px;color:#133751;background:#e9f6ff;border:1px solid #77accd;box-shadow:0 7px 25px #071c3459;border-radius:8px;font-size:12px;font-weight:650}
.editor-focused-shell .flow-one-screen .flow-unplaced-drop-target>.page-tree-row,
.editor-focused-shell .flow-one-screen .page-tree-root.flow-unplaced-drop-target{outline:2px dotted #91ccef;outline-offset:1px}

/* R17Q: real preview tap options, above every Telegram scroll container. */
.r10-editor .tg-preview-floating-menu{position:fixed!important;z-index:375!important;left:0;top:0;transform:none!important;max-height:min(360px,calc(100dvh - 16px));overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;min-width:0;max-width:calc(100vw - 16px)}
.r10-editor .tg-preview-floating-menu::before{display:none!important}
.r10-editor .tg-preview-floating-menu .button-quick-head{position:sticky;top:0;background:#fff;z-index:1}

/* R17T: two clear creation modes, with a real selectable button list. */
.screen-builder-modal .screen-builder-mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:5px;border-radius:13px;background:#152438;border:1px solid #3c526b;margin:9px 0 14px}
.screen-builder-modal .screen-builder-mode-tab{border:0;border-radius:9px;padding:12px 8px;background:transparent;color:#a9bed5;font-weight:700;font-size:13px;cursor:pointer;white-space:normal;line-height:1.4}
.screen-builder-modal .screen-builder-mode-tab.is-active{color:#f5faff;background:#31517a;box-shadow:0 1px 5px #07142366}
.screen-builder-modal .screen-builder-mode-tab:focus-visible{outline:2px solid #9addff;outline-offset:2px}
.screen-builder-modal #aliasButtonForm{display:grid;gap:14px}
.screen-builder-modal .screen-builder-existing-fieldset{min-width:0;min-height:0;border:0;padding:0;margin:0}
.screen-builder-modal .screen-builder-existing-fieldset legend{font-size:13px;font-weight:700;margin-bottom:8px;color:#edf4ff}
.screen-builder-modal .screen-builder-existing-list{display:grid;gap:6px;overflow-y:auto;max-height:min(44dvh,360px);padding:2px 5px 5px 1px;overscroll-behavior:contain}
.screen-builder-modal .screen-builder-existing-group{margin-top:8px;padding:3px 2px;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#a5c0e0}
.screen-builder-modal .screen-builder-existing-choice{display:flex;align-items:center;gap:10px;border:1px solid #3b5472;background:#1c3047;border-radius:10px;padding:11px 12px;cursor:pointer;min-width:0}
.screen-builder-modal .screen-builder-existing-choice:hover{background:#2a4565}
.screen-builder-modal .screen-builder-existing-choice:has(input:checked){border-color:#84caff;background:#305277}
.screen-builder-modal .screen-builder-existing-choice:focus-within{outline:2px solid #83c9ff;outline-offset:1px}
.screen-builder-modal .screen-builder-existing-choice input{accent-color:#8ccfff;flex:0 0 auto;width:17px;height:17px}
.screen-builder-modal .screen-builder-existing-choice-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.screen-builder-modal .screen-builder-existing-choice-body strong{color:#f1f7ff;font-weight:650;font-size:13px;overflow-wrap:anywhere}
.screen-builder-modal .screen-builder-existing-choice-body small{color:#adc0d6;font-size:11px;overflow-wrap:anywhere}
.screen-builder-modal .screen-builder-existing-check{color:#a3dcff;opacity:0}
.screen-builder-modal .screen-builder-existing-choice:has(input:checked) .screen-builder-existing-check{opacity:1}
@media(max-width:450px){.screen-builder-modal .screen-builder-mode-tab{font-size:12px;padding:11px 6px}.screen-builder-modal .screen-builder-existing-list{max-height:38dvh}}

/* R17U — direct reusable-action type popup, with saved actions below Add. */
.screen-action-picker-layer{z-index:650;backdrop-filter:blur(5px)}
.screen-action-picker{width:min(570px,100%);max-height:min(86dvh,820px);overflow-y:auto;display:grid;gap:11px;background:#17283a;color:#eef6ff}
.screen-action-picker .modal-head{align-items:start}
.screen-action-picker .modal-head h2{font-size:21px}
.screen-action-picker .hint{margin:0;color:#bac9dc}
.screen-action-picker-list{display:grid;gap:6px;max-height:44dvh;overflow-y:auto;overscroll-behavior:contain;padding:2px}
.screen-action-picker-list>button{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;width:100%;text-align:left;padding:12px 13px;border:1px solid #41617f;background:#223d58;border-radius:10px;color:#f0f7ff;font-size:13px;cursor:pointer}
.screen-action-picker-list>button:hover,.screen-action-picker-list>button:focus-visible{background:#36597b;border-color:#91d1ff}
.screen-action-picker-list>button:disabled{opacity:.48;cursor:default}
.screen-action-picker-list>button small{color:#b7cde0;font-size:11px;white-space:normal}
.screen-action-picker-saved-toggle{border:1px solid #4e7691;border-radius:10px;background:#1b354b;color:#eaf6ff;display:flex;justify-content:space-between;gap:12px;padding:11px 13px;font-weight:700;cursor:pointer}
.screen-action-picker-saved{max-height:26dvh}
.screen-actions-attached-list{display:grid;gap:7px;margin-top:10px}
.screen-action-attached{display:flex;align-items:center;gap:5px;margin:0!important;min-width:0}
.screen-action-attached-title{min-width:0;flex:1;display:grid;gap:3px}
.screen-action-attached-title strong{word-break:break-word;font-size:13px}
.screen-action-attached-title small{font-size:11px;color:#9bbad4}
.screen-action-attached>button{flex-shrink:0}
@media(max-width:480px){.screen-action-picker{padding:17px}.screen-action-picker-list{max-height:41dvh}.screen-action-attached>button{min-width:26px;padding:4px}}


/* R17X — visual corrections only; Bot Flow order and destinations stay intact. */
/* A rail must reach its parent row and every outer sibling after a branch. */
.editor-focused-shell .flow-one-screen .flow-tree-children{
  border-left:2px dotted #5aabc9;
  background-image:none;
  overflow:visible;
}
/* Never paint over the dotted rail at the last child. It can have descendants,
   and the old masking rectangle incorrectly hid their connection. */
.editor-focused-shell .flow-one-screen .flow-tree-children>.page-tree-node:last-child::after{
  content:none!important;
}
/* Connect parent to its child rail. This is paint only: no layout or DnD change. */
.editor-focused-shell .flow-one-screen .flow-tree-branch>.page-tree-row::after{
  content:"";
  position:absolute;
  width:12px;
  height:2px;
  border-top:2px dotted #5aabc9;
  left:0;
  bottom:-5px;
  pointer-events:none;
  z-index:0;
}
/* Keep insertion controls close to the message immediately following them. */
.r10-editor #messageSequence>.tg-chat-insert-round{
  margin:4px auto 2px;
}
.r10-editor #messageSequence>.tg-chat-insert-round + .screen-message-unit.tg-edit-unit{
  margin-top:4px;
}
/* The mobile composer and reply keyboard are both part of the phone frame. */
@media(max-width:600px){
  .r10-editor .simple-stage.telegram-simulator{
    height:min(560px,calc(100dvh - 185px));
    min-height:0;
    max-width:100%;
    overflow:hidden;
    border-radius:14px;
  }
  .r10-editor .simple-chat-body{flex:1 1 auto;min-height:0;overflow-y:auto;}
  .r10-editor .tg-composer{flex:0 0 auto;min-width:0;width:100%;box-sizing:border-box;}
  .r10-editor .tg-composer input{min-width:0;width:0;flex:1 1 auto;}
  .r10-editor #editorReplyButtons{flex:0 0 auto;max-height:min(32dvh,190px);overflow-y:auto;overscroll-behavior:contain;min-width:0;}
  .r10-editor #editorReplyButtons .reply-keyboard{width:100%;min-width:0;box-sizing:border-box;}
}
@media(max-width:400px){
  .r10-editor .simple-stage.telegram-simulator{height:min(510px,calc(100dvh - 165px));}
  .r10-editor .tg-composer{gap:4px;padding:5px 6px;}
  .r10-editor .tg-composer input{padding-inline:8px;}
}

/* The Telegram hover is an informational miniature, not a click shield.
   Without this, it can cover the left-pencil on narrow screens. */
.flow-hover-card,.flow-hover-card *{pointer-events:none!important;}
/* Reconnect Welcome to every outer sibling after an expanded branch.
   Keep the original row order, levels and drag data unchanged. */
.editor-focused-shell .flow-one-screen .page-tree-root{overflow:visible;}
.editor-focused-shell .flow-one-screen .page-tree-root::after{
  content:"";position:absolute;left:9px;bottom:-10px;height:10px;
  border-left:2px dotted #5aabc9;pointer-events:none;
}
.editor-focused-shell .flow-one-screen .page-tree-list{
  border-left:2px dotted #5aabc9;
  margin-left:9px;
  padding-left:9px;
  overflow-x:visible;
}
.editor-focused-shell .flow-one-screen .page-tree-list>.page-tree-node::before{
  content:""!important;position:absolute;top:17px;left:-9px;
  width:8px;height:0;border-top:2px dotted #5aabc9;
  pointer-events:none;
}

/* R18D: user-approved Telegram reply-keyboard attachment bubble. */
.tg-keyboard-announcement { margin-top: 6px; }
.tg-keyboard-announcement .tg-message-preview { align-items: flex-start; }
.tg-notice-bubble-button { display: block; border: 0; background: transparent; padding: 0; margin: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.tg-notice-bubble-button:focus-visible { outline: 2px solid var(--primary,#3390ec); outline-offset: 3px; border-radius: 12px; }
.tg-keyboard-announcement-caption { font-size: 11px; color: var(--muted,#667788); margin: 5px 0 8px 12px; }
.tg-keyboard-notice-text { display: block; width: min(100%,390px); resize: vertical; min-height: 58px; padding: 8px; border: 1px solid #83b5df; border-radius: 9px; background: transparent; color: inherit; font: inherit; }
.tg-notice-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 6px; }
.tg-notice-actions button { border: 1px solid #a7bfd1; border-radius: 8px; padding: 7px 10px; cursor: pointer; color: inherit; background: transparent; }
.tg-notice-actions button:first-child { background: #3390ec; color: #fff; border-color: #3390ec; }
.button-quick-menu.tg-preview-floating-menu { max-width: 270px; }

/* E3: distinguish the existing destination without changing the flow. */
.page-choice-list button.current{border-color:#78aee8;background:#eaf4ff;color:#173f67}
.button-replace-context{display:grid;gap:3px;padding:10px 12px;background:#eef5fa;border:1px solid #d8e4ef;border-radius:11px;color:#253e56;margin-top:12px}
.button-replace-context span{font-size:12px;color:#5c7184}
.button-replace-keep{display:flex;align-items:start;gap:9px;font-size:13px;padding:10px 4px;color:#263e53;cursor:pointer}
.button-replace-keep input{margin-top:2px;flex:none;accent-color:#3989d6}
.button-replace-keep span{overflow-wrap:anywhere}
/* R19A Bots.Business read-only migration preview */
.bb-import-modal {max-width:690px;max-height:90vh;overflow:auto}
.bb-import-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:18px 0}
.bb-import-summary>div{padding:12px 8px;text-align:center;background:var(--surface-2,#1a2230);border:1px solid var(--border,#435066);border-radius:12px}
.bb-import-summary strong{display:block;font-size:22px}.bb-import-summary small{display:block;font-size:11px;opacity:.78}
.bb-import-scroll{max-height:160px;overflow-y:auto;margin:9px 0 18px;border:1px solid var(--border,#435066);border-radius:12px}
.bb-import-entry{padding:10px 12px;border-bottom:1px solid var(--border,#435066)}.bb-import-entry:last-child{border-bottom:0}
.bb-import-entry small{display:block;margin-top:3px;opacity:.8;line-height:1.4}
.bb-import-issues{max-height:140px}
@media(max-width:480px){.bb-import-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.bb-import-modal{max-width:calc(100vw - 18px)}}

/* R19B: the detached screen list is a real visual forest. Keep exactly the
   same four row controls and continuous dotted rails as the Welcome tree. */
.editor-focused-shell .flow-one-screen .flow-unplaced-list{display:flex;flex-direction:column;gap:8px;min-width:0}
.editor-focused-shell .flow-one-screen .flow-unplaced-root{margin:0!important;min-width:0}
.editor-focused-shell .flow-one-screen .flow-unplaced-root>.flow-tree-children{margin:2px 0 4px 9px;padding-left:9px;border-left:1px dotted #62829b}
.editor-focused-shell .flow-one-screen .flow-unplaced-root>.flow-tree-children .page-tree-node{min-width:0}
.editor-focused-shell .flow-one-screen .flow-unplaced-root>.flow-tree-children .page-tree-row{background:transparent;border-color:transparent}
.editor-focused-shell .flow-one-screen .flow-unplaced-root>.flow-tree-children .page-tree-row:hover{background:#223c54;border-color:#42617b}
.editor-focused-shell .flow-one-screen .flow-unplaced-root>.flow-unplaced-row{margin:0;min-width:0}
.editor-focused-shell .flow-one-screen .flow-unplaced-root .flow-tree-children{position:relative}
.editor-focused-shell .flow-one-screen .flow-unplaced-root .flow-tree-children::before{border-left-style:dotted}
/* R19C — Messages and buttons share the actual Telegram flow outline.
   A message is a content node, not an extra Welcome button or a drag target. */
.editor-focused-shell .flow-one-screen .page-tree-root .flow-message-icon,
.editor-focused-shell .flow-one-screen .flow-tree-message-row .flow-message-icon{
  flex:0 0 23px;display:grid;place-items:center;font-size:16px;
  color:#78c9e8;line-height:1;user-select:none;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-node{margin:2px 0 4px;min-width:0}
.editor-focused-shell .flow-one-screen .flow-tree-message-row{
  background:rgba(37,76,103,.38)!important;
  border:1px dotted #557995!important;
  min-height:35px;padding:3px 4px;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row .screen-link{
  font-weight:500;color:#bfdcee;font-size:12px;white-space:normal;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row .screen-label,
.editor-focused-shell .flow-one-screen .page-tree-root .screen-label{
  white-space:normal!important;overflow-wrap:anywhere;overflow:visible!important;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row .tree-screen-edit{margin-left:auto}
.editor-focused-shell .flow-one-screen .flow-tree-message-node>.flow-tree-children{
  margin-top:2px;margin-bottom:5px;
}
.editor-focused-shell .flow-one-screen .page-tree-root{
  background:rgba(37,76,103,.46);border:1px dotted #6595b1;
  min-height:43px;
}
.editor-focused-shell .flow-one-screen .page-tree-root .screen-link{flex:1;min-width:0;line-height:1.4}
.editor-focused-shell .flow-one-screen .flow-tree-message-row.is-selected{
  border-color:#8bc8e9!important;box-shadow:none!important;
}
/* R19D: Monetize.tg sponsored placement in the Telegram draft/test preview. */
.tg-native-ad-preview{margin:10px 0 3px;max-width:100%;}
.tg-native-ad-status{font-size:11px;font-weight:700;letter-spacing:.01em;color:var(--muted,#667b8b);margin:2px 0 5px 3px;}
.tg-native-ad-preview>.tg-sim-inline-group{margin-top:2px;}
.tg-native-ad-preview>.tg-sim-inline-group button{cursor:default;opacity:1;}
.tg-native-ad-preview>small,.tg-native-ad-placeholder small{display:block;margin:6px 3px 2px;font-size:10px;line-height:1.35;color:var(--muted,#667b8b);}
.tg-native-ad-placeholder{margin:10px 0;padding:10px 12px;border:1px dashed var(--border,#b8c8d4);border-radius:10px;font-size:12px;color:var(--muted,#667b8b);}

/* R19F: anchored insertion menu; not a screen-sized modal or inline form block. */
.tg-plus-popover{position:fixed;z-index:1100;width:min(250px,calc(100vw - 16px));background:#f7fbff;color:#18364e;border:1px solid #c4d9e8;border-radius:12px;padding:5px;box-shadow:0 10px 30px #081e3042;display:grid;gap:3px;max-height:min(360px,70dvh);overflow:auto}
.tg-plus-popover-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 7px 5px;font-size:11px;font-weight:800;color:#45657e;border-bottom:1px solid #dfebf4}
.tg-plus-popover-title button{border:0;background:transparent;color:#45657e;border-radius:6px;font-size:17px;line-height:20px;padding:0 6px}
.tg-plus-popover>button,.tg-plus-scroll button{width:100%;border:0;background:transparent;color:#143954;border-radius:8px;text-align:left;padding:9px 10px;font-size:13px;font-weight:650;cursor:pointer;white-space:normal}
.tg-plus-popover>button:hover,.tg-plus-popover>button:focus-visible,.tg-plus-scroll button:hover{background:#dceefa}
.tg-plus-scroll{max-height:245px;overflow-y:auto}
@media(max-width:400px){.tg-plus-popover{width:min(235px,calc(100vw - 16px))}}

/* R19F-R2: float + menus above the editor, never behind a chat or modal. */
#tgPlusPortal{position:fixed;inset:0;width:0;height:0;z-index:2147483000;pointer-events:none;}
#tgPlusPortal .tg-plus-popover{position:fixed;z-index:1;pointer-events:auto;box-sizing:border-box;filter:drop-shadow(0 8px 18px rgba(12,33,56,.18));}
#tgPlusPortal .tg-plus-popover button{touch-action:manipulation;}

/* R19G: measured Telegram-style contextual menus and touch-first preview drag. */
#tgPlusPortal .tg-plus-popover{visibility:hidden;isolation:isolate;overflow:visible;
 box-shadow:0 14px 42px rgba(11,42,66,.26),0 2px 8px rgba(11,42,66,.10);
 border:1px solid #bdd5e6;border-radius:15px;padding:7px;animation:tgPlusRise .13s ease-out;}
#tgPlusPortal .tg-plus-popover::after{content:"";position:absolute;left:var(--plus-arrow-x,50%);
 width:11px;height:11px;background:#f7fbff;border:inherit;border-right:0;border-bottom:0;
 pointer-events:none;transform:translateX(-50%) rotate(45deg);}
#tgPlusPortal .tg-plus-popover[data-side="below"]::after{top:-7px;}
#tgPlusPortal .tg-plus-popover[data-side="above"]::after{bottom:-7px;transform:translateX(-50%) rotate(225deg);}
#tgPlusPortal .tg-plus-popover>button{min-height:42px;padding:11px 12px;border-radius:9px;font-size:13px;}
#tgPlusPortal .tg-plus-popover>button:active{background:#cce6f7;}
@keyframes tgPlusRise{from{opacity:.6}to{opacity:1}}
@media(prefers-reduced-motion:reduce){#tgPlusPortal .tg-plus-popover{animation:none}}
@media(pointer:coarse){
 #propertiesContent [data-preview-button-id]{touch-action:none;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;}
 #propertiesContent [data-preview-button-id].tg-holding-button{outline:2px solid #50b6de;outline-offset:1px;
 box-shadow:0 0 0 5px rgba(58,165,220,.16);transition:outline .12s,box-shadow .12s;}
 #tgPlusPortal .tg-plus-popover>button{min-height:46px;}
 .flow-drag-ghost{max-width:min(300px,82vw);}
}
/* Preview buttons must reserve their pointer sequence for long-press dragging,
   otherwise the browser cancels the pointer and scrolls mid-drag. */
#propertiesContent [data-preview-button-id]{touch-action:none;-webkit-touch-callout:none;}
/* Drag hints overlay the drop zones without changing their size or moving the
   targets out from under a finger during a press-and-hold gesture. */
.flow-pointer-active .reply-keyboard[data-keyboard-owner],
.flow-pointer-active .canvas-inline-keyboard[data-inline-owner]{position:relative;}
.flow-pointer-active .reply-keyboard[data-keyboard-owner]::before,
.flow-pointer-active .canvas-inline-keyboard[data-inline-owner]::before{
  position:absolute;z-index:3;left:8px;right:8px;top:0;margin:0;
  pointer-events:none;display:block;box-sizing:border-box;
  background:rgba(216,244,252,.95);box-shadow:0 2px 9px #14344a25;
}

/* R19H: true-to-source drag preview and precise in-keyboard insertion. */
.flow-drag-ghost.flow-preview-ghost{
  padding:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;
  overflow:visible!important;max-width:none!important;
  filter:drop-shadow(0 9px 16px rgba(10,32,55,.25));
  -webkit-user-select:none;user-select:none;
}
.flow-preview-ghost>[data-preview-button-id],
.flow-preview-ghost>.canvas-inline-button,
.flow-preview-ghost>.reply-key{
  box-sizing:border-box!important;max-width:none!important;
  flex:initial!important;cursor:grabbing!important;
  text-decoration:none!important;transform:none!important;
}
.flow-preview-ghost>.flow-ghost-hint{
  position:absolute;left:50%;top:calc(100% + 9px);
  transform:translateX(-50%);width:max-content;
  max-width:min(280px,86vw);min-width:150px;
  padding:6px 11px;text-align:center;
  background:#17384e;color:#f5fcff;border:1px solid #477b99;
  border-radius:11px;box-shadow:0 6px 18px #0b263d55;
  font:600 11px/1.35 system-ui,-apple-system,"Segoe UI",sans-serif;
  white-space:normal;pointer-events:none;
}
.flow-preview-ghost[data-valid="false"]>.flow-ghost-hint{background:#73442f;border-color:#ae7658;}
.flow-pointer-active .flow-button-drop-target{position:relative;z-index:4;outline:2px solid #068bc0!important;outline-offset:1px;}
.flow-pointer-active .flow-button-drop-target::after{
  content:"";position:absolute;z-index:5;pointer-events:none;
  background:#078dc8;box-shadow:0 0 0 2px #eafaff;border-radius:8px;
}
.flow-button-drop-target[data-drop-edge="left"]::after{width:4px;top:2px;bottom:2px;left:-4px;}
.flow-button-drop-target[data-drop-edge="right"]::after{width:4px;top:2px;bottom:2px;right:-4px;}
.flow-button-drop-target[data-drop-edge="top"]::after{height:4px;left:2px;right:2px;top:-4px;}
.flow-button-drop-target[data-drop-edge="bottom"]::after{height:4px;left:2px;right:2px;bottom:-4px;}
@media(pointer:coarse){
 #propertiesContent [data-preview-button-id]{touch-action:none;-webkit-user-select:none;user-select:none;}
 .flow-preview-ghost{transition:none!important;}
}
/* App-owned confirmation/prompt surface, including keyboard-extra-message approval. */
.tg-studio-dialog-backdrop{
 position:fixed;inset:0;z-index:30000;display:flex;align-items:center;
 justify-content:center;padding:clamp(12px,4vw,24px);
 background:rgba(5,14,27,.67);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.tg-studio-dialog{
 width:min(440px,100%);max-height:calc(100dvh - 24px);overflow-y:auto;
 background:linear-gradient(155deg,#1b2b40,#132236);color:#f1f7ff;
 border:1px solid #4c6c8b;border-radius:21px;
 box-shadow:0 24px 74px #050d1db3,0 2px 8px #050d1d66;
 animation:tg-dialog-enter .16s cubic-bezier(.2,.8,.3,1) both;
}
.tg-studio-dialog-form{padding:clamp(18px,4.5vw,27px);margin:0;}
.tg-studio-dialog-heading{display:flex;align-items:center;gap:11px;margin-bottom:14px;}
.tg-studio-dialog-icon{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;
 border-radius:12px;background:#28597b;color:#cbeefe;font-size:20px;}
.tg-studio-dialog h2{font-size:19px;line-height:1.3;font-weight:750;letter-spacing:-.4px;margin:0;color:#fff;}
.tg-studio-dialog p{font-size:13px;line-height:1.6;color:#c2d3e5;white-space:pre-line;overflow-wrap:anywhere;margin:0 0 20px;}
.tg-studio-dialog-input{width:100%;margin:0 0 19px;background:#101d2e;border:1px solid #56718c;
 border-radius:11px;color:#fff;padding:12px 13px;font-size:14px;outline:0;}
.tg-studio-dialog-input:focus{border-color:#5abbe8;box-shadow:0 0 0 3px #56bbec33;}
.tg-studio-dialog-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:9px;}
.tg-studio-dialog-actions button{border-radius:10px;border:1px solid transparent;
 min-height:42px;padding:9px 16px;font-weight:700;font-size:13px;}
.tg-studio-dialog-cancel{background:#293e55;border-color:#455a70!important;color:#d7e6f6;}
.tg-studio-dialog-accept{background:#168ac6;color:white;box-shadow:0 5px 16px #0b75b644;}
.tg-studio-dialog-accept.is-danger{background:#bc4759;box-shadow:0 5px 16px #ae3e5650;}
.tg-studio-dialog-actions button:focus-visible{outline:3px solid #80cbed;outline-offset:3px;}
@keyframes tg-dialog-enter{from{opacity:.65;transform:translateY(10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.tg-studio-dialog{animation:none}}


/* R19I: responsive Telegram-style simulator; geometry never shifts on add menu. */
.r10-editor .simple-stage.telegram-simulator{
  box-sizing:border-box!important;width:min(360px,100%)!important;max-width:100%!important;
  min-width:0!important;display:flex!important;flex-direction:column!important;
  overflow:hidden!important;isolation:isolate;border:1px solid #8da4b3!important;
  border-radius:24px!important;background:#dae6df;
  box-shadow:0 18px 50px rgba(7,28,45,.24),0 2px 8px rgba(9,31,50,.10);
}
.r10-editor .simple-chat-header{flex:0 0 auto;min-width:0;min-height:55px;gap:8px;background:#fff;border-bottom:1px solid #dbe5eb;}
.r10-editor .simple-chat-header .tg-chat-identity{flex:1 1 auto;min-width:0;}
.r10-editor .simple-chat-header .screen-picker-wrap{flex:0 0 auto;display:flex;align-items:center;gap:2px;}
.r10-editor .simple-chat-body{flex:1 1 auto!important;min-height:0!important;overscroll-behavior-y:auto;
  overflow-y:auto!important;overflow-x:hidden!important;scrollbar-gutter:stable;}
.r10-editor .simple-chat-body #messageSequence{min-width:0;width:100%;}
.r10-editor .tg-composer{flex:0 0 auto!important;min-width:0;align-items:center;}
.r10-editor #editorReplyButtons{flex:0 0 auto!important;min-width:0;max-height:min(33dvh,190px);overflow-y:auto;
  overflow-x:hidden;overscroll-behavior-y:auto;scrollbar-width:thin;}
.r10-editor .tg-live-keyboard,.r10-editor .reply-keyboard{max-width:100%;box-sizing:border-box;}
.r10-editor .tg-edit-button-rows{width:100%!important;min-width:0!important;max-width:100%!important;}
.r10-editor .tg-edit-button-row{width:100%;min-width:0;max-width:100%;display:flex;align-items:stretch;gap:4px;box-sizing:border-box;}
.r10-editor .tg-edit-button-row>.canvas-button-wrap,
.r10-editor .tg-edit-button-row>.reply-key-wrap{flex:1 1 0%;min-width:min(95px,40%);max-width:100%;position:relative;}
.r10-editor .tg-edit-button-row .canvas-inline-button,
.r10-editor .tg-edit-button-row .reply-key{box-sizing:border-box;min-width:0;min-height:37px;
  padding:8px 20px 8px 9px!important;white-space:normal;overflow-wrap:anywhere;text-align:center;
  font-size:clamp(10px,2.6vw,12px);line-height:1.3;border-radius:8px;}
/* Adjacent + is an affordance, not another 50%-width bot button. */
.r10-editor .tg-edit-button-rows .tg-edit-button-row>.tg-square-add:not(:only-child){
  flex:0 0 36px!important;width:36px!important;min-width:36px!important;max-width:36px!important;
  min-height:36px;height:auto;align-self:stretch;position:relative;border-radius:8px;
}
.r10-editor .tg-edit-button-rows .tg-bottom-add-row>.tg-square-add{flex:1 1 100%!important;width:100%!important;max-width:100%!important;}
/* True centre alignment independent of glyph baseline / OS font rendering. */
.r10-editor .tg-square-add,.r10-editor .tg-chat-insert-round{
  font-size:0!important;position:relative;line-height:0!important;display:grid!important;place-items:center!important;
}
.r10-editor .tg-square-add::before,.r10-editor .tg-square-add::after,
.r10-editor .tg-chat-insert-round::before,.r10-editor .tg-chat-insert-round::after{
  content:'';position:absolute;left:50%;top:50%;background:currentColor;border-radius:2px;
  transform:translate(-50%,-50%);pointer-events:none;
}
.r10-editor .tg-square-add::before{width:13px;height:2px;}
.r10-editor .tg-square-add::after{width:2px;height:13px;}
.r10-editor .tg-chat-insert-round::before{width:17px;height:2.5px;}
.r10-editor .tg-chat-insert-round::after{width:2.5px;height:17px;}
.r10-editor .tg-edit-button-row .tg-button-remove{
  display:grid!important;place-items:center!important;box-sizing:border-box;line-height:1!important;
  font-family:Arial,Helvetica,sans-serif;font-size:15px;font-weight:500;
  width:20px!important;height:20px!important;top:0!important;right:0!important;
  padding:0!important;text-align:center;border-radius:0 8px 0 8px;
}
.r10-editor .tg-edit-button-row .tg-button-remove::first-letter{line-height:1;}
.r10-editor .tg-screen-tools[r126-start-tool]{justify-content:center!important;align-items:center!important;width:100%;margin:9px auto 0;}
.r10-editor .tg-screen-tools[r126-start-tool]>.tg-edit-screen-button{margin-inline:auto;max-width:100%;}
/* Inline editor actions: attachment | variable dropdown | done. */
.r10-editor .tg-direct-edit-footer{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:6px;margin:6px 0 0!important;min-width:0;width:100%;}
.r10-editor .tg-direct-edit-footer>.tg-media-tool{grid-column:1;grid-row:1;min-width:30px;order:0;}
.r10-editor .tg-direct-edit-footer>.tg-variable-trigger{grid-column:2;grid-row:1;order:1;}
.r10-editor .tg-direct-edit-footer>.tg-edit-done{grid-column:3;grid-row:1;order:2;}
.r10-editor .tg-variable-trigger{display:flex;align-items:center;justify-content:center;gap:5px;
  border:1px solid #b9d1e3;border-radius:9px;background:#e6f4fc;color:#246e94;
  font:650 11px/1.3 system-ui,sans-serif;min-height:32px;width:100%;min-width:0;
  padding:5px 7px;white-space:nowrap;cursor:pointer;}
.r10-editor .tg-variable-trigger span{font-size:14px;line-height:1;}
#tgVariablePortal{position:fixed;inset:0;width:0;height:0;z-index:2147483001;pointer-events:none;}
#tgVariablePortal>.tg-variable-popover{position:fixed;pointer-events:auto;visibility:visible;
  width:min(270px,calc(100vw - 18px));max-height:min(355px,65dvh);overflow:hidden;
  background:#fff;box-shadow:0 16px 40px #0c2a4355;border:1px solid #b7d4e6;border-radius:15px;}
#tgVariablePortal .tg-variable-options{overflow-y:auto;max-height:min(290px,54dvh);padding:5px;}
#tgVariablePortal .tg-variable-options button{min-height:40px;}
.tg-preview-floating-menu .tg-quick-title-edit{border:0;background:transparent;color:#233e54;
  text-align:left;font:750 13px/1.3 system-ui,sans-serif;min-width:0;flex:1;
  padding:5px 7px;border-radius:7px;overflow-wrap:anywhere;cursor:text;}
.tg-preview-floating-menu .tg-quick-title-edit:hover{background:#e7f4fa;}
.tg-preview-floating-menu .tg-quick-title-edit span{color:#5591b0;font-size:12px;margin-left:3px;}
.tg-preview-floating-menu .tg-quick-name-input{box-sizing:border-box;min-width:0;flex:1;border-radius:8px;
  border:1px solid #489bc6;background:#fafdff;color:#1f3b50;font:650 14px system-ui,sans-serif;padding:8px;outline:2px solid #a9dff7;}
/* Preserve horizontal button width instead of squeezing text to single letters. */
@media(max-width:390px){
 .r10-editor .simple-stage.telegram-simulator{border-radius:17px!important;}
 .r10-editor .simple-chat-body{padding:10px 7px 13px!important;scrollbar-gutter:auto;}
 .r10-editor .tg-edit-button-row>.canvas-button-wrap,.r10-editor .tg-edit-button-row>.reply-key-wrap{min-width:min(88px,37%);}
 .r10-editor .tg-edit-button-rows .tg-edit-button-row>.tg-square-add:not(:only-child){flex-basis:33px!important;width:33px!important;min-width:33px!important;max-width:33px!important;}
 .r10-editor .tg-edit-button-row .canvas-inline-button,.r10-editor .tg-edit-button-row .reply-key{font-size:11px;padding:7px 17px 7px 6px!important;}
 .r10-editor .tg-direct-edit-footer{gap:4px;}
 .r10-editor .tg-variable-trigger{font-size:10px;padding:5px 3px;}
}
/* Smooth app-like entry, without replaying earlier message transitions. */
.r10-editor.is-chat-testing .tg-chat-line.tg-sim-enter{animation-duration:.37s!important;
  animation-timing-function:cubic-bezier(.21,.75,.25,1)!important;will-change:transform,opacity;}
.r10-editor.is-chat-testing .tg-chat-line.outgoing.tg-sim-enter{animation-duration:.34s!important;}
.r10-editor.is-chat-testing .tg-chat-line.tg-sim-typing.tg-sim-enter{animation-duration:.25s!important;}
@media(prefers-reduced-motion:reduce){
 .r10-editor.is-chat-testing .tg-chat-line.tg-sim-enter{animation:none!important;will-change:auto;}
}

/* CSS-drawn close icons are centred geometrically, independent of glyph metrics. */
.r10-editor .tg-edit-button-row .tg-button-remove,
.r10-editor .tg-message-top-controls>.tg-message-delete-screen{position:absolute;font-size:0!important;}
.r10-editor .tg-message-top-controls>.tg-message-delete-screen{position:relative;}
.r10-editor .tg-edit-button-row .tg-button-remove::before,
.r10-editor .tg-edit-button-row .tg-button-remove::after,
.r10-editor .tg-message-top-controls>.tg-message-delete-screen::before,
.r10-editor .tg-message-top-controls>.tg-message-delete-screen::after{
 content:'';position:absolute;left:50%;top:50%;width:11px;height:1.75px;
 background:currentColor;border-radius:3px;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none;
}
.r10-editor .tg-edit-button-row .tg-button-remove::after,
.r10-editor .tg-message-top-controls>.tg-message-delete-screen::after{transform:translate(-50%,-50%) rotate(-45deg)}

/* R20B: Telegram row width belongs entirely to real buttons. Editing tools never steal columns. */
.r10-editor .tg-edit-button-row>.canvas-button-wrap,
.r10-editor .tg-edit-button-row>.reply-key-wrap{min-width:0!important;flex:1 1 0%!important;max-width:none!important;}
.r10-editor .tg-row-add-dock{display:flex;width:100%;justify-content:flex-end;min-width:0;padding:1px 2px 3px;box-sizing:border-box;}
.r10-editor .tg-row-add-dock>.tg-square-add{display:grid!important;place-items:center!important;flex:0 0 28px!important;
 width:28px!important;min-width:28px!important;max-width:28px!important;height:25px!important;min-height:25px!important;
 border-radius:7px!important;font-size:0!important;position:relative;padding:0!important;}
.r10-editor .tg-row-add-dock>.tg-square-add::before,.r10-editor .tg-row-add-dock>.tg-square-add::after{
 content:"";position:absolute;left:50%;top:50%;background:currentColor;border-radius:2px;transform:translate(-50%,-50%);}
.r10-editor .tg-row-add-dock>.tg-square-add::before{width:12px;height:2px;}
.r10-editor .tg-row-add-dock>.tg-square-add::after{width:2px;height:12px;}
.r10-editor .tg-edit-button-row .canvas-inline-button,.r10-editor .tg-edit-button-row .reply-key{
 min-width:0!important;width:100%!important;max-width:100%;height:100%;padding:8px 4px!important;
 overflow-wrap:anywhere!important;word-break:normal!important;white-space:normal!important;line-height:1.25!important;
 font-size:clamp(9px,2.7vw,12px)!important;}
.r10-editor .tg-edit-button-row .tg-button-remove{width:14px!important;height:14px!important;opacity:.8;}
.flow-hover-buttons{width:100%!important;min-width:0!important;max-width:100%!important;}
.flow-hover-button-row{min-width:0!important;width:100%!important;grid-auto-flow:row;}
.flow-hover-button-row>span{min-width:0!important;max-width:100%;width:100%;font-size:clamp(8px,2.6vw,11px);padding:7px 2px!important;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.25;}
.flow-hover-phone,.flow-hover-chat-line{min-width:0!important;max-width:100%;}
.flow-hover-chat-body{min-width:0;overflow-x:hidden;}
.r10-editor .tg-variable-chevron{display:inline-block!important;flex:0 0 auto;width:7px;height:7px;
 border-right:1.8px solid currentColor;border-bottom:1.8px solid currentColor;transform:rotate(45deg) translateY(-2px);margin:0 4px 3px 2px;}
.r10-editor .tg-screen-tools.r126-start-tool{display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important;margin:9px auto 0!important;}
.r10-editor .tg-screen-tools.r126-start-tool .tg-edit-screen-button{margin-inline:auto!important;}
.editor-focused-shell .flow-one-screen .tg-flow-row-add,.editor-focused-shell .flow-one-screen .tg-flow-msg-add{
 display:grid;place-items:center;flex:0 0 21px;width:21px;min-width:21px;height:23px;padding:0;
 border:1px solid #6487a1;border-radius:5px;background:#2d5470;color:#e3f2fc;cursor:pointer;line-height:1;font-size:15px;}
.editor-focused-shell .flow-one-screen .tg-flow-msg-add{border-radius:50%;background:#24687e;}
.editor-focused-shell .flow-one-screen .tg-flow-row-add:hover,.editor-focused-shell .flow-one-screen .tg-flow-msg-add:hover{background:#387da4;color:#fff;}
@media(max-width:390px){
 .r10-editor .tg-edit-button-row>.canvas-button-wrap,.r10-editor .tg-edit-button-row>.reply-key-wrap{min-width:0!important;}
 .r10-editor .tg-edit-button-row .canvas-inline-button,.r10-editor .tg-edit-button-row .reply-key{font-size:9px!important;padding:7px 2px!important;}
 .r10-editor .tg-edit-button-row{gap:2px!important;}
}

/* R20D — editing affordance beside last button rather than below it. */
.r10-editor .tg-edit-button-row>.tg-row-add-dock{display:flex!important;flex:0 0 29px!important;width:29px!important;min-width:29px!important;max-width:29px!important;align-items:center;justify-content:center;padding:0!important;margin:0!important;align-self:stretch;box-sizing:border-box;}
.r10-editor .tg-edit-button-row>.tg-row-add-dock>.tg-square-add{width:28px!important;min-width:28px!important;height:30px!important;min-height:30px!important;max-width:28px!important;align-self:center;}
.r10-editor .tg-edit-button-row>.canvas-button-wrap,.r10-editor .tg-edit-button-row>.reply-key-wrap{min-width:0!important;flex:1 1 0%!important;}
.r10-editor .tg-edit-button-row{flex-wrap:nowrap!important;min-width:0!important;}
/* Preview publishing controls are in the header below the draft-mode explanation. */
.r10-editor .tg-preview-note-row{width:100%;max-width:740px;display:flex;align-items:center;justify-content:space-between;gap:9px;margin:6px auto 10px;min-width:0;}
.r10-editor .tg-preview-note-row .tg-editor-mode-note{margin:0!important;max-width:none;flex:1;min-width:0;}
.r10-editor .tg-preview-actions{display:flex;gap:5px;align-items:center;justify-content:flex-end;flex:none;}
.r10-editor .tg-preview-actions .btn{white-space:nowrap;font-size:11px;padding:7px 9px;min-height:32px;}
@media(max-width:410px){.r10-editor .tg-preview-note-row{flex-wrap:wrap;}.r10-editor .tg-preview-actions{width:100%;justify-content:flex-end;}}
/* Deep Bot Flow branches can scroll horizontally without widening the editor. */
.simple-screens #editorMenu{max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;}
.simple-screens #editorMenu .screen-tree{overflow-x:auto;max-width:100%;min-width:0;scrollbar-width:thin;}
.simple-screens #editorMenu .page-tree-node{min-width:max-content;}
.simple-screens #editorMenu .page-tree-row{min-width:max-content;}

/* R20E: consistent compact Bot Flow rows; nested depth scrolls, labels never enlarge a row. */
.simple-screens #editorMenu .page-tree-row,
.simple-screens #editorMenu .page-tree-root{height:38px!important;min-height:38px!important;max-height:38px!important;box-sizing:border-box;}
.simple-screens #editorMenu .page-tree-row .screen-link,
.simple-screens #editorMenu .page-tree-root .screen-link{height:100%;min-height:0;min-width:0;overflow:hidden!important;}
.simple-screens #editorMenu .page-tree-row .screen-label,
.simple-screens #editorMenu .page-tree-root .screen-label{white-space:nowrap!important;display:block!important;-webkit-line-clamp:unset!important;overflow:hidden!important;text-overflow:ellipsis!important;overflow-wrap:normal!important;max-width:100%;}
.simple-screens #editorMenu .page-tree-row{width:100%;max-width:100%;min-width:0!important;}
.simple-screens #editorMenu .page-tree-node{max-width:100%;min-width:0!important;}
.simple-screens #editorMenu .flow-tree-children{min-width:0;max-width:100%;}
.simple-screens #editorMenu .page-tree-list{overflow-x:auto;min-width:0;max-width:100%;}
.r10-editor .tg-command-layer{display:grid;position:relative;z-index:8;max-height:200px;overflow-y:auto;background:#fff;border:1px solid #d4e3ec;border-bottom:0;box-shadow:0 -8px 26px #20364c20;}
.r10-editor .tg-command-layer[hidden]{display:none!important;}
.r10-editor .tg-command-option{display:flex!important;align-items:center;gap:10px;text-align:left;border:0;border-bottom:1px solid #edf2f6;background:#fff;padding:8px 12px;cursor:pointer;color:#304c61;font-size:12px;}
.r10-editor .tg-command-option:hover,.r10-editor .tg-command-option:focus-visible{background:#e8f4ff;}
.r10-editor .tg-command-option strong{min-width:80px;color:#2287c9;font-weight:700;}
.r10-editor .tg-command-option span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.r10-editor .tg-command-empty{padding:9px 12px;font-size:11px;color:#687b90;}
.r10-editor .tg-composer .tg-menu-command{color:#3985b7;background:transparent;font-size:21px;width:32px;min-width:32px;}
.r10-editor .tg-composer .tg-menu-command[aria-expanded="true"]{background:#e0f1fc;}

/* R20F: Bot Flow is a bounded, independently scrolling list. Toolbar/status/footer
   remain in the sidebar, never inside the horizontally sliding tree. */
.editor-focused-shell .simple-screens #editorMenu,
.editor-focused-shell .simple-screens #editorMenu .screen-tree {overflow-x:hidden!important;max-width:100%!important;min-width:0!important;}
.editor-focused-shell .flow-one-screen{min-width:0!important;max-width:100%!important;overflow-x:hidden!important;}
.editor-focused-shell .flow-one-screen .flow-items-viewport{
  width:100%;max-width:100%;min-width:0;max-height:min(56vh,540px);
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:#557c99 transparent;
  padding:2px 3px 6px 0;box-sizing:border-box;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-list{
  min-width:0!important;max-width:100%!important;width:100%!important;
  overflow-x:hidden!important;overflow-y:visible!important;box-sizing:border-box;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-node,
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-row,
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-root{
  min-width:0!important;max-width:100%!important;width:100%;box-sizing:border-box;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-children{
  min-width:0!important;max-width:100%!important;box-sizing:border-box;
  margin-left:clamp(2px,1vw,8px)!important;
  padding-left:clamp(2px,1vw,8px)!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-row .screen-link{
  min-width:0!important;flex:1 1 0%!important;overflow:hidden!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-row .screen-label,
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-root .screen-label{
  display:block!important;white-space:nowrap!important;overflow:hidden!important;
  text-overflow:ellipsis!important;overflow-wrap:normal!important;
}
/* An empty inline/reply-keyboard row needs a full-size add target, not the 29px beside-button dock. */
.r10-editor .tg-edit-button-row>.tg-row-add-dock.tg-row-add-empty{
  flex:1 1 100%!important;width:100%!important;max-width:100%!important;
  min-width:0!important;display:flex!important;align-self:stretch!important;
}
.r10-editor .tg-edit-button-row>.tg-row-add-dock.tg-row-add-empty>.tg-square-add{
  flex:1 1 auto!important;box-sizing:border-box!important;max-width:100%!important;
  width:100%!important;min-width:0!important;min-height:36px!important;height:38px!important;
}
/* Avoid cumulative indentation making deep branches effectively zero-width. */
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children .flow-tree-children .flow-tree-children{
  margin-left:0!important;padding-left:0!important;border-left:0!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children .flow-tree-children .flow-tree-children>.page-tree-node::before,
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children .flow-tree-children .flow-tree-children>.page-tree-node::after{
  content:none!important;
}

/* Header + footer never inherit horizontal movement from the Bot Flow viewport. */
.editor-focused-shell .flow-one-screen>.flow-move-status,
.editor-focused-shell .flow-one-screen>.flow-help-row,
.editor-focused-shell .flow-one-screen>.page-new,
.editor-focused-shell .flow-one-screen>.flow-all-screens{max-width:100%!important;min-width:0;box-sizing:border-box;}

/* R20G: Bot Flow is a naturally tall tree with a single sideways scroll area.
   Only nested items move horizontally; labels, footer and tools stay in place.
   Each level keeps exactly the same row width as the first level. */
.editor-focused-shell .simple-screens #editorMenu,
.editor-focused-shell .simple-screens #editorMenu .screen-tree,
.editor-focused-shell .flow-one-screen{overflow:visible!important;max-width:100%!important;min-width:0!important;}
.editor-focused-shell .flow-one-screen .flow-items-viewport{
  width:100%!important;max-width:100%!important;max-height:none!important;
  height:auto!important;overflow-x:auto!important;overflow-y:visible!important;
  overscroll-behavior-x:contain;overscroll-behavior-y:auto;
  scrollbar-width:thin;scrollbar-color:#5c8aa9 transparent;
  box-sizing:border-box;padding:2px 5px 10px 0;
  --flow-row-width:245px;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-list{
  width:max-content!important;min-width:100%!important;max-width:none!important;
  overflow:visible!important;display:flex;flex-direction:column;align-items:flex-start;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-node{
  width:max-content!important;min-width:max-content!important;max-width:none!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-root,
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-row{
  width:var(--flow-row-width)!important;
  min-width:var(--flow-row-width)!important;max-width:var(--flow-row-width)!important;
  box-sizing:border-box;flex:0 0 auto;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-children{
  width:max-content!important;min-width:max-content!important;max-width:none!important;
  margin-left:10px!important;padding-left:12px!important;
  overflow:visible!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children .flow-tree-children .flow-tree-children{
  margin-left:10px!important;padding-left:12px!important;border-left:2px dotted #5aabc9!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-row .screen-link{
  flex:1 1 auto!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-row .screen-label{
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}
/* The message editor is a normal popup, not an unnamed Telegram button. */
.tg-flow-message-modal textarea.input{width:100%;min-height:120px;resize:vertical;box-sizing:border-box;}
.tg-flow-message-modal .divider{margin:13px 0;}

/* R20H — message selection, preview pinning and desktop Bot Flow width control. */
.editor-focused-shell .flow-tree-message-row .flow-message-select{cursor:pointer;}
.r10-editor .tg-flow-selected-message>.tg-message-preview .tg-bubble,
.r10-editor .tg-flow-selected-message .tg-linked-screen-preview{outline:2px solid #479ddd;outline-offset:3px;}
.tg-flow-message-modal .tg-remove-message-attachment{margin:0 0 10px;}
@media (min-width:1001px){
 .editor-focused-shell .simple-editor-grid{
   --flow-pane-width:310px;
   grid-template-columns:var(--flow-pane-width) minmax(0,1fr)!important;
   position:relative;
 }
 .editor-focused-shell .simple-canvas{
   position:sticky;top:12px;align-self:start;
   max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior-y:contain;
   scrollbar-width:thin;
 }
 .editor-focused-shell .flow-pane-resizer{
   display:block;position:absolute;z-index:10;top:5px;bottom:5px;
   left:calc(var(--flow-pane-width) + 10px);transform:translateX(-50%);
   width:14px;min-width:14px;padding:0;border:0;border-radius:8px;
   background:transparent;cursor:col-resize;touch-action:none;
 }
 .editor-focused-shell .flow-pane-resizer::before{
   content:'';position:absolute;left:5px;top:30%;bottom:30%;width:4px;
   background:#668fac;border-radius:4px;opacity:.5;transition:opacity .15s,background .15s;
 }
 .editor-focused-shell .flow-pane-resizer:hover::before,
 .editor-focused-shell .flow-pane-resizer:focus-visible::before,
 .editor-focused-shell .is-resizing-flow .flow-pane-resizer::before{
   opacity:1;background:#55b3e9;
 }
 .editor-focused-shell .is-resizing-flow{user-select:none;cursor:col-resize;}
}
@media (max-width:1000px){
 .editor-focused-shell .flow-pane-resizer{display:none!important;}
 .editor-focused-shell .simple-canvas{position:static;max-height:none;overflow:visible;}
}


/* R20I: content pencil, button settings gear, and removal are distinct controls. */
.r10-editor .tg-message-top-controls>.tg-message-edit-trigger{
  color:#386a85;border-color:#b7cfdd;background:#eff8fc;font-size:16px;font-weight:600;
}
.r10-editor .tg-message-top-controls>.tg-message-edit-trigger:hover,
.r10-editor .tg-message-top-controls>.tg-message-edit-trigger:focus-visible{
  background:#d7eefb;color:#17567b;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row .tree-screen-options,
.editor-focused-shell .flow-one-screen .page-tree-root .tree-screen-options{
  margin-left:auto;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row .tree-screen-edit{
  margin-left:0;
}
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-options,
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-edit,
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-remove,
.editor-focused-shell .flow-one-screen .page-tree-root>.tree-screen-options,
.editor-focused-shell .flow-one-screen .page-tree-root>.tree-screen-edit,
.editor-focused-shell .flow-one-screen .page-tree-root>.tree-screen-remove{
  flex:0 0 22px;width:22px;min-width:22px;min-height:29px;padding:0;
  display:grid;place-items:center;border:0;border-radius:6px;
  background:transparent;color:#bdd7e8;cursor:pointer;line-height:1;
}
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-remove,
.editor-focused-shell .flow-one-screen .page-tree-root>.tree-screen-remove{color:#e5adba;}
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-options:hover,
.editor-focused-shell .flow-one-screen .page-tree-row>.tree-screen-edit:hover,
.editor-focused-shell .flow-one-screen .page-tree-root>.tree-screen-options:hover,
.editor-focused-shell .flow-one-screen .page-tree-root>.tree-screen-edit:hover{
  background:#3b5c7b;color:#fff;
}
/* Keep the sticky desktop preview but remove R20H's extra outer scroll container.
   Telegram's existing chat-history scroller remains untouched. */
@media (min-width:1001px){
  .editor-focused-shell .simple-canvas{
    max-height:none!important;overflow:visible!important;overscroll-behavior:auto!important;
  }
}
/* Override legacy rule that hid all message pencil controls. */
.r10-editor .tg-message-top-controls>.tg-message-edit-trigger{display:grid!important;position:relative!important;top:auto!important;right:auto!important;opacity:1!important;}

/* R20J: sticky preview follows the entire editor card without an extra scrollbar.
   When the card exceeds viewport height, its upper edge can scroll offscreen
   until the bottom of the card is visible. */
@media(min-width:1001px){
 .editor-focused-shell .simple-canvas{top:min(12px,calc(100dvh - var(--tg-sticky-height,650px) - 12px))!important;}
 /* Invisible, accessible resize target at the column edge. Only cursor changes. */
 .editor-focused-shell .flow-pane-resizer::before{display:none!important;}
}
.editor-focused-shell .flow-one-screen .page-nav-caption{display:flex;flex-wrap:wrap;align-items:center;gap:6px;}
.editor-focused-shell .flow-one-screen .page-nav-caption>span{margin-right:auto;}
.editor-focused-shell .flow-items-zoom-surface{width:max-content;min-width:100%;transform-origin:0 0;}
.flow-zoom-controls,.flow-map-zoom{display:flex;align-items:center;gap:2px;flex:none;white-space:nowrap;}
.flow-zoom-controls button,.flow-map-zoom button{font:inherit;font-weight:700;cursor:pointer;padding:3px 5px;min-width:22px;border:1px solid #44627c;border-radius:6px;background:#203b54;color:#d6edff;}
.flow-zoom-controls .flow-zoom-value{min-width:39px;font-size:11px;}
.flow-map-zoom{margin-left:auto;}
.flow-map-zoom button{background:#e5f1fa;color:#245276;border-color:#bcd5e7;}
.screen-builder-modal .tg-message-top-controls>.tg-message-edit-trigger{display:grid!important;place-items:center;position:relative!important;opacity:1!important;color:#386a85;}

/* R20K: message settings overlay sits above the unchanged New Screen builder. */
.tg-builder-message-layer{z-index:1100!important;}

/* R20L: a subtle boundary starts each reply-keyboard branch without affecting row sizes. */
.editor-focused-shell .flow-one-screen .flow-keyboard-section-divider{
  width:calc(100% - 12px);height:0;box-sizing:border-box;border-top:2px dotted #8199ac;
  margin:8px 6px 6px;flex:0 0 auto;pointer-events:none;
}
.r10-editor .tg-form-home-control{position:relative;display:flex;align-items:center;gap:4px;}
.r10-editor .tg-form-home-control .tg-preview-static-button{flex:1;min-width:0;text-align:center;}
.r10-editor .tg-form-home-remove{flex:0 0 27px;width:27px;height:27px;display:grid;place-items:center;
  border:1px solid #b8cbd8;border-radius:6px;background:#f3f8fc;color:#607b90;cursor:pointer;}
.r10-editor .tg-form-home-remove:hover{background:#dfeef8;}
.tg-form-home-setting{margin:8px 0;}

/* Forms are message units: use the same overlay and spacing as saved messages. */
.r10-editor .tg-form-preview .tg-form-message-unit{margin-top:30px;max-width:100%;width:100%;min-width:0;}
.r10-editor .tg-form-preview .tg-form-message-unit>.tg-message-preview{position:relative;width:100%;max-width:100%;min-width:0;box-sizing:border-box;overflow:visible;}
.r10-editor .tg-form-preview .tg-form-message-unit>.tg-message-preview>.tg-bubble{max-width:100%;width:100%;min-width:0;box-sizing:border-box;overflow-wrap:anywhere;}
.r10-editor .tg-form-preview .tg-form-home-control{max-width:100%;min-width:0;box-sizing:border-box;}
/* New interactive Flow Map uses real draft messages and the original editor actions. */
.tg-flow-node{width:295px!important;max-width:295px;box-sizing:border-box;min-height:130px;gap:6px;padding:10px!important;}
.tg-flow-node.is-flow-focused{outline:3px solid #388ad3;outline-offset:3px;}
.tg-flow-node-top{touch-action:none;cursor:grab;}
.tg-map-screen{display:flex;flex-direction:column;gap:8px;min-width:0;max-width:100%;max-height:none;overflow:visible;background:linear-gradient(150deg,#dbe8e4,#e3eef8);padding:9px 7px;border-radius:11px;}
.tg-map-message{position:relative;min-width:0;display:flex;flex-direction:column;gap:3px;}
.tg-map-bubble{min-width:0;max-width:100%;width:100%;box-sizing:border-box;border-radius:6px 12px 12px 12px;background:#fff;box-shadow:0 1px 3px #20394728;padding:9px;color:#162e3d;font-size:12px;line-height:1.4;overflow-wrap:anywhere;}
.tg-map-bubble .tg-media{max-width:100%;height:auto;max-height:180px;border-radius:7px;object-fit:contain;}
.tg-map-bubble video{max-width:100%;max-height:180px;}
.tg-map-bubble small{display:block;text-align:right;font-size:9px;color:#8393a3;margin-top:3px;}
.tg-map-text{white-space:normal;overflow-wrap:anywhere;}
.tg-map-message-tools{display:flex;justify-content:flex-end;gap:4px;max-width:100%;width:100%;box-sizing:border-box;}
.tg-map-message-tools>button,.tg-map-button-edit,.tg-map-button-remove,.tg-map-form-home>button{border:1px solid #d1dce5;background:#fff;color:#386887;cursor:pointer;border-radius:6px;display:grid;place-items:center;width:24px;height:24px;min-width:24px;padding:0;line-height:1;font-size:14px;}
.tg-map-message-tools>button:last-child,.tg-map-button-remove{color:#ba5261;}
.tg-map-button-group{display:grid;gap:3px;min-width:0;}
.tg-map-button-row{display:grid;gap:3px;width:100%;min-width:0;}
.tg-map-button{position:relative;min-width:0;display:flex;align-items:stretch;background:#ecf8ffde;border:1px solid #c9dbe8;border-radius:7px;}
.tg-map-button-label{min-width:0;width:100%;flex:1;text-align:center;border:0;background:none;color:#265e86;cursor:pointer;font-size:11px;line-height:1.25;padding:7px 3px;white-space:normal;overflow-wrap:anywhere;}
.tg-map-button-edit,.tg-map-button-remove{flex:0 0 17px;width:17px;min-width:17px;height:20px;align-self:center;padding:0;margin:1px;border:0;background:transparent;color:#416e8a;font-size:12px;}
.tg-map-button-remove{color:#a95160;}
.tg-map-button-label:hover,.tg-map-button-label:focus-visible{background:#d4ecff;outline:1px solid #6aa6d8;border-radius:5px;}
.tg-map-keyboard{padding-top:8px;border-top:2px dotted #87a5bb;display:grid;gap:5px;min-width:0;}
.tg-map-keyboard>small,.tg-map-conditions{font-size:10px;color:#507084;}
.tg-map-form-home{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;color:#315d7d;font-size:11px;background:#f1f9ffb3;padding:5px;border-radius:7px;}
.tg-map-form-home span{flex:1;text-align:center;}
.tg-map-insert{display:flex;gap:3px;align-items:center;min-width:0;}
.tg-map-insert button:first-child{flex:1;min-width:0;border:1px dashed #8ab6d4;background:#ecf7fc;border-radius:7px;color:#235a78;text-align:left;padding:7px;font-size:11px;cursor:pointer;}
.tg-map-insert button:last-child{border:0;background:transparent;color:#386d89;cursor:pointer;}
.tg-map-empty,.tg-map-effect{font-size:11px;padding:8px;color:#56718a;background:#f4f9fbd9;border-radius:7px;}
.tg-flow-paper>svg path{pointer-events:stroke;stroke-linecap:round;stroke-linejoin:round;opacity:.82;}
.tg-flow-paper>svg path:hover{stroke-width:3.5;opacity:1;}
.tg-flow-node-actions{padding-top:6px;border-top:1px solid #e7edf4;margin-top:auto;}
@media(max-width:680px){.tg-flow-toolbar{flex-wrap:wrap;min-height:0;gap:5px;}.tg-flow-toolbar>div{flex-basis:100%;}.tg-flow-toolbar-add{padding:5px 7px;}.tg-flow-toolbar .flow-map-zoom{margin-left:auto;}.tg-flow-node{width:295px!important;}}
/* R20M toolbar zoom remains on a single line even with the toolbar's generic div selector. */
.tg-flow-toolbar>.flow-map-zoom{display:flex!important;flex:0 0 auto!important;align-items:center!important;gap:4px!important;min-width:0;}
.tg-flow-toolbar>.flow-map-zoom button{width:auto;min-width:31px;height:31px;padding:4px 9px;}

/* The form's ✎ ⚙ × share ordinary message positioning, not a second toolbar. */
.r10-editor .tg-form-preview .tg-form-message-unit .tg-message-top-controls{
 position:absolute;right:4px;top:-23px;left:auto;bottom:auto;z-index:15;
 display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:5px;
 max-width:100%;width:auto;margin:0;padding:0;pointer-events:none;
}
.r10-editor .tg-form-preview .tg-form-message-unit .tg-message-top-controls>button{
 position:relative;inset:auto;width:28px;height:28px;min-width:28px;flex:0 0 28px;
 display:grid;place-items:center;pointer-events:auto;
}
.tg-map-message{position:relative!important;}
.tg-map-bubble{padding-top:36px!important;}
.tg-map-message-tools{position:absolute;top:4px;right:4px;width:auto!important;z-index:3;justify-content:flex-end;gap:4px;}
.tg-map-message-tools>button{width:26px;height:26px;min-width:26px;}
.tg-map-form-home{background:transparent;}
.tg-map-inline-home{margin:0 0 4px!important;display:flex;background:#e1f1ffed;border:1px solid #bad7e6;border-radius:8px;min-height:30px;}
.tg-map-add-row{display:flex;justify-content:center;}
.tg-map-add-row>button{border:1px dashed #8ab5d2;background:#ecf7fd;color:#396e8c;border-radius:9px;min-height:32px;min-width:60px;cursor:pointer;}
.tg-map-screen{background:linear-gradient(145deg,#dcece5,#e4edf7);}
.tg-map-button{display:block;position:relative;}
.tg-map-button-label{display:block;width:100%;min-height:38px;padding:7px 37px 7px 27px;}
.tg-map-button-edit,.tg-map-button-remove{position:absolute;top:50%;transform:translateY(-50%);margin:0!important;width:19px!important;height:23px!important;}
.tg-map-button-edit{right:21px;}.tg-map-button-remove{right:1px;}
.tg-flow-paper>svg path{stroke-linejoin:round;stroke-linecap:round;}
.tg-flow-paper>svg path:hover{filter:drop-shadow(0 0 2px #367bb4);}
.tg-preview-footer-actions{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;padding:11px 0 6px;}
.tg-preview-footer-actions button{border:1px solid #b9d5e2;border-radius:10px;background:#f1f9fe;color:#295c7d;min-height:37px;padding:8px 15px;font-weight:700;cursor:pointer;}
.tg-preview-footer-actions button:hover{background:#dbeef9;}

/* Map cards mirror the normal Telegram preview shell; interactive controls stay available. */
.tg-flow-node{width:350px!important;max-width:350px!important;}
.tg-map-phone{overflow:hidden;border-radius:12px;border:1px solid #b8d1e0;background:#f3f7fa;box-shadow:0 2px 9px #16374b19;}
.tg-map-phone-head{display:flex;align-items:center;gap:8px;padding:10px;background:#edf7fd;color:#224c68;min-width:0;}
.tg-map-phone-head>span:nth-child(2){width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#c7e2f2;}
.tg-map-phone-head>span:nth-child(3){display:flex;min-width:0;flex-direction:column;line-height:1.2;font-size:12px;}
.tg-map-phone-head small{font-size:9px;color:#6d8399;}
.tg-map-day{text-align:center;color:#697f8d;font-size:10px;margin:0 auto 5px;padding:4px 10px;border-radius:12px;background:#e8f2f9;}
.tg-map-composer{display:flex;gap:12px;align-items:center;justify-content:space-between;background:#fff;padding:10px 13px;color:#557890;font-size:14px;}
.tg-map-composer span:nth-child(2){flex:1;border:1px solid #d9e5eb;border-radius:15px;padding:5px 12px;font-size:11px;}
.tg-map-phone>.tg-map-keyboard{background:#dcebf4;padding:8px;}
.tg-map-phone>.tg-map-keyboard .tg-map-button-label{padding:8px 42px 8px 28px;}

.tg-map-home-label{flex:1;border:0;background:none;color:inherit;text-align:center;cursor:pointer;min-width:0;padding:5px;font-size:11px;}
.tg-map-home-label:hover{background:#cde7fa;border-radius:6px;}
.tg-map-keyboard-add{width:100%;min-height:30px;border:1px dashed #8daec7;border-radius:7px;background:#eaf6ff;color:#2f6586;font-weight:bold;cursor:pointer;}
.r10-editor .tg-form-home-control .tg-preview-static-button{border:0;background:#e2f4ff;border-radius:6px;min-height:34px;cursor:pointer;color:#2d6888;font-weight:600;}

/* R21C: active form prompts own the inline Main menu; bottom keyboard is an
   editor-only placeholder until the form finishes. Never duplicate its label. */
.r10-editor .tg-form-deferred-keyboard{min-height:0;padding:8px 12px 11px;}
.r10-editor .tg-form-deferred-keyboard .reply-keyboard-caption{margin-bottom:5px;}
.r10-editor .tg-form-deferred-keyboard .tg-row-add-dock{width:100%!important;justify-content:center;}
.r10-editor .tg-form-deferred-keyboard .tg-row-add-dock .tg-square-add{width:100%!important;max-width:none!important;flex:1 1 auto!important;min-height:31px!important;}
.r10-editor .tg-form-deferred-keyboard .tg-row-add-dock .tg-square-add::before{width:13px;}
.r10-editor .tg-form-deferred-keyboard .tg-row-add-dock .tg-square-add::after{height:13px;}
.r10-editor .tg-form-add-message{margin:8px auto 12px;}

/* R21K: saved actions are first-class, unmistakably owned without a new UI component. */
.screen-action-picker-own{display:grid;gap:6px;min-width:0;border:1px solid rgba(125,191,235,.54);border-radius:12px;padding:10px;background:rgba(48,101,149,.2)}
.screen-action-picker-heading{font-weight:750;color:#ebf6ff;font-size:12px;letter-spacing:.025em;display:flex;justify-content:space-between;gap:9px}
.screen-action-picker-heading span{color:#adcfea;font-weight:500}
.screen-action-picker-own .screen-action-picker-list>button{background:#174f67;border-color:#4d9cb6}
.screen-action-picker-own .screen-action-picker-list>button:hover{background:#246f83}
.r21k-form-routes{display:grid;gap:9px;margin-top:12px;padding:12px;border-radius:12px;border:1px solid var(--border,#ccd5dd)}
.r21k-route-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;border-top:1px dashed var(--border,#ccd5dd);padding:10px 0}
.r21k-route-row>.field{min-width:0}.r21k-route-row>.field:nth-child(3){grid-column:1/-1}
.r21k-route-row>button{justify-self:end;grid-column:1/-1}
@media(max-width:440px){.r21k-route-row{grid-template-columns:minmax(0,1fr)}.r21k-route-row>.field:nth-child(3){grid-column:auto}}

/* R21L: compact form action, inline variable creator. */
.tg-form-add-action{display:inline-flex;align-items:center;gap:5px;margin:3px 0 7px 10px;padding:4px 10px;border:1px solid var(--border,#bfd0dd);border-radius:999px;background:var(--surface,#f5f8fa);color:var(--text,#243b53);font-size:12px;font-weight:650;cursor:pointer}
.r21l-inline-create{display:grid;gap:8px;border:1px solid var(--border,#bacddd);background:var(--surface-soft,rgba(90,155,205,.08));border-radius:12px;padding:12px;margin:8px 0}
.r21l-inline-create .field{min-width:0}


/* R21M — compact actions control in the existing New Screen builder.
   The lightening bolt identifies a behaviour attached to a screen; the plus
   creates another action immediately without an intermediate picker. */
.screen-builder-modal .screen-builder-actions{padding:5px!important;min-width:0;}
.screen-builder-modal .screen-builder-actions-bar{display:flex;align-items:stretch;gap:5px;min-width:0;}
.screen-builder-modal .screen-builder-actions-toggle{
  flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-start;
  gap:9px;padding:6px 9px!important;border:0;background:transparent;
  color:#e0edff;text-align:left;border-radius:9px;min-height:38px;
}
.screen-builder-modal .screen-builder-actions-toggle:hover,
.screen-builder-modal .screen-builder-actions-toggle:focus-visible{background:#2b415b;}
.screen-builder-modal .screen-builder-action-symbol{font-size:20px;line-height:1;display:grid;place-items:center;width:24px;flex:0 0 24px;}
.screen-builder-modal .screen-builder-action-heading{display:flex;gap:2px;align-items:baseline;flex-wrap:wrap;min-width:0;}
.screen-builder-modal .screen-builder-action-heading strong{font-size:13px;font-weight:750;}
.screen-builder-modal .screen-builder-action-heading small{font-size:11px!important;color:#a7bfd7!important;font-weight:500;}
.screen-builder-modal .screen-builder-action-caret{font-size:15px!important;color:#b6d3ed!important;margin-left:auto;flex:0 0 auto;}
.screen-builder-modal .screen-builder-action-add{
  display:grid;place-items:center;flex:0 0 36px;width:36px;min-height:36px;
  border:1px solid #5b7da4;border-radius:9px;background:#314e72;
  color:#f4faff;font-size:21px;line-height:1;font-weight:600;cursor:pointer;
}
.screen-builder-modal .screen-builder-action-add:hover,
.screen-builder-modal .screen-builder-action-add:focus-visible{background:#426b99;outline-offset:2px;}
.screen-builder-modal .screen-builder-action-details{padding:8px 7px 4px;border-top:1px solid #405a75;margin-top:6px;min-width:0;}
.screen-builder-modal .screen-builder-action-details .easy-settings-stack{margin:0;}
@media(max-width:450px){
 .screen-builder-modal .screen-builder-action-heading{gap:5px;}
 .screen-builder-modal .screen-builder-actions-toggle{padding:5px 7px!important;}
}
.screen-builder-modal .screen-builder-action-symbol{
  width:26px;height:27px;flex:0 0 26px;border-radius:8px;
  background:#6e5ae6;color:#fff;font-size:19px;
  box-shadow:0 1px 6px rgba(86,79,181,.35);
}
.screen-builder-modal .screen-builder-action-heading strong{color:#f6f4ff;}


/* R21N — Option 1: native settings row, not a boxed mini-panel.
   Only New Screen/Edit Button builder gets this treatment. Other settings stay unchanged. */
.screen-builder-modal .screen-builder-actions{
  border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;padding:0!important;margin:0!important;min-width:0;
}
.screen-builder-modal .screen-builder-actions-row{
  display:flex;align-items:center;gap:2px;min-width:0;min-height:42px;
  padding:2px 0;border-top:1px solid #35475c;border-bottom:1px solid #35475c;
}
.screen-builder-modal .screen-builder-actions-toggle{
  flex:1 1 auto;min-width:0;width:auto!important;min-height:36px;
  display:flex;align-items:center;gap:8px;padding:5px 7px!important;
  border:0;border-radius:8px;background:transparent;color:#e0edff;
  text-align:left;font-weight:600;cursor:pointer;
}
.screen-builder-modal .screen-builder-actions-toggle:is(:hover,:focus-visible){background:transparent;color:#fff;}
.screen-builder-modal .screen-builder-action-chevron:is(:hover,:focus-visible),
.screen-builder-modal .screen-builder-action-add:is(:hover,:focus-visible){background:#2b415b;}
.screen-builder-modal .screen-builder-action-symbol{
  display:grid;place-items:center;flex:0 0 20px;width:20px;height:23px;
  border:0;border-radius:0;background:transparent;box-shadow:none;
  font-size:16px;font-weight:500;color:#a6b9d4;
}
.screen-builder-modal .screen-builder-action-heading{display:flex;align-items:baseline;flex-wrap:nowrap;gap:4px;min-width:0;}
.screen-builder-modal .screen-builder-action-heading strong{
  color:#e4ecf8;font-size:13px;font-weight:650;line-height:1.4;white-space:nowrap;
}
.screen-builder-modal .screen-builder-action-heading small{
  color:#9db0c7!important;font-size:11px!important;font-weight:500!important;white-space:nowrap;
}
.screen-builder-modal .screen-builder-action-add,
.screen-builder-modal .screen-builder-action-chevron{
  flex:0 0 32px;width:32px;min-height:32px;height:32px;
  display:grid;place-items:center;padding:0;
  border:0;border-radius:8px;background:transparent;box-shadow:none;
  color:#b9d2eb;cursor:pointer;
}
.screen-builder-modal .screen-builder-action-add{font-size:21px;line-height:1;font-weight:400;}
.screen-builder-modal .screen-builder-action-chevron{flex-basis:27px;width:27px;color:#91a7bf;font-size:15px;line-height:1;}
.screen-builder-modal .screen-builder-actions :is(.screen-builder-actions-toggle,.screen-builder-action-add,.screen-builder-action-chevron):focus-visible{
  outline:2px solid #8bd0ff;outline-offset:1px;
}
.screen-builder-modal .screen-builder-action-details{
  padding:9px 1px 6px;border:0;margin:0;min-width:0;
}
.screen-builder-modal .screen-builder-action-details[hidden]{display:none!important;}
.screen-builder-modal .screen-builder-action-details .easy-settings-stack{margin:0;}
@media(max-width:390px){
 .screen-builder-modal .screen-builder-action-heading strong{font-size:12px;}
 .screen-builder-modal .screen-builder-actions-toggle{gap:6px;padding:5px 4px!important;}
 .screen-builder-modal .screen-builder-action-add{flex-basis:30px;width:30px;}
 .screen-builder-modal .screen-builder-action-chevron{flex-basis:25px;width:25px;}
}

/* R22 · one-piece universal data action controls (retain native modal styling) */
.r22-data-fields { display:grid; gap:12px; min-width:0; }
.r22-data-fields > .field { margin:0; min-width:0; }
.r22-data-fields .input { width:100%; min-width:0; }
.r22-data-fields > .hint { margin:0; line-height:1.45; }
@media (max-width:520px) { .r22-data-fields { gap:10px; } .r22-data-fields .input { font-size:16px; } }

/* R23: Add action overlays use the EXISTING right padding of each Telegram
   bubble. No layout properties on chat rows, timestamps, or inline keyboards
   are changed. The timestamp remains in its original flow and position. */
/* R23.2: the bottom-centre action uses only the bubble's EXISTING metadata
   line. Absolutely positioned: no extra padding, rows, or message height. */
.r10-editor .screen-message-unit.tg-edit-unit .tg-message-preview>.tg-message-action-corner {
 position:absolute;z-index:13;left:50%;right:auto;bottom:3px;
 transform:translateX(-50%);display:inline-flex;flex-direction:row;
 align-items:center;justify-content:center;gap:3px;
 min-width:0;width:max-content;max-width:calc(100% - 66px);height:15px;
 margin:0;padding:0 5px;box-sizing:border-box;border:0;border-radius:5px;
 background:#171b21;color:#ffa12e;box-shadow:0 1px 2px #10223344;
 font:700 9px/1 system-ui,sans-serif;cursor:pointer;white-space:nowrap;
 -webkit-tap-highlight-color:transparent;
}
.r10-editor .screen-message-unit.tg-edit-unit .tg-message-preview>.tg-message-action-corner>span {
 flex:none;font-size:11px;line-height:1;
}
.r10-editor .screen-message-unit.tg-edit-unit .tg-message-preview>.tg-message-action-corner>small {
 display:inline;color:#ffa12e;font-size:9px;font-weight:700;line-height:1;
 letter-spacing:0;text-align:center;white-space:nowrap;
}
.r10-editor .screen-message-unit.tg-edit-unit .tg-message-preview>.tg-message-action-corner:is(:hover,:focus-visible) {
 background:#272c35;outline:2px solid #ffa12e;outline-offset:1px;
}
/* The action is just a clickable overlay; removing the pencil does not shift
   the remaining ⚙ and × controls or their common right-hand anchor. */
/* Invisible non-interactive slots keep remaining controls at their original
   coordinates when the old pencil button is removed. */
.r10-editor .tg-message-top-controls>.tg-removed-pencil-space,
.screen-builder-modal .tg-message-top-controls>.tg-removed-pencil-space {
  width:28px; height:28px; flex:0 0 28px; display:block;
  visibility:hidden; pointer-events:none;
}
.editor-focused-shell .flow-one-screen .tg-removed-pencil-space,
.tg-map-message-tools>.tg-removed-pencil-space,
.tg-map-insert>.tg-removed-pencil-space {
  visibility:hidden!important;pointer-events:none!important;cursor:default!important;
}
.tg-map-message-tools>.tg-removed-pencil-space{width:24px;height:24px;flex:0 0 24px;display:block;}
.tg-map-insert>.tg-removed-pencil-space{width:20px;height:24px;flex:0 0 20px;display:block;}

/* Generated Telegram message previews preserve their original wrappers and
   padding. Their icon likewise floats outside the document layout. */
.r10-editor .tg-action-output-unit { position:relative; }
/* Generated media, location and poll messages use the same one-line slot. */
.r10-editor .tg-action-output-unit .tg-message-action-corner {
 position:absolute;z-index:13;left:50%;right:auto;bottom:3px;
 transform:translateX(-50%);display:inline-flex;flex-direction:row;
 align-items:center;justify-content:center;gap:3px;width:max-content;
 max-width:calc(100% - 66px);height:15px;margin:0;padding:0 5px;
 box-sizing:border-box;border:0;border-radius:5px;background:#171b21;color:#ffa12e;
 box-shadow:0 1px 2px #10223344;cursor:pointer;font:700 9px/1 system-ui,sans-serif;white-space:nowrap;
}
.r10-editor .tg-action-output-unit .tg-message-action-corner>span{font-size:11px;line-height:1;}
.r10-editor .tg-action-output-unit .tg-message-action-corner>small{display:inline;font-size:9px;font-weight:700;line-height:1;color:#ffa12e;}
.r10-editor .tg-action-output-unit .tg-message-action-corner:is(:hover,:focus-visible){background:#272c35;outline:2px solid #ffa12e;outline-offset:1px;}
/* Insert variable takes the exact same bottom-centre overlay slot while the
   owner edits a message. The editing footer retains its existing height. */
.r10-editor .tg-direct-edit-bubble{position:relative;}
.r10-editor .tg-direct-edit-footer{min-height:32px;}
.r10-editor .tg-direct-edit-footer>.tg-variable-trigger{
 position:absolute;grid-column:auto;grid-row:auto;left:50%;bottom:3px;
 transform:translateX(-50%);z-index:14;display:inline-flex;
 align-items:center;justify-content:center;gap:3px;flex:none;
 width:max-content;max-width:calc(100% - 66px);min-width:0;
 height:15px;min-height:15px;margin:0;padding:0 5px;
 font:650 9px/1 system-ui,sans-serif;border-radius:5px;white-space:nowrap;
}
.r10-editor .tg-direct-edit-footer>.tg-variable-trigger .tg-variable-chevron{width:5px;height:5px;}
/* The settings and X keep their original layout positions and flex slots.
   Only the visual faces are reduced slightly. */
.r10-editor .tg-message-top-controls>.tg-message-settings-trigger,
.r10-editor .tg-message-top-controls>.tg-message-delete-screen{
 transform:scale(.87);transform-origin:center;
}
.r10-editor .tg-message-top-controls>.tg-message-delete-screen::before,
.r10-editor .tg-message-top-controls>.tg-message-delete-screen::after{width:10px;height:1.5px;}
/* Make the bottom message composer shorter; preview messages and keyboards
   retain their existing geometry. */
.r10-editor .tg-composer{min-height:42px;height:42px;box-sizing:border-box;padding:3px 8px;gap:6px;}
.r10-editor .tg-composer input{height:30px;min-height:30px;box-sizing:border-box;padding:5px 11px;}
.r10-editor .tg-composer button{width:28px;min-width:28px;height:28px;}
.r10-editor .tg-composer .tg-menu-command{width:28px;min-width:28px;height:28px;}

/* R23.3: Telegram-white message bubbles in the left Bot Flow only.
   No changes to the chat preview, timestamps, toolbar icon styles or spacing. */
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .screen-link.flow-message-select,
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .screen-link.flow-message-label {
  flex:1 1 auto;min-width:0;width:auto;max-width:100%;
  display:flex;align-items:center;justify-content:flex-start;
  background:#fff!important;color:#243749!important;
  border:1px solid #cfdee8!important;border-radius:10px 10px 10px 4px;
  padding:5px 9px!important;margin:2px 0;
  box-shadow:0 1px 2px rgba(7,31,52,.13);
  text-align:left;min-height:26px;height:auto;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .screen-link .screen-label {
  color:#243749!important;white-space:normal!important;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .screen-link.flow-message-select:is(:hover,:focus-visible) {
  background:#f2f9ff!important;border-color:#87b7d6!important;
}
/* Keep both existing icons, but make the actions an adjacent end cap. */
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .tree-screen-options {
  margin-left:0!important;margin-right:0!important;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .tree-screen-remove {
  margin-left:0!important;margin-right:0!important;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .tree-screen-options + .tree-screen-remove {
  margin-left:-2px!important;
}
/* Three evenly sized choices; only the keyboard-placement dialog uses this. */
.tg-studio-dialog-actions:has([data-choice]) {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.tg-studio-dialog-actions [data-choice] {min-width:0;padding:10px 5px;font-size:12px;white-space:nowrap;}

/* The first Welcome message is also a real text bubble in Bot Flow. */
.editor-focused-shell .flow-one-screen .page-tree-root > .screen-link.page-select {
  flex:1 1 auto;min-width:0;max-width:100%;width:auto;
  background:#fff!important;color:#243749!important;
  border:1px solid #cfdee8!important;border-radius:10px 10px 10px 4px;
  padding:6px 9px!important;margin:2px 0;
  box-shadow:0 1px 2px rgba(7,31,52,.13);
}
.editor-focused-shell .flow-one-screen .page-tree-root > .screen-link.page-select .screen-label{color:#243749!important;}
.editor-focused-shell .flow-one-screen .page-tree-root > .tree-screen-options{margin-left:0!important;margin-right:0!important;}
.editor-focused-shell .flow-one-screen .page-tree-root > .tree-screen-options + .tree-screen-remove{margin-left:-2px!important;}

/* R23.4 — In Bot Flow a message is JUST its Telegram-white bubble.
   The surrounding message tab, its glyph, and all tab-selection chrome are
   invisible. Actual ⚙ and × controls keep their established size/end slots.
   No changes to button nodes, message contents, timestamps, or bot data. */
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-root,
.editor-focused-shell .flow-one-screen .flow-items-viewport .page-tree-root:is(:hover,:focus-within),
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-message-row,
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-message-row:is(:hover,:focus-within),
.editor-focused-shell .flow-one-screen .flow-items-viewport .flow-tree-message-row.is-selected {
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
  outline:none!important;
}
.editor-focused-shell .flow-one-screen .page-tree-root>.flow-message-icon,
.editor-focused-shell .flow-one-screen .flow-tree-message-row>.flow-message-icon {
  display:none!important;
}
/* The bubble itself is still the clickable, white message; preserve its
   content padding, size constraints, and the existing right-end tool buttons. */
.editor-focused-shell .flow-one-screen .page-tree-root>.screen-link.page-select,
.editor-focused-shell .flow-one-screen .flow-tree-message-row>.screen-link.flow-message-select,
.editor-focused-shell .flow-one-screen .flow-tree-message-row>.screen-link.flow-message-label {
  position:relative;
}
/* Draw the outgoing rail from the LOWER-LEFT corner of the white message,
   never from a blue parent tab. Child-rail indentation and button order stay
   unchanged. This applies only where the message actually has descendants. */
.editor-focused-shell .flow-one-screen .flow-tree-message-node:has(> .flow-tree-children) > .flow-tree-message-row > .screen-link::after {
  content:"";
  position:absolute;
  left:8px;
  top:calc(100% - 1px);
  height:15px;
  border-left:2px dotted #5aabc9;
  pointer-events:none;
  z-index:2;
}
/* Welcome uses the same bubble attachment instead of the old row stem. */
.editor-focused-shell .flow-one-screen .page-tree-root::after {content:none!important;}
.editor-focused-shell .flow-one-screen .page-tree-root:has(+ .page-tree-list > .page-tree-node) > .screen-link.page-select::after {
  content:"";
  position:absolute;
  left:8px;
  top:calc(100% - 1px);
  height:17px;
  border-left:2px dotted #5aabc9;
  pointer-events:none;
  z-index:2;
}


/* R23.5 — Actual Telegram inline-button shapes in the LEFT Bot Flow.
   Keep every button node, drag handle, destination, edit/remove control and
   connection exactly as before. This is presentation-only; no bot logic or
   Telegram reply-keyboard rows are altered. */
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row,
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row:is(:hover,:focus-within),
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row.is-selected {
  background:transparent!important;
  border-color:transparent!important;
  border-left-color:transparent!important;
  box-shadow:none!important;
  outline:none!important;
  border-radius:0!important;
  padding:2px 2px!important;
  gap:3px;
}
/* The actual button label becomes a Telegram button, not a flow card. */
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link {
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  box-sizing:border-box;
  min-height:30px;
  padding:6px 8px!important;
  border-radius:6px!important;
  border:1px solid rgba(150,193,216,.44)!important;
  background:#f8fcff!important;
  color:#268ac2!important;
  box-shadow:0 1px 2px rgba(9,30,46,.10)!important;
  font-size:11.5px;
  font-weight:650;
  line-height:1.25;
  white-space:normal!important;
  overflow-wrap:anywhere;
  cursor:pointer;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link .screen-label {
  color:#268ac2!important;
  display:block;
  width:100%;
  text-align:center!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  line-height:1.25!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link:is(:hover,:focus-visible) {
  background:#e7f4fe!important;
  border-color:#86bfdd!important;
  color:#1975a8!important;
  outline:2px solid #80c7eb!important;
  outline-offset:1px!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link.active {
  background:#e7f4fe!important;
  border-color:#86bfdd!important;
}
/* Handles/icons remain functional, in their pre-existing flow slots. */
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .page-grip {
  border:0!important;
  background:transparent!important;
  color:#87b4d1!important;
}
/* Draw the button's own outgoing branch from the button's lower-left corner.
   The parent message's established bubble-corner line remains unchanged. */
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"].flow-tree-branch > .page-tree-row::after {
  content:none!important;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"].flow-tree-branch > .page-tree-row > .screen-link {
  position:relative;
}
.editor-focused-shell .flow-one-screen .flow-items-viewport
  .page-tree-node[data-flow-placement="inline"].flow-tree-branch > .page-tree-row > .screen-link::after {
  content:"";
  position:absolute;
  left:8px;
  top:calc(100% - 1px);
  height:12px;
  border-left:2px dotted #5aabc9;
  z-index:2;
  pointer-events:none;
}

/* R23.6 — Form question nodes show the real Telegram prompt and answer expectation.
   All existing bubble colours/widths and button shapes remain unchanged. */
.editor-focused-shell .flow-one-screen .flow-truth-answer{
  color:#acd5e8;font-size:10px;line-height:1.35;margin:0 47px 7px 6px;
  white-space:normal;overflow-wrap:anywhere;
}
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .tree-screen-options,
.editor-focused-shell .flow-one-screen .flow-tree-message-row > .tree-screen-remove,
.editor-focused-shell .flow-one-screen .page-tree-root > .tree-screen-options,
.editor-focused-shell .flow-one-screen .page-tree-root > .tree-screen-remove,
.editor-focused-shell .flow-one-screen .page-tree-row > .tree-screen-options,
.editor-focused-shell .flow-one-screen .page-tree-row > .tree-screen-remove{
  align-self:flex-start!important;margin-top:3px!important;
}
.tg-flow-node .flow-truth-answer{font-size:10px;line-height:1.35;color:#617b90;margin:2px 5px 9px;}

/* R23.6 — Keep real form prompts fully readable and their controls visible. */
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport{
  container-type:inline-size!important;
  --flow-row-width:min(245px,calc(100cqw - 9px))!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-children > .page-tree-node > .page-tree-row{
  width:calc(var(--flow-row-width) - 24px)!important;
  min-width:calc(var(--flow-row-width) - 24px)!important;
  max-width:calc(var(--flow-row-width) - 24px)!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children > .page-tree-node > .page-tree-row{
  width:calc(var(--flow-row-width) - 48px)!important;
  min-width:calc(var(--flow-row-width) - 48px)!important;
  max-width:calc(var(--flow-row-width) - 48px)!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children .flow-tree-children > .page-tree-node > .page-tree-row{
  width:calc(var(--flow-row-width) - 72px)!important;
  min-width:calc(var(--flow-row-width) - 72px)!important;
  max-width:calc(var(--flow-row-width) - 72px)!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-message-row,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-root{
  height:auto!important;max-height:none!important;min-height:38px!important;
  align-items:flex-start!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-message-row > .screen-link,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-root > .screen-link{
  height:auto!important;max-height:none!important;min-height:26px!important;
  overflow:visible!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-message-row > .screen-link .screen-label,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-root > .screen-link .screen-label{
  display:block!important;white-space:normal!important;overflow:visible!important;
  text-overflow:clip!important;overflow-wrap:anywhere!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-node[data-flow-placement="inline"] > .page-tree-row{
  height:auto!important;min-height:38px!important;max-height:none!important;
  align-items:flex-start!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link{
  height:auto!important;min-height:30px!important;max-height:none!important;
  overflow:visible!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link .screen-label{
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  overflow-wrap:anywhere!important;
}

/* R24 — avoid shrinking each nested Telegram inline button a second time.
   Keep readable button faces at every depth. Deep branches scroll horizontally. */
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport{
  --flow-row-width:270px!important;
  overflow-x:auto!important;
  scrollbar-width:thin;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-node > .page-tree-row,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-root,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-children > .page-tree-node > .page-tree-row,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children > .page-tree-node > .page-tree-row,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .flow-tree-children .flow-tree-children .flow-tree-children > .page-tree-node > .page-tree-row{
  box-sizing:border-box!important;width:270px!important;min-width:270px!important;max-width:270px!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link{
  min-width:175px!important;max-width:none!important;flex:1 1 auto!important;
  padding:6px 5px!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-node[data-flow-placement="inline"] > .page-tree-row > .screen-link .screen-label{
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  overflow-wrap:normal!important;
}
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-row > .tree-screen-options,
.editor-focused-shell .simple-screens #editorMenu .flow-one-screen .flow-items-viewport .page-tree-row > .tree-screen-remove{
  align-self:flex-start!important;margin-top:2px!important;
}
/* Code view is a choice, never a replacement for the no-code Telegram preview. */
.editor-focused-shell .tg-editor-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:3px;margin:8px 0;border:1px solid #3b5871;border-radius:9px;background:#152a40;}
.editor-focused-shell .tg-editor-mode-switch button{cursor:pointer;border:0;border-radius:6px;background:transparent;color:#acc8db;font-size:12px;font-weight:650;padding:8px 4px;}
.editor-focused-shell .tg-editor-mode-switch button[aria-pressed="true"]{background:#f9fcff;color:#16435f;}
.editor-focused-shell .simple-screens.code-mode{min-width:0;}
.editor-focused-shell .tg-code-editor{min-width:0;display:flex;flex-direction:column;gap:9px;color:#e7f2fa;font-size:12px;}
.editor-focused-shell .tg-code-editor header{display:flex;flex-direction:column;gap:3px;padding:5px 1px;}
.editor-focused-shell .tg-code-editor header strong{font-size:14px;}
.editor-focused-shell .tg-code-editor header small{font-size:11px;color:#9dbdd4;}
.editor-focused-shell .tg-code-intro{line-height:1.5;margin:0;color:#b4d0e1;}
.editor-focused-shell .tg-code-tools{display:flex;gap:6px;}
.editor-focused-shell .tg-code-tools button,.editor-focused-shell .tg-code-snippet{border:1px solid #4d7799;border-radius:7px;background:#24455e;color:#eef7ff;padding:7px;cursor:pointer;text-align:left;font-size:11px;}
.editor-focused-shell .tg-code-completion{display:flex;flex-direction:column;gap:4px;max-height:210px;overflow-y:auto;}
.editor-focused-shell .tg-code-completion[hidden]{display:none;}
.editor-focused-shell .tg-code-source-wrap{min-width:0;border:1px solid #4e6b84;background:#101e30;border-radius:10px;padding:6px;}
.editor-focused-shell .tg-code-source-wrap label{display:block;color:#afd0e3;font-size:10px;padding:3px 5px 6px;}
.editor-focused-shell .tg-code-source{width:100%;min-height:300px;max-width:100%;box-sizing:border-box;resize:vertical;background:#0e1929;color:#e8f0fb;border:0;outline:0;padding:9px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.6;tab-size:2;overflow-wrap:normal;white-space:pre;}
.editor-focused-shell .tg-code-source:focus{box-shadow:inset 0 0 0 1px #7cbaee;border-radius:5px;}
.editor-focused-shell .tg-code-commands{display:flex;flex-wrap:wrap;gap:4px;padding:6px 3px;}
.editor-focused-shell .tg-code-commands code{background:#213e55;border-radius:4px;color:#89d7ff;padding:3px 4px;font-size:10px;}
.editor-focused-shell .tg-code-help,.editor-focused-shell .tg-code-warning{color:#9bb8cd;font-size:11px;line-height:1.5;margin:0;}
.editor-focused-shell .tg-code-error{color:#ffbf99;min-height:16px;line-height:1.45;}
.editor-focused-shell .tg-code-apply{cursor:pointer;background:#fa9b42;color:#241409;border:0;border-radius:7px;font-weight:750;padding:10px;font-size:12px;}
@media(max-width:650px){.editor-focused-shell .tg-code-source{min-height:240px;}}

.r10-editor .tg-form-unsent-drafts{margin:8px 0 4px;padding:9px;background:#eff6fb;border:1px solid #c5d7e5;border-radius:8px;color:#3c5263;font-size:11px;}
.r10-editor .tg-form-unsent-drafts summary{cursor:pointer;font-weight:700;}
.r10-editor .tg-form-unsent-drafts p{margin:7px 0;color:#637c8d;line-height:1.5;}
.r10-editor .tg-form-unsent-item{padding:7px 2px;border-top:1px solid #d6e4ee;display:flex;flex-direction:column;gap:6px;overflow-wrap:anywhere;}
.r10-editor .tg-form-unsent-item>div{display:flex;gap:5px;}
.r10-editor .tg-form-unsent-item button{border:1px solid #b5cddd;background:#fff;color:#245170;border-radius:5px;font-size:10px;padding:6px;cursor:pointer;}

/* R24.2 — form questions are editable message steps, not a settings-only modal. */
.tg-form-preview .tg-form-sequence-caption { font-size:10px; font-weight:600; opacity:.65; margin:5px 38px 2px 7px; line-height:1.25; }
.tg-form-preview .tg-form-question-edit-actions { display:flex; justify-content:flex-end; gap:6px; margin-top:5px; }
.tg-form-preview .tg-form-question-edit-actions button { border:0; border-radius:7px; padding:5px 8px; background:rgba(255,255,255,.16); color:inherit; cursor:pointer; font-size:11px; }
.tg-form-preview .tg-form-question-edit-actions button:first-child { background:#ed9c44; color:#101827; }
.tg-form-preview .tg-form-message-unit .tg-tap-to-edit { cursor:text; }

/* R25: Bot-level code commands, compact selector and help. */
.editor-focused-shell .tg-code-select{width:100%;background:#182f46;border:1px solid #4f7794;border-radius:8px;padding:9px;color:#e8f5ff;font:inherit}
.editor-focused-shell .tg-code-label{font-size:11px;color:#b4d0e1}
.editor-focused-shell .tg-code-snippet small{display:block;margin-top:3px;color:#b4cfdd;font-size:10px;font-weight:400}
.editor-focused-shell .tg-code-tools{flex-wrap:wrap}

/* R25.3: Restore the proven pre-code-builder Bot Flow connector rails.
   The R24.2 tree styling above is intentional: no SVG geometry, no curved
   paths, no connector positions derived from DOM rectangles. The rail belongs
   to the parent tree, and the first-level Welcome connection is CSS-native. */
/* Multi-line Bots.Business CMD import, not an ordinary single-line prompt. */
textarea.tg-studio-dialog-input{width:100%;min-height:190px;max-height:48dvh;resize:vertical;white-space:pre;font-family:ui-monospace,Consolas,monospace;font-size:12px;box-sizing:border-box;}

/* R25.2: stable, mutually exclusive Flow/Code tab states and contextual code lenses. */
.editor-focused-shell .tg-editor-mode-switch button[aria-pressed="false"]{background:transparent!important;color:#acc8db!important;box-shadow:none!important;}
.editor-focused-shell .tg-editor-mode-switch button[aria-pressed="true"]{background:#f9fcff!important;color:#16435f!important;}
.editor-focused-shell .tg-code-scopes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:3px 0 10px;}
.editor-focused-shell .tg-code-scopes button{background:transparent;border:1px solid #4b6880;border-radius:7px;color:#b8d5e9;padding:7px 2px;cursor:pointer;font-weight:600;font-size:11px;}
.editor-focused-shell .tg-code-scopes button[aria-pressed="true"]{background:#f9fcff;color:#16435f;}
.editor-focused-shell .tg-code-visual .tg-code-source{min-height:300px;max-height:55vh;white-space:pre;resize:vertical;tab-size:2;}
.editor-focused-shell .tg-code-lessons{border:1px solid #38536e;border-radius:8px;padding:8px;color:#bfd5e7;}
.editor-focused-shell .tg-code-lessons p{margin:7px 0;line-height:1.4;}

/* R25.4: R25.3's native dotted rails, with no dangling leaf tails.
   This affects paint only. No tree depth, message, button or drag changes. */
.editor-focused-shell .flow-one-screen .flow-tree-branch>.page-tree-row::after{content:none!important}
.editor-focused-shell .flow-one-screen .flow-tree-children>.page-tree-node:last-child:not(:has(> .flow-tree-children))::after{
  content:""!important;position:absolute;left:-13px;top:19px;bottom:-12px;
  width:3px;height:auto;background:#17283c;z-index:0;pointer-events:none;
}
/* The final message may include a reply-hint after its row: it is still
   a leaf, and its own horizontal connector remains above the mask. */

/* Close the Welcome-level trunk at its actual final visible node too. */
.editor-focused-shell .flow-one-screen .page-tree-list>.page-tree-node:last-child::after{
  content:""!important;position:absolute;left:-11px;top:19px;bottom:-16px;
  width:3px;height:auto;background:#17283c;z-index:0;pointer-events:none;
}

/* R32: compact multiline transactions in the existing Action Editor only. */
.r32-transaction-step{border:1px solid var(--line,rgba(128,145,160,.35));border-radius:12px;padding:12px;margin:8px 0;min-width:0}.r32-transaction-step .fieldrow{min-width:0}.r32-step-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}.r32-transaction-step .input{min-width:0;max-width:100%}@media(max-width:480px){.r32-transaction-step .fieldrow{display:block}}

/* R36: native Telegram button style settings and flow-connector actions. */
.r10-editor .canvas-button-wrap .tg-button-settings{position:absolute;right:20px;top:50%;transform:translateY(-50%);width:19px;height:19px;min-width:19px;padding:0;border:0;background:transparent;color:#607d91;display:grid;place-items:center;font-size:12px;line-height:1;cursor:pointer;z-index:3;border-radius:5px;}
.r10-editor .canvas-button-wrap .tg-button-settings:hover,.r10-editor .canvas-button-wrap .tg-button-settings:focus-visible{background:#dbeaf6;color:#186caa;}
.r10-editor .canvas-button-wrap>.canvas-inline-button{padding-right:45px!important;}
.r10-editor .canvas-button-wrap .tg-button-remove{right:1px;}
.tg-inline-style-preview{display:flex;align-items:center;justify-content:center;margin:12px 0 16px;padding:17px;background:#e9f1f7;border-radius:11px;}
.tg-style-button{padding:8px 24px;border-radius:7px;font-size:13px;font-weight:650;background:white;color:#31576f;}
.r10-editor .canvas-inline-button.tg-style-primary,.tg-map-button-label.tg-style-primary,.tg-style-primary{background:#287ed6!important;color:white!important;}
.r10-editor .canvas-inline-button.tg-style-success,.tg-map-button-label.tg-style-success,.tg-style-success{background:#239968!important;color:white!important;}
.r10-editor .canvas-inline-button.tg-style-danger,.tg-map-button-label.tg-style-danger,.tg-style-danger{background:#cc4854!important;color:white!important;}
.tg-flow-edge-layer{position:absolute;inset:0;pointer-events:none;z-index:4;}
.tg-flow-edge-station{position:absolute;display:flex;flex-direction:column;align-items:center;gap:3px;transform:translate(-50%,-50%);pointer-events:auto;max-width:150px;max-height:200px;overflow-y:auto;scrollbar-width:thin;padding:3px 5px;border-radius:12px;background:#f6faffea;box-shadow:0 1px 6px #30495b2b;border:1px solid #b6d1e8;}
.tg-flow-edge-plus{height:23px;min-width:23px;width:23px;flex:none;display:grid;place-items:center;background:#2377ca;color:white;border:0;border-radius:50%;font-weight:750;font-size:17px;line-height:1;cursor:pointer;}
.tg-flow-edge-plus-small{background:#d7ecfb;color:#215f92;height:18px;width:18px;min-width:18px;font-size:14px;border:1px solid #a7c7e3;}
.tg-flow-edge-plus:hover,.tg-flow-edge-plus:focus-visible{background:#124f96;color:white;}
.tg-flow-edge-chip{font:600 10px/1.2 system-ui,sans-serif;max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #a8c5df;background:white;color:#254f75;border-radius:7px;padding:5px 7px;cursor:pointer;}
.tg-flow-edge-chip:hover{background:#e9f5ff;}
@media (pointer:coarse){.tg-flow-edge-plus{height:30px;width:30px;min-width:30px;}.tg-flow-edge-plus-small{height:24px;width:24px;min-width:24px;}.r10-editor .canvas-button-wrap .tg-button-settings{width:22px;height:26px;right:23px;}}

/* Same 14px square as the existing X; placed immediately to its left. */
.r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-settings{top:0;right:16px;transform:none;width:14px;height:14px;min-width:14px;font-size:10px;line-height:1;border-radius:3px;}
@media(pointer:coarse){.r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-settings{width:22px;height:22px;right:22px;min-width:22px;top:0;font-size:12px}.r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-remove{width:22px!important;height:22px!important;}}

/* R37: compact native event-composition controls */
.r37-event-section{border:1px solid var(--border,#dce1e8);border-radius:12px;padding:12px;margin:12px 0;min-width:0}
.r37-event-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.r37-event-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.85fr) minmax(0,1fr) 30px;gap:7px;align-items:end;margin:9px 0}
.r37-event-row.r37-mapping-row{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) 30px}
.r37-event-row .field{min-width:0;margin:0}
.r37-remove{border:1px solid var(--border,#dce1e8);border-radius:9px;background:transparent;min-height:39px;cursor:pointer}
.r37-action-order{display:grid;gap:6px;margin-top:8px}
.r37-action-order-row{display:flex;align-items:center;gap:6px;padding:6px 9px;border-radius:9px;background:var(--surface-2,#f3f6f9)}
.r37-action-order-row span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.r37-action-order-row button{border:1px solid var(--border,#dce1e8);border-radius:8px;background:var(--surface,#fff);width:30px;height:30px;cursor:pointer}
.r37-action-order-row button:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:620px){.r37-event-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 32px}.r37-event-row .field:nth-child(3){grid-column:1 / 3;grid-row:2}.r37-event-row:not(.r37-mapping-row) .r37-remove{grid-column:3;grid-row:2}}

/* R38 — visible controls: the gear occupies the same solid badge as X, and is always its immediate left sibling. */
.r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-settings{
 position:absolute!important;top:0!important;right:14px!important;transform:none!important;
 box-sizing:border-box!important;width:14px!important;height:14px!important;min-width:14px!important;
 display:grid!important;place-items:center!important;z-index:7!important;padding:0!important;
 border:0!important;border-radius:0!important;background:#e6edf2!important;
 color:#405c72!important;opacity:1!important;font:700 11px/14px Arial,sans-serif!important;
 box-shadow:inset -1px 0 0 #c5d5df!important;cursor:pointer!important;
}
.r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-settings:is(:hover,:focus-visible){background:#b6dff8!important;color:#164f83!important;outline:1px solid #3389bf!important;outline-offset:-1px!important;}
.r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-remove{right:0!important;z-index:7!important;opacity:1!important;}
.r10-editor .tg-edit-button-row .canvas-button-wrap>.canvas-inline-button{padding-right:32px!important;}
@media(pointer:coarse){
 .r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-settings{width:22px!important;min-width:22px!important;height:22px!important;right:22px!important;font-size:13px!important;line-height:22px!important;}
 .r10-editor .tg-edit-button-row .canvas-button-wrap>.tg-button-remove{width:22px!important;height:22px!important;}
 .r10-editor .tg-edit-button-row .canvas-button-wrap>.canvas-inline-button{padding-right:46px!important;}
}
.r38-external-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0;}
.r38-external-choices button{border:1px solid #b6d4ea;background:#eef7fc;color:#215d83;border-radius:11px;min-height:44px;font:650 13px system-ui,sans-serif;cursor:pointer;}
.r38-external-choices button:hover{background:#d7eafb;}
@media(max-width:370px){.r38-external-choices{grid-template-columns:1fr;}}

/* Keep the expanded inline/reply button menu usable on compact touch displays. */
.r10-editor .tg-preview-floating-menu{max-height:min(420px,calc(100dvh - 20px));overflow-y:auto;overscroll-behavior:contain;}

/* R38: the real Test Bot renders saved native styles on inline and reply buttons. */
.r10-editor .tg-sim-inline-row button.tg-style-primary,.r10-editor .tg-live-keyboard-row button.tg-style-primary{background:#287ed6!important;color:#fff!important;}
.r10-editor .tg-sim-inline-row button.tg-style-success,.r10-editor .tg-live-keyboard-row button.tg-style-success{background:#239968!important;color:#fff!important;}
.r10-editor .tg-sim-inline-row button.tg-style-danger,.r10-editor .tg-live-keyboard-row button.tg-style-danger{background:#cc4854!important;color:#fff!important;}
.r10-editor .tg-sim-inline-row button.tg-style-primary:active,.r10-editor .tg-sim-inline-row button.tg-style-success:active,.r10-editor .tg-sim-inline-row button.tg-style-danger:active{filter:brightness(.91);}

/* R38.1: native button styles and settings also apply to Telegram reply keyboards. */
.r10-editor .tg-edit-button-row .reply-key-wrap>.reply-key.tg-style-primary{background:#287ed6!important;color:#fff!important;}
.r10-editor .tg-edit-button-row .reply-key-wrap>.reply-key.tg-style-success{background:#239968!important;color:#fff!important;}
.r10-editor .tg-edit-button-row .reply-key-wrap>.reply-key.tg-style-danger{background:#cc4854!important;color:#fff!important;}
.r10-editor .tg-edit-button-row .reply-key-wrap>.tg-button-settings{
 position:absolute!important;top:0!important;right:14px!important;transform:none!important;
 box-sizing:border-box!important;width:14px!important;height:14px!important;min-width:14px!important;
 display:grid!important;place-items:center!important;z-index:7!important;padding:0!important;
 border:0!important;border-radius:0!important;background:#e6edf2!important;
 color:#405c72!important;opacity:1!important;font:700 11px/14px Arial,sans-serif!important;
 box-shadow:inset -1px 0 0 #c5d5df!important;cursor:pointer!important;
}
.r10-editor .tg-edit-button-row .reply-key-wrap>.tg-button-settings:is(:hover,:focus-visible){background:#b6dff8!important;color:#164f83!important;outline:1px solid #3389bf!important;outline-offset:-1px!important;}
.r10-editor .tg-edit-button-row .reply-key-wrap>.tg-button-remove{right:0!important;z-index:7!important;opacity:1!important;}
.r10-editor .tg-edit-button-row .reply-key-wrap>.reply-key{padding-right:32px!important;}
@media(pointer:coarse){
 .r10-editor .tg-edit-button-row .reply-key-wrap>.tg-button-settings{width:22px!important;min-width:22px!important;height:22px!important;right:22px!important;font-size:13px!important;line-height:22px!important;}
 .r10-editor .tg-edit-button-row .reply-key-wrap>.tg-button-remove{width:22px!important;height:22px!important;}
 .r10-editor .tg-edit-button-row .reply-key-wrap>.reply-key{padding-right:46px!important;}
}

/* R46 — preview buttons are native-size again; management stays in tap menu. */
.r10-editor .tg-edit-button-row .canvas-button-wrap>.canvas-inline-button,
.r10-editor .tg-edit-button-row .reply-key-wrap>.reply-key{padding-right:10px!important;}
.screen-builder-modal .screen-builder-actions{margin-top:10px!important;margin-bottom:0!important;}
.screen-builder-modal .screen-builder-action-empty{margin:7px 8px;color:#97b3cf;font-size:12px;}
.screen-action-section-title{font-size:13px;color:#9db8ce;margin:14px 0 7px;}
.business-suite-modal{max-height:90vh;overflow-y:auto;}
.business-suite-modal .business-rules-head,.business-suite-modal .business-connections-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:15px 0 5px;}
.business-suite-modal .business-rule,.business-suite-modal .business-account{border:1px solid #385472;border-radius:10px;padding:12px;margin:9px 0;}
.business-suite-modal .business-account-actions{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0;}
.business-suite-modal .business-account-actions button,.business-suite-modal .business-chat-row button{background:#263f58;color:#e6f2ff;border:1px solid #47617c;border-radius:8px;padding:7px 10px;cursor:pointer;}
.business-suite-modal .business-account-actions button:disabled,.business-suite-modal .business-chat-row button:disabled{opacity:.42;cursor:not-allowed;}
.business-suite-modal .business-chat-row{display:flex;justify-content:space-between;gap:10px;align-items:center;border-bottom:1px solid #385472;padding:8px 1px;}

/* R48: discoverable owner tools, two companion preview controls and a quieter event editor. */
.tg-preview-footer-actions{gap:8px;}
.tg-preview-footer-actions button{flex:0 1 auto;white-space:nowrap;min-width:0;}
@media(max-width:420px){.tg-preview-footer-actions{gap:7px}.tg-preview-footer-actions button{font-size:12px;padding:8px 10px;}}
.r48-trigger-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:9px 0 12px;}
.r48-trigger-tools .btn{padding:9px 5px;min-width:0;font-size:12px;white-space:normal;}
.r12-modal[aria-label="Configure event trigger"]{max-width:630px;}
.r12-modal[aria-label="Configure event trigger"] #eventRuleForm{display:grid;gap:8px;}
.r12-modal[aria-label="Configure event trigger"] #eventRuleForm>.field,
.r12-modal[aria-label="Configure event trigger"] #eventRuleForm>.fieldrow{margin-bottom:0;}
.r12-modal[aria-label="Configure event trigger"] .field{gap:4px;margin-bottom:7px;}
.r12-modal[aria-label="Configure event trigger"] .fieldrow{gap:10px;}
.r12-modal[aria-label="Configure event trigger"] .input{min-height:38px;padding:8px 10px;}
.r12-modal[aria-label="Configure event trigger"] .r37-event-section{margin:6px 0;padding:9px 10px;border-radius:10px;}
.r12-modal[aria-label="Configure event trigger"] .r37-event-head{margin-bottom:4px;}
.r12-modal[aria-label="Configure event trigger"] .r37-event-head .btn{padding:6px 9px;font-size:12px;}
.r12-modal[aria-label="Configure event trigger"] .r37-event-row{margin:6px 0;}
.r12-modal[aria-label="Configure event trigger"] .r12-actions-list,
.r12-modal[aria-label="Configure event trigger"] .screen-action-picker-list{max-height:185px;}
.r12-modal[aria-label="Configure event trigger"] .audience-item{padding:8px 9px;}
.r12-modal[aria-label="Configure event trigger"] .r48-actions-field{margin-top:4px;margin-bottom:3px;}
.r12-modal[aria-label="Configure event trigger"] .r48-actions-field>label{font-size:13px;font-weight:750;}
.r12-modal[aria-label="Configure event trigger"] .r48-execution-order{padding:7px 10px;}
.r12-modal[aria-label="Configure event trigger"] .r48-execution-order .r37-action-order-row{padding:4px 7px;}
.r48-event-help{margin:7px 0 10px;padding:8px 11px;border:1px solid var(--border,#d5e0e9);border-radius:10px;font-size:12px;}
.r48-event-help summary{cursor:pointer;font-size:12px;font-weight:650;}
.r48-event-help .hint{margin:8px 0 1px;line-height:1.5;}
.r48-create-variable{display:inline-flex;align-items:center;gap:4px;border:1px dashed #789bbc;background:transparent;color:inherit;border-radius:8px;font-size:12px;font-weight:650;padding:7px 10px;cursor:pointer;justify-self:start;}
.r48-create-variable:hover,.r48-create-variable:focus-visible{background:rgba(102,164,215,.12);}
.r48-mapping-creator{margin:2px 0 8px;}
.r48-variable-creator{border:1px solid #7cadd4;border-radius:10px;background:rgba(119,173,218,.09);padding:11px;margin:4px 0 9px;}
.r48-variable-creator>strong{font-size:13px;}
.r48-variable-creator .hint{font-size:12px;margin:4px 0 10px;}
.r48-inline-controls{display:flex;align-items:center;flex-wrap:wrap;gap:7px;}
.r48-inline-controls .btn{min-width:0;}
@media(max-width:600px){.r48-trigger-tools .btn{font-size:11px}.r12-modal[aria-label="Configure event trigger"] .fieldrow{grid-template-columns:1fr;gap:3px}.r12-modal[aria-label="Configure event trigger"] .r37-event-row{gap:6px}}
.r48-event-group{border:1px solid var(--border,#d6e0e8);border-radius:10px;margin:4px 0;min-width:0;}
.r48-event-group>summary{list-style:none;cursor:pointer;padding:12px 13px;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.r48-event-group>summary::-webkit-details-marker{display:none;}
.r48-event-group>summary:after{content:'⌄';font-size:15px;font-weight:700;opacity:.7;}
.r48-event-group[open]>summary:after{content:'⌃';}
.r48-event-group>summary small{font-size:11px;font-weight:400;opacity:.73;margin-left:auto;}
.r48-event-group-body{padding:1px 12px 9px;display:grid;gap:7px;}
.r48-event-group-body>.fieldrow{margin:0;}
.r48-event-group-body>.field{margin-bottom:0!important;}
.r48-event-group-body .r37-event-section{border-color:var(--border,#d6e0e8);}
@media(max-width:440px){.r48-event-group>summary{align-items:start;flex-wrap:wrap}.r48-event-group>summary small{margin-left:0;}}

/* R49: Telegram Business workspace is a first-class, mobile-friendly Bot tool. */
.r49-business-workspace{width:min(920px,calc(100vw - 24px));max-width:920px;max-height:min(92dvh,920px);overflow:auto;}
.r49-business-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:10px 0 14px;}
.r49-business-summary>div{display:flex;flex-direction:column;gap:4px;padding:12px;border-radius:12px;background:rgba(100,150,200,.08);border:1px solid rgba(140,165,195,.2);}
.r49-business-summary strong{font-size:22px;font-weight:750;line-height:1.15;}
.r49-business-summary span{font-size:12px;opacity:.78;}
.r49-business-nav{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:15px;}
.r49-business-nav button,.r49-inbox-filters button{border:1px solid rgba(140,165,195,.34);border-radius:9px;background:transparent;color:inherit;padding:9px 11px;font:inherit;font-size:12px;cursor:pointer;}
.r49-business-nav button.active,.r49-business-nav button[aria-pressed="true"],.r49-inbox-filters button.active{background:#2475c5;border-color:#3986d1;color:white;}
.r49-business-nav button:focus-visible,.r49-inbox-filters button:focus-visible{outline:2px solid #70abf2;outline-offset:2px;}
.r49-business-panel{border-top:1px solid rgba(140,165,195,.2);padding-top:13px;}
.r49-business-panel h3{margin:0 0 10px;font-size:17px;}
.r49-business-panel p{line-height:1.5;}
.r49-business-status{display:flex;flex-direction:column;gap:4px;padding:13px 14px;border:1px solid rgba(140,165,195,.28);border-radius:12px;margin:14px 0;}
.r49-business-status span{font-size:13px;opacity:.78;}
.r49-business-quick{display:flex;flex-wrap:wrap;gap:8px;}
.r49-inbox-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin:14px 0;}
.r49-inbox-controls .field{margin:0;flex:1 1 220px;}
.r49-inbox-filters{display:flex;gap:6px;flex-wrap:wrap;}
.r49-business-workspace .business-inbox-row{padding:12px;border:1px solid rgba(140,165,195,.25);border-radius:12px;margin-bottom:10px;}
.r49-business-workspace .business-inbox-row[hidden]{display:none;}
.r49-business-workspace .business-inbox-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:9px;}
.r49-business-workspace .business-inbox-meta small{opacity:.72;}
.r49-business-workspace .business-inbox-fields{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(160px,2fr) auto;gap:8px;align-items:end;margin:8px 0;}
.r49-business-workspace .business-inbox-fields label{font-size:12px;display:grid;gap:4px;min-width:0;}
.r49-business-workspace .business-inbox-fields button,.r49-business-workspace .business-inbox-actions button{background:#263f58;color:#e6f2ff;border:1px solid #47617c;border-radius:8px;padding:8px 10px;cursor:pointer;}
.r49-business-workspace .business-inbox-actions{display:flex;flex-wrap:wrap;gap:6px;}
.r49-business-workspace .business-inbox-actions button:disabled{opacity:.42;cursor:not-allowed;}
.r49-business-workspace .r49-business-error{padding:10px;border:1px solid #b94a4a;border-radius:9px;}
@media(max-width:600px){.r49-business-summary{gap:5px;}.r49-business-summary>div{padding:8px;}.r49-business-summary span{font-size:10px;}.r49-business-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}.r49-business-nav button{padding:10px 7px;}.r49-business-workspace .business-inbox-fields{grid-template-columns:1fr;}.r49-business-workspace .business-inbox-fields button{width:100%;}}

.r49-pinned-business{padding:9px 10px 4px;}
.r49-pinned-business button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid rgba(122,166,211,.38);border-radius:10px;background:rgba(52,117,185,.11);color:inherit;padding:10px 11px;text-align:left;font:inherit;font-size:13px;font-weight:650;cursor:pointer;}
.r49-pinned-business button span{font-size:11px;font-weight:500;opacity:.7;white-space:nowrap;}
.r49-pinned-business button:focus-visible{outline:2px solid #70abf2;outline-offset:2px;}

/* R50: two clearly separated Make.TG products, without altering Flow controls. */
.r50-product-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:20px 0 23px}.r50-product-switch>a{border:1px solid #345165;border-radius:16px;background:linear-gradient(125deg,#153a39,#133145);color:#e2f6f6;display:flex;flex-direction:column;gap:9px;padding:20px;text-decoration:none;min-height:155px}.r50-product-switch>a.r50-product-secondary{background:linear-gradient(125deg,#293354,#172b43)}.r50-product-switch span{font-size:10px;color:#9cdec9;letter-spacing:1.3px;font-weight:800}.r50-product-switch strong{font-size:17px;line-height:1.3}.r50-product-switch small{color:#adc6d5;font-size:12px;line-height:1.5}.r50-product-switch em{font-size:12px;font-style:normal;color:#b2efcf;font-weight:750;margin-top:auto}.r49-pinned-business .r50-business-full-link{display:flex;align-items:center;justify-content:space-between;padding:13px 12px;color:#b5f5d6;text-decoration:none;font-weight:750;font-size:12px}.r49-pinned-business .r50-business-full-link span{font-weight:500;color:#91c6c6;font-size:10px}.r49-pinned-business .r50-business-full-link:hover{color:#fff}@media(max-width:740px){.r50-product-switch{grid-template-columns:1fr}}

/* R65 multi-route visual decision editor */
.r65-switch-case{margin:10px 0;padding:12px;border:1px solid var(--border,#dce3e9);border-radius:14px;background:var(--surface,#fff)}
.r65-switch-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.r65-switch-case .fieldrow{margin-top:9px}
@media(max-width:540px){.r65-switch-case{padding:10px}.r65-switch-case .fieldrow{display:grid;grid-template-columns:1fr;gap:8px}}

/* R76: one compact validation card per form question */
.r76-form-rule{padding:10px 12px;border:1px solid var(--line,#dde3ec);border-radius:12px;margin:8px 0;background:var(--surface,#fff)}
.r76-form-rule .fieldrow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
@media(max-width:430px){.r76-form-rule .fieldrow{grid-template-columns:1fr}}

/* R84: compact execution inspector, responsive and neutral. */
.r84-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(94px,1fr));gap:8px;margin:10px 0 18px}
.r84-stats span{border:1px solid var(--line,#dbe3ec);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:4px}
.r84-stats b{font-size:18px}.r84-stats small{font-size:11px;opacity:.75}
.r84-warning{color:var(--danger,#b45309);overflow-wrap:anywhere}
.r84-run-controls{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
@media(max-width:550px){.r84-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.r84-run-controls{justify-content:flex-start}}

/* R105: compact, shared Screen Actions controls across editor views. */
.r105-flow-add-action{flex:0 0 auto;max-width:130px;border:1px solid #e8cfa7;background:#fff8ed;color:#945d11;border-radius:7px;padding:4px 6px;font-size:10px;font-weight:700;cursor:pointer;white-space:nowrap;}
.r105-flow-add-action:hover,.r105-flow-add-action:focus-visible{background:#ffe9c9;outline:2px solid #e5ad57;outline-offset:1px;}
.r105-attached-action{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:7px 10px;background:#f6f9fc;border-radius:7px;}
.r105-attached-action button{border:0;background:transparent;color:#b54848;cursor:pointer;font-size:16px;}
.r105-read-create-row{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 14px;}
.tg-map-message-tools>button.r105-map-add-action{width:auto!important;min-width:0!important;height:25px;padding:0 7px;font-size:10px;border-color:#ebd2a8;color:#9a6309;background:#fff7e9;white-space:nowrap;}
@media(max-width:720px){.r105-flow-add-action{max-width:106px;font-size:9px;padding:3px 5px;}.tg-map-message-tools>button.r105-map-add-action{font-size:9px;padding:0 5px;}}

/* R106: mobile-safe, in-place flow diagnostics (no second builder). */
.r106-health-modal{max-width:740px;width:min(96vw,740px);max-height:min(92vh,850px);overflow-y:auto;}
.r106-health-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:12px 0 15px;}
.r106-health-stats span{background:var(--surface,#f8fafc);border:1px solid var(--line,#dbe3ea);border-radius:11px;padding:10px 7px;display:flex;align-items:center;flex-direction:column;gap:3px;}
.r106-health-stats strong{font-size:17px}.r106-health-stats small{font-size:10px;color:var(--muted,#64748b);text-align:center;}
.r106-health-filters{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:12px;}
.r106-health-filter{background:var(--surface,#f8fafc);border:1px solid var(--line,#dbe3ea);border-radius:22px;padding:7px 11px;color:inherit;cursor:pointer;font-size:12px;}
.r106-health-filter b{margin-left:3px}.r106-health-filter.active{background:#e8f1ff;border-color:#89b4ef;color:#1b4c80;}
.r106-health-findings{display:flex;flex-direction:column;gap:8px;min-height:58px;max-height:45vh;overflow:auto;padding-right:3px;}
.r106-health-finding{border:1px solid var(--line,#dce4eb);background:var(--surface,#fff);border-radius:12px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.r106-health-finding>div{display:flex;flex-direction:column;gap:4px;min-width:0;}.r106-health-finding strong{font-size:13px;}.r106-health-finding small{font-size:12px;color:var(--muted,#64748b);overflow-wrap:anywhere;line-height:1.4;}
.r106-health-level{font-size:10px;font-weight:750;color:#6b7280;}.r106-health-error .r106-health-level{color:#a23838}.r106-health-warning .r106-health-level{color:#936211}
.r106-health-finding button{white-space:nowrap;flex:0 0 auto;}.r106-health-footer{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:14px;}.r106-health-empty{padding:18px;text-align:center;color:var(--muted,#64748b);font-size:13px;}
@media(max-width:560px){.r106-health-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.r106-health-finding{align-items:flex-start;flex-direction:column}.r106-health-findings{max-height:48vh}.r106-health-finding button{align-self:flex-end}.r106-health-modal{max-height:94dvh;}}

/* R106.1 — active saved actions stand out within the EXISTING screen picker. */
.screen-action-picker .screen-action-section-title{display:flex;align-items:center;justify-content:space-between;gap:8px}
.r107-picker-count{font-size:11px;font-weight:700;color:#a6e0cc;white-space:nowrap}
.r107-picker-existing{max-height:32dvh}
.r107-picker-selected{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:10px 12px;border:2px solid #56c7a7;border-radius:10px;background:#164e49;box-shadow:inset 3px 0 0 #7be0a3;color:#f0fff9}
.r107-picker-action-name{min-width:0;display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}
.r107-picker-action-name strong{font-size:13px;font-weight:750}
.r107-picker-action-name small{font-size:11px;color:#abf6cf;font-weight:650}
.r107-picker-remove{flex:0 0 auto;border:1px solid #a2ddc7;border-radius:8px;padding:7px 9px;color:#e4fff2;background:#225b52;font-size:12px;cursor:pointer}
.r107-picker-remove:hover,.r107-picker-remove:focus-visible{background:#2e7061;outline:2px solid #c3f8df;outline-offset:2px}
@media(max-width:440px){.r107-picker-selected{padding:9px;gap:6px}.r107-picker-action-name strong{font-size:12px}.r107-picker-remove{font-size:11px;padding:7px}}

/* R107 — selecting a saved Action never attaches it; explicit icon controls. */
.r107-picker-row{display:flex;align-items:center;gap:8px;min-width:0;padding:5px 7px;border:1px solid #41617f;border-radius:11px;background:#223d58;color:#f0f7ff}
.r107-picker-row.r107-picker-selected{border:2px solid #56c7a7;background:#164e49;padding:4px 6px;box-shadow:inset 3px 0 0 #7be0a3}
.r107-picker-row.r107-picker-focused{outline:2px solid #91d1ff;outline-offset:1px}
.r107-picker-row-choice{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;align-items:flex-start;gap:4px;background:transparent;border:0;padding:6px;color:inherit;text-align:left;cursor:pointer}
.r107-picker-row-choice strong{font-size:13px;overflow-wrap:anywhere}.r107-picker-row-choice small{font-size:11px;color:#b7cde0}.r107-picker-selected .r107-picker-row-choice small{color:#abf6cf}
.r107-picker-row-choice:focus-visible,.r107-picker-icon:focus-visible{outline:2px solid #91d1ff;outline-offset:2px}
.r107-picker-row-controls{display:flex;flex:0 0 auto;gap:5px;align-items:center}
.r107-picker-icon{display:grid;place-items:center;width:33px;height:33px;border-radius:9px;border:1px solid #6d849b;background:#244661;color:#fff;font-size:19px;font-weight:650;cursor:pointer}
.r107-picker-attach:not(:disabled){color:#aeffe2;border-color:#56c7a7}.r107-picker-detach:not(:disabled){color:#ffc3bc;border-color:#d87970}.r107-picker-edit{color:#d0e7ff}
.r107-picker-icon:hover:not(:disabled){background:#376582}.r107-picker-icon:disabled{opacity:.25;cursor:not-allowed}
.r107-picker-legacy{gap:10px}.r107-picker-legacy>.r107-picker-action-name{flex:1}
.r107-journey-routes{display:grid;gap:7px;max-height:34dvh;overflow:auto}.r107-journey-route{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 11px;border:1px solid #39536d;border-radius:10px}.r107-journey-route>div{min-width:0}.r107-journey-route strong,.r107-journey-route small{display:block;overflow-wrap:anywhere}.r107-journey-route small{font-size:11px;opacity:.75}
@media(max-width:480px){.r107-picker-row{gap:4px;padding:4px}.r107-picker-icon{width:29px;height:32px}.r107-picker-row-controls{gap:3px}.r107-picker-row-choice strong{font-size:12px}}

/* R108 — sidebar-only controls; Telegram preview and full-map action controls unchanged. */
.editor-focused-shell #editorMenu .flow-one-screen .page-tree-row>.page-grip,
.editor-focused-shell #editorMenu .flow-one-screen .flow-unplaced-row>.page-grip{display:none!important;}
.editor-focused-shell #editorMenu .flow-one-screen .r108-flow-action-count{
 flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:3px;
 min-width:33px;max-width:54px;min-height:25px;box-sizing:border-box;
 padding:3px 5px;border:1px solid #a88949;border-radius:7px;
 background:#fff2d7;color:#7c4b0b;font-size:10px;font-weight:750;
 cursor:pointer;white-space:nowrap;line-height:1.2;
}
.editor-focused-shell #editorMenu .flow-one-screen .r108-flow-action-count:hover,
.editor-focused-shell #editorMenu .flow-one-screen .r108-flow-action-count:focus-visible{
 background:#ffe5a9;border-color:#a87926;outline:2px solid #b27f2b;outline-offset:1px;
}
/* Removing the grip lets the dotted rail meet the button text instead of an empty icon track. */
.editor-focused-shell #editorMenu .flow-one-screen .flow-tree-children>.page-tree-node::before{
 width:15px!important;left:-12px!important;
}
.editor-focused-shell #editorMenu .flow-one-screen .page-tree-row .screen-link{
 padding-inline-start:5px!important;
}
@media(max-width:760px){
 .editor-focused-shell #editorMenu .flow-one-screen .r108-flow-action-count{min-height:29px;font-size:10px;padding-inline:5px}
}

/* R109 · Native-first template onboarding (responsive, Telegram-friendly). */
.tg-template-onboarding{width:min(94vw,520px)!important;max-height:min(90vh,900px);overflow-y:auto}
.tg-template-onboarding .tg-template-ready{font-size:13px;color:#59718a;margin:10px 0 16px;line-height:1.6}
.tg-template-check{border:1px solid #d8e6f1;border-radius:13px;padding:13px 14px;margin:10px 0;background:#f8fbff;color:#263d53}
.tg-template-check strong{display:block;font-size:13px;margin-bottom:5px}
.tg-template-check p{font-size:12px;line-height:1.55;margin:0}
.tg-template-check.tg-template-next{background:#fff;border-color:#d8e6f1}
.tg-template-onboarding .btn{margin-top:9px}
.tg-template-connected,.tg-template-caution{font-size:12px;color:#58758b;line-height:1.5}
.tg-template-steps{padding-left:20px;margin:12px 0;color:#2a455c;font-size:12px;line-height:1.6}
.tg-template-steps li{margin-bottom:11px}
.tg-template-steps a{text-decoration:underline}
@media(max-width:680px){.tg-template-onboarding{width:min(96vw,520px)!important;padding:17px!important}.tg-template-steps{padding-left:17px}}
/* R110 local coding assistant: compact, keyboard-accessible, touch friendly */
.editor-focused-shell .tg-code-smart-toolbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.editor-focused-shell .tg-code-smart-toolbar button{background:#235678;border:1px solid #6791a9;color:#f0faff;padding:8px 10px;border-radius:8px;cursor:pointer;font:inherit}
.editor-focused-shell .tg-code-smart-toolbar label{font-size:11px;color:#b4d0e1}
.editor-focused-shell .tg-code-smart-toolbar select{flex:1;min-width:115px;max-width:230px}
.editor-focused-shell .tg-smart-completions{display:flex;flex-direction:column;gap:2px;max-height:235px;overflow:auto;padding:5px;background:#11273b;border:1px solid #57738f;border-radius:8px}
.editor-focused-shell .tg-smart-completions[hidden]{display:none}
.editor-focused-shell .tg-smart-option{background:transparent;border:0;text-align:left;color:#e9f7ff;padding:7px 10px;border-radius:5px;cursor:pointer;display:flex;justify-content:space-between;gap:5px;flex-wrap:wrap;font-size:12px}
.editor-focused-shell .tg-smart-option[aria-selected="true"],.editor-focused-shell .tg-smart-option:hover{background:#315d7d}
.editor-focused-shell .tg-smart-option small{color:#bad1e3;font-size:10px}
.editor-focused-shell .tg-language-examples summary{cursor:pointer}
.editor-focused-shell .tg-language-examples pre{overflow:auto;white-space:pre-wrap;user-select:text;border-radius:8px;background:#0e1929;color:#d0eaff;padding:10px;font-size:11px}
/* R111 - code commands appear alongside Flow without pretending scripts are buttons. */
.tg-flow-code-list{margin:12px 8px 8px;padding:8px;border:1px solid var(--border,#dde4ed);border-radius:12px;background:var(--surface,#fff)}
.tg-flow-code-list>summary{cursor:pointer;list-style:none;font-weight:650;padding:7px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.tg-flow-code-list>summary span{font-weight:500;color:var(--muted,#64748b)}
.tg-flow-code-list>.tg-code-help{padding:0 8px 4px;line-height:1.45}
.tg-flow-code-item{display:flex;align-items:center;gap:6px;border-top:1px solid var(--border,#e5e9ef);padding:5px 3px;min-width:0}
.tg-flow-code-item>button:first-child{background:transparent;border:0;min-width:0;text-align:left;cursor:pointer;flex:1;padding:8px 5px;color:inherit}
.tg-flow-code-item strong,.tg-flow-code-item small{display:block;white-space:normal;overflow-wrap:anywhere}
.tg-flow-code-item small{font-size:11px;opacity:.72;padding-top:2px}
.tg-code-visual-reply{background:transparent;border:1px solid var(--border,#dce3ea);border-radius:9px;padding:7px;cursor:pointer;color:inherit;white-space:nowrap;font-size:12px}
.tg-flow-code-list>.tg-code-visual-reply{margin-top:8px;width:100%}
.tg-blueprint-summary{border-radius:10px;padding:8px 10px;margin:10px 0;background:var(--surface,#f8fafc);font-size:12px;line-height:1.45}
.tg-blueprint-summary p{margin:5px 0}
.tg-blueprint-warning{opacity:.82}
@media(max-width:600px){.tg-flow-code-list{margin:10px 2px}.tg-flow-code-item>button:first-child{padding:10px 4px}}

/* R112 — beginner-friendly, reversible code-message editing and scenario tests */
.tg-code-block-modal{max-width:580px;max-height:min(88vh,860px);overflow-y:auto}
.tg-code-block-card{border:1px solid var(--border,#d6dde7);border-radius:13px;padding:13px;margin:12px 0;background:var(--card,#fff)}
.tg-code-block-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.tg-code-block-card .field{margin-top:8px}
.tg-code-block-add{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}
.tg-code-test-lab{padding:14px;margin:14px 0;border:1px solid var(--border,#d6dde7);border-radius:14px;background:var(--card,#fff);display:grid;gap:8px}
.tg-code-test-lab>p{font-size:12px;line-height:1.5;margin:0;color:var(--muted,#586777)}
.tg-code-test-lab>label{font-size:12px;font-weight:650}
.tg-code-test-lab pre{max-height:250px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:12px;margin:6px 0 0}
@media(max-width:480px){.tg-code-block-modal{width:calc(100vw - 16px);padding:14px}.tg-code-block-add .btn{flex:1 1 auto}}

/* R116 code diagnostics — compact, low-noise, accessible from keyboard */
.tg-code-diagnostics{border:1px solid #334c66;border-radius:10px;background:#152335;margin:8px 0 12px;padding:8px;color:#e0eaf7;font-size:12px}
.tg-code-diagnostic-status{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;font-variant-numeric:tabular-nums}
.tg-code-diagnostic-status span{color:#b9d1eb}
.tg-code-diagnostic-list{display:grid;gap:5px;margin-top:7px;max-height:195px;overflow:auto}
.tg-code-diagnostic{display:flex;flex-wrap:wrap;text-align:left;gap:4px 8px;align-items:baseline;padding:7px 8px;border-radius:7px;border:1px solid #3d576e;background:#1b2e43;color:inherit;cursor:pointer;white-space:normal;font:inherit}
.tg-code-diagnostic:hover,.tg-code-diagnostic:focus-visible{border-color:#77abe1;outline-offset:2px}
.tg-code-diagnostic.error{border-inline-start:3px solid #f2a0a0}
.tg-code-diagnostic.warning{border-inline-start:3px solid #d5bb6d}
.tg-code-diagnostic strong{white-space:nowrap;font-size:11px}
.tg-code-diagnostic span{flex:1 1 160px}
.tg-code-diagnostic small{display:block;flex:1 1 100%;color:#abc0d6}
.tg-code-diagnostic-note{margin:6px 0 0;color:#abc0d6}
@media(max-width:650px){.tg-code-diagnostic-status{display:block}.tg-code-diagnostics{padding:7px}}

/* R125: match the existing centered, light screen chooser for square +. */
.r125c-compact-picker{width:min(260px,calc(100vw - 16px));background:#fff;color:#18364e;box-shadow:0 10px 30px #081e3042}
#tgPlusPortal .r125c-compact-picker .tg-plus-scroll{max-height:min(245px,42dvh);overflow-y:auto}
#tgPlusPortal .r125c-compact-picker .r125c-popover-field{display:grid;gap:4px;margin:5px 7px;color:#45657e;font-size:12px;font-weight:650}
#tgPlusPortal .r125c-compact-picker .r125c-popover-field input{min-width:0;width:100%;box-sizing:border-box;border-radius:7px;border:1px solid #bdd4e6;padding:9px;background:#fff;color:#17364d;font:inherit}
.r125c-popover-empty{display:block;padding:10px;font-size:12px;color:#708495}
@media(max-width:400px){.r125c-compact-picker{width:min(235px,calc(100vw - 16px))}}

/* R136: mobile-first Telegram formatting palette, inside the phone preview. */
:is(.r10-editor,.screen-builder-modal).tg-format-host{position:relative;isolation:isolate}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette{position:absolute!important;inset:auto auto auto auto;bottom:auto!important;right:auto!important;z-index:320!important;display:flex;flex-direction:column;gap:3px;margin:0!important;padding:5px!important;max-width:calc(100% - 16px)!important;width:min(322px,calc(100% - 16px));box-sizing:border-box;border:1px solid #cad5e0;border-radius:13px;background:#fcfdff!important;color:#172f42;box-shadow:0 13px 36px #142a3b50,0 1px 4px #142a3b22;overflow:visible!important;white-space:normal;touch-action:none;user-select:none;-webkit-user-select:none;cursor:move}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette[hidden],:is(.r10-editor,.screen-builder-modal) .tg-format-palette [hidden]{display:none!important}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette-heading{min-height:21px;padding:1px 5px;display:flex;align-items:center;justify-content:space-between;gap:5px;letter-spacing:.08em;font-size:9px;font-weight:750;color:#4f657a;cursor:move}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette-heading small{font-size:9px;letter-spacing:0;font-weight:400;color:#8196a7}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette-row{display:flex;align-items:center;justify-content:space-between;gap:1px;min-width:0}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette button{border:0!important;border-radius:8px;background:transparent!important;color:#263d53!important;min-width:0!important;width:27px!important;height:30px!important;flex:1 1 27px;font-size:13px!important;padding:2px!important;line-height:1.2;display:flex;align-items:center;justify-content:center;cursor:pointer;touch-action:manipulation;user-select:none}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette button:hover,:is(.r10-editor,.screen-builder-modal) .tg-format-palette button:focus-visible{background:#e7f1fb!important;outline:1px solid #b1c8df}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette .tg-format-more-toggle{width:auto!important;flex:0 0 auto;min-width:39px!important;font-size:10px!important;font-weight:650}
:is(.r10-editor,.screen-builder-modal) .tg-format-palette .tg-format-dismiss{width:25px!important;flex:0 0 25px;background:#eef1f5!important;color:#586b7c!important;font-size:19px!important}
.r10-editor .tg-format-extra{border-top:1px solid #e1e7ee;padding:7px 2px 1px;cursor:move}
.r10-editor .tg-format-extra-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
.r10-editor .tg-format-extra-grid button{height:35px!important;width:100%!important;justify-content:flex-start!important;gap:6px;background:#f3f6fa!important;padding:3px 7px!important;font-size:11px!important;line-height:1.1!important;white-space:normal;text-align:left;min-width:0!important}
.r10-editor .tg-format-extra-grid button span{font-size:10px;overflow:hidden;text-overflow:ellipsis}
.r10-editor .tg-format-extra p{font-size:10px;line-height:1.4;color:#607588;margin:7px 4px 3px;max-width:100%;white-space:normal}
@media(max-width:420px){:is(.r10-editor,.screen-builder-modal) .tg-format-palette{width:min(308px,calc(100% - 16px))}:is(.r10-editor,.screen-builder-modal) .tg-format-palette-heading small{display:none}}
@media(prefers-reduced-motion:no-preference){:is(.r10-editor,.screen-builder-modal) .tg-format-palette{transition:box-shadow .13s ease}}

/* R140 hosted rewards owner panel */
.reward-hub-modal{max-width:min(780px,95vw);max-height:min(92dvh,900px);overflow-y:auto}
.reward-hub-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:15px 0}
.reward-hub-summary>span{display:flex;flex-direction:column;padding:12px;background:var(--surface, #f3f7fb);border-radius:13px;min-width:0}
.reward-hub-summary strong{font-size:18px;overflow-wrap:anywhere}
.reward-hub-summary small{font-size:12px;opacity:.65}
.reward-hub-section{border:1px solid var(--line,#dce5eb);border-radius:12px;margin:10px 0;padding:12px}
.reward-hub-section summary{cursor:pointer;font-weight:700;padding:4px}
.reward-hub-line{display:flex;gap:12px;align-items:center;justify-content:space-between;border-top:1px solid var(--line,#dce5eb);padding:10px 0}
.reward-hub-line>div:first-child{min-width:0;overflow-wrap:anywhere}
.reward-hub-line small{display:block;font-size:12px;opacity:.75;overflow-wrap:anywhere}
.reward-actions{display:flex;gap:5px;flex-wrap:wrap}
@media(max-width:560px){.reward-hub-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.reward-hub-line{align-items:flex-start;flex-direction:column}.reward-hub-line button{width:auto}}

/* R145: three clear actions below the phone; released bot link next to Publish. */
.r10-editor .tg-preview-footer-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;max-width:520px;margin-inline:auto;padding:10px 6px 5px}
.r10-editor .tg-preview-footer-actions button{width:100%;min-height:39px;padding:7px 9px;font-size:12px;white-space:normal;line-height:1.25;border-radius:11px}
.r10-editor .tg-preview-footer-actions button:nth-child(2){background:#e6f3ff;border-color:#9bc2e4;color:#1d5b90}
.r10-editor .tg-preview-actions .r145-open-telegram{border:1px solid #b9d5e2;background:#fff;color:#27618a;text-decoration:none;min-height:32px;padding:6px 10px;white-space:nowrap}
.r10-editor .tg-preview-actions .r145-open-telegram:hover{background:#e8f4ff}
@media(max-width:470px){.r10-editor .tg-preview-footer-actions{gap:5px;padding-inline:0}.r10-editor .tg-preview-footer-actions button{font-size:11px;padding:7px 5px;min-height:42px}.r10-editor .tg-preview-actions .r145-open-telegram{font-size:11px;padding:6px 8px}}

/* R146: the five primary bot controls belong under the preview, not the rail. */
.r10-editor .tg-preview-footer-actions{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;max-width:600px;margin:0 auto;padding:10px 6px 5px}
.r10-editor .tg-preview-footer-actions > *{grid-column:span 2;min-width:0;display:flex;align-items:center;justify-content:center;text-align:center;text-decoration:none;font:inherit;font-size:12px;line-height:1.25;min-height:39px;padding:7px 8px;white-space:normal;border:1px solid var(--border,#cbd5e1);border-radius:11px;box-sizing:border-box}
.r10-editor .tg-preview-footer-actions > :nth-child(4),.r10-editor .tg-preview-footer-actions > :nth-child(5){grid-column:span 3}
.r10-editor .tg-preview-footer-actions .r146-preview-admin-link{color:var(--text,#17212c);background:var(--surface,#fff)}
.r10-editor .tg-preview-footer-actions .r146-preview-admin-link:hover,.r10-editor .tg-preview-footer-actions .r146-preview-admin-link:focus-visible{filter:brightness(1.08);outline-offset:2px}
.editor-focused-shell #editorMenu .r146-flow-action-badge{min-width:0;max-width:70px;display:inline-flex;align-items:center;justify-content:center;gap:2px;padding:3px 4px;white-space:nowrap;font-size:10px;flex:0 0 auto}
.editor-focused-shell #editorMenu .r146-flow-action-badge span{font-size:inherit}
@media(max-width:470px){.r10-editor .tg-preview-footer-actions{gap:5px;padding-inline:0}.r10-editor .tg-preview-footer-actions > *{font-size:11px;min-height:42px;padding:7px 4px}}

/* R146: A message-free screen can still own dormant inline buttons. */
.r10-editor .r146-dormant-buttons{font-size:12px;line-height:1.45;color:var(--muted,#64748b);margin:7px 10px;padding:7px 10px;border:1px solid var(--line,#dbe4ee);border-radius:9px;max-width:100%;}

/* R148: readable, tap-friendly Telegram-style builder tools below the preview. */
.tg-preview-footer-actions.r148-preview-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;padding:12px 0 2px}
.r148-preview-tools>button,.r148-preview-tools>a{display:flex;align-items:center;gap:9px;min-height:48px;min-width:0;margin:0;padding:10px 12px;border-radius:12px;border:1px solid var(--border,#dce6ed);background:var(--panel,#fff);color:var(--text,#203849);font-size:12px;font-weight:500;text-align:left;text-decoration:none;white-space:normal;line-height:1.35;cursor:pointer;box-shadow:none}
.r148-preview-tools>button:hover,.r148-preview-tools>a:hover{background:var(--hover,#eef7ff);border-color:#67b1e4}.r148-preview-tools>button:focus-visible,.r148-preview-tools>a:focus-visible{outline:2px solid #2481cc;outline-offset:2px}
.r148-preview-tools .r148-tool-icon{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:8px;background:#2481cc12;color:#2481cc;font-size:17px}.r148-preview-tools>*>span:nth-child(2){flex:1;overflow-wrap:anywhere}
.r148-flow-actions{display:grid;gap:4px;margin:5px 0 8px 13px;padding-left:8px;border-left:1px solid #7da7c14d}.r148-flow-action{display:flex;align-items:center;gap:7px;width:100%;min-height:38px;border:1px solid #83b4d12b;border-radius:8px;background:var(--panel,#fff);color:var(--text,#203849);padding:6px 8px;text-align:left;cursor:pointer}.r148-flow-action>span:nth-child(2){flex:1;min-width:0}.r148-flow-action strong{display:block;font-size:11px;font-weight:500;overflow-wrap:anywhere}.r148-flow-action small{display:block;font-size:10px;opacity:.7;overflow-wrap:anywhere}.r148-flow-action:hover{border-color:#2481cc}.r148-flow-action>span:first-child{font-size:12px}
[data-theme="dark"] .r148-preview-tools>*,[data-theme="dark"] .r148-flow-action{background:#202f40;color:#e3eef7;border-color:#33485c}
@media(max-width:680px){.tg-preview-footer-actions.r148-preview-tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.r148-preview-tools>button,.r148-preview-tools>a{padding:9px 10px;min-height:52px}}


/* R149: exactly two rows of three Telegram-native bot builder tools.
   Scoped to the editor preview; preserves every existing action and URL. */
.r10-editor .tg-preview-footer-actions.r148-preview-tools {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  width:100%;
  max-width:600px;
  margin-inline:auto;
  padding:10px 0 4px;
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > button,
.r10-editor .tg-preview-footer-actions.r148-preview-tools > a {
  grid-column:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  width:100%;
  min-width:0;
  min-height:83px;
  margin:0;
  padding:9px 5px;
  border:1px solid var(--border,#dce6ed);
  border-radius:14px;
  background:var(--panel,#fff);
  color:var(--text,#203849);
  box-shadow:0 1px 2px rgba(31,72,104,.045);
  text-align:center;
  text-decoration:none;
  font-size:11px;
  font-weight:650;
  line-height:1.2;
  white-space:normal;
  cursor:pointer;
  transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease;
}
/* Undo the prior five-button 3/2 grid spanning rule. */
.r10-editor .tg-preview-footer-actions.r148-preview-tools > :nth-child(4),
.r10-editor .tg-preview-footer-actions.r148-preview-tools > :nth-child(5) {
  grid-column:auto;
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools .r148-tool-icon {
  display:grid;
  place-items:center;
  flex:0 0 30px;
  width:30px;
  height:30px;
  padding:0;
  border-radius:10px;
  background:rgba(36,129,204,.095);
  color:#2481cc;
  font-size:17px;
  line-height:1;
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > * > span:nth-child(2) {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  flex:0 1 auto;
  min-width:0;
  width:100%;
  overflow:hidden;
  overflow-wrap:normal;
  word-break:normal;
  text-overflow:ellipsis;
  text-align:center;
  font-size:inherit;
  line-height:1.2;
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > a {
  border-color:#cce4f7;
  background:linear-gradient(180deg,#f6fbff 0%,#eaf5fe 100%);
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > a > span:last-child:not(.r148-tool-icon) {
  display:none;
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > button:hover,
.r10-editor .tg-preview-footer-actions.r148-preview-tools > a:hover {
  border-color:#72b7e9;
  background:#e8f5ff;
  box-shadow:0 3px 10px rgba(36,129,204,.12);
  transform:translateY(-1px);
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > *:focus-visible {
  outline:2px solid #2481cc;
  outline-offset:2px;
}
.r10-editor .tg-preview-footer-actions.r148-preview-tools > *:active { transform:translateY(0); }
[data-theme="dark"] .r10-editor .tg-preview-footer-actions.r148-preview-tools > * {
  background:#202f40;
  color:#e3eef7;
  border-color:#33485c;
  box-shadow:none;
}
[data-theme="dark"] .r10-editor .tg-preview-footer-actions.r148-preview-tools > a { background:#203b53; }
[data-theme="dark"] .r10-editor .tg-preview-footer-actions.r148-preview-tools .r148-tool-icon {
  background:rgba(80,171,236,.14);
  color:#79c8ff;
}
[data-theme="dark"] .r10-editor .tg-preview-footer-actions.r148-preview-tools > *:hover { background:#29465c;border-color:#69b9eb; }
@media(max-width:360px) {
  .r10-editor .tg-preview-footer-actions.r148-preview-tools { gap:5px; }
  .r10-editor .tg-preview-footer-actions.r148-preview-tools > * {
    min-height:79px;
    padding:8px 3px;
    font-size:10px;
  }
}
@media(prefers-reduced-motion:reduce) {
  .r10-editor .tg-preview-footer-actions.r148-preview-tools > * { transition:none; }
}
