@-moz-document url(chrome://browser/content/browser.xhtml){

/* tabs on bottom of window */
/* requires that you set
	 * toolkit.legacyUserProfileCustomizations.stylesheets = true
	 * in about:config
	 */
#main-window body {
	flex-direction: column-reverse !important;
}

#navigator-toolbox {
	flex-direction: column-reverse !important;
}

#urlbar {
	top: unset !important;
	bottom: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2) !important;
	box-shadow: none !important;
	display: flex !important;
	flex-direction: column !important;
}

#urlbar-input-container {
	order: 2;
}

#urlbar>.urlbarView {
	order: 1;
	border-bottom: 1px solid #666;
}

#urlbar-results {
	display: flex;
	flex-direction: column-reverse;
}

/* Center text in the search bar */
#urlbar-input {
	text-align: center !important;
}

/* If #urlbar-input does not work, you might need to target the actual input field within the URL bar container */
/* #urlbar #urlbar-input-container input { */
/* text-align: center !important; */
/* } */

.search-one-offs {
	display: none !important;
}

.tab-background {
	border-top: none !important;
}

#navigator-toolbox::after {
	border: none;
}

#TabsToolbar .tabbrowser-arrowscrollbox,
#tabbrowser-tabs,
.tab-stack {
	min-height: 28px !important;
}

.tabbrowser-tab {
	font-size: 80%;
}

.tab-content {
	padding: 0 5px;
}

.tab-close-button .toolbarbutton-icon {
	width: 12px !important;
	height: 12px !important;
}

toolbox[inFullscreen=true] {
	display: none;
}


/* Scale down tabs by default */
.tabbrowser-tab {
	transform: scale(0.8);
	transform-origin: top;
	transition: transform 0.2s ease-out;
}

/* Return tabs to original size on hover */
.tabbrowser-tab:hover {
	transform: scale(1.0);
}

/* Adjust the height of the tab bar to fit the scaled-down tabs */
#TabsToolbar {
	min-height: 20px !important;
	/* Adjust this value based on your default tab height */
}

/* Ensure the active tab is fully visible */
.tabbrowser-tab[selected="true"] {
	transform: scale(1.0);
}

/*
	 * the following makes it so that the on-click panels in the nav-bar
	 * extend upwards, not downwards. some of them are in the #mainPopupSet
	 * (hamburger + unified extensions), and the rest are in
	 * #navigator-toolbox. They all end up with an incorrectly-measured
	 * max-height (based on the distance to the _bottom_ of the screen), so
	 * we correct that. The ones in #navigator-toolbox then adjust their
	 * positioning automatically, so we can just set max-height. The ones
	 * in #mainPopupSet do _not_, and so we need to give them a
	 * negative margin-top to offset them *and* a fixed height so their
	 * bottoms align with the nav-bar. We also calc to ensure they don't
	 * end up overlapping with the nav-bar itself. The last bit around
	 * cui-widget-panelview is needed because "new"-style panels (those
	 * using "unified" panels) don't get flex by default, which results in
	 * them being the wrong height.
	 *
	 * Oh, yeah, and the popup-notification-panel (like biometrics prompts)
	 * of course follows different rules again, and needs its own special
	 * rule.
	 */
#mainPopupSet panel.panel-no-padding {
	margin-top: calc(-50vh + 40px) !important;
}

#mainPopupSet .panel-viewstack,
#mainPopupSet popupnotification {
	max-height: 50vh !important;
	height: 50vh;
}

#mainPopupSet panel.panel-no-padding.popup-notification-panel {
	margin-top: calc(-50vh - 35px) !important;
}

#navigator-toolbox .panel-viewstack {
	max-height: 75vh !important;
}

panelview.cui-widget-panelview {
	flex: 1;
}

panelview.cui-widget-panelview>vbox {
	flex: 1;
	min-height: 50vh;
}

/* Reduce the height and padding of the navigation toolbar by default */
#nav-bar {
	--toolbar-reduced-height: 24px;
	/* Reduced height */
	--toolbar-original-height: 39px;
	/* Default height, adjust as needed */
	height: var(--toolbar-reduced-height);
	padding-top: 2px;
	/* Adjust padding to ensure buttons are vertically centered */
	padding-bottom: 2px;
	/* transition: height 0.2s ease-out, padding 0.2s ease-out; */
}


/* Adjust the margin or padding of the following toolbar to avoid overlap */
#PersonalToolbar {
	/* Adjust the bookmarks toolbar as an example */
	margin-top: 4px;
	/* Increase if there is overlap */
}

}