
:root {
    --tabs_toolbar_color_tabs_not_on_top: linear-gradient(#f9f9fa, #f9f9fa);
    --tab-min-height_tnot: 32px;
    --tab_below_navigation_toolbar_bottom_padding: calc(var(--tab-min-height_tnot) + 5px);
    --tab_below_navigation_toolbar_bottom_padding_macOS: calc(var(--tab-min-height) + 8px);
    --tab_below_navigation_toolbar_toolbox_top_padding_macOS: calc(-1px + var(--tab-min-height));
}

#TabsToolbar {
    position: absolute;
    display: block;
    bottom: 0;
    width: 100vw;
    background-clip: padding-box;
    color: var(--toolbar-color);
    z-index: 2;
}

#tabbrowser-tabs {
    width: 100%;
}

@media (-moz-platform: windows),(-moz-platform: linux) {
    #navigator-toolbox {
        position: relative;
        padding-bottom: var(--tab_below_navigation_toolbar_bottom_padding);
    }

    #main-window[tabsintitlebar]:not([inDOMFullscreen="true"]) #titlebar,
    #main-window[tabsintitlebar][sizemode="maximized"]:not([inDOMFullscreen="true"]) #titlebar {
        height: 26px;
    }

    #main-window[tabsintitlebar] #toolbar-menubar {
        padding-inline-end: 140px;
    }

    .titlebar-buttonbox-container {
        position: fixed;
        right: 0;
        visibility: visible;
        display: block;
    }

}


/* remove unneeded items */
#TabsToolbar .titlebar-buttonbox-container,
#TabsToolbar .private-browsing-indicator,
#TabsToolbar #window-controls,
#TabsToolbar *[type="caption-buttons"],
#TabsToolbar *[type="pre-tabs"],
#TabsToolbar *[type="post-tabs"] {
    display: none;
}

/* lw themes support */
/* overrides other settings too */
#main-window:not(:-moz-lwtheme) #navigator-toolbox #TabsToolbar:not(:-moz-lwtheme),
#main-window:not([tabsintitlebar]) #TabsToolbar:not(:-moz-lwtheme) {
    appearance: none !important;
}

@media not (-moz-toolbar-prefers-color-scheme: dark), not (prefers-color-scheme: dark) {
    #main-window:not(:-moz-lwtheme) #navigator-toolbox #TabsToolbar:not(:-moz-lwtheme) {
        background-image: var(--tabs_toolbar_color_tabs_not_on_top) !important;
    }
}

#nav-bar {
    box-shadow: unset !important;
}

/* remove color overlay for lw-themes */
#main-window[style*='--lwt-header-image'] :is(#nav-bar,#PersonalToolbar,#TabsToolbar):-moz-lwtheme {
    background: unset !important;
}

/* adjust background color */
#main-window:not([style*='--lwt-header-image']) #TabsToolbar:-moz-lwtheme {
    appearance: none !important;
    background-image: linear-gradient(var(--toolbar-bgcolor), var(--toolbar-bgcolor)) !important;
}

/* Fixes for projects other settings */
/* remove application/hamburger button in titlebar and tab toolbars start padding */
#main-window[tabsintitlebar][sizemode="fullscreen"] #navigator-toolbox #PanelUI-button {
    visibility: collapse;
}

/* override code inside appbutton in titlebar code */
#main-window[tabsintitlebar] #toolbar-menubar[autohide="true"][inactive="true"] ~ #TabsToolbar,
#main-window[tabsintitlebar][sizemode="maximized"] #toolbar-menubar[autohide="true"][inactive="true"] ~ #TabsToolbar,
#main-window[tabsintitlebar][sizemode="fullscreen"] #TabsToolbar,
#main-window[uidensity=compact][tabsintitlebar] #toolbar-menubar[autohide="true"][inactive="true"] ~ #TabsToolbar,
#main-window[uidensity=compact][tabsintitlebar][sizemode="maximized"] #toolbar-menubar[autohide="true"][inactive="true"] ~ #TabsToolbar,
#main-window[tabsintitlebar]:is([sizemode="normal"],[sizemode="maximized"],[sizemode="fullscreen"]) #navigator-toolbox #TabsToolbar {
    padding-inline-start: 0px !important;
    margin-inline-start: 0px !important;
}

/* remove restored border between navigation toolbar and tabs toolbar */
#nav-bar:not(:-moz-lwtheme) {
    box-shadow: unset !important;
}

/* notification position */
#tab-notification-deck {
    position: absolute;
    display: block;
    bottom: calc(-2 * var(--tab_below_navigation_toolbar_bottom_padding) + 8px);
    width: 100vw;
}

/* Fx 105+ */
:root:not([privatebrowsingmode=temporary]) :is(toolbarbutton, toolbarpaletteitem) + #tabbrowser-tabs,
:root[privatebrowsingmode=temporary] :is(toolbarbutton:not(#firefox-view-button), toolbarpaletteitem:not(#wrapper-firefox-view-button)) + #tabbrowser-tabs {
    border-inline-start: 0px solid color-mix(in srgb, currentColor 25%, transparent) !important;
}

:root:not([privatebrowsingmode=temporary]):not([firefoxviewhidden]) :is(#firefox-view-button, #wrapper-firefox-view-button) + #tabbrowser-tabs:not([overflow]) {
    padding-inline-start: 0 !important;
    margin-inline-start: 0 !important;
}

/* Fx 106+ */
#private-browsing-indicator-with-label {
    display: none !important;
}
