/* The shell owns the two stable rows; only main content scrolls. */
.shell>.top,.shell.thread-open>.top,.shell:has(.messenger.open)>.top{display:flex!important;flex:none!important;position:relative;min-height:54px!important;height:54px;box-sizing:border-box;padding:3px 8px!important;gap:6px!important;z-index:20}
.shell>.bottom,.shell.thread-open>.bottom,.shell:has(.messenger.open)>.bottom{display:flex!important;flex:none!important;position:relative;min-height:66px!important;box-sizing:border-box;z-index:20}
.shell>#main{flex:1!important;min-height:0!important;overflow:auto}
.shell>.legal-footer{display:none}
.top #brand{flex:1;min-width:0;gap:5px!important}.top #brand img{width:26px!important;height:26px!important}.top #brand .brand-wordmark{font-size:18px!important}.top #brand .brand-tagline{font-size:9px!important;white-space:nowrap}
.top .header-actions{flex:none}.demo-ad-window{flex:none;width:82px;height:44px;display:grid;grid-template-columns:30px 1fr;align-items:center;gap:3px;border:1px solid #c4d7bd;border-radius:9px;background:#f0f7e8;padding:3px;color:#244536;text-decoration:none;overflow:hidden;font:10px system-ui}
.demo-ad-window img{width:30px;height:30px;object-fit:cover;border-radius:5px}.demo-ad-window span{overflow:hidden}.demo-ad-window b{display:block;font-size:10px}.demo-ad-window small{font-size:8px!important;display:block}
html.demo-phone-reserve body{box-sizing:border-box;padding-top:28px!important;padding-bottom:34px!important;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
html.demo-phone-reserve body>aside{flex:none;padding:3px!important;font:10px system-ui!important}
html.demo-phone-reserve .shell{height:auto!important;flex:1!important;min-height:0!important}
html.demo-phone-reserve body::before,html.demo-phone-reserve body::after{position:fixed;left:0;right:0;z-index:9999;background:#e4eae6;color:#263c30;text-align:center;font:11px system-ui;box-sizing:border-box;pointer-events:none}
html.demo-phone-reserve body::before{content:'Область Android · время  /  Wi-Fi  /  батарея';height:28px;top:0;padding:6px}
html.demo-phone-reserve body::after{content:'Демо Димон · область Android · ◁  ○  □';height:34px;bottom:0;padding:8px}
@media(max-width:359px){.demo-ad-window{width:66px;grid-template-columns:24px 1fr}.demo-ad-window img{width:24px;height:26px}.top #brand img{display:none}.top #brand .brand-wordmark{font-size:16px!important}}
@media(max-height:430px){.shell>.top{min-height:48px!important;height:48px}.shell>.bottom{min-height:52px!important}.demo-ad-window{height:38px}}

html.demo-phone-reserve [data-demo-shell-status]{flex:none;font-size:9px!important;line-height:1.2;margin:3px!important;max-height:24px;overflow:auto}

.shell>.top,.shell.thread-open>.top,.shell:has(.messenger.open)>.top{max-height:54px!important;align-items:center!important}

/* Compact rows with 44px touch targets retained. */
.shell>.top,.shell.thread-open>.top,.shell:has(.messenger.open)>.top{height:44px!important;min-height:44px!important;max-height:44px!important;margin-top:0!important;padding:0 6px!important}
.top #brand .brand-wordmark{font-size:16px!important}.top #brand .brand-tagline{font-size:8px!important}.top #brand img{width:24px!important;height:24px!important}
.shell .chat-head{height:44px!important;min-height:44px!important;max-height:44px!important;padding:0 5px!important;gap:4px!important;flex:none}
.shell .chat-head .avatar{width:26px!important;height:26px!important}.shell .chat-head strong{font-size:16px!important}.shell .chat-head button{min-height:44px!important;height:44px!important;min-width:40px!important}
.shell .chat-head>div{min-height:0!important}.shell .chat-head small:empty{display:none}
#sendForm.message-form{padding:3px 4px!important;gap:2px!important}body #sendForm.message-form #messageInput{min-height:38px!important;height:38px!important;padding:6px 9px!important}
#syncStatus:empty,.sync-status:empty{display:none!important}.demo-ad-window{height:38px}

.shell>.bottom,.shell.thread-open>.bottom,.shell:has(.messenger.open)>.bottom{height:52px!important;min-height:52px!important;max-height:52px!important;padding:0 3px!important;gap:1px!important;align-items:center}
.shell>.bottom button{height:48px!important;min-height:44px!important;padding:2px!important;margin:0!important}.shell>.bottom small{font-size:10px!important;line-height:1.1!important}.shell>.bottom .nav-icon{width:20px;height:20px}
.shell>#offlineBanner{font-size:10px!important;line-height:16px!important;height:18px!important;max-height:18px!important;padding:1px 5px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#syncStatus:not(:empty){font-size:10px!important;line-height:14px!important;padding:1px 5px!important;min-height:0!important;margin:0!important}

/* Keep diagnostic labels outside the simulated phone's usable surface. */
html.demo-phone-reserve body>aside{display:none!important}
html.demo-phone-reserve [data-demo-shell-status]{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
.shell .chat-head button.avatar{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;max-width:32px!important;max-height:32px!important;flex:0 0 32px!important;font-size:14px!important;padding:0!important}
.shell .chat-head button.avatar img{width:32px!important;height:32px!important;object-fit:cover}

/* Conversation composer proportions from the owner's reference; OS keyboard stays native. */
.shell .chat-head strong{font-size:20px!important;line-height:1.15!important}
#sendForm.message-form{position:relative;display:grid!important;grid-template-columns:36px minmax(0,1fr) 36px 36px 48px!important;align-items:center!important;gap:0!important;min-height:54px!important;padding:3px 4px!important;background:transparent!important;isolation:isolate}
#sendForm.message-form::before{content:'';position:absolute;left:4px;right:56px;top:3px;bottom:3px;border-radius:26px;background:#fff;z-index:-1}
#sendForm.message-form #messageInput{grid-column:2!important;grid-row:1!important;order:unset!important;width:100%!important;border:0!important;background:transparent!important;box-shadow:none!important;font-size:20px!important;line-height:1.3!important;min-height:44px!important;height:44px!important;padding:7px 2px!important}
#sendForm.message-form>button{grid-row:1!important;order:unset!important;justify-self:center;min-height:44px!important;height:44px!important;min-width:36px!important;width:36px!important;padding:4px!important;background:transparent!important;color:#5c6669!important;border:0!important}
#sendForm.message-form #chatEmoji{grid-column:1!important}#sendForm.message-form #attachFile{grid-column:3!important}#sendForm.message-form #cameraCapture{grid-column:4!important}
#sendForm.message-form #recordVoice,#sendForm.message-form button[type=submit]{grid-column:5!important;width:46px!important;height:46px!important;min-width:46px!important;border-radius:50%!important;background:#1aa763!important;color:white!important;margin-left:4px!important}

.shell .top>a.demo-ad-window{display:grid!important;grid-template-columns:26px minmax(0,1fr)!important;width:82px!important;min-width:82px!important;max-width:82px!important;flex:0 0 82px!important;min-height:36px!important;max-height:36px!important;height:36px!important;padding:2px!important;font:9px system-ui!important;box-sizing:border-box!important;white-space:normal!important;visibility:visible!important}
.shell .top>a.demo-ad-window img{width:26px!important;height:26px!important}.shell .top>a.demo-ad-window span{display:block!important;min-width:0}.shell .top>a.demo-ad-window small{display:block!important;font-size:8px!important;line-height:1.1!important}.shell .top>a.demo-ad-window b{display:block!important;font-size:10px!important;line-height:1.1!important}

/* Owner review: reduce only call contact search height. */
.shell input[data-call-search],.call-picker input[aria-label='Поиск собеседника']{height:38px!important;min-height:38px!important;max-height:38px!important;padding:5px 10px!important;line-height:24px!important;font-size:16px!important;box-sizing:border-box!important;border-radius:10px;}

/* Owner review: wider ad, unchanged height. */
.shell .top>a.demo-ad-window{width:112px!important;min-width:112px!important;max-width:112px!important;flex-basis:112px!important;grid-template-columns:26px minmax(0,1fr)!important;}

.shell .call-page-head .call-search-link{display:grid;place-items:center;width:40px;height:40px;min-height:40px;padding:6px;box-sizing:border-box;color:#263b31;text-decoration:none;flex:none}.call-search-link svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2}.call-recent-heading{margin-top:8px!important;font-size:14px!important;color:#69736d}.shell input[data-call-search][hidden]{display:none!important;}

/* Owner review: compact heights and wider promotion photo; demo only. */
.shell .top>a.demo-ad-window{width:140px!important;min-width:140px!important;max-width:140px!important;flex-basis:140px!important;grid-template-columns:50px minmax(0,1fr)!important;height:36px!important}
.shell .top>a.demo-ad-window img{width:50px!important;height:26px!important;object-fit:cover!important}
.shell .top>a.demo-ad-window small{color:#c52338!important;font-size:11px!important;font-weight:700!important}
.shell .top>a.demo-ad-window b{font-size:10px!important}
.shell .chat-head{height:40px!important;min-height:40px!important;max-height:40px!important}.shell .chat-head button{height:40px!important;min-height:40px!important}.shell .chat-head .avatar{width:28px!important;height:28px!important}
.shell #threadSearch{height:34px!important;min-height:34px!important;max-height:34px!important;padding:4px 10px!important;box-sizing:border-box!important;font-size:16px!important;margin:0!important}
.shell #starFilter{height:34px!important;min-height:34px!important;padding:3px!important}
.shell>.bottom,.shell.thread-open>.bottom,.shell:has(.messenger.open)>.bottom{height:44px!important;min-height:44px!important;max-height:44px!important}
.shell>.bottom button{height:42px!important;min-height:40px!important}.shell>.bottom .nav-icon{width:19px;height:19px}
.demo-keyboard-preview{flex:0 0 260px;height:260px;max-height:45dvh;min-height:0;box-sizing:border-box;padding:5px;background:#e1e4e8;display:flex;flex-direction:column;gap:4px;overflow:hidden;z-index:50}
.demo-keyboard-preview[hidden]{display:none!important}.demo-keyboard-preview>div:first-child{display:flex;align-items:center;justify-content:space-between;flex:none;height:22px}.demo-keyboard-preview small{font:10px system-ui;color:#394650}.demo-keyboard-preview button{min-height:0!important;min-width:0!important;padding:2px!important;margin:0!important;border:0!important;border-radius:5px!important;background:#fff!important;color:#172327!important;font:18px system-ui!important;box-shadow:0 1px 2px #0003}
.demo-keyboard-preview>div:first-child button{font-size:11px!important;padding:3px 8px!important}.demo-key-row{display:flex;flex:1;min-height:0;gap:4px}.demo-key-row>button{flex:1}

.shell .thread-tools{height:36px!important;min-height:36px!important;max-height:36px!important;padding:1px 8px!important;gap:4px!important;box-sizing:border-box!important;align-items:center!important;flex:none!important;}

body #sendForm.message-form textarea#messageInput{height:var(--demo-message-height,38px)!important;min-height:38px!important;max-height:96px!important;resize:none!important;line-height:24px!important;overflow-y:auto!important;box-sizing:border-box!important;font-family:inherit!important;font-size:20px!important;border-radius:24px!important;width:100%;grid-column:2!important;}

/* Owner review: more history above the desktop keyboard preview. */
.demo-keyboard-preview{flex-basis:190px;height:190px;max-height:33dvh;gap:3px;padding:4px}
.demo-keyboard-preview button{font-size:16px!important}
body .shell #sendForm.message-form{min-height:42px!important;padding:2px 4px!important;grid-template-columns:32px minmax(0,1fr) 32px 32px 40px!important}
body .shell #sendForm.message-form textarea#messageInput{height:var(--demo-message-height,32px)!important;min-height:32px!important;max-height:84px!important;padding:4px 2px!important;line-height:24px!important}
body .shell #sendForm.message-form>button{height:36px!important;min-height:36px!important;width:32px!important;min-width:32px!important;padding:3px!important}
body .shell #sendForm.message-form #recordVoice,body .shell #sendForm.message-form button[type=submit]{height:38px!important;min-height:38px!important;width:38px!important;min-width:38px!important;margin-left:2px!important}
#sendForm.message-form::before{right:46px;top:2px;bottom:2px}

/* Owner review: compact inbox only; accepted keyboard/composer unchanged. */
.shell .inbox #chatSearch{height:32px!important;min-height:32px!important;max-height:32px!important;padding:4px 10px!important;box-sizing:border-box!important}
.shell .inbox .chat-row{min-height:58px!important;padding:9px 10px!important;gap:10px!important}
.shell .inbox .chat-row>.avatar{width:40px!important;height:40px!important;flex-basis:40px!important}
.shell .inbox .chat-filters button{min-height:28px!important;height:28px!important;padding:3px 9px!important;font-size:12px!important;line-height:20px!important}

/* Explicit owner request21Oct: search icon and compact inbox filters only. */
.shell .inbox #chatSearch[hidden]{display:none!important}
.shell .inbox .chat-filters{display:flex!important;flex-wrap:nowrap!important;gap:3px!important;overflow:visible!important}
.shell .inbox .chat-filters button{font-size:11px!important;min-width:0!important;min-height:26px!important;height:26px!important;line-height:18px!important;padding:3px 6px!important;flex:0 0 auto!important}
.shell .inbox #demoInboxSearchToggle{min-width:32px!important;width:32px!important;padding:4px!important}

.shell .inbox:has(#chatSearch:not([hidden])) .inbox-list{flex:0 0 auto!important;min-height:0!important;overflow:visible!important}

/* Owner request: Stories controls one third shorter, no changes to chat geometry. */
[data-demo-feed="stories"] #newPost{height:32px!important;min-height:32px!important;padding:4px 10px!important;font-size:13px!important;line-height:22px!important}
[data-demo-feed="stories"] .feed-search-details>summary{min-height:32px!important;padding:6px 10px!important;font-size:13px!important;line-height:20px!important}
[data-demo-feed="stories"] #searchForm input,[data-demo-feed="stories"] #searchForm select,[data-demo-feed="stories"] #searchForm button{height:32px!important;min-height:32px!important;padding:4px 8px!important;font-size:13px!important;box-sizing:border-box!important}

/* Keep the simulated Android bars visible around Stories-only dialogs. */
html.demo-phone-reserve dialog[data-demo-story-image-editor]::backdrop,html.demo-phone-reserve dialog[data-demo-story-preview]::backdrop{background:linear-gradient(to bottom,transparent 0 28px,rgba(0,0,0,.38) 28px calc(100% - 34px),transparent calc(100% - 34px) 100%)}
html.demo-phone-reserve dialog[data-demo-story-image-editor]::backdrop,html.demo-phone-reserve dialog[data-demo-story-preview]::backdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body:has(dialog[data-demo-story-image-editor][open]) #modal{visibility:hidden}
body:has(dialog[data-demo-story-image-editor][open]) #modal::backdrop{visibility:hidden}

html.demo-phone-reserve dialog[data-demo-story-versions]::backdrop{background:linear-gradient(to bottom,transparent 0 28px,rgba(0,0,0,.38) 28px calc(100% - 34px),transparent calc(100% - 34px) 100%);backdrop-filter:none!important}
body:has(dialog[data-demo-story-versions][open]) #modal,body:has(dialog[data-demo-story-versions][open]) #modal::backdrop{visibility:hidden}

/* Stories form only: leave the simulated Android system bands unobscured. */
html.demo-phone-reserve #modal:has([data-demo-story-form]){box-sizing:border-box!important;width:calc(100% - 24px)!important;max-width:560px!important;max-height:calc(100dvh - 80px)!important;height:auto!important;margin:auto!important;overflow-y:auto!important}
html.demo-phone-reserve #modal:has([data-demo-story-form])::backdrop{background:linear-gradient(to bottom,transparent 0 28px,rgba(0,0,0,.38) 28px calc(100% - 34px),transparent calc(100% - 34px) 100%)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

/* The page behind an open Stories dialog must not add a second scroll rail. */
html.demo-phone-reserve body:has(#modal[open] [data-demo-story-form]) .shell>#main{overflow:hidden!important}
/* Poll editor reserves the same simulated OS bands; chat/keyboard sizes stay fixed. */
html.demo-phone-reserve #modal:has(#pollCreateRoot){box-sizing:border-box!important;width:calc(100% - 24px)!important;max-width:560px!important;max-height:calc(100dvh - 80px)!important;height:auto!important;margin:auto!important;overflow-y:auto!important}
html.demo-phone-reserve #modal:has(#pollCreateRoot)::backdrop{background:linear-gradient(to bottom,transparent 0 28px,rgba(0,0,0,.38) 28px calc(100% - 34px),transparent calc(100% - 34px) 100%)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html.demo-phone-reserve body:has(#modal[open] #pollCreateRoot) .shell>#main{overflow:hidden!important}
html.demo-phone-reserve:has(#modal[open] #pollCreateRoot),html.demo-phone-reserve body:has(#modal[open] #pollCreateRoot){overflow:hidden!important}
html.demo-phone-reserve body:has(#modal[open] #pollCreateRoot) #messages{overflow:hidden!important}

/* Owner request 29.10: compact Find row, preserve accepted brand/promo/peer geometry. */
.shell .inbox #demoFindPerson{height:32px!important;min-height:32px!important;max-height:32px!important;padding:3px 10px!important;box-sizing:border-box!important}
