:root {
    --tab-min-height: 0 !important;
    --inline-tab-padding: 0 !important; // we do this ourselves
    --page-icon: url("chrome://namoroka/content/firefox-1/icons/page.png") !important;
    --page-invalid-icon: url("chrome://namoroka/content/firefox-1/icons/page-invalid.png") !important;
    --new-tab-icon: url("chrome://namoroka/content/firefox-1/tabbrowser/newtab.png") !important;
}

#TabsToolbar {
    appearance: none !important;
    
    @media not (-moz-windows-classic) {
        border-block-start: 1px solid ThreeDShadow !important;
    }
    
    border-block-start-width: 0 !important;
    padding-block: 1px !important;
    background-image: url("chrome://namoroka/content/firefox-1/icons/tabstrip-bottom.png") !important;
    background-repeat: repeat-x !important;
    background-position: bottom 1px center !important;
    box-shadow: inset 0 -1px 0 ThreeDLightShadow !important;

    .tabbrowser-tab {
        appearance: tab !important;
        border: 2px solid transparent !important;
        border-bottom-width: 1px !important;
        margin-top: 2px !important;
        margin-bottom: 1px !important;
        padding: 0px 4px 1px 4px !important;
        background-color: -moz-Dialog !important;
        color: -moz-DialogText !important;
   
        &[selected] {
            font-weight: bold !important;
            margin-block: 0 !important;
            border-bottom-color: transparent !important;
            padding: 2px 6px 4px 6px !important;
            
            &:first-of-type {
                padding-inline: 5px !important;
            }

            .tab-throbber, 
            .tab-icon-pending, 
            .tab-icon-image, 
            .tab-sharing-icon-overlay, 
            .tab-icon-overlay {
                &:not([pinned]) {
                    margin-block-start: 1px !important;
                }
            }
        }

        &:not([pinned]) {
            transition: min-width 0ms ease-out,
                        max-width 0ms ease-out !important;
        }

        &:not([pinned], [fadein]) {
            border: 0 !important;
            appearance: none !important;
            padding: 0 !important;
        }
        
        .tab-background {
            visibility: collapse !important;
        }

        .tab-content {
            .tab-throbber, 
            .tab-icon-pending, 
            .tab-icon-image, 
            .tab-sharing-icon-overlay, 
            .tab-icon-overlay {
                &:not([pinned]) {
                    margin-inline-end: 3px !important;
                }
            }
            
            .tab-throbber[busy] {
                background-image: url("chrome://namoroka/content/firefox-1/Throbber-small.gif") !important;
                opacity: 0.6 !important;

                &[progress] {
                    opacity: 0.6 !important;
                }

                &::before {
                    content: none !important;
                }
            }

            // Firefox 1 always showed the tab icon
            .tab-icon-image:not([src], [busy="true"]), 
            .tab-icon-image:not([busy="true"]):-moz-broken,
            .tab-icon-image:not([busy="true"])[src="chrome://branding/content/icon32.png"] {
                display: flex !important;
                content: var(--page-icon) !important;
            }

            .tab-label-container {
                mask-image: none !important;
                height: unset !important;

                .tab-label {
                    width: 100% !important;
                    margin-block-start: 1px !important;
                    line-height: normal !important;
                    overflow: hidden !important;
                    text-overflow: ellipsis !important;
                }

                .tab-secondary-label {
                    visibility: collapse !important;
                }
            }

            :root:not([namoroka-style-1="true"]) & {
                .tab-close-button {
                    visibility: collapse !important;
                }
            }
        }

    }

    .toolbarbutton-1 {
        margin: 0 !important;
        padding: 0 !important;
    }

    #tabs-newtab-button,
    #new-tab-button {
        width: 27px !important;
        list-style-image: var(--new-tab-icon) !important;

        .toolbarbutton-icon {
            width: 16px !important;
            height: 16px !important;
            list-style-image: inherit !important;
            background-image: none !important;
        }
    }

    .tabs-closebutton-box {
        padding: 4px !important;

        :root[namoroka-style-1="true"] & {
            visibility: collapse !important;
        }
    }

    :root:not([namoroka-style-1="true"]) & {
        #alltabs-button {
            width: 18px !important;
            list-style-image: url("chrome://namoroka/content/firefox-1/arrow/arrow-dn.gif") !important;
            
            .toolbarbutton-icon {
                width: auto !important;
            }

            &:hover:active,
            &[open="true"] {
                .toolbarbutton-icon {
                    transform: translate(1px, 1px) !important;
                }
            }
        }

        #tabbrowser-tabs:not([overflow], [hashiddentabs]) ~ #alltabs-button {
            display: none !important;
        }
    }
}