/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

%define WINDOWS_AERO
%include browser.css
%undef WINDOWS_AERO

%define customToolbarColor hsl(210,75%,92%)
%define customToolbarColorWin10 hsl(210,0%,92%)
%define glassActiveBorderColor rgb(37, 44, 51)
%define glassInactiveBorderColor rgb(102, 102, 102)

@media not all and (-moz-windows-classic) {
  #main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container {
    margin-top: 1px;
  }

  #appmenu-button {
    border-width: 2px;
    -moz-border-left-colors: @appMenuButtonBorderColor@;
    -moz-border-bottom-colors: @appMenuButtonBorderColor@;
    -moz-border-right-colors: @appMenuButtonBorderColor@;
    margin-bottom: 1px; /* compensate white outer border */
    box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
                0 0 2px 1px rgba(255,255,255,.25) inset;
  }

  #main-window[privatebrowsingmode=temporary] #appmenu-button {
    -moz-border-left-colors: rgba(255,255,255,.5) rgba(43,8,65,.9);
    -moz-border-bottom-colors: rgba(255,255,255,.5) rgba(43,8,65,.9);
    -moz-border-right-colors: rgba(255,255,255,.5) rgba(43,8,65,.9);
  }

  #appmenu-popup {
    margin-top: -1px;
    -moz-margin-start: 1px;
  }

  .panel-promo-message {
    font-style: italic;
  }
}

@media (-moz-windows-default-theme) {
 @media (-moz-os-version: windows-vista),
        (-moz-os-version: windows-win7) {
  #navigator-toolbox > toolbar:not(:-moz-lwtheme),
  #browser-bottombox:not(:-moz-lwtheme) {
    background-color: @customToolbarColor@;
  }

  .tabbrowser-tab:not(:-moz-lwtheme),
  .tabs-newtab-button:not(:-moz-lwtheme) {
    background-image: @toolbarShadowOnTab@, @bgTabTexture@,
                      linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  .tabbrowser-tab:not(:-moz-lwtheme):hover,
  .tabs-newtab-button:not(:-moz-lwtheme):hover {
    background-image: @toolbarShadowOnTab@, @bgTabTextureHover@,
                      linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  .tabbrowser-tab[selected="true"]:not(:-moz-lwtheme) {
    background-image: linear-gradient(#fff, @toolbarHighlight@ 50%),
                      linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  #main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
    background-image: @toolbarShadowOnTab@,
                      linear-gradient(#fff, @toolbarHighlight@ 50%),
                      linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  #navigator-toolbox:not(:-moz-lwtheme)::after {
    background-color: #aabccf;
  }
 }

 @media (-moz-os-version: windows-win8),
        (-moz-os-version: windows-win10) {
  #navigator-toolbox > toolbar:not(:-moz-lwtheme),
  #browser-bottombox:not(:-moz-lwtheme) {
    background-color: @customToolbarColorWin10@;
  }

  .tabbrowser-tab:not(:-moz-lwtheme),
  .tabs-newtab-button:not(:-moz-lwtheme) {
    background-image: @toolbarShadowOnTab@, @bgTabTexture@,
                      linear-gradient(@customToolbarColorWin10@, @customToolbarColorWin10@);
  }

  .tabbrowser-tab:not(:-moz-lwtheme):hover,
  .tabs-newtab-button:not(:-moz-lwtheme):hover {
    background-image: @toolbarShadowOnTab@, @bgTabTextureHover@,
                      linear-gradient(@customToolbarColorWin10@, @customToolbarColorWin10@);
  }

  .tabbrowser-tab[selected="true"]:not(:-moz-lwtheme) {
    background-image: linear-gradient(#fff, @toolbarHighlight@ 50%),
                      linear-gradient(@customToolbarColorWin10@, @customToolbarColorWin10@);
  }

  #main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
    background-image: @toolbarShadowOnTab@,
                      linear-gradient(#fff, @toolbarHighlight@ 50%),
                      linear-gradient(@customToolbarColorWin10@, @customToolbarColorWin10@);
  }

  #navigator-toolbox:not(:-moz-lwtheme)::after {
    background-color: #bcbcbc;
  }
 }
 
 
  #navigator-toolbox[tabsontop=true] #urlbar:not(:-moz-lwtheme),
  #navigator-toolbox[tabsontop=true] .searchbar-textbox:not(:-moz-lwtheme) {
    border-color: hsla(210,54%,20%,.25) hsla(210,54%,20%,.27) hsla(210,54%,20%,.3);
  }

  #navigator-toolbox[tabsontop=true] #urlbar:not(:-moz-lwtheme):not([focused]):hover,
  #navigator-toolbox[tabsontop=true] .searchbar-textbox:not(:-moz-lwtheme):not([focused]):hover {
    border-color: hsla(210,54%,20%,.35) hsla(210,54%,20%,.37) hsla(210,54%,20%,.4);
  }

  #navigator-toolbox[tabsontop=true] #urlbar:not(:-moz-lwtheme)[focused],
  #navigator-toolbox[tabsontop=true] .searchbar-textbox:not(:-moz-lwtheme)[focused] {
    border-color: hsla(206,100%,60%,.65) hsla(206,100%,55%,.65) hsla(206,100%,50%,.65);
  }

  .sidebar-splitter {
    border: 0;
    -moz-border-end: 1px solid #A9B7C9;
    min-width: 0;
    width: 3px;
    background-color: transparent;
    -moz-margin-start: -3px;
    position: relative;
  }

  #appcontent ~ .sidebar-splitter {
    -moz-border-start: 1px solid #A9B7C9;
    -moz-border-end: none;
    -moz-margin-start: 0;
    -moz-margin-end: -3px;
  }

  .menu-accel,
  .menu-iconic-accel {
    color: graytext;
  }

  .chatbar-button,
  chatbar > chatbox {
    border-color: #A9B7C9;
  }
  
}

