/* Messenger preview has its own palette, independent of the builder's mint controls. */
.ws-device{--tg-surface:#fff;--tg-text:#17212b;--tg-sub:#82909d;--tg-blue:#248bda;--tg-wall:#dce7d6;--tg-in:#fff;--tg-out:#e2ffc7;--tg-border:#d8dfe5;--tg-input:#f0f2f5;color:var(--tg-text)}
.ws-device.phone{width:100%;max-width:334px;height:650px;position:relative;top:auto;padding:8px!important;border:3px solid #42464c!important;border-radius:46px!important;background:#111317!important;box-shadow:0 20px 38px #0003,0 0 0 1px #0008,inset 0 0 0 2px #060708;overflow:visible;margin:20px auto 24px;display:block}
.ws-device.phone:before,.ws-device.phone:after{content:'';position:absolute;background:#373b40;border-radius:3px;width:3px;left:-5px;top:111px;height:44px}.ws-device.phone:after{left:auto;right:-5px;top:154px;height:66px}
.ws-screen{display:flex;flex-direction:column;overflow:hidden;background:var(--tg-surface);height:100%;min-height:0;border-radius:35px}
.ws-device.pc .ws-screen{border-radius:10px}.ws-device.pc{background:var(--tg-surface);border-color:var(--tg-border)}
.tg-status{height:48px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:5px 20px 0;position:relative;background:var(--tg-surface);font-size:12px;color:var(--tg-text)}.tg-island{position:absolute;left:50%;transform:translateX(-50%);top:10px;width:88px;height:25px;border-radius:20px;background:#0b0c0e}.tg-indicators{display:flex;gap:5px;align-items:center;font-size:11px;letter-spacing:-1px}.tg-indicators svg{width:15px;height:14px;fill:var(--tg-text);stroke:var(--tg-text);stroke-width:1.8;stroke-linecap:round}.tg-indicators svg path{fill:none}.tg-battery{height:10px;width:19px;border:1px solid currentColor;border-radius:3px;position:relative}.tg-battery:before{content:'';position:absolute;inset:1px;background:currentColor;border-radius:1px}.tg-battery:after{content:'';position:absolute;right:-3px;top:2px;width:2px;height:4px;background:currentColor;border-radius:1px}
.ws-device .ws-chat-head{padding:10px 10px 12px;gap:8px;background:var(--tg-surface)!important;border-color:var(--tg-border);min-height:65px;flex-shrink:0;color:var(--tg-text)}.tg-back{font-size:35px;line-height:30px;color:var(--tg-blue);font-weight:300}.tg-more{font-size:23px;margin-left:auto;color:var(--tg-blue)}.ws-device .avatar{width:36px;height:36px;background:linear-gradient(145deg,#6bc7f2,#258dd7)!important;color:#fff!important}.ws-device .avatar svg{width:21px;height:21px}.tg-contact{min-width:0}.ws-device .ws-chat-head b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;max-width:205px;color:var(--tg-text)}.ws-device .ws-chat-head small{color:var(--tg-sub);font-size:11px;margin-top:3px}
.ws-testing .ws-device.phone .ws-chat-log{height:auto;flex:1;min-height:120px}.ws-device .ws-chat-log{padding:16px 10px;gap:9px;background-color:var(--tg-wall);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%2386a285' stroke-width='1.1' opacity='.2'%3E%3Cpath d='m13 20 14-8-4 17-4-8-6-1zm47 39 13-6-5 15-2-6-6-3M35 72q10-12 16 0t-16 0M71 17l4-5 4 5-2 6h-4zM13 83l3-4 3 4-3 4z'/%3E%3Ccircle cx='47' cy='30' r='6'/%3E%3Cpath d='M5 48q4-6 8 0m0 0q4-6 8 0M84 88l4 4m-4 0 4-4'/%3E%3C/g%3E%3C/svg%3E")}
.ws-device .ws-bubble{background:var(--tg-in)!important;color:var(--tg-text)!important;border-radius:12px 12px 12px 3px;padding:9px 10px 6px;font-size:12px;line-height:1.45;box-shadow:0 1px 2px #0001;max-width:90%;flex-shrink:0}.ws-device .ws-bubble.user{background:var(--tg-out)!important;border-radius:12px 12px 3px 12px;min-width:70px}.ws-device .ws-bubble.note{background:#526d6b75!important;color:white!important;border-radius:12px;padding:5px 9px;box-shadow:none;font-size:10px}.tg-message-time{display:block;text-align:right;font-size:9px;color:var(--tg-sub);margin-top:3px;line-height:12px}.tg-message-time span{color:#58a24b;letter-spacing:-3px;margin-right:3px}.ws-device .ws-chat-buttons{margin:7px -5px 0;gap:4px}.ws-device .ws-chat-buttons button{color:var(--tg-blue);border:1px solid var(--tg-border);border-radius:6px;background:transparent;font-size:11px;padding:8px 6px}.ws-device .ws-chat-buttons button:hover{background:#248bda15}.ws-device .ws-file{color:var(--tg-blue)}
.ws-device #ws-chat-form{background:var(--tg-surface);padding:9px 8px;align-items:center;border-color:var(--tg-border);flex-shrink:0;gap:6px}.tg-attach{color:var(--tg-blue);font-size:25px;font-weight:300;line-height:26px}.ws-device #ws-chat-input{background:var(--tg-input)!important;color:var(--tg-text)!important;border:1px solid var(--tg-border);border-radius:22px;padding:9px 11px;font-size:12px}.ws-device #ws-chat-form button{display:grid;place-items:center;border:0;border-radius:50%;width:32px;height:32px;flex-shrink:0;padding:6px;background:var(--tg-blue);color:#fff}.ws-device #ws-chat-form button svg{width:21px;height:21px}.ws-device .ws-reply{background:var(--tg-input);border-color:var(--tg-border);gap:5px;padding:7px;max-height:130px;overflow:auto;flex-shrink:0}.ws-device .ws-reply button{background:var(--tg-surface);border:1px solid var(--tg-border);color:var(--tg-text);box-shadow:0 1px 1px #0001;font-size:11px;min-width:90px;white-space:normal}.tg-home{height:24px;display:flex;align-items:center;justify-content:center;background:var(--tg-surface);flex-shrink:0}.tg-home span{width:106px;height:4px;background:var(--tg-text);border-radius:5px}
.ws-device .ws-empty{display:flex;flex-direction:column;align-items:center;gap:12px;margin:auto;padding:22px 14px;background:#ffffffd9;border-radius:16px;color:#4f6679;max-width:235px;font-size:12px}.ws-empty .tg-empty-plane{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#2b9fdf;color:white;font-size:27px;transform:rotate(-20deg)}.ws-empty b{color:#213547;font-size:14px}.ws-device .ws-empty button{background:var(--tg-blue);border:0;color:#fff;border-radius:8px;width:100%;padding:9px}
[data-theme=dark] .ws-device{--tg-surface:#17212b;--tg-text:#ecf2f6;--tg-sub:#91a2b2;--tg-blue:#61b1ef;--tg-wall:#101b24;--tg-in:#202e3b;--tg-out:#2b5278;--tg-border:#2c3b49;--tg-input:#253341}[data-theme=dark] .ws-device .ws-empty{background:#202e3be8;color:#afbfcc}[data-theme=dark] .ws-empty b{color:#ecf2f6}[data-theme=dark] .tg-message-time span{color:#80c6ef}
@media(max-width:480px){.ws-device.phone{height:610px;max-width:310px}.ws-test{padding:12px}.ws-device .ws-chat-head b{max-width:175px}.tg-status{padding-left:15px;padding-right:15px}}
/* Let the whole handset be inspected; only the conversation scrolls inside it. */
@media(min-width:1001px){body.ws-testing:not(.ws-test-pc) .mm-workspace{height:auto;min-height:920px}body.ws-testing:not(.ws-test-pc) .mm-left{height:920px}body.ws-testing:not(.ws-test-pc) .ws-test{overflow:visible}}
.bot-lifecycle{padding:14px 18px;border:1px solid var(--line);border-radius:12px;margin-bottom:18px}.broadcast-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,1fr);gap:24px}.message-preview{min-width:0}.message-preview>.row{justify-content:center;gap:8px}.message-preview>.row button{padding:8px 14px}.message-preview .ws-device.pc{width:100%;height:570px;margin:20px 0;border:1px solid var(--line);border-radius:16px;overflow:hidden}.message-preview .ws-device.pc .ws-screen{height:100%;display:flex;flex-direction:column}.preview-compose{display:flex;gap:12px;padding:14px;background:var(--tg-surface);color:var(--tg-blue)}.preview-compose span:nth-child(2){flex:1;border-radius:20px;padding:8px 12px;background:var(--tg-input);color:var(--tg-sub);font-size:12px}.message-preview button:disabled{opacity:1;cursor:default}.message-preview .ws-chat-log{min-height:100px;flex:1}.message-preview .ws-bubble{white-space:pre-wrap;overflow-wrap:anywhere}.message-preview .ws-reply-keyboard{display:grid;gap:5px;padding:8px;background:var(--tg-surface)}.message-preview .ws-reply-keyboard button{color:var(--tg-text);background:var(--tg-input);border-radius:6px}.modal:has(.broadcast-editor){max-width:1100px;width:calc(100vw - 40px)}@media(max-width:800px){.broadcast-editor{grid-template-columns:1fr}.bot-lifecycle .row{flex-wrap:wrap}.editor-layout:has(.message-preview){grid-template-columns:1fr}.message-preview .ws-device.pc{max-width:100%}}
@media(min-width:801px){.editor-layout:has(.message-preview .pc){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}

.broadcast-photo{display:block;max-width:100%;width:100%;max-height:320px;object-fit:contain;border-radius:8px;margin-bottom:10px}
