/**********
 * button *
 **********/

.button,
.button.flat:hover,
.dialog-action-area.linked .button:first-child,
.dialog-action-area.linked .button:hover:first-child,
.dialog-action-area.linked .button,
.dialog-action-area.linked .button:hover,
.dialog-action-area.linked .button:last-child,
.dialog-action-area.linked .button:hover:last-child,
.inline-toolbar GtkToolButton > .button,
.inline-toolbar.toolbar .button,
.mate-panel-menu-bar .button:hover {
    border-style: solid;
    border-width: 2px;
    border-radius: 3px;
    border-color: transparent;
    border-image: -gtk-scaled(url("borders/button/button.png"), url("borders/button/button@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.5),
                inset -1px 0 alpha(white, 0.5),
                inset 0 -1px alpha(white, 0.1);
}

.button.flat,
.button.flat:insensitive,
.mate-panel-menu-bar .button {
    border-color: transparent;
    border-image: none;
    box-shadow: none;
}

.button:active,
.button:checked,
.button.flat:checked,
.button.flat:active,
.button.flat:checked:hover,
.button.flat:active:hover,
.inline-toolbar GtkToolButton > .button:active,
.inline-toolbar GtkToolButton > .button:checked,
.inline-toolbar.toolbar .button:active,
.inline-toolbar.toolbar .button:active:checked,
.dialog-action-area.linked .button:active:first-child,
.dialog-action-area.linked .button:active:hover:first-child,
.dialog-action-area.linked .button:checked:first-child,
.dialog-action-area.linked .button:checked:hover:first-child,
.dialog-action-area.linked .button:active,
.dialog-action-area.linked .button:active:hover,
.dialog-action-area.linked .button:checked,
.dialog-action-area.linked .button:checked:hover,
.dialog-action-area.linked .button:active:last-child,
.dialog-action-area.linked .button:active:hover:last-child,
.dialog-action-area.linked .button:checked:last-child,
.dialog-action-area.linked .button:checked:hover:last-child,
.mate-panel-menu-bar .button:active,
.mate-panel-menu-bar .button:checked {
    border-image: -gtk-scaled(url("borders/button/button-active.png"), url("borders/button/button-active@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

.button:insensitive,
.inline-toolbar GtkToolButton > .button:insensitive,
.inline-toolbar.toolbar .button:insensitive,
.dialog-action-area.linked .button:insensitive:first-child,
.dialog-action-area.linked .button:insensitive,
.dialog-action-area.linked .button:insensitive:last-child {
    border-image: -gtk-scaled(url("borders/button/button-insensitive.png"), url("borders/button/button-insensitive@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

.button:insensitive:active,
.button:insensitive:checked,
.inline-toolbar GtkToolButton > .button:insensitive:active,
.inline-toolbar GtkToolButton > .button:insensitive:checked,
.inline-toolbar.toolbar .button:insensitive:active,
.inline-toolbar.toolbar .button:insensitive:active:checked {
    border-image: -gtk-scaled(url("borders/button/button-active-insensitive.png"), url("borders/button/button-active-insensitive@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(black, 0.05),
                inset 1px 0 alpha(black, 0.02),
                inset -1px 0 alpha(black, 0.02),
                inset 0 -1px alpha(black, 0.01);
}

.button.default,
.dialog-action-area.linked .button.default:first-child,
.dialog-action-area.linked .button.default,
.dialog-action-area.linked .button.default:last-child {
    border-color: transparent;
    border-image: -gtk-scaled(url("borders/button/button-focus.png"), url("borders/button/button-focus@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.5),
                inset -1px 0 alpha(white, 0.5),
                inset 0 -1px alpha(white, 0.1);
}

.button.default:active,
.button.default:checked,
.dialog-action-area.linked .button.default:active:first-child,
.dialog-action-area.linked .button.default:checked:first-child,
.dialog-action-area.linked .button.default:active,
.dialog-action-area.linked .button.default:checked,
.dialog-action-area.linked .button.default:active:last-child,
.dialog-action-area.linked .button.default:checked:last-child {
    border-color: transparent;
    border-image: -gtk-scaled(url("borders/button/button-focus.png"), url("borders/button/button-focus@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

/************************************
* Primary toolbar/headerbar buttons *
*************************************/

.header-bar .titlebutton.button,
.titlebar .titlebutton.flat,
.titlebar .titlebutton.button,
.titlebar .titlebutton.button:hover,
.titlebar .titlebutton.button:active,
.titlebar .titlebutton.button:active:hover,
.titlebar .titlebutton.button:checked,
.titlebar .titlebutton.button:backdrop {
    border: none;
    box-shadow: none;
}

.header-bar .button.flat,
.header-bar.titlebar GtkMenuButton.button.titlebutton,
.primary-toolbar .button.flat,
.primary-toolbar .button.flat:insensitive {
    border-style: solid;
    border-width: 2px;
    border-radius: 3px;
    border-color: transparent;
    border-image: none;
    box-shadow: none;
}

.header-bar .button,
.header-bar .button.flat:hover,
.header-bar.titlebar GtkMenuButton.button.titlebutton:hover,
.primary-toolbar .button,
.primary-toolbar .button:hover,
.primary-toolbar .button.flat:hover,
.primary-toolbar .button.raised,
.primary-toolbar .button.raised:hover,
.primary-toolbar .raised .button,
.primary-toolbar .raised .button:hover {
    border-style: solid;
    border-width: 2px;
    border-radius: 3px;
    border-color: transparent;
    border-image: -gtk-scaled(url("borders/button/raised-button.png"), url("borders/button/raised-button@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(white, 0.2),
                inset 0 -1px alpha(white, 0.1);
}

.header-bar .button:checked,
.header-bar .button:checked:hover,
.header-bar .button:active,
.header-bar .button:active:hover,
.header-bar.titlebar GtkMenuButton.button.titlebutton:checked,
.header-bar.titlebar GtkMenuButton.button.titlebutton:checked:hover,
.header-bar.titlebar GtkMenuButton.button.titlebutton:active,
.header-bar.titlebar GtkMenuButton.button.titlebutton:active:hover,
.primary-toolbar .button:checked,
.primary-toolbar .button:checked:hover,
.primary-toolbar .button:active,
.primary-toolbar .button:active:hover,
.primary-toolbar .button.flat:checked,
.primary-toolbar .button.flat:checked:hover,
.primary-toolbar .button.flat:active,
.primary-toolbar .button.flat:active:hover,
.primary-toolbar .button.raised:checked,
.primary-toolbar .button.raised:checked:hover,
.primary-toolbar .raised .button:checked,
.primary-toolbar .raised .button:checked:hover,
.primary-toolbar .button.raised:active,
.primary-toolbar .button.raised:active:hover,
.primary-toolbar .raised .button:active,
.primary-toolbar .raised .button:active:hover {
    border-image: -gtk-scaled(url("borders/button/button-active.png"), url("borders/button/button-active@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

.header-bar .button:insensitive,
.primary-toolbar .button:insensitive,
.primary-toolbar .button.raised:insensitive,
.primary-toolbar .raised .button:insensitive {
    border-image: -gtk-scaled(url("borders/button/button-insensitive.png"), url("borders/button/button-insensitive@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

.header-bar .button:insensitive:checked,
.primary-toolbar .button:insensitive:checked,
.primary-toolbar .button.flat:insensitive:checked,
.primary-toolbar .button.raised:insensitive:checked,
.primary-toolbar .raised .button:insensitive:checked {
    border-image: -gtk-scaled(url("borders/button/button-active-insensitive.png"), url("borders/button/button-active-insensitive@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(black, 0.05),
                inset 1px 0 alpha(black, 0.02),
                inset -1px 0 alpha(black, 0.02),
                inset 0 -1px alpha(black, 0.01);
}

.header-bar .button.default,
.primary-toolbar .button.default,
.primary-toolbar .button.flat.default,
.primary-toolbar .button.raised.default,
.primary-toolbar .raised .button.default {
    border-image: -gtk-scaled(url("borders/button/button-focus.png"), url("borders/button/button-focus@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.5),
                inset -1px 0 alpha(white, 0.5),
                inset 0 -1px alpha(white, 0.1);
}

.header-bar .button.default:active,
.primary-toolbar .button.default:active,
.primary-toolbar .button.flat.default:active,
.primary-toolbar .button.raised.default:active,
.primary-toolbar .raised .button.default:active {
    border-image: -gtk-scaled(url("borders/button/button-focus.png"), url("borders/button/button-focus@2.png")) 4 / 4px stretch;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

/*****************
 * column-header *
 *****************/

column-header.button,
column-header .button,
column-header.button:active,
column-header .button:active,
column-header.button:hover,
column-header .button:hover,
column-header.button:insensitive,
column-header .button:insensitive {
    border-style: solid;
    border-width: 0 1px 1px 0;
    border-radius: 0;
    border-color: @border;
    border-image: none;
}

column-header.button:last-child,
column-header:last-child .button,
column-header.button:last-child:active,
column-header:last-child .button:active,
column-header.button:last-child:active:hover,
column-header:last-child .button:active:hover {
    border-right-width: 0;
}

.entry,
GtkComboBox.combobox-entry .button {
    border-style: solid;
    border-width: 2px;
    border-radius: 3px;
    border-color: transparent;
    border-image: -gtk-scaled(url("borders/entry/entry.png"), url("borders/entry/entry@2.png")) 4 / 4px stretch;
}

.entry:insensitive {
    border-image: -gtk-scaled(url("borders/entry/entry-insensitive.png"), url("borders/entry/entry-insensitive@2.png")) 4 / 4px stretch;
}

/************
 * notebook *
 ************/

.notebook {
    border: 2px solid transparent;
    border-radius: 0;
    border-image: -gtk-scaled(url("borders/notebook/notebook.png"), url("borders/notebook/notebook@2.png")) 2 / 2px stretch;
}

.notebook tab {

}

.notebook tab.top {
    border-bottom-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-top.png"), url("borders/notebook/tab-top@2.png")) 3 3 0 3 / 3px 3px 0 3px stretch;
}

.notebook tab.bottom {
    border-top-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-bottom.png"), url("borders/notebook/tab-bottom@2.png")) 0 3 3 3 / 0 3px 3px 3px stretch;
}

.notebook tab.left {
    border-right-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-left.png"), url("borders/notebook/tab-left@2.png")) 3 0 3 3 / 3px 0 3px 3px stretch;
}

.notebook tab.right {
    border-left-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-right.png"), url("borders/notebook/tab-right@2.png")) 3 3 3 0 / 3px 3px 3px 0 stretch;
}

.notebook tab.top:active {
    border-bottom-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-top-active.png"), url("borders/notebook/tab-top-active@2.png")) 3 3 0 3 / 3px 3px 0 3px stretch;
}

.notebook tab.bottom:active {
    border-top-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-bottom-active.png"), url("borders/notebook/tab-bottom-active@2.png")) 0 3 3 3 / 0 3px 3px 3px stretch;
}

.notebook tab.left:active {
    border-right-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-left-active.png"), url("borders/notebook/tab-left-active@2.png")) 3 0 3 3 / 3px 0 3px 3px stretch;
}

.notebook tab.right:active {
    border-left-width: 0;
    border-image: -gtk-scaled(url("borders/notebook/tab-right-active.png"), url("borders/notebook/tab-right-active@2.png")) 3 3 3 0 / 3px 3px 3px 0 stretch;
}

/*********
 * Scale *
 *********/

.scale.trough {
    border: 1px solid transparent;
    border-radius: 3px;
    border-image: -gtk-scaled(url("borders/scale/scale.png"), url("borders/scale/scale@2.png")) 3 3 4 3 / 3px 3px 4px 3px stretch;
}

.scale.trough.vertical {
    border-image: -gtk-scaled(url("borders/scale/scale-vertical.png"), url("borders/scale/scale-vertical@2.png")) 3 4 3 3 / 3px 4px 3px 3px stretch;
}

.scale.trough:insensitive {
    border-image: -gtk-scaled(url("borders/scale/scale-insensitive.png"), url("borders/scale/scale-insensitive@2.png")) 3 4 3 3 / 3px 4px 3px 3px stretch;
}

.scale.trough.vertical:insensitive {
    border-image: -gtk-scaled(url("borders/scale/scale-vertical-insensitive.png"), url("borders/scale/scale-vertical-insensitive@2.png")) 3 4 3 3 / 3px 4px 3px 3px stretch;
}

/**********
 * switch *
 **********/

GtkSwitch.trough {
    border: 1px solid @border;
    border-radius: 4px;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06),
                0 1px alpha(white, 0.2);
}

GtkSwitch.trough:insensitive,
GtkSwitch.trough:insensitive:active {
    border-color: shade(@border, 1.1);
}

GtkSwitch.slider {
    border: 1px solid @border;
    border-radius: 4px;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.5),
                inset -1px 0 alpha(white, 0.5),
                inset 0 -1px alpha(white, 0.1);
}

GtkSwitch.slider:insensitive {
    border-color: shade(@border, 1.1);
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

/******************
 * Linked Entries *
 ******************/

.linked .entry {
    box-shadow: inset -1px 0 @border;   
}

.linked .entry,
.primary-toolbar .linked .entry {

    border-right-width: 0;
    border-left-width: 0;
    border-radius: 0;
    border-image-width: 3px 0 4px 0;
}

.linked .entry:first-child,
.primary-toolbar .linked .entry:first-child {
    border-right-width: 0;
    border-left-width: 2px;
    border-radius: 3px 0 0 3px;
    border-image-width: 3px 0 4px 3px;
}

.linked .entry:last-child,
.primary-toolbar .linked .entry:last-child {
    border-left-width: 0;
    border-radius: 0 3px 3px 0;
    border-image-width: 3px 3px 4px 0;
}

.linked .entry:only-child,
.primary-toolbar .linked .entry:only-child {
    border-right-width: 2px;
    border-left-width: 2px;
    border-radius: 3px;
    border-image-width: 3px 3px 4px 3px;
}

/********************************************
 * Linked borders and shadows - Nomal/Hover *
 ********************************************/
 
/* Middle Button */

.linked .button,
.linked .button:hover,
.linked > GtkComboBox > .button:dir(ltr),
.linked > GtkComboBox > .button:hover:dir(ltr),
.inline-toolbar.toolbar .button,
.inline-toolbar.toolbar .button:hover,
.inline-toolbar.toolbar .button:insensitive,
.inline-toolbar.toolbar GtkToolButton > .button,
.inline-toolbar.toolbar GtkToolButton > .button:hover,
.inline-toolbar.toolbar GtkToolButton > .button:insensitive,
.path-bar .button,
.path-bar .button:hover {
    border-right-width: 0;
    border-left-width: 0;
    border-image-width: 4px 0 4px 0;
    border-radius: 0;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset -1px 0 alpha(black, 0.2),
                inset 1px 0 alpha(white, 0.2);
}

/* Leftmost button */

.linked .button:first-child,
.linked .button:first-child:hover,
.linked > GtkComboBox:first-child > .button:dir(ltr),
.linked > GtkComboBox:first-child > .button:hover:dir(ltr),
.inline-toolbar.toolbar .button:first-child,
.inline-toolbar.toolbar .button:first-child:hover,
.inline-toolbar.toolbar GtkToolButton:first-child > .button,
.inline-toolbar.toolbar GtkToolButton:first-child > .button:hover,
.path-bar .button:first-child,
.path-bar .button:first-child:hover {
    border-left-width: 2px;
    border-right-width: 0;
    border-image-width: 4px 0 4px 4px;
    border-radius: 3px 0 0 3px;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(black, 0.2);
}

/* Rightmost button */

.linked .button:last-child,
.linked .button:last-child:hover,
.linked > GtkComboBox:last-child > .button:dir(ltr),
.linked > GtkComboBox:last-child > .button:hover:dir(ltr),
.inline-toolbar.toolbar .button:last-child,
.inline-toolbar.toolbar .button:hover:last-child,
.inline-toolbar.toolbar GtkToolButton:last-child > .button,
.inline-toolbar.toolbar GtkToolButton:last-child > .button:hover,
.path-bar .button:last-child,
.path-bar .button:last-child:hover {
    border-left-width: 0;
    border-right-width: 2px;
    border-image-width: 4px 4px 4px 0;
    border-radius: 0 3px 3px 0;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(white, 0.2);
}

/* Single button */

.linked .button:only-child,
.linked .button:only-child:hover,
.inline-toolbar.toolbar .button:only-child,
.inline-toolbar.toolbar .button:only-child:hover,
.inline-toolbar.toolbar GtkToolButton:only-child > .button,
.inline-toolbar.toolbar GtkToolButton:only-child > .button:hover,
.path-bar .button:only-child,
.path-bar .button:only-child:hover {
    border-left-width: 2px;
    border-right-width: 2px;
    border-image-width: 4px 4px 4px 4px;
    border-radius: 3px;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(white, 0.2);
}

/*********************************
* Linked Button Borders - Active *
**********************************/

/* Middle button */

.linked .button:active,
.linked .button:checked,
.linked .button:active:hover,
.linked .button:checked:hover,
.inline-toolbar.toolbar .button:active,
.inline-toolbar.toolbar .button:active:hover,
.inline-toolbar.toolbar GtkToolButton > .button:active,
.inline-toolbar.toolbar GtkToolButton > .button:active:hover,
.path-bar .button:active,
.path-bar .button:checked,
.path-bar .button:active:hover,
.path-bar .button:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 0 -1px alpha(black, .06),
                inset 1px 0 alpha(black, 0.2),
                inset -1px 0 alpha(black, 0.2); 
}

/* Leftmost button */

.linked .button:first-child:active,
.linked .button:first-child:checked,
.linked .button:first-child:active:hover,
.linked .button:first-child:checked:hover,
.inline-toolbar.toolbar .button:first-child:active,
.inline-toolbar.toolbar .button:first-child:active:hover,
.inline-toolbar.toolbar GtkToolButton:first-child > .button:active,
.inline-toolbar.toolbar GtkToolButton:first-child > .button:active:hover,
.path-bar .button:first-child:active,
.path-bar .button:first-child:checked,
.path-bar .button:first-child:active:hover,
.path-bar .button:first-child:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 0 -1px alpha(black, 0.06),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.2);   
}

/* Rightmost button */

.linked .button:last-child:active,
.linked .button:last-child:checked,
.linked .button:last-child:active:hover,
.linked .button:last-child:checked:hover,
.inline-toolbar.toolbar .button:last-child:active,
.inline-toolbar.toolbar .button:last-child:active:hover,
.inline-toolbar.toolbar GtkToolButton:last-child > .button:active,
.inline-toolbar.toolbar GtkToolButton:last-child > .button:active:hover,
.path-bar .button:last-child:active,
.path-bar .button:last-child:checked,
.path-bar .button:last-child:active:hover,
.path-bar .button:last-child:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 0 -1px alpha(black, 0.06),
                inset 1px 0 alpha(black, 0.2),
                inset -1px 0 alpha(black, 0.08);
}

/********************************************
 * Linked borders and shadows - Insensitive *
 ********************************************/

/* Middle Button */

.linked .button:insensitive,
.inline-toolbar.toolbar .button:insensitive,
.inline-toolbar.toolbar GtkToolButton > .button:insensitive,
.path-bar .button:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 0 -1px alpha(white, 0.06),
                inset -1px 0 alpha(black, 0.2),
                inset 1px 0 alpha(white, 0.15);
}

/* Leftmost button */

.linked .button:first-child:insensitive,
.inline-toolbar.toolbar .button:first-child:insensitive,
.inline-toolbar.toolbar GtkToolButton:first-child > .button:insensitive,
.path-bar .button:first-child:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 0 -1px alpha(white, 0.06),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(black, 0.2);
}

/* Rightmost button */

.linked .button:last-child:insensitive,
.inline-toolbar.toolbar .button:last-child:insensitive,
.inline-toolbar.toolbar GtkToolButton:last-child > .button:insensitive,
.path-bar .button:last-child:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 0 -1px alpha(white, 0.06),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15);
}

/***********************************************************
 * Tool/Headarbar linked borders and shadows - Nomal/Hover *
 ***********************************************************/
 
/* Middle Button */

.header-bar .linked .button,
.header-bar .linked .button:hover,
.primary-toolbar .linked .button,
.primary-toolbar .linked .button:hover,
.primary-toolbar .button.raised.linked,
.primary-toolbar .raised.linked .button,
.primary-toolbar .raised .linked .button,
.primary-toolbar .button.raised.linked:hover,
.primary-toolbar .raised.linked .button:hover,
.primary-toolbar .raised .linked .button:hover {
    border-right-width: 0;
    border-left-width: 0;
    border-radius: 0;
    border-image-width: 4px 0 4px 0;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(black, 0.2);
}

/* Leftmost button */

.header-bar .linked .button:first-child,
.header-bar .linked .button:hover:first-child,
.primary-toolbar .linked .button:first-child,
.primary-toolbar .linked .button:first-child:hover,
.primary-toolbar .button.raised.linked:first-child,
.primary-toolbar .raised.linked .button:first-child,
.primary-toolbar .button.raised.linked:first-child:hover,
.primary-toolbar .raised.linked .button:first-child:hover {
    border-left-width: 2px;
    border-right-width: 0;
    border-radius: 3px 0 0 3px;
    border-image-width: 4px 0 4px 4px;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(black, 0.2);
}

/* Rightmost button */

.header-bar .linked .button:last-child,
.header-bar .linked .button:last-child:hover,
.primary-toolbar .linked .button:last-child,
.primary-toolbar .linked .button:last-child:hover,
.primary-toolbar .button.raised.linked:last-child,
.primary-toolbar .raised.linked .button:last-child,
.primary-toolbar .button.raised.linked:last-child:hover,
.primary-toolbar .raised.linked .button:last-child:hover {
    border-left-width: 0;
    border-right-width: 2px;
    border-radius: 0 3px 3px 0;
    border-image-width: 4px 4px 4px 0;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(white, 0.2);
}

/* Single button */

.header-bar .linked .button:only-child,
.header-bar .linked .button:only-child:hover,
.primary-toolbar .linked .button:only-child,
.primary-toolbar .linked .button:only-child:hover,
.primary-toolbar .button.raised.linked:only-child,
.primary-toolbar .raised.linked .button:only-child,
.primary-toolbar .button.raised.linked:only-child:hover,
.primary-toolbar .raised.linked .button:only-child:hover {
    border-width: 2px;
    border-radius: 3px;
    border-image-width: 4px;
    box-shadow: inset 0 1px white,
                inset 0 -1px alpha(white, 0.1),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(white, 0.2);
}

/******************************************************
 * Tool/Headarbar linked borders and shadows - Active *
 ******************************************************/

/* Middle button */
 
.header-bar .linked .button:active,
.header-bar .linked .button:active:hover,
.header-bar .linked .button:checked,
.header-bar .linked .button:checked:hover,
.primary-toolbar .linked .button:active,
.primary-toolbar .linked .button:active:hover,
.primary-toolbar .linked .button:checked,
.primary-toolbar .linked .button:checked:hover,
.primary-toolbar .button.raised.linked:active,
.primary-toolbar .raised.linked .button:active,
.primary-toolbar .button.raised.linked:active:hover,
.primary-toolbar .raised.linked .button:active:hover,
.primary-toolbar .button.raised.linked:checked,
.primary-toolbar .raised.linked .button:checked,
.primary-toolbar .button.raised.linked:checked:hover,
.primary-toolbar .raised.linked .button:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.2),
                inset -1px 0 alpha(black, 0.2),
                inset 0 -1px alpha(black, 0.06);
}

/* Leftmost button */

.header-bar .linked .button:first-child:active,
.header-bar .linked .button:first-child:active:hover,
.header-bar .linked .button:first-child:checked,
.header-bar .linked .button:first-child:checked:hover,
.primary-toolbar .linked .button:first-child:active,
.primary-toolbar .linked .button:first-child:active:hover,
.primary-toolbar .linked .button:first-child:checked,
.primary-toolbar .linked .button:first-child:checked:hover,
.primary-toolbar .button.raised.linked:first-child:active,
.primary-toolbar .raised.linked .button:first-child:active,
.primary-toolbar .button.raised.linked:first-child:active:hover,
.primary-toolbar .raised.linked .button:first-child:active:hover,
.primary-toolbar .button.raised.linked:first-child:checked,
.primary-toolbar .raised.linked .button:first-child:checked,
.primary-toolbar .button.raised.linked:first-child:checked:hover,
.primary-toolbar .raised.linked .button:first-child:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.2),
                inset 0 -1px alpha(black, 0.06);
}

/* Rightmost button */

.header-bar .linked .button:last-child:active,
.header-bar .linked .button:last-child:active:hover,
.header-bar .linked .button:last-child:checked,
.header-bar .linked .button:last-child:checked:hover,
.primary-toolbar .linked .button:last-child:active,
.primary-toolbar .linked .button:last-child:active:hover,
.primary-toolbar .linked .button:last-child:checked,
.primary-toolbar .linked .button:last-child:checked:hover,
.primary-toolbar .button.raised.linked:last-child:active,
.primary-toolbar .raised.linked .button:last-child:active,
.primary-toolbar .button.raised.linked:last-child:active:hover,
.primary-toolbar .raised.linked .button:last-child:active:hover,
.primary-toolbar .button.raised.linked:last-child:checked,
.primary-toolbar .raised.linked .button:last-child:checked,
.primary-toolbar .button.raised.linked:last-child:checked:hover,
.primary-toolbar .raised.linked .button:last-child:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.2),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

/* Single button */

.header-bar .linked .button:only-child:active,
.header-bar .linked .button:only-child:active:hover,
.header-bar .linked .button:only-child:checked,
.header-bar .linked .button:only-child:checked:hover,
.primary-toolbar .linked .button:only-child:active,
.primary-toolbar .linked .button:only-child:active:hover,
.primary-toolbar .linked .button:only-child:checked,
.primary-toolbar .linked .button:only-child:checked:hover,
.primary-toolbar .button.raised.linked:only-child:active,
.primary-toolbar .raised.linked .button:only-child:active,
.primary-toolbar .button.raised.linked:only-child:active:hover,
.primary-toolbar .raised.linked .button:only-child:active:hover,
.primary-toolbar .button.raised.linked:only-child:checked,
.primary-toolbar .raised.linked .button:only-child:checked,
.primary-toolbar .button.raised.linked:only-child:checked:hover,
.primary-toolbar .raised.linked .button:only-child:checked:hover {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

/***********************************************************
 * Tool/Headarbar linked borders and shadows - Insensitive *
 ***********************************************************/

/* Middle button */

.header-bar .linked .button:insensitive,
.primary-toolbar .linked .button:insensitive,
.primary-toolbar .button.raised.linked:insensitive,
.primary-toolbar .raised.linked .button:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset -1px 0 alpha(black, 0.15),
                inset 1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

/* Leftmost button */

.header-bar .linked .button:first-child:insensitive,
.primary-toolbar .linked .button:first-child:insensitive,
.primary-toolbar .button.raised.linked:first-child:insensitive,
.primary-toolbar .raised.linked .button:first-child:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset -1px 0 alpha(black, 0.15),
                inset 1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

/* Rightmost button */

.header-bar .linked .button:last-child:insensitive,
.primary-toolbar .linked .button:last-child:insensitive,
.primary-toolbar .button.raised.linked:last-child:insensitive,
.primary-toolbar .raised.linked .button:last-child:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset -1px 0 alpha(white, 0.15),
                inset 1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

/* Single button */

.header-bar .linked .button:only-child:insensitive,
.primary-toolbar .linked .button:only-child:insensitive,
.primary-toolbar .button.raised.linked:only-child:insensitive,
.primary-toolbar .raised.linked .button:only-child:insensitive {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset -1px 0 alpha(white, 0.15),
                inset 1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

/******************************************************************
 * Tool/Headarbar linked borders and shadows - Active Insensitive *
 *****************************************************************/

/* Middle button */

.header-bar .linked .button:insensitive:checked,
.primary-toolbar .linked .button:checked:insensitive,
.primary-toolbar .button.raised.linked:checked:insensitive,
.primary-toolbar .raised.linked .button:checked:insensitive {
    box-shadow: inset 0 1px alpha(black, 0.05),
                inset -1px 0 alpha(black, 0.15),
                inset 1px 0 alpha(black, 0.05),
                inset 0 -1px alpha(black, 0.02);
}

/* Leftmost button */

.header-bar .linked .button:first-child:insensitive,
.primary-toolbar .linked .button:first-child:insensitive,
.primary-toolbar .button.raised.linked:first-child:insensitive,
.primary-toolbar .raised.linked .button:first-child:insensitive {
    box-shadow: inset 0 1px alpha(black, 0.05),
                inset -1px 0 alpha(black, 0.15),
                inset 1px 0 alpha(black, 0.05),
                inset 0 -1px alpha(black, 0.02);
}

/* Rightmost button */

.header-bar .linked .button:last-child:insensitive,
.primary-toolbar .linked .button:last-child:insensitive,
.primary-toolbar .button.raised.linked:last-child:insensitive,
.primary-toolbar .raised.linked .button:last-child:insensitive {
    box-shadow: inset 0 1px alpha(black, 0.05),
                inset -1px 0 alpha(black, 0.05),
                inset 1px 0 alpha(black, 0.05),
                inset 0 -1px alpha(black, 0.02);
}

/* Single button */

.header-bar .linked .button:only-child:insensitive,
.primary-toolbar .linked .button:only-child:insensitive,
.primary-toolbar .button.raised.linked:only-child:insensitive,
.primary-toolbar .raised.linked .button:only-child:insensitive {
    box-shadow: inset 0 1px alpha(black, 0.05),
                inset 1px 0 alpha(black, 0.02),
                inset -1px 0 alpha(black, 0.02),
                inset 0 -1px alpha(black, 0.01);
}