@media (-moz-windows-compositor) {
  #main-window {
    background-color: transparent;
    -moz-appearance: -moz-win-glass;
  }

  /* On win 10, if we don't set this on the entire browser container, including
   * the sidebar, then the accent color bleeds through in the titlebar
   * if the sidebar is open. */
  #browser {
    -moz-appearance: -moz-win-exclude-glass;
  }

/* ==== Windows 10 styling ==== */

  @media (-moz-os-version: windows-win10) {
    /* Draw XUL caption buttons on Win10 in lwthemes */

    #titlebar-buttonbox,
    .titlebar-button {
      -moz-appearance: none !important;
    }

    .titlebar-button {
      border: none;
      margin: 0 !important;
      padding: 9px 17px;
    }
        
    #main-window[sizemode="maximized"][tabsontop=true] #tabbrowser-tabs {
      min-height: 28px;
    }

    #main-window[sizemode=maximized] .titlebar-button {
      padding-top: 8px;
      padding-bottom: 8px;
    }

    .titlebar-button > .toolbarbutton-icon {
      width: 12px;
      height: 12px;
    }

    #main-window[chromemargin^="0,"][sizemode=normal] #navigator-toolbox {
      margin-top: -4px;
    }

	#main-window[sizemode="maximized"] #titlebar-close {
      padding-right: 19px;
    }
	
    #titlebar-close:hover {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-highlight);
      background-color: hsla(0, 86%, 49%, 1);
      transition: background-color linear 160ms;
    }

    #titlebar-close:hover:active {
      background-color: hsla(0, 86%, 49%, 0.6); 
      transition: none;
    }
    
    /* light persona */
    
    #titlebar-min:-moz-lwtheme-darktext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#minimize-outline);
    }

    #titlebar-max:-moz-lwtheme-darktext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#maximize-outline);
    }

    #main-window[sizemode="maximized"]:-moz-lwtheme-darktext #titlebar-max:-moz-lwtheme-darktext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#restore-outline);
    }

    #titlebar-close:-moz-lwtheme-darktext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-outline);
    }
    #titlebar-close:hover:-moz-lwtheme-darktext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-outline);
    }
        
    /* dark persona */
    
    #titlebar-min:-moz-lwtheme-brighttext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#minimize-outline-inverted);
    }

    #titlebar-max:-moz-lwtheme-brighttext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#maximize-outline-inverted);
    }

    #main-window[sizemode="maximized"]:-moz-lwtheme-brighttext #titlebar-max:-moz-lwtheme-brighttext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#restore-outline-inverted);
    }

    #titlebar-close:-moz-lwtheme-brighttext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-outline-inverted);
    }
    #titlebar-close:hover:-moz-lwtheme-brighttext {
      list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-outline-inverted);
    }
        
    /* the 12px image renders a 10px icon, and the 10px upscaled gets rounded to 12.5, which
     * rounds up to 13px, which makes the icon one pixel too big on 1.25dppx. Fix: */
    @media (min-resolution: 1.20dppx) and (max-resolution: 1.45dppx) {
      .titlebar-button > .toolbarbutton-icon {
        width: 11.5px;
        height: 11.5px;
      }
    }

    /* 175% dpi should result in the same device pixel sizes as 150% dpi. */
    @media (min-resolution: 1.70dppx) and (max-resolution: 1.95dppx) {
      .titlebar-button {
        padding-left: 14.1px;
        padding-right: 14.1px;
      }

      .titlebar-button > .toolbarbutton-icon {
        width: 10.8px;
        height: 10.8px;
      }
    }

    /* 225% dpi should result in the same device pixel sizes as 200% dpi. */
    @media (min-resolution: 2.20dppx) and (max-resolution: 2.45dppx) {
      .titlebar-button {
        padding-left: 15.3333px;
        padding-right: 15.3333px;
      }

      .titlebar-button > .toolbarbutton-icon {
        width: 10.8px;
        height: 10.8px;
      }
    }

    /* 275% dpi should result in the same device pixel sizes as 250% dpi. */
    @media (min-resolution: 2.70dppx) and (max-resolution: 2.95dppx) {
      .titlebar-button > .toolbarbutton-icon {
        width: 10.8px;
        height: 10.8px;
      }
    }

    .titlebar-button:hover {
      background-color: hsla(0, 0%, 0%, .17);
      transition: background-color linear 160ms;
    }

    .titlebar-button:hover:active {
      background-color: hsla(0, 0%, 0%, .27);
      transition: none;
    }

    .titlebar-button:not(:hover) > .toolbarbutton-icon:-moz-window-inactive {
      opacity: 0.5;
    }
          
    /* dark persona */
    .titlebar-button:-moz-lwtheme-brighttext:hover {
      background-color: hsla(0, 0%, 100%, .27);
      transition: background-color linear 180ms;
    }

    .titlebar-button:-moz-lwtheme-brighttext:hover:active {
      background-color: hsla(0, 0%, 100%, .37);
      transition: none;
    }
    
    /* dark accent color */
    #main-window[darkwindowframe="true"] .titlebar-button:not(#titlebar-close):not(:-moz-window-inactive):not(:-moz-lwtheme):hover {
      background-color: hsla(0, 0%, 100%, .17);
      transition: background-color linear 180ms;
    }

    #main-window[darkwindowframe="true"] .titlebar-button:not(#titlebar-close):not(:-moz-window-inactive):not(:-moz-lwtheme):hover:active	{
      background-color: hsla(0, 0%, 100%, .27);
      transition: none;
    }
    
    #main-window[darkwindowframe="true"] #titlebar-close:not(:-moz-window-inactive):not(:-moz-lwtheme):hover {
      background-color: hsla(0, 86%, 49%, 1);
      transition: background-color linear 120ms;
    }

    #main-window[darkwindowframe="true"] #titlebar-close:not(:-moz-window-inactive):not(:-moz-lwtheme):hover:active	{
      background-color: hsla(0, 60%, 39%, 1);
      transition: none;
    }
     
    #appmenu-button {
      margin-top: -1px;
      margin-bottom: 5px;
    }    

  }

