@media screen and (max-width: 1350px) {
	.section-fullscreen.layout-main {
		grid-template-columns: minmax(0, 70px) minmax(0, 1fr);
	}
	.section-fullscreen.layout-guest {
		grid-template-columns: minmax(0, 1fr);
	}
	#LPU {
		width: calc(100% - 15px);
		margin: 5px 5px 5px 5px;
	}
	#LPD {
		padding: 0 0px;
	}
	#LPD_list,
	#LPD_list_p,
	#LPD_actions,
	#LPD_news {
		padding: 12px;
		background-color: transparent;
		border: 0;
	}
	.LPD_pin > .user_panel-status-dot {
		right: 0px;
		bottom: 0px;
		width: 14px;
		height: 14px;
	}
	#RP {
		grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
	}
	#LA {
        flex: 0 0 auto;
		max-width: 250px;
	}
	#RADR {
        flex: 0 0 auto;
        width: 250px;
    }
	.chat_msg {
		max-width: 100%;
	}
}

/* Mobile panel stack: phone / coarse tablet */
@media (max-width: 900px) {
	html {
		--m-panel-ms: 280ms;
		--mnb-height: calc(56px + env(safe-area-inset-bottom, 0px));
		--m-safe-top: env(safe-area-inset-top, 0px);
		--rau-chrome-height: calc(52px + var(--m-safe-top));
	}

	.section-fullscreen.layout-main {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.section-fullscreen.layout-guest {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	#LP {
		display: none !important;
	}

	#RP {
		margin: 0;
		border-radius: 0;
		border: 0;
		grid-template-columns: minmax(0, 1fr) !important;
		position: relative;
		overflow: hidden;
		width: 100%;
	}

	#LA {
		position: absolute;
		inset: 0;
		z-index: 3;
		max-width: none !important;
		width: 100% !important;
		border-right: 0;
		display: flex;
		flex-direction: column;
		transform: translateX(0);
		transition: transform var(--m-panel-ms) ease;
		will-change: transform;
	}

	#LAM:not([hidden]) {
		display: flex;
	}

	#RA {
		position: absolute;
		inset: 0;
		z-index: 2;
		width: 100%;
		display: flex;
		flex-direction: column;
		min-height: 0;
		transform: translateX(100%);
		transition: transform var(--m-panel-ms) ease;
		will-change: transform;
	}

	/* Chat/content panel must stack above #LA, иначе fixed-шиты в #RA
	   (notes/mentions/pins/…) остаются под #LA из‑за stacking context. */
	html[data-m-panel="radl"] #RA,
	html[data-m-panel="radr"] #RA,
	html[data-chat-open="1"] #RA {
		z-index: 4 !important;
	}
	html[data-m-panel="radl"] #LA,
	html[data-m-panel="radr"] #LA,
	html[data-chat-open="1"] #LA {
		z-index: 1 !important;
	}
	html[data-m-sheet="1"] #RA {
		z-index: 30 !important;
		overflow: visible !important;
	}
	html[data-m-sheet="1"] #LA {
		z-index: 1 !important;
	}
	/* Профиль из MNB: шит внутри #LA — поднять над #RA и снять transform (иначе fixed клипается) */
	html[data-mobile="1"] #LA[data-user-panel-open="1"],
	html[data-m-sheet="1"] #LA[data-user-panel-open="1"] {
		z-index: 45 !important;
		transform: none !important;
		pointer-events: none;
	}
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #LAD,
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #user_panel,
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #user_panel-status_menu {
		pointer-events: auto;
	}
	html[data-m-sheet="1"] #RAU,
	html[data-m-sheet="1"] #RAD,
	html[data-m-sheet="1"] #LAS,
	html[data-m-sheet="1"] #LAD {
		overflow: visible !important;
	}

	#RAU {
		position: relative;
		left: auto;
		width: 100%;
		z-index: 2;
		padding: var(--m-safe-top) 10px 0;
		box-sizing: border-box;
		background-color: var(--color-panel-bg, #313131);
		flex: 0 0 auto;
		min-height: calc(52px + var(--m-safe-top));
		max-height: none;
		height: auto;
		overflow: hidden;
	}

	#RAU_back:not([hidden]) {
		display: block;
		align-self: center;
	}

	#RAU_nav-radr:not([hidden]) {
		display: block;
	}

	#RAD {
		display: flex;
		flex: 1 1 auto;
		min-height: 0;
		height: auto !important;
		max-height: none;
		width: 100%;
		position: relative;
		overflow: hidden;
	}

	#RADL {
		flex: 1 1 auto;
		width: 100%;
		max-width: none;
		padding-top: 0;
		min-width: 0;
		transform: translateX(0);
		transition: transform var(--m-panel-ms) ease;
		will-change: transform;
	}

	#RADR {
		position: absolute;
		inset: 0;
		z-index: 4;
		width: 100% !important;
		max-width: none !important;
		margin: 0;
		border-left: 0;
		transform: translateX(100%);
		transition: transform var(--m-panel-ms) ease;
		will-change: transform;
		background-color: var(--color-panel-bg, #2a2a2a);
	}

	#RADR_head:not([hidden]) {
		display: flex;
	}

	/* Panel: LA (home) */
	html[data-m-panel="la"] #LA {
		transform: translateX(0);
	}
	html[data-m-panel="la"] #RA {
		transform: translateX(100%);
		pointer-events: none;
	}

	/* Panel: main content */
	html[data-m-panel="radl"] #LA,
	html[data-chat-open="1"] #LA {
		transform: translateX(-100%);
		pointer-events: none;
	}
	html[data-m-panel="radl"] #RA,
	html[data-chat-open="1"] #RA {
		transform: translateX(0);
		pointer-events: auto;
	}
	html[data-m-panel="radl"] #RADR,
	html[data-chat-open="1"] #RADR {
		transform: translateX(100%);
	}

	/* Panel: right sidebar */
	html[data-m-panel="radr"] #LA {
		transform: translateX(-100%);
		pointer-events: none;
	}
	html[data-m-panel="radr"] #RA {
		transform: translateX(0);
		pointer-events: auto;
	}
	html[data-m-panel="radr"] #RADL {
		transform: translateX(-30%);
	}
	html[data-m-panel="radr"] #RADR {
		transform: translateX(0);
	}

	/*
	 * Профиль из MNB на любой странице: шит внутри #LA.
	 * Должен побеждать html[data-m-panel="radl|radr"] / data-chat-open transform,
	 * иначе #user_panel-status_menu (position:fixed) уезжает вместе с #LA за экран.
	 */
	html[data-mobile="1"] #LA[data-user-panel-open="1"],
	html[data-mobile="1"][data-m-panel="radl"] #LA[data-user-panel-open="1"],
	html[data-mobile="1"][data-m-panel="radr"] #LA[data-user-panel-open="1"],
	html[data-mobile="1"][data-chat-open="1"] #LA[data-user-panel-open="1"],
	html[data-m-sheet="1"] #LA[data-user-panel-open="1"] {
		z-index: 45 !important;
		transform: none !important;
		pointer-events: none;
	}
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #LAD,
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #user_panel,
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #user_panel-status_menu {
		pointer-events: auto;
	}
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #LAS,
	html[data-mobile="1"] #LA[data-user-panel-open="1"] #LAV {
		visibility: hidden;
	}

	/* Project enter: ghost slides out left, LA enters from right */
	#LA_ghost:not([hidden]) {
		display: flex;
		flex-direction: column;
		position: absolute;
		inset: 0;
		z-index: 5;
		width: 100%;
		background-color: var(--color-panel-bg, #2a2a2a);
		transform: translateX(0);
		transition: transform var(--m-panel-ms) ease;
		overflow: hidden;
		pointer-events: none;
	}

	html[data-m-transition="project-enter"] #LA_ghost:not([hidden]) {
		transform: translateX(-100%);
	}

	html[data-m-transition="project-enter"] #LA {
		transform: translateX(0);
		animation: m_la_enter_from_right var(--m-panel-ms) ease both;
	}

	@keyframes m_la_enter_from_right {
		from { transform: translateX(100%); }
		to { transform: translateX(0); }
	}

	/* Leave project: ghost (project) exits right, LA (contacts) enters from left */
	html[data-m-transition="project-leave"] #LA_ghost:not([hidden]) {
		transform: translateX(100%);
	}

	html[data-m-transition="project-leave"] #LA {
		transform: translateX(0);
		animation: m_la_enter_from_left var(--m-panel-ms) ease both;
	}

	@keyframes m_la_enter_from_left {
		from { transform: translateX(-100%); }
		to { transform: translateX(0); }
	}

	#LAS {
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	/* Нижняя панель профиля/опций на мобилке не нужна — профиль в #MNB. */
	html[data-mobile="1"] #LAD {
		display: none !important;
	}

	#LAC {
		overflow: visible;
		flex: 0 0 auto;
		min-height: 0;
	}

	#LAC_list {
		height: auto;
		overflow: visible;
		padding: 0 15px 12px;
		box-sizing: border-box;
	}

	#RAU {
		gap: 8px;
	}

	#RAU_title {
		max-width: 48%;
		padding-right: 20px;
	}

	@media (max-width: 500px) {
		#RAU_notes,
		#RAU_mentions,
		#RAU_friend_notes {
			display: none !important;
		}

		#RAU_alerts {
			display: flex !important;
		}
	}

	/* Mobile LAC project rows (в общем списке с ЛС) */
	#LAC_list .lac_item.lac_mobile_project .lac_item-avatar {
		display: flex;
		align-items: center;
		justify-content: center;
		font-weight: 700;
		background-size: cover;
		background-position: center;
	}

	#LAC_list .lac_item.lac_mobile_project .lac_item-call {
		display: none;
	}

	#LAC_list .lac_item.lac_mobile_project .lac_item-pin {
		display: block;
	}

	/* На таче нет hover — кнопки меню канала/группы всегда видны */
	.lac_channel-more,
	.lac_group-edit {
		opacity: 0.55;
		visibility: visible;
		pointer-events: auto;
	}

	.chat_msg {
		max-width: 100%;
	}

	.chat_msg-toolbar {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		top: 5px;
		border: 0;
		box-shadow: none;
	}

	/* ——— Mobile fullscreen sheets ——— */
	.m_sheet_close {
		display: none;
	}

	/* Body-level overlays — выше #RP/#LA */
	#IFM_user_card:not([hidden]),
	#IFM_user_card_ban:not([hidden]),
	#IFM_user_card_kick_confirm:not([hidden]),
	#IFM_user_card_remove_friend:not([hidden]),
	#IFM_share_target:not([hidden]),
	#IFM_notify_mode_picker:not([hidden]),
	#IFM_channel_more,
	#IFM_feed_news_more,
	#IFM_news_author_menu {
		z-index: 50000 !important;
	}

	html[data-mobile="1"] #RADL_inputs-upload[open="1"] #IFM_attach_files {
		display: none !important;
	}

	#LAUL_list[open="1"] #LAUL_list_content,
	#RAU_alerts_panel.is-ported.is-open,
	#RAU_pins_panel.is-ported.is-open,
	#user_panel[open="1"] #user_panel-status_menu:not([hidden]),
	#user_panel-status_menu.is-ported:not([hidden]),
	#IFM_user_card:not([hidden]),
	#IFM_channel_more,
	#IFM_feed_news_more,
	#IFM_news_author_menu {
		position: fixed !important;
		inset: 0 !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: none !important;
		min-width: 0 !important;
		height: 100% !important;
		max-height: none !important;
		margin: 0 !important;
		border-radius: 0 !important;
		border-left: 0 !important;
		border-right: 0 !important;
		z-index: 40000 !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		padding: calc(56px + var(--m-safe-top)) 16px 24px !important;
		box-sizing: border-box !important;
		box-shadow: none !important;
	}

	#RAU_alerts_panel.is-ported.is-open {
		background-color: var(--color-panel-bg, #2a2a2a);
		backdrop-filter: none;
		/* Контент — с боковыми отступами; футеры вкладок — flush к краям (ниже). */
		padding-bottom: 0 !important;
		overflow: hidden !important;
		overflow-y: hidden !important;
	}

	#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes {
		flex: 1 1 auto;
		min-height: 0;
	}

	#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_notes_panel.is-active,
	#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_mentions_panel.is-active,
	#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_friend_notes_panel.is-active {
		flex: 1 1 auto;
		min-height: 0;
	}

	#RAU_alerts_panel.is-ported.is-open #RAU_notes_footer,
	#RAU_alerts_panel.is-ported.is-open #RAU_mentions_footer,
	#RAU_alerts_panel.is-ported.is-open #RAU_friend_notes_footer {
		box-sizing: border-box;
		width: calc(100% + 32px);
		max-width: none;
		margin-left: -16px;
		margin-right: -16px;
		margin-bottom: 0;
		padding-left: 16px;
		padding-right: 16px;
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	}

	#RAU_pins_panel.is-ported.is-open {
		padding-bottom: 0 !important;
		overflow: hidden !important;
		overflow-y: hidden !important;
		display: flex !important;
		flex-direction: column;
	}

	#RAU_pins_panel.is-ported.is-open #RAU_pins_list {
		flex: 1 1 auto;
		min-height: 0;
	}

	#RAU_pins_panel.is-ported.is-open #RAU_pins_footer {
		box-sizing: border-box;
		width: calc(100% + 32px);
		max-width: none;
		margin-left: -16px;
		margin-right: -16px;
		margin-bottom: 0;
		padding-left: 16px;
		padding-right: 16px;
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	}

	#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes .m_sheet_close {
		display: none !important;
	}

	#RADL_inputs-upload-mobile-panel[data-open="1"] .RADL_mobile_attach-sheet {
		bottom: 0;
	}

	html[data-mobile="1"][data-mnb-visible="1"] #RADL_inputs-upload-mobile-panel[data-open="1"] .RADL_mobile_attach-sheet {
		bottom: var(--mnb-height);
		max-height: calc(66vh - var(--mnb-height) * 0.2);
	}

	/*
	 * Не используем :has(): старые Android WebView игнорировали весь список
	 * селекторов. data-mnb-visible синхронизируется из sync_mobile_chrome().
	 */
	html[data-mobile="1"][data-mnb-visible="1"] #LAUL_list[open="1"] #LAUL_list_content,
	html[data-mobile="1"][data-mnb-visible="1"] #RAU_alerts_panel.is-ported.is-open,
	html[data-mobile="1"][data-mnb-visible="1"] #RAU_pins_panel.is-ported.is-open,
	html[data-mobile="1"][data-mnb-visible="1"] #user_panel[open="1"] #user_panel-status_menu:not([hidden]),
	html[data-mobile="1"][data-mnb-visible="1"] #user_panel-status_menu.is-ported:not([hidden]),
	html[data-mobile="1"][data-mnb-visible="1"] #RADL_inputs-upload[open="1"] #IFM_attach_files,
	html[data-mobile="1"][data-mnb-visible="1"] #IFM_user_card:not([hidden]),
	html[data-mobile="1"][data-mnb-visible="1"] #IFM_channel_more,
	html[data-mobile="1"][data-mnb-visible="1"] #IFM_feed_news_more,
	html[data-mobile="1"][data-mnb-visible="1"] #IFM_news_author_menu,
	html[data-mobile="1"][data-mnb-visible="1"] #user_panel-online_picker[open="1"],
	html[data-mobile="1"][data-mnb-visible="1"] #LAUL_list[open="1"] #LAUL_list_content .LAUL_menu-item--flyout.is-open .LAUL_flyout {
		bottom: var(--mnb-height) !important;
		height: auto !important;
		max-height: calc(100vh - var(--mnb-height)) !important;
		max-height: calc(100dvh - var(--mnb-height)) !important;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
	}

	html[data-mobile="1"][data-mnb-visible="1"] #RAU_alerts_panel.is-ported.is-open,
	html[data-mobile="1"][data-mnb-visible="1"] #RAU_pins_panel.is-ported.is-open {
		padding-bottom: 0 !important;
	}

	html[data-mobile="1"][data-mnb-visible="1"] #RAU_alerts_panel.is-ported.is-open #RAU_notes_footer,
	html[data-mobile="1"][data-mnb-visible="1"] #RAU_alerts_panel.is-ported.is-open #RAU_mentions_footer,
	html[data-mobile="1"][data-mnb-visible="1"] #RAU_alerts_panel.is-ported.is-open #RAU_friend_notes_footer,
	html[data-mobile="1"][data-mnb-visible="1"] #RAU_pins_panel.is-ported.is-open #RAU_pins_footer {
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	}

	/* Эмодзи в composer — компактный попап как #IFM_msg_react_picker (в body на мобилке) */
	html[data-mobile="1"] #RADL_inputs-emoji_content.RADL_inputs-emoji_content--ported.is-open,
	html[data-mobile="1"] #RADL_inputs-emoji[open="1"] #RADL_inputs-emoji_content {
		display: flex !important;
		flex-direction: column !important;
		position: fixed !important;
		/* Не inset: auto — иначе перебивает left/top из place_fixed_popup */
		right: auto !important;
		bottom: auto !important;
		width: auto !important;
		height: auto !important;
		min-width: 220px;
		max-width: min(320px, 70vw) !important;
		max-height: 280px;
		margin: 0 !important;
		padding: 0 !important;
		overflow: hidden !important;
		border-radius: 12px !important;
		box-shadow: 0 0 30px 2px rgba(0, 0, 0, 0.35) !important;
		z-index: 60010 !important;
	}

	html[data-mobile="1"] #RADL_inputs-emoji_content.RADL_inputs-emoji_content--ported.is-open .RADL_picker_scroll,
	html[data-mobile="1"] #RADL_inputs-emoji[open="1"] #RADL_inputs-emoji_content .RADL_picker_scroll {
		flex: 1 1 auto;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		padding: 15px 15px 8px;
	}

	html[data-mobile="1"] #RADL_inputs-emoji_content.RADL_inputs-emoji_content--ported.is-open .RADL_pack_bar,
	html[data-mobile="1"] #RADL_inputs-emoji[open="1"] #RADL_inputs-emoji_content .RADL_pack_bar {
		flex: 0 0 auto;
	}

	html[data-mobile="1"] #RADL_inputs-emoji_content .m_sheet_close {
		display: none !important;
	}

	/* Повторно после общего блока — body-оверлеи выше шитов внутри #RA */
	#IFM_user_card:not([hidden]),
	#IFM_user_card_ban:not([hidden]),
	#IFM_user_card_kick_confirm:not([hidden]),
	#IFM_user_card_remove_friend:not([hidden]),
	#IFM_share_target:not([hidden]),
	#IFM_notify_mode_picker:not([hidden]),
	#RAU_alerts_panel.is-ported.is-open,
	#RAU_pins_panel.is-ported.is-open,
	#IFM_channel_more,
	#IFM_feed_news_more,
	#IFM_news_author_menu {
		z-index: 50000 !important;
	}

	#RAU_alerts_panel.is-ported.is-open,
	#RAU_pins_panel.is-ported.is-open {
		display: flex !important;
		flex-direction: column;
	}

	#RAU_notes_list,
	#RAU_mentions_list,
	#RAU_friend_notes_list,
	#RAU_pins_list {
		max-height: none !important;
		flex: 1 1 auto;
	}

	#LAUL_list[open="1"] #LAUL_list_content .m_sheet_close,
	#RAU_alerts_panel.is-ported.is-open > .m_sheet_close,
	#RAU_pins_panel.is-ported.is-open .m_sheet_close,
	#user_panel[open="1"] #user_panel-status_menu .m_sheet_close,
	#user_panel-status_menu.is-ported .m_sheet_close,
	#RADL_inputs-upload[open="1"] #IFM_attach_files .m_sheet_close,
	#IFM_user_card:not([hidden]) .m_sheet_close,
	#IFM_share_target .IFM_panel > .m_sheet_close,
	#IFM_channel_more .m_sheet_close,
	#IFM_feed_news_more .m_sheet_close,
	#IFM_news_author_menu .m_sheet_close,
	.IFM_panel > .m_sheet_close {
		display: block !important;
		position: fixed;
		top: calc(10px + var(--m-safe-top));
		right: 10px;
		z-index: 50001;
		width: 40px;
		height: 40px;
		margin: 0;
		padding: 0;
		border: 1px solid var(--color-null-element-border);
		border-radius: 10px;
		background-color: var(--color-null-element-bg);
		background-image: url('../../ico/bt/close.svg');
		background-repeat: no-repeat;
		background-position: center;
		background-size: 46%;
		cursor: pointer;
		box-sizing: border-box;
	}

	#user_panel-online_picker[open="1"],
	#LAUL_list[open="1"] #LAUL_list_content .LAUL_menu-item--flyout.is-open .LAUL_flyout {
		position: fixed !important;
		inset: 0 !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: none !important;
		min-width: 0 !important;
		height: 100% !important;
		max-height: none !important;
		margin: 0 !important;
		border-radius: 0 !important;
		border-left: 0 !important;
		border-right: 0 !important;
		z-index: 40001 !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		padding: calc(56px + var(--m-safe-top)) 16px 24px !important;
		box-sizing: border-box !important;
		box-shadow: none !important;
		display: block !important;
	}

	#LAUL_list[open="1"] #LAUL_list_content .LAUL_menu-item--flyout:not(.is-open) .LAUL_flyout {
		display: none !important;
	}

	#LAUL_list[open="1"] #LAUL_list_content .LAUL_menu-item--flyout:hover .LAUL_flyout {
		display: none !important;
	}

	#LAUL_list[open="1"] #LAUL_list_content .LAUL_menu-item--flyout.is-open:hover .LAUL_flyout {
		display: block !important;
	}

	/* IFM_channel_more / feed news more: субменю встроено под пунктом */
	#IFM_channel_more .LAUL_menu-item--flyout,
	#IFM_feed_news_more .LAUL_menu-item--flyout {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		cursor: default;
	}

	#IFM_channel_more .LAUL_menu-item--flyout .LAUL_menu-item-label,
	#IFM_feed_news_more .LAUL_menu-item--flyout .LAUL_menu-item-label {
		flex: 0 0 auto;
		width: 100%;
		box-sizing: border-box;
	}

	#IFM_channel_more .LAUL_menu-item--flyout .LAUL_flyout,
	#IFM_channel_more .LAUL_menu-item--flyout.is-open .LAUL_flyout,
	#IFM_channel_more .LAUL_menu-item--flyout:hover .LAUL_flyout,
	#IFM_channel_more .LAUL_menu-item--flyout:not(.is-open) .LAUL_flyout,
	#IFM_feed_news_more .LAUL_menu-item--flyout .LAUL_flyout,
	#IFM_feed_news_more .LAUL_menu-item--flyout.is-open .LAUL_flyout,
	#IFM_feed_news_more .LAUL_menu-item--flyout:hover .LAUL_flyout,
	#IFM_feed_news_more .LAUL_menu-item--flyout:not(.is-open) .LAUL_flyout {
		display: block !important;
		position: static !important;
		inset: auto !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		bottom: auto !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		height: auto !important;
		max-height: none !important;
		margin: 4px 0 2px 4px !important;
		padding: 2px 0 2px 12px !important;
		border: 0 !important;
		border-left: 2px solid var(--color-null-element-border) !important;
		border-radius: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
		overflow: visible !important;
		z-index: auto !important;
		box-sizing: border-box !important;
	}

	#IFM_channel_more .LAUL_menu-item--flyout .LAUL_flyout .m_sheet_close,
	#IFM_feed_news_more .LAUL_menu-item--flyout .LAUL_flyout .m_sheet_close {
		display: none !important;
	}

	#user_panel-online_picker[open="1"] .m_sheet_close,
	#LAUL_list[open="1"] #LAUL_list_content .LAUL_menu-item--flyout.is-open .LAUL_flyout .m_sheet_close {
		display: block !important;
		position: fixed;
		top: calc(10px + var(--m-safe-top));
		right: 10px;
		z-index: 50002;
		width: 40px;
		height: 40px;
		margin: 0;
		padding: 0;
		border: 1px solid var(--color-null-element-border);
		border-radius: 8px;
		background-color: var(--color-null-element-bg);
		background-image: url('../../ico/bt/close.svg');
		background-repeat: no-repeat;
		background-position: center;
		background-size: 46%;
		cursor: pointer;
		box-sizing: border-box;
	}

	/* IFM modal panels: full-bleed on phone */
	#IFM_avatar_edit,
	#IFM_text_status,
	#IFM_project_delete,
	#IFM_news_delete,
	#IFM_group_delete,
	#IFM_logout_confirm,
	#IFM_email_change_request,
	#IFM_email_change_result,
	#IFM_password_change_request,
	#IFM_password_change_result,
	#IFM_twofa_change_result,
	#IFM_delete_account,
	#IFM_twofa_settings,
	#IFM_unsaved_edit,
	#IFM_emoji_manage,
	#IFM_sticker_manage,
	#IFM_invite_friends,
	#IFM_project_join_requests,
	#IFM_project_join_requests_confirm,
	#IFM_screen_pick,
	#IFM_session_takeover,
	#IFM_set_login,
	#IFM_notify_mode_picker,
	#IFM_share_target,
	#IFM_user_card_remove_friend,
	#IFM_user_card_kick_confirm,
	#IFM_user_card_ban {
		padding: 0 !important;
		align-items: stretch !important;
		justify-content: stretch !important;
	}

	#IFM_avatar_edit .IFM_panel,
	#IFM_text_status .IFM_panel,
	#IFM_project_delete .IFM_panel,
	#IFM_news_delete .IFM_panel,
	#IFM_group_delete .IFM_panel,
	#IFM_logout_confirm .IFM_panel,
	#IFM_email_change_request .IFM_panel,
	#IFM_email_change_result .IFM_panel,
	#IFM_password_change_request .IFM_panel,
	#IFM_password_change_result .IFM_panel,
	#IFM_delete_account .IFM_panel,
	#IFM_twofa_settings .IFM_panel,
	#IFM_unsaved_edit .IFM_panel,
	#IFM_emoji_manage .IFM_panel,
	#IFM_sticker_manage .IFM_panel,
	#IFM_invite_friends .IFM_panel,
	#IFM_project_join_requests .IFM_panel,
	#IFM_project_join_requests_confirm .IFM_panel,
	#IFM_screen_pick .IFM_panel,
	#IFM_session_takeover .IFM_panel,
	#IFM_set_login .IFM_panel,
	#IFM_notify_mode_picker .IFM_panel,
	#IFM_share_target .IFM_panel,
	#IFM_user_card_remove_friend .IFM_panel,
	#IFM_user_card_kick_confirm .IFM_panel,
	#IFM_user_card_ban .IFM_panel {
		max-width: none !important;
		width: 100% !important;
		min-height: 100%;
		border-radius: 0 !important;
		box-sizing: border-box;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding-top: 56px;
	}

	#IFM_notify_mode_picker .IFM_panel {
		padding-top: 0;
		max-height: none;
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}

	#IFM_notify_mode_picker .IFM_notify_mode_picker-head {
		padding-top: calc(12px + var(--m-safe-top, 0px));
	}

	/* Auth / forms: no horizontal overflow */
	html[is_auth="0"] #RP,
	html.layout-guest #RP,
	.section-fullscreen.layout-guest #RP {
		margin: 0 !important;
		border-radius: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow-x: hidden !important;
	}

	.auth_form,
	.ifm_form {
		max-width: 100% !important;
		width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-left: 16px !important;
		padding-right: 16px !important;
		box-sizing: border-box !important;
		overflow-x: hidden;
	}

	.auth_form-field,
	.ifm_form-field,
	.auth_form-field input,
	.ifm_form-field input,
	.auth_form-field textarea,
	.ifm_form-field textarea,
	.auth_form-field select,
	.ifm_form-field select {
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box !important;
	}

	#RADL,
	#RADL_content {
		overflow-x: hidden !important;
		max-width: 100%;
	}

	#RADL {
		min-height: 0;
		display: flex;
		flex-direction: column;
	}

	#RADL_content {
		flex: 1 1 auto;
		min-height: 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		scroll-padding-top: 8px;
	}

	/* Формы auth/help: скролл в #RADL_content, не центрирование «сквозь» шапку #RAU */
	#RADL_content .auth_form,
	#RADL_content .ifm_form[data-panel-form="help"] {
		justify-content: flex-start;
		margin-top: 0;
		margin-bottom: 0;
		padding-top: 12px;
		padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
		min-height: min-content;
	}

	html[data-mobile="1"][page_type="channel_edit"] #RADL_content,
	html[data-mobile="1"][page_type="project_edit"] #RADL_content,
	html[data-mobile="1"][page_type="project_roles"] #RADL_content,
	html[data-mobile="1"][page_type="group_edit"] #RADL_content {
		padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
	}

	html[data-mobile="1"] #IFM_user_settings,
	html[data-mobile="1"] #IFM_project_settings,
	html[data-mobile="1"] #IFM_news_settings,
	html[data-mobile="1"] #IFM_project_roles,
	html[data-mobile="1"] #IFM_news_roles {
		padding: 0;
		align-items: stretch;
	}

	html[data-mobile="1"] #IFM_user_settings .IFM_user_settings-panel,
	html[data-mobile="1"] #IFM_project_settings .IFM_settings-modal-panel,
	html[data-mobile="1"] #IFM_news_settings .IFM_settings-modal-panel,
	html[data-mobile="1"] #IFM_project_roles .IFM_project_roles-panel,
	html[data-mobile="1"] #IFM_news_roles .IFM_news_roles-panel {
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
		border: 0;
	}

	html[data-mobile="1"] #IFM_project_roles .IFM_project_roles-panel,
	html[data-mobile="1"] #IFM_news_roles .IFM_news_roles-panel {
		width: 100%;
	}

	html[data-mobile="1"] .IFM_project_roles-layout,
	html[data-mobile="1"] .IFM_news_roles-layout {
		flex-direction: column;
	}

	html[data-mobile="1"] #IFM_project_roles_nav,
	html[data-mobile="1"] #IFM_project_roles_members,
	html[data-mobile="1"] #IFM_news_roles_nav,
	html[data-mobile="1"] #IFM_news_roles_members {
		flex: 0 0 auto;
		width: 100%;
		max-height: 38vh;
		border-right: 0;
		border-bottom: 1px solid var(--color-null-element-border);
	}

	html[data-mobile="1"] #IFM_user_settings[data-m-view="nav"] .IFM_user_settings-body-wrap {
		display: none;
	}

	html[data-mobile="1"] #IFM_user_settings[data-m-view="content"] #user_settings_lac_nav {
		display: none;
	}

	html[data-mobile="1"] #user_settings_lac_list .user_settings_lac_item[data-cat="hotkeys"],
	html[data-mobile="1"] #form_user_settings .user_settings_cat[data-cat="hotkeys"] {
		display: none !important;
	}

	html[data-mobile="1"] #IFM_user_settings[data-m-view="nav"] .IFM_user_settings-head-title {
		text-align: center;
	}

	/* В LA-панели баннер не перекрывает #LAU и список разделов. */
	html[data-mobile="1"][data-android-update="1"][data-m-panel="la"] #LAS {
		padding-top: var(--android-update-height, 0px);
	}

	/* В RA-панели Android-баннер располагается под #RAU, а не поверх него. */
	html[data-mobile="1"][data-android-update="1"][data-m-panel="radl"] #IFM_android_update,
	html[data-mobile="1"][data-android-update="1"][data-m-panel="radr"] #IFM_android_update,
	html[data-mobile="1"][data-android-update="1"][data-chat-open="1"] #IFM_android_update {
		top: calc(52px + var(--m-safe-top));
	}

	html[data-mobile="1"][data-android-update="1"][data-m-panel="radl"] #RAD,
	html[data-mobile="1"][data-android-update="1"][data-m-panel="radr"] #RAD,
	html[data-mobile="1"][data-android-update="1"][data-chat-open="1"] #RAD {
		padding-top: var(--android-update-height, 0px);
	}

	/* user_contacts: на узком экране шапка/баннер #LAU не показываем. */
	html[page_type="user_contacts"] #LAU {
		display: none !important;
	}

	/* В открытом DM шапка должна помещать back/title/options без обрезания. */
	html[data-mobile="1"][page_type="user_contacts"][data-chat-open="1"] #RAU {
		display: flex;
		align-items: center;
		row-gap: 4px;
		overflow: visible;
		padding-bottom: 6px;
	}

	html[data-mobile="1"][page_type="user_contacts"][data-chat-open="1"] #RAU_title {
		flex: 1 1 auto;
		min-width: 0;
		max-width: none;
	}

	html[data-mobile="1"][page_type="user_contacts"][data-chat-open="1"] #RAU_options {
		flex: 0 0 auto;
	}

	html[data-mobile="1"][page_type="user_contacts"][data-chat-open="1"] #RAU_search {
		display: flex;
	}

	/* Модалка «Создать» — не перекрывать #MNB */
	html[data-mobile="1"][data-mnb-visible="1"] #IFM_lpd_create:not([hidden]) {
		align-items: flex-start;
		padding-top: calc(48px + var(--m-safe-top));
		padding-bottom: var(--mnb-height);
		box-sizing: border-box;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	#LAUL_pin:not([hidden]) {
		display: block;
	}

	html[page_type="project"] #LAUL_header {
		padding: 10px 30px 0 10px;
	}

	#LAUL_list {
		right: 8px;
	}

	#LAU[have_bg="1"] #LAUL_pin {
		right: 42px;
	}

	#IFM_download {
		padding: 0;
		align-items: stretch;
		justify-content: stretch;
	}

	#IFM_download .IFM_download-panel {
		max-width: none;
		width: 100%;
		height: 100%;
		max-height: 100dvh;
		border-radius: 0;
		border: 0;
		display: flex;
		flex-direction: column;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	#IFM_download .IFM_download-qr {
		flex: 0 0 auto;
	}

	/* Mobile bottom nav — над #LA/#RA (не внутри #LA, иначе уезжает с панелью) */
	#MNB:not([hidden]) {
		display: flex !important;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 60001;
		height: calc(56px + env(safe-area-inset-bottom, 0px));
		padding: 0 6px env(safe-area-inset-bottom, 0px);
		align-items: center;
		justify-content: space-around;
		gap: 2px;
		background: var(--color-panel-bg, #2a2a2a);
		border-top: 1px solid var(--color-null-element-border, rgba(255,255,255,0.08));
		box-sizing: border-box;
		pointer-events: auto;
	}

	html[data-mobile="1"][is_auth="1"] #LA,
	html[data-mobile="1"][is_auth="1"] #RA {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
		box-sizing: border-box;
	}

	/* В открытом чате панель скрыта — убрать отступ под композер */
	html[data-mobile="1"][data-chat-open="1"] #LA,
	html[data-mobile="1"][data-chat-open="1"] #RA {
		padding-bottom: 0;
	}

	.MNB_btn {
		flex: 1 1 0;
		height: 48px;
		max-width: 72px;
		border: 0;
		border-radius: 12px;
		background-color: transparent;
		background-repeat: no-repeat;
		background-position: center;
		background-size: 26px;
		opacity: 0.72;
		cursor: pointer;
	}

	.MNB_btn.is-active,
	.MNB_btn:active {
		opacity: 1;
		background-color: rgba(255, 255, 255, 0.06);
	}

	.MNB_btn[data-mnb="feed"] {
		background-image: url('../../ico/bt/article.svg');
	}
	.MNB_btn[data-mnb="search"] {
		background-image: url('../../ico/bt/search.svg');
	}
	.MNB_btn[data-mnb="user_contacts"] {
		position: relative;
		background-image: url('../../ico/bt/people.svg');
	}

	.MNB_unread {
		position: absolute;
		top: 5px;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 18px;
		min-width: 18px;
		padding: 0 4px;
		box-sizing: border-box;
		color: #fff;
		font-size: 10px;
		font-weight: 700;
		line-height: 18px;
		pointer-events: none;
	}

	.MNB_unread[hidden] {
		display: none !important;
	}

	.MNB_unread--dm {
		right: calc(50% - 27px);
		border-radius: 999px;
		background: #e05555;
	}

	.MNB_unread--projects {
		left: calc(50% - 29px);
		border-radius: 5px;
		background: var(--color-lpd-active-border, #c9a227);
		color: #1a1a1a;
	}

	.MNB_btn[data-mnb="market"] {
		background-image: url('../../ico/bt/sparkle.svg');
	}

	.MNB_btn--avatar {
		position: relative;
		background-image: none;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.MNB_avatar {
		width: 28px;
		height: 28px;
		border-radius: 50%;
		background-color: var(--color-null-element-bg);
		background-image: url('../../ico/bt/avatar.svg');
		background-repeat: no-repeat;
		background-position: center;
		background-size: 70%;
	}

	.MNB_avatar[have_img="1"] {
		background-size: cover;
	}

	.MNB_btn--avatar .user_panel-status-dot {
		position: absolute;
		right: 10px;
		bottom: 8px;
		width: 10px;
		height: 10px;
	}

	.MNB_btn--avatar.is-speaking .MNB_avatar {
		box-shadow: 0 0 0 2px #8d87fb;
	}
}

@media (max-width: 520px) {
    #IFM_call_popup {
        align-items: flex-end;
        padding: 12px;
    }
    .IFM_call_popup-card {
        width: 100%;
        padding: 22px 16px 16px;
        border-radius: 16px 16px 12px 12px;
    }

	#RAU_title {
        max-width: unset;
        flex: 1 1 auto;
	}

	#RAU_descr {
		display: none;
	}
}

@media (max-width: 640px) {
	.user_settings_hotkey_row-ctrl,
	.user_settings_mic_ptt_row .user_settings_hotkey_row-ctrl {
		grid-template-columns: 1fr;
	}

	.user_settings_hotkey_rows .user_settings_hotkey_reset,
	.user_settings_mic_ptt_row .user_settings_hotkey_reset,
	.user_settings_mic_ptt_row .user_settings_mic_ptt_go_hotkeys {
		max-width: none;
	}
}
