/*     / //  /  /   ☔ RainFox 5.3 | 2019-2022   //  / /  /     */

/* hide system context menus */
menu, menuitem, menucaption, .autocomplete-richlistbox, .autocomplete-richlistitem {
	-moz-appearance: none !important;
}
menupopup, menupopup menuitem, menupopup menu, menupopup menuseparator {
	-moz-appearance: none !important; -moz-default-appearance: none !important;
}

/* hide system context menu shadows (a huge thanks to /u/Guerra24 !!) */
menupopup {
		-moz-window-shadow: none !important;
}

/* paddings and stuff */
menu, menuitem, menucaption, .ac-title {
	height: 24px;
	padding: 0px 1px !important;
	transition: var(--userChrome-animation-speed) !important;
	-moz-box-align: center !important;
}
menupopup {
	padding: 6px 9px 8px !important; margin: -6px -9px 0 !important;
	border: 0 !important;
	background: 0 !important;
}
menu[open] menupopup {
	margin: -12px -9px 0 !important;
}
#PopupAutoComplete > richlistbox > richlistitem {
	transition: var(--userChrome-animation-speed);
}
.subviewbutton.panel-subview-footer {
	border-top: 0px solid var(--panel-separator-color) !important;
	transition: var(--userChrome-animation-speed);
}
menuitem[type="checkbox"][checked="true"] .menu-iconic-left, menuitem[type="radio"][checked="true"] .menu-iconic-left {
	appearance: none !important;
	margin-inline-start: 6px;
}
menuitem[type="checkbox"]:not([checked="true"]) .menu-iconic-left, menuitem[type="radio"]:not([checked="true"]) .menu-iconic-left {
	appearance: auto !important;
}

.menu-iconic > .menu-iconic-left, .menuitem-iconic > .menu-iconic-left {
	margin-inline-end: calc(1em - 4px) !important; margin-inline-start: 6px;
	padding-top: 0px !important;
	appearance: none !important;
}
menu > .menu-text, menuitem > .menu-text, menu > .menu-iconic-text, menuitem > .menu-iconic-text {
	appearance: auto !important;
	margin-inline-start: 0 !important;
}

/* PlacesToolbar fixes */
#PlacesToolbar menuitem, #PlacesToolbar menu {
	margin: 0 !important;
	border-radius: 0 !important;
}
#PlacesToolbar menu > .menu-iconic-text, #PlacesToolbar menuitem > .menu-iconic-text {
	padding-inline-start: 0px !important;
}
#PlacesToolbar menupopup[placespopup="true"] menuseparator::before {
	border: none !important;
}

/* shadows & corners for menus */
.popup-internal-box, #PopupSearchAutoComplete > *, .menupopup-arrowscrollbox {
	border-radius: var(--userChrome-cmenu-rounding) !important;
	box-shadow: 0px 1px 10px -3px #0009 !important;
	padding: 4px 0 !important;
}

slot {
	margin: 4px !important;
}
.panel-arrowcontainer .panel-arrowcontent, slot, .popup-internal-box, hbox[flex="1"][part="innerbox"] {
	border-radius: var(--userChrome-cmenu-rounding) !important;
}
.in-bookmarks-menu {
	padding-bottom: 5px !important;	padding-top: 5px !important;
}

/* remove ugly borders (mozilla STOP MOVING EVERYTHING TO HTML:SLOT PLEASE) */
.panel-arrowcontent, slot {
	padding-top: 0px !important;
	border: none !important;
}

/* menus theme-adaptive colours (use panels colour scheme) */
menu, 
menuitem, 
menucaption, 
.ac-title-text, 
.labels-wrapper > .label-row {
	color: var(--arrowpanel-color) !important;
}
.popup-internal-box, 
.autocomplete-richlistbox, 
#PopupSearchAutoComplete > *, .menupopup-arrowscrollbox {
	background: var(--arrowpanel-background) !important;
	border: 0px !important;
}
menu[_moz-menuactive="true"],
menuitem[_moz-menuactive="true"],
menucaption:hover:not([disabled="true"]), 
.autocomplete-richlistitem:hover {
	background-color: var(--panel-item-hover-bgcolor) !important;
}

menu:active[_moz-menuactive="true"]:not([disabled="true"]),
menuitem:active[_moz-menuactive="true"]:not([disabled="true"]),
menucaption:active:not([disabled="true"]), 
#allTabsMenu-allTabsViewTabs > .all-tabs-item:hover:active, 
.autocomplete-richlistitem:active {
	background-color: var(--panel-item-active-bgcolor) !important;
	box-shadow: 0 1px 0 hsla(210,4%,10%,.03) inset;
}
menu[disabled="true"], 
menuitem[disabled="true"], 
menucaption[disabled="true"], 
.ac-title-text[disabled="true"] {
	color: var(--arrowpanel-color, rgba(127,127,127,0.5)) !important;
	opacity: 50%;
}

/* menu separator */
menupopup menuseparator {
	margin: 4px 10px !important; padding: 0px !important;
	border-bottom: none !important;
	opacity: 50% !important;
	border-top: 1px solid var(--panel-separator-color) !important;
}

/* menu arrows */
.menu-right {
	opacity: 0.6;
	float: inline-end;
	margin-right: 8px !important;
	padding: 2px;
	margin-top: 2px !important;
}
#identity-popup-mainView .subviewbutton-nav::after, 
.widget-overflow-list .subviewbutton-nav::after, 
.PanelUI-subView .subviewbutton-nav::after {
	fill-opacity: 1.0 !important;
}
toolbarbutton {
	fill: var(--arrowpanel-color);
}

/* menu shortcut keys */
.menu-accel, .menu-iconic-accel {
	margin-right: 11px !important; margin-left: 18px !important;
	opacity: 0.8;
}
.subviewbutton[shortcut]::after {
	opacity: 0.8;
}