/* ==== Windows Vista/7/8 styling ==== */

  @media (-moz-os-version: windows-vista),
         (-moz-os-version: windows-win7),
         (-moz-os-version: windows-win8) {
    /* Make sure the native margins are correct on Win Vista/7/8.
     * We can't use -moz-win-glass there because the border sizing would
     * not be correct. */
    #main-window {
      -moz-appearance: -moz-win-borderless-glass;
    }
    
    /* These should be hidden w/ glass enabled. Windows draws its own buttons. */
    .titlebar-button {
      display: none;
    }

    /* The borders on the glass frame are ours, and inside #browser, and on
     * vista and win7 we want to make sure they are "glassy", so we can't use
     * #browser as the exclude-glass container. We use #appcontent instead. */
    #browser {
      -moz-appearance: none;
    }

    #appcontent {
      -moz-appearance: -moz-win-exclude-glass;
    }

    #main-window[chromemargin^="0,"][sizemode=normal] #navigator-toolbox {
      margin-top: -7px;
    }

    /* Artificially draw window borders that are covered by lwtheme, see bug 591930. */
    #main-window[sizemode="normal"] > #titlebar > #titlebar-content:-moz-lwtheme {
      border-top: 2px solid;
      -moz-border-top-colors: @glassActiveBorderColor@ rgba(255,255,255,.6);
    }

    #main-window[sizemode="normal"] > #titlebar > #titlebar-content:-moz-lwtheme:-moz-window-inactive {
      -moz-border-top-colors: @glassInactiveBorderColor@ rgba(255,255,255,.6);
    }
    
    #main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container:-moz-lwtheme {
      margin-top: -1px;
    }

    #main-window[sizemode="normal"] #titlebar-buttonbox:-moz-lwtheme {
      margin-top: -2px;
    }

    #appmenu-button {
      margin-bottom: -1px; /* compensate white outer border */
    }
    
  }

