#bot-studio { --tg-blue: #3390ec; --tg-line: #e4e9ed; --tg-muted: #8797a4; }
.studio-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.studio-toolbar p { color:#6f8075; font-size:12px; margin:6px 0 0; }
.studio-status { display:flex; gap:7px; align-items:center; color:#42624d; font-size:12px; }
.studio-status i { width:7px; height:7px; border-radius:50%; background:#65a66c; }
.studio-mode { display:flex; border:1px solid #d9e2d5; background:#eaf0e5; padding:4px; border-radius:10px; flex-shrink:0; }
.studio-mode button { border:0; background:transparent; color:#6b7c66; border-radius:7px; padding:10px 17px; font-size:12px; }
.studio-mode button.selected { background:white; color:#254e3c; box-shadow:0 1px 5px #1e382012; font-weight:600; }
.studio-layout { display:grid; grid-template-columns:240px minmax(0,1fr); gap:0; border:1px solid #dce3dc; border-radius:16px; overflow:hidden; background:white; box-shadow:0 12px 40px #244b2b07; }
.studio-scenes { background:#fff; padding:22px 14px; border-right:1px solid var(--tg-line); }
.studio-scenes-title { font-size:10px; letter-spacing:1px; color:#8b9a8a; padding:0 12px; margin-bottom:15px; }
.studio-scenes>button { width:100%; display:flex; align-items:center; gap:12px; border:0; border-radius:10px; padding:16px 12px; margin-bottom:6px; background:transparent; text-align:left; color:#60735e; }
.studio-scenes>button:hover { background:#f3f7f0; }
.studio-scenes>button.active { background:#eaf3e0; color:#244f35; }
.studio-scenes>button span { flex:1; font-size:13px; font-weight:600; }
.studio-scenes>button small { display:block; font-size:10px; color:#8a9982; font-weight:400; margin-top:6px; }
.studio-scenes>button>.icon:last-child { width:15px; color:#91a28b; }
.studio-guide { border-top:1px solid #e7ece3; margin:24px 12px 0; padding-top:22px; font-size:11px; color:#7e8d76; line-height:1.8; }
.studio-guide strong { font-size:12px; color:#5f7655; }.studio-guide p { margin-top:9px; }
.studio-chat { min-width:0; display:flex; flex-direction:column; background:#dbe8d4; }
.studio-chat-head { background:#fff; min-height:80px; display:flex; align-items:center; gap:12px; padding:16px 24px; border-bottom:1px solid #dfe6df; }
.studio-chat-head strong { display:block; font-size:14px; color:#263c49; }.studio-chat-head small { display:block; margin-top:5px; font-size:11px; color:#8d9da4; }
.studio-head-back { display:none; background:none; border:0; color:#7a949c; }
.studio-avatar { width:43px; height:43px; border-radius:50%; background:linear-gradient(145deg,#6cbae9,#3e9dd4); display:grid; place-items:center; color:white; flex-shrink:0; }.studio-avatar .icon { width:23px; height:23px; }
.studio-simulated { margin-left:auto; border:1px solid #e7edf1; color:#90a3af; font-size:10px; border-radius:5px; padding:4px 7px; }
.studio-conversation { min-height:540px; max-height:740px; overflow:auto; padding:26px 32px 36px; background-color:#dce8d6; background-image:radial-gradient(#b9cdb355 1px,transparent 1px),linear-gradient(135deg,#e7eddd99,transparent); background-size:23px 23px,100% 100%; }
.studio-date { width:max-content; margin:0 auto 23px; color:#fff; background:#8da37e77; padding:5px 14px; border-radius:20px; font-size:10px; }
.studio-user { margin:0 0 24px auto; max-width:80%; width:max-content; background:#efffdf; padding:12px 14px; border-radius:13px 13px 3px 13px; color:#365442; font-size:12px; box-shadow:0 1px 1px #456b2512; }.studio-user span { font-size:10px; color:#88b56c; margin-left:18px; }
.studio-message-wrap { max-width:510px; }.studio-message { background:white; border-radius:12px 12px 12px 3px; overflow:hidden; box-shadow:0 1px 2px #31483118; color:#304450; }
.studio-message.editable { outline:2px solid transparent; transition:outline-color .15s; }.studio-message.editable:hover { outline-color:#77a9d9; }
.studio-message-text { display:block; border:0; background:transparent; width:100%; text-align:left; font-size:13px; line-height:1.9; color:#304450; padding:17px 19px 7px; white-space:pre-wrap; overflow-wrap:anywhere; }.studio-message-text.static { padding-bottom:8px; }
.studio-edit-hint { display:flex; align-items:center; gap:5px; margin-top:16px; border-top:1px dashed #e5eaf0; padding-top:10px; font-size:10px; color:#91a8b7; white-space:normal; }.studio-edit-hint .icon { width:12px; height:12px; }
.studio-picture { position:relative; display:block; width:100%; border:0; background:#f3f6fa; padding:0; }.studio-picture img,.studio-static-picture { width:100%; max-height:270px; object-fit:contain; display:block; }.studio-picture-edit { position:absolute; bottom:10px; right:10px; background:#263b4f99; color:white; font-size:10px; border-radius:6px; padding:6px 9px; }.studio-picture-edit .icon { width:12px; height:12px; }
.studio-time { font-size:9px; color:#a1adb2; text-align:right; padding:2px 13px 9px; }.studio-time span { color:#79a774; margin-left:5px; }
.studio-keyboard { display:grid; grid-template-columns:1fr; gap:5px; margin-top:5px; }.studio-keyboard.two { grid-template-columns:repeat(2,minmax(0,1fr)); }.studio-keyboard .wide { grid-column:1/-1; }
.studio-keyboard button { background:#83a57a88; color:white; padding:13px 10px; border-radius:6px; border:1px solid transparent; font-size:12px; min-width:0; overflow-wrap:anywhere; }.studio-keyboard button:hover { background:#638e65b8; border-color:#47734266; }
.studio-add { display:block; width:100%; background:#ffffff55; color:#567a55; border:1px dashed #799a6f88; border-radius:7px; font-size:11px; padding:11px; margin-top:9px; }.studio-add:hover { background:#ffffff99; }
.studio-message.instruction { padding:15px 18px; max-width:510px; font-size:12px; line-height:1.9; white-space:pre-wrap; margin-bottom:13px; }
.studio-empty { text-align:center; font-size:11px; color:#738369; margin:13px 0; }
.studio-template-tools { display:flex; gap:8px; margin-top:15px; }
.studio-footnote { font-size:11px; line-height:1.9; color:#6e8668; max-width:510px; margin-top:23px; background:#ffffff66; border-radius:8px; padding:12px 14px; }
.studio-compose { display:flex; align-items:center; gap:14px; padding:16px 22px; background:#f8faf6; border-top:1px solid #d9e3d1; font-size:10px; color:#98a493; }.studio-restart { padding:9px 13px; border:1px solid #dae3d4; border-radius:7px; background:white; color:#617d57; font-size:11px; flex-shrink:0; }.studio-compose-send { font-size:24px; color:#83ab70; margin-left:auto; }.studio-compose a { margin-left:auto; }
#studio-form [hidden] { display:none !important; }#studio-photo { width:100%; min-width:0; }#studio-photo-preview { max-width:100%; max-height:220px; object-fit:contain; border-radius:10px; display:block; margin:14px auto; }.studio-template-choices { max-height:350px; overflow:auto; margin-bottom:18px; }.studio-template-choices small { font-size:10px; color:#a58b63; }.studio-external { overflow-wrap:anywhere; }
.studio-invite { display:flex; justify-content:space-between; align-items:center; gap:20px; background:#eaf3df; border:1px solid #d5e5c7; border-radius:12px; padding:19px 23px; margin-bottom:24px; }.studio-invite strong { display:block; font-size:14px; color:#38572b; }.studio-invite p { font-size:12px; color:#75876a; margin:6px 0 0; }.studio-invite a { flex-shrink:0; }
@media(max-width:1180px) { .studio-layout { grid-template-columns:200px minmax(0,1fr); }.studio-conversation { padding:24px 20px; }.studio-scenes { padding:20px 10px; }.studio-scenes>button { padding:14px 8px; gap:8px; }.studio-scenes>button span { font-size:12px; } }
@media(max-width:850px) { .studio-layout { grid-template-columns:1fr; }.studio-scenes { display:flex; overflow-x:auto; padding:10px; gap:6px; border-right:0; border-bottom:1px solid var(--tg-line); }.studio-scenes-title,.studio-guide,.studio-scenes>button small,.studio-scenes>button>.icon:last-child { display:none; }.studio-scenes>button { width:auto; flex-shrink:0; margin:0; padding:12px; }.studio-scenes>button>.icon { width:16px; }.studio-chat-head { padding:15px 18px; }.studio-conversation { min-height:480px; }.studio-head-back { display:block; }.studio-toolbar { flex-wrap:wrap; }.studio-toolbar p { font-size:11px; } }
@media(max-width:560px) { .studio-mode { width:100%; }.studio-mode button { flex:1; padding:10px 8px; }.studio-chat-head { padding:14px 11px; gap:8px; }.studio-chat-head strong { font-size:12px; }.studio-chat-head small { font-size:9px; line-height:1.6; }.studio-avatar { width:33px; height:33px; }.studio-simulated { display:none; }.studio-conversation { padding:20px 13px 26px; min-height:430px; max-height:650px; }.studio-message-text { font-size:12px; padding:14px 14px 7px; }.studio-keyboard button { font-size:11px; padding:12px 6px; }.studio-compose { flex-wrap:wrap; padding:13px; gap:9px; }.studio-compose>span:not(.studio-compose-send) { font-size:9px; }.studio-invite { flex-direction:column; align-items:flex-start; padding:17px; }.studio-message.instruction { font-size:11px; }.studio-scenes>button { padding:10px; }.studio-scenes>button span { font-size:11px; } }

/* Keep the preview at a real phone width on every desktop screen. */
.studio-layout { grid-template-columns:220px minmax(0,1fr); gap:36px; padding:25px; border-radius:20px; overflow:visible; background:#eef2ea; box-shadow:none; align-items:start; }
.studio-scenes { border:1px solid #dde6d6; border-radius:14px; padding:20px 12px; }
.studio-device { width:390px; max-width:100%; height:760px; justify-self:center; display:flex; flex-direction:column; border:7px solid #293d40; border-radius:39px; overflow:hidden; background:#fff; box-shadow:0 18px 40px #213c3820,0 0 0 1px #a9b8af; }
.studio-phone-status { display:flex; align-items:center; justify-content:space-between; min-height:32px; padding:7px 22px 0; background:#fff; color:#263c48; font-size:11px; font-weight:600; position:relative; }
.studio-phone-camera { position:absolute; left:50%; top:8px; transform:translateX(-50%); width:70px; height:17px; background:#26393c; border-radius:12px; }
.studio-phone-signals svg { display:block; width:43px; height:15px; }
.studio-phone-home { flex-shrink:0; background:#f8faf6; padding:6px 0 9px; display:flex; justify-content:center; }
.studio-phone-home i { display:block; width:100px; height:4px; background:#273c43; border-radius:4px; }
.studio-device .studio-chat { flex:1; min-height:0; }
.studio-device .studio-chat-head { padding:13px 12px; gap:9px; min-height:68px; flex-shrink:0; }
.studio-device .studio-chat-head strong { font-size:13px; }
.studio-device .studio-chat-head small { font-size:10px; margin-top:4px; }
.studio-device .studio-avatar { width:35px; height:35px; }
.studio-device .studio-avatar .icon { width:20px; height:20px; }
.studio-device .studio-head-back { display:flex; align-items:center; justify-content:center; padding:5px; min-width:32px; min-height:44px; }
.studio-device .studio-simulated { margin-left:auto; font-size:9px; padding:3px 5px; }
.studio-device .studio-conversation { flex:1; min-height:0; max-height:none; padding:18px 12px 25px; overscroll-behavior:contain; scrollbar-width:thin; }
.studio-device .studio-user { font-size:12px; margin-bottom:18px; }
.studio-device .studio-message-text { font-size:13px; line-height:1.85; padding:15px 14px 6px; }
.studio-device .studio-edit-hint { font-size:10px; margin-top:12px; }
.studio-device .studio-date { margin-bottom:19px; }
.studio-device .studio-message-wrap { max-width:100%; }
.studio-device .studio-keyboard button { min-height:44px; padding:11px 7px; font-size:12px; }
.studio-device .studio-add { min-height:44px; }
.studio-device .studio-picture img,.studio-device .studio-static-picture { max-height:230px; }
.studio-device .studio-message.instruction { font-size:12px; padding:13px 14px; }
.studio-device .studio-compose { flex-shrink:0; padding:11px 10px; gap:9px; flex-wrap:wrap; }
.studio-device .studio-restart { min-height:40px; padding:8px 10px; font-size:11px; }
.studio-device .studio-compose>span:not(.studio-compose-send) { font-size:9px; }
.studio-device .studio-compose a { font-size:11px; }
.studio-device .studio-compose-send { font-size:22px; }
.studio-mobile-picker { display:none; }
@media(max-width:1180px) { .studio-layout { grid-template-columns:180px minmax(0,1fr); padding:20px; gap:20px; }.studio-scenes>button { padding:14px 8px; }.studio-scenes>button>.icon:last-child { display:none; } }
@media(max-width:1000px) {
  .studio-layout { grid-template-columns:1fr; background:transparent; border:0; padding:0; }
  .studio-scenes { display:none; }
  .studio-toolbar { flex-wrap:wrap; }
  .studio-mobile-picker { display:flex; align-items:center; gap:10px; width:100%; font-size:11px; color:#6f8369; margin-top:4px; }
  .studio-mobile-picker select { flex:1; width:0; min-width:0; max-width:280px; font-size:13px; min-height:44px; border:1px solid #d8e3d1; background:#fff; border-radius:8px; padding:8px 11px; color:#345839; }
  .studio-mobile-picker a { margin-left:auto; white-space:nowrap; font-size:11px; }
}
@media(max-width:560px) {
  body.studio-page .layout>.sidebar,body.studio-page .topbar { display:none; }
  body.studio-page .layout>.main { margin-left:0; width:100%; }
  body.studio-page .content { padding:14px 0 0; }
  body.studio-page .page-head { margin:0 15px 11px; }
  body.studio-page .page-head .eyebrow,body.studio-page .page-head p { display:none; }
  body.studio-page .page-head h1 { font-size:18px; letter-spacing:0; margin:0; }
  .studio-toolbar { padding:0 12px; gap:10px; margin-bottom:10px; }
  .studio-toolbar>div:first-child { display:none; }
  .studio-mode button { min-height:42px; font-size:13px; }
  .studio-mobile-picker { gap:8px; margin:0; }
  .studio-mobile-picker select { max-width:none; font-size:16px; }
  .studio-device { width:100%; height:calc(100vh - 176px); height:calc(100dvh - 176px); min-height:420px; max-height:900px; border:0; border-radius:0; box-shadow:none; }
  .studio-phone-status,.studio-phone-home { display:none; }
  .studio-device .studio-chat-head { border-top:1px solid #dfe6df; min-height:67px; padding:10px 12px; }
  .studio-device .studio-chat-head strong { font-size:14px; }
  .studio-device .studio-chat-head small { font-size:11px; }
  .studio-device .studio-conversation { padding:18px 13px 24px; }
  .studio-device .studio-message-text { font-size:14px; }
  .studio-device .studio-keyboard button { font-size:13px; min-height:46px; }
  .studio-device .studio-compose { padding:9px 12px max(9px,env(safe-area-inset-bottom)); }
  body.studio-page #modal { width:100%; max-width:100%; max-height:92vh; max-height:92dvh; margin:auto auto 0; border-radius:20px 20px 0 0; }
  body.studio-page #modal .modal-body { padding:18px; }
  body.studio-page #modal .modal-head { padding:18px; }
  body.studio-page #modal input:not([type=checkbox]),body.studio-page #modal textarea,body.studio-page #modal select { font-size:16px; min-height:44px; }
  body.studio-page #modal button { min-height:44px; }
  body.studio-page #modal .modal-actions { bottom:0; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
}

/* Show complete messages and keyboards, then fit the whole phone to the viewport. */
body.studio-page .topbar { height:54px; }
body.studio-page .content { padding-top:16px; padding-bottom:16px; }
body.studio-page .page-head { margin-bottom:12px; }
body.studio-page .page-head .eyebrow,body.studio-page .page-head p { display:none; }
body.studio-page .page-head h1 { font-size:21px; margin-bottom:0; }
.studio-toolbar { margin-bottom:12px; }
.studio-toolbar p { display:none; }
.studio-layout { padding:12px; gap:24px; }
.studio-scenes { padding:14px 10px; }
.studio-scenes>button { padding-top:12px; padding-bottom:12px; }
.studio-guide { display:none; }
.studio-preview-area { min-width:0; display:flex; justify-content:center; align-items:flex-start; }
.studio-device-stage { width:390px; position:relative; flex-shrink:0; }
.studio-device-stage .studio-device { position:absolute; top:0; left:0; height:auto; min-height:0; max-height:none; max-width:none; transform-origin:top left; }
.studio-device .studio-chat { flex:none; }
.studio-device .studio-conversation { flex:none; height:auto; min-height:0; max-height:none; overflow:visible; overscroll-behavior:auto; padding:12px 12px 16px; }
.studio-device .studio-user { margin-bottom:12px; }
.studio-device .studio-date { margin-bottom:12px; }
.studio-device .studio-picture img,.studio-device .studio-static-picture { max-height:170px; }
.studio-device .studio-edit-hint { margin-top:8px; padding-top:7px; }
.studio-device .studio-footnote { margin-top:12px; padding:9px 12px; }
@media(max-height:720px) and (min-width:1001px) {
  .studio-scenes>button { padding:9px; }
  .studio-scenes>button small { display:none; }
  .studio-scenes-title { margin-bottom:10px; }
}
@media(max-width:1000px) { .studio-layout { padding:0; } }
@media(max-width:560px) {
  body.studio-page .content { padding-top:10px; padding-bottom:0; }
  body.studio-page .page-head h1 { font-size:17px; }
  .studio-toolbar { margin-bottom:8px; }
  .studio-mobile-picker { gap:8px; }
  .studio-device .studio-chat-head { min-height:61px; padding-top:7px; padding-bottom:7px; }
  .studio-device .studio-picture img,.studio-device .studio-static-picture { max-height:145px; }
}