/* ==== Windows Vista/7 (true glass) styling ==== */

  @media (-moz-os-version: windows-vista),
         (-moz-os-version: windows-win7) {
    #toolbar-menubar:not(:-moz-lwtheme),
    #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme),
    #nav-bar[tabsontop=false]:not(:-moz-lwtheme),
    #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child:not(:-moz-lwtheme) {
      text-shadow: 0 0 .5em white, 0 0 .5em white, 0 1px 0 rgba(255,255,255,.4);
    }
  
    #main-menubar:not(:-moz-lwtheme):not(:-moz-window-inactive) {
      background-color: rgba(255,255,255,.7);
      border-radius: 2.5px;
      color: black;
    }
    
  }
 
/* ==== Windows 8/10 (flat color) styling ==== */
 
  @media (-moz-os-version: windows-win8),
         (-moz-os-version: windows-win10) {
    /* On dark window frames, use a light text color instead of fog on Win8/10 */
    #main-window[darkwindowframe=true] #toolbar-menubar:not(:-moz-lwtheme),
    #main-window[darkwindowframe=true] #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme),
    #main-window[darkwindowframe=true] #nav-bar[tabsontop=false]:not(:-moz-lwtheme),
    #main-window[darkwindowframe=true] #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child:not(:-moz-lwtheme) {
	  color: white;
	}
    
    /* Prevent the dark window frame styles from disturbing native menu styling */
    #main-window[darkwindowframe=true] #main-menubar > menu:not(:-moz-lwtheme) {
      color: inherit;
    }
    
    #main-window[darkwindowframe=true] #toolbar-menubar:not(:-moz-lwtheme):-moz-window-inactive {
      color: ThreeDShadow;
    }
  }
  
/* ==== ==== */

  #main-window[sizemode=fullscreen]:not(:-moz-lwtheme) {
    -moz-appearance: none;
    background-color: #556;
  }

  #toolbar-menubar:not(:-moz-lwtheme),
  #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme),
  #nav-bar[tabsontop=false]:not(:-moz-lwtheme),
  #nav-bar + #customToolbars + #PersonalToolbar:-moz-any([collapsed=true],[moz-collapsed=true]) + #TabsToolbar[tabsontop=false]:last-child:not(:-moz-lwtheme) {
    background-color: transparent !important;
    color: black;
    border-left-style: none !important;
    border-right-style: none !important;
  }

  :-moz-any(#toolbar-menubar, #nav-bar[tabsontop=false]) :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
  :-moz-any(#toolbar-menubar, #nav-bar[tabsontop=false]) :-moz-any(@primaryToolbarButtons@) > toolbarbutton > .toolbarbutton-icon:not(:-moz-lwtheme),
  #TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
  #TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@) > toolbarbutton > .toolbarbutton-icon:not(:-moz-lwtheme),
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@) > toolbarbutton > .toolbarbutton-icon:not(:-moz-lwtheme) {
    list-style-image: url("chrome://browser/skin/Toolbar-glass.png");
  }

  :-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme),
  :-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme),
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme),
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme) {
    list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png");
  }
  
/* Show toolbar borders on vista through win8, but not on win10 and later: */
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7),
       (-moz-os-version: windows-win8) {
  /* Vertical toolbar border */
  #main-window[sizemode=normal] #navigator-toolbox::after,
  #main-window[sizemode=normal] #navigator-toolbox[tabsontop=true] > toolbar:not(#toolbar-menubar):not(#TabsToolbar),
  #main-window[sizemode=normal] #navigator-toolbox[tabsontop=false] > toolbar:not(#toolbar-menubar):not(#nav-bar) {
    border-left: 1px solid @toolbarShadowColor@;
    border-right: 1px solid @toolbarShadowColor@;
    background-clip: padding-box;
  }
  #main-window[sizemode=normal] #navigator-toolbox > toolbar:-moz-lwtheme {
    border-color: transparent !important;
  }
  #main-window[sizemode=normal] #browser-border-start,
  #main-window[sizemode=normal] #browser-border-end {
    display: -moz-box;
    background-color: @toolbarShadowColor@;
    width: 1px;
  }
  #main-window[sizemode=normal] #browser-bottombox {
    border: 1px solid @toolbarShadowColor@;
    border-top-style: none;
    background-clip: padding-box;
  }
}

/* Round top corners on Vista/7/8, but now Win10 because it's flush against the window edge */
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7),
       (-moz-os-version: windows-win8) {
  #main-window[sizemode=normal][tabsontop=false] #PersonalToolbar:not(:-moz-lwtheme) {
    border-top-left-radius: 2.5px;
    border-top-right-radius: 2.5px;
  }
  #main-window[sizemode=normal] #nav-bar[tabsontop=true]:not(:-moz-lwtheme),
  #main-window[sizemode=normal] #nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar:not(:-moz-lwtheme),
  #main-window[sizemode=normal] #nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme),
  #main-window[sizemode=normal][disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after {
    border-top-left-radius: 2.5px;
    border-top-right-radius: 2.5px;
  }
}

  /* Toolbar shadow behind tabs */
  /* This code is only needed for restored windows (i.e. sizemode=normal)
     because of the border radius on the toolbar below the tab bar. */
  #main-window[sizemode=normal] #nav-bar[tabsontop=true]:not(:-moz-lwtheme),
  #main-window[sizemode=normal] #nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar:not(:-moz-lwtheme),
  #main-window[sizemode=normal] #nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme),
  #main-window[sizemode=normal][disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after {
    border-top: 1px solid @toolbarShadowColor@;
    background-clip: padding-box;
  }
  #main-window[sizemode=normal] #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
    margin-bottom: -1px;
    background-image: none !important;
  }
  #main-window[sizemode=normal] #tabbrowser-tabs[tabsontop=true] > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox > .scrollbox-innerbox:not(:-moz-lwtheme) {
    position: relative;
  }

  #navigator-toolbox[tabsontop=false] > #PersonalToolbar {
    margin-top: 3px;
  }
  
  #navigator-toolbox[tabsontop=false] > #PersonalToolbar:not(:-moz-lwtheme) {
    margin-top: 2px;
    border-top: 1px solid @toolbarShadowColor@;
    background-image: linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
  }
  
  @media (-moz-os-version: windows-win10) {
    /* Remove gradient and make border faded */
    #navigator-toolbox[tabsontop=false] > #PersonalToolbar:not(:-moz-lwtheme) {
      border-top: 1px solid rgba(10%,10%,10%,.2);
      background-image: none;
    }
  }

  #main-window[sizemode=normal] #TabsToolbar[tabsontop=true] {
    padding-left: 4px;
    padding-right: 4px;
  }

  #main-window[sizemode=normal] #TabsToolbar[tabsontop=false] {
    padding-left: 2px;
    padding-right: 2px;
  }

  /* Rounded corners for when chrome is disabled */
  #main-window[sizemode=normal][disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after {
    visibility: visible;
    background-color: @customToolbarColor@;
    background-image: linear-gradient(@toolbarHighlight@, @toolbarHighlight@);
    height: 4px;
  }

  /* Make the window draggable by glassed toolbars (bug 555081) */
  #toolbar-menubar:not([autohide="true"]),
  #TabsToolbar[tabsontop="true"],
  #nav-bar[tabsontop=false],
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed="true"] + #TabsToolbar[tabsontop="false"]:last-child,
  #navigator-toolbox > toolbar:not(#toolbar-menubar):-moz-lwtheme {
    -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
  }

  #appcontent:not(:-moz-lwtheme) {
    background-color: -moz-dialog;
  }

  #navigator-toolbox[tabsontop=false] #urlbar:not(:-moz-lwtheme),
  #navigator-toolbox[tabsontop=false] .searchbar-textbox:not(:-moz-lwtheme) {
    background-color: rgba(255,255,255,.725);
    @navbarTextboxCustomBorder@
    color: black;
  }

  #navigator-toolbox[tabsontop=false] html|*.urlbar-input:not(:-moz-lwtheme)::-moz-placeholder,
  #navigator-toolbox[tabsontop=false] .searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input:not(:-moz-lwtheme)::-moz-placeholder {
    opacity: 1.0;
    color: #777;
  }

  #navigator-toolbox[tabsontop=false] #urlbar:not(:-moz-lwtheme):hover,
  #navigator-toolbox[tabsontop=false] .searchbar-textbox:not(:-moz-lwtheme):hover {
    background-color: rgba(255,255,255,.898);
  }

  #navigator-toolbox[tabsontop=false] #urlbar:not(:-moz-lwtheme)[focused],
  #navigator-toolbox[tabsontop=false] .searchbar-textbox:not(:-moz-lwtheme)[focused] {
    background-color: white;
  }

  .tabbrowser-tab:not(:-moz-lwtheme) {
    text-shadow: none;
  }

  #main-window[sizemode=normal] .statuspanel-inner {
    /* align with the browser's side borders */
    padding-left: 1px;
    padding-right: 1px;
  }

  #allTabs-panel,
  #ctrlTab-panel {
    background: transparent;
    -moz-appearance: -moz-win-glass;
    border-radius: 0;
    border: none;
    font: normal 1.2em "Segoe UI";
    color: black;
    text-shadow: white -1px -1px .35em, white -1px 1px .35em, white 1px 1px .35em, white 1px -1px .35em;
  }
}

@media not all and (-moz-windows-compositor) {
  @media (-moz-windows-default-theme) {
    #main-window {
      background-color: rgb(185,209,234);
    }
    #main-window:-moz-window-inactive {
      background-color: rgb(215,228,242);
    }

    #toolbar-menubar:not([autohide=true]):not(:-moz-lwtheme),
    #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme),
    #navigator-toolbox[tabsontop=false] > toolbar:not(#toolbar-menubar):not(:-moz-lwtheme) {
      -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
      background-color: transparent;
    }
    #toolbar-menubar[autohide=true] {
      background-color: transparent !important;
    }
  }

  #print-preview-toolbar:not(:-moz-lwtheme) {
    -moz-appearance: -moz-win-browsertabbar-toolbox;
  }
}

/* ::::: fullscreen window controls ::::: */

#window-controls {
  -moz-box-align: start;
}

#minimize-button,
#restore-button,
#close-button {
  -moz-appearance: none;
  border-style: none;
  margin: 0;
}
#close-button {
  -moz-image-region: rect(0, 49px, 16px, 32px);
}
#close-button:hover {
  -moz-image-region: rect(16px, 49px, 32px, 32px);
}
#close-button:hover:active {
  -moz-image-region: rect(32px, 49px, 48px, 32px);
}

#minimize-button:-moz-locale-dir(rtl),
#restore-button:-moz-locale-dir(rtl),
#close-button:-moz-locale-dir(rtl) {
  transform: scaleX(-1);
}

/* ::::: splitmenu highlight style that imitates Windows 7 start menu ::::: */
@media (-moz-windows-default-theme) {
  .splitmenu-menuitem,
  .splitmenu-menu {
    -moz-appearance: none;
    padding-top: 2px;
    padding-bottom: 2px;
    border: 1px solid transparent;
  }
  .splitmenu-menuitem {
    -moz-margin-end: 0;
  }
  .splitmenu-menu {
    -moz-margin-start: -1px;
  }
  .splitmenu-menuitem:-moz-locale-dir(ltr),
  .splitmenu-menu:-moz-locale-dir(rtl) {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
  }
  .splitmenu-menu:-moz-locale-dir(ltr),
  .splitmenu-menuitem:-moz-locale-dir(rtl) {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
  }

  .splitmenu-menuitem > .menu-text {
    -moz-margin-start: 1px !important;
    -moz-margin-end: 3px !important;
  }
  .splitmenu-menu > .menu-right {
    -moz-margin-end: -3px;
  }

  .splitmenu-menuitem[iconic],
  .splitmenu-menu[iconic] {
    padding-bottom: 1px;
  }
  .splitmenu-menuitem[iconic] > .menu-iconic-left {
    margin-top: -3px;
    margin-bottom: -2px;
    -moz-margin-start: -1px;
  }
  .splitmenu-menuitem[iconic] > .menu-iconic-text {
    -moz-margin-start: 2px !important;
    -moz-margin-end: 3px !important;
  }
  .splitmenu-menu[iconic] > .menu-right {
    margin-top: -1px;
  }

  .splitmenu-menuitem[_moz-menuactive],
  .splitmenu-menu[_moz-menuactive] {
    background-color: transparent;
    background-image: linear-gradient(#fafbfd, #ebf3fd);
    border-color: #aeccf1;
  }

  .splitmenu-menuitem[disabled][_moz-menuactive],
  .splitmenu-menu[disabled][_moz-menuactive] {
    background-image: linear-gradient(#f8f9f9, #eaeaea);
    border-color: #d8d7d7;
  }

  .splitmenu-menu[_moz-menuactive]:not(:hover):not([open]) {
    background-image: none;
  }
}
