/* NOTES to contributors:
 * use 4 spaces indents, and keep code ALIGNED and ORDERED */

/* default */
* {
    -GtkArrow-arrow-scaling: 0.6;
    -GtkHTML-link-color: @link_color;
    -GtkIMHtml-hyperlink-color: @link_color;
    -GtkScrollbar-has-backward-stepper: false;
    -GtkScrollbar-has-forward-stepper: false;
    -GtkScrolledWindowscrollbar-spacing: 0;
    -GtkTextView-error-underline-color: @error_color;
    -GtkToolButton-icon-spacing: 6;
    -GtkToolItemGroup-expander-size: 11;
    -treeview-expander-size: 11;
    -GtkWindow-resize-grip-height: 13;
    -GtkWindow-resize-grip-width: 13;
    -WnckTasklist-fade-overlay-rect: 0;

    background-clip: padding-box;

    outline-color: alpha(@theme_fg_color, 0.3);
    outline-style: dashed;
    outline-offset: 2px;
}

/***************
 * base states *
 ***************/
.background {
    background-color: @theme_bg_color;
    color: @theme_fg_color;
}

*:selected {
    background-color: shade(@theme_selected_bg_color, 1.23);
    color: @theme_selected_fg_color;
}

*:selected:focus {
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

*:selected:backdrop {
    text-shadow: none;
    -gtk-icon-shadow: none;
}

*:disabled {
    color: mix(@theme_fg_color, @theme_bg_color, 0.4);
}

*:active {
    background-color: shade(@theme_bg_color, 0.915);
}

/* apply effects to insensitive and prelit images */
*:disabled {
    -gtk-icon-effect: dim;
}

*:hover {
    -gtk-icon-effect: highlight;
}

.gtkstyle-fallback {
    background-color: @theme_bg_color;
    color: @theme_fg_color;
}

.gtkstyle-fallback:hover {
    background-color: shade(@theme_bg_color, 1.1);
    color: @theme_fg_color;
}

.gtkstyle-fallback:active {
    background-color: shade(@theme_bg_color, 0.9);
    color: @theme_fg_color;
}

.gtkstyle-fallback:disabled {
    background-color: shade(shade(@theme_bg_color, 0.95), 1.05);
    color: mix(@theme_fg_color, @theme_bg_color, 0.5);
}

.gtkstyle-fallback:selected {
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

GtkImage,
GtkImage:disabled,
GtkLabel,
GtkLabel:disabled,
GtkBox,
GtkBox:disabled,
GtkGrid,
GtkGrid:disabled {
    background-color: transparent;
}

/******************
 * visual effects *
 ******************/
/* transitions */
button,
button {
    transition: none;
}

entry {
    transition: all 150ms ease-out;
}

entry:focus {
    transition: all 150ms ease-in;
}

notebook tab GtkLabel,
notebook .prelight-page,
notebook .prelight-page GtkLabel,
notebook .active-page,
notebook .active-page GtkLabel {
    transition: all 200ms ease-in;
}

/* inset shadows */
button,
.primary-toolbar .raised button,
.primary-toolbar .raisedbutton,
toolbar button,
headerbar button,
switch slider {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.4),
                inset -1px 0 alpha(@light_shadow, 0.4);
}

button,
button.default {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

button:active,
.primary-toolbar button:active,
toolbar button:active,
headerbar button:active,
button:checked,
.primary-toolbar button:checked,
toolbar button:checked,
headerbar button:checked {
    color: @theme_fg_color;
    box-shadow: inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

button:disabled,
.primary-toolbar .raised button:disabled,
.primary-toolbar .raisedbutton:disabled,
toolbar button:disabled,
headerbar button:disabled,
switch slider:disabled {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

entry {
    box-shadow: inset 1px 1px alpha(@dark_shadow, 0.1);
}

/* disable inset shadow */
.primary-toolbar combobox,
.primary-toolbar button *,
.primary-toolbar button,
notebook tab button,
column-header button,
GtkCalendarbutton {
    box-shadow: none;
}

/*************
 * assistant *
 *************/
GtkAssistantsidebar .highlight {
    font: bold;
}

GtkAssistantsidebar {
    padding: 2px;
    border-width: 0 1px 0 0;
    border-style: solid;
    border-right-color: shade(@theme_bg_color, 0.7);
    border-radius: 0;
    background-color: mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1);
    color: mix(@theme_text_color, @theme_base_color, 0.3);
}

/**********
 * button *
 **********/
button {
    padding: 2px 4px;
    border-width: 1px;
    border-radius: 3px;
    border-style: solid;
    border-top-color: shade(@theme_bg_color, 0.8);
    border-right-color: shade(@theme_bg_color, 0.72);
    border-left-color: shade(@theme_bg_color, 0.72);
    border-bottom-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );

    color: @theme_fg_color;
}

button:hover {
    border-top-color: shade(@theme_bg_color, 0.85);
    border-right-color: shade(@theme_bg_color, 0.78);
    border-left-color: shade(@theme_bg_color, 0.78);
    border-bottom-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

button:active,
button:checked {
    border-color: shade(@theme_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.85), 1.05),
                                      shade(shade(@theme_bg_color, 0.85), 0.97)
                                      );
}

button:active:hover,
button:checked:hover {
    border-top-color: shade(@theme_bg_color, 0.85);
    border-right-color: shade(@theme_bg_color, 0.78);
    border-left-color: shade(@theme_bg_color, 0.78);
    border-bottom-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

button:focus,
button:hover:focus,
button:active:focus,
button:active:hover:focus,
button:checked:focus,
button:checked:hover:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

button:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.95), 1.05),
                                      shade(shade(@theme_bg_color, 0.95), 0.97)
                                      );
}

button:active:disabled,
button:checked:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.95), 1.05),
                                      shade(shade(@theme_bg_color, 0.95), 0.97)
                                      );
}

/* default button */
button.default {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(alpha(@theme_selected_bg_color, 0.7), 1.05),
                                      shade(alpha(@theme_selected_bg_color, 0.7), 0.97)
                                      );
}

button.default:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 1.05),
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 0.97)
                                      );
}

button.default:active,
button.default:checked {
    border-color: shade(@theme_selected_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(alpha(@theme_selected_bg_color, 0.7), 1.05),
                                      shade(alpha(@theme_selected_bg_color, 0.7), 0.97)
                                      );
}

button.default:active:hover,
button.default:checked:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 1.05),
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 0.97)
                                      );
}

button.flat,
button.flat:disabled {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
}

button:link > label,
*:link {
  color: @link_color;
  text-decoration-line: underline;
}

button:visited > label,
*:link:visited,
*:visited {
  color: @link_visited_color;
  text-decoration-line: underline;
}

/****************
 * cell and row *
 ****************/
.cell {
    border-width: 0;
    border-radius: 0;
}

.cell:selected,
.cell:selected:focus {
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

row:selected,
row:selected:hover,
row:selected:focus {

    border-width: 1px 0;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );

    color: @theme_selected_fg_color;
}

/*******************
 * check and radio *
 *******************/
checkbutton,
radiobutton,
checkbutton:disabled,
radiobutton:disabled,
check,
radio,
check:disabled,
radio:disabled {
    min-height: 16px;
    min-width: 16px;
    border: 1px solid;
    border-style: none;
    background-color: transparent;
    color: @theme_text_color;
}

check:hover,
radio:hover,
checkbutton:hover,
checkbutton:active:hover,
checkbutton:selected,
checkbutton:selected:focus {
    background-color: shade(@theme_bg_color, 1.05);
}

/*****************
 * column-header *
 *****************/
column-header button,
column-header button:active,
column-header button:checked {
    border-width: 0 1px 1px 0;
    border-radius: 0;
}

column-header button,
column-header button:active,
column-header button:checked,
column-header button:focus,
column-header button:active:focus,
column-header button:checked:focus {
    border-color: shade(@theme_bg_color, 0.97);
    border-bottom-color: shade(@theme_bg_color, 0.9);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.14), 0.98),
                                      shade(shade(@theme_bg_color, 1.14), 1.35)
                                      );
}

column-header button:hover,
column-header button:active:hover,
column-header button:checked:hover,
column-header button:hover:focus,
column-header button:active:hover:focus,
column-header button:checked:hover:focus {
    border-color: shade(@theme_bg_color, 0.97);
    border-bottom-color: shade(@theme_bg_color, 0.9);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.98), 0.98),
                                      shade(shade(@theme_bg_color, 0.98), 1.35)
                                      );
}

column-header:last-child button {
    border-width: 0 0 1px 0;
}

/****************
 * content view *
 ****************/
.content-view.view {
    background-color: @theme_base_color;
}

.content-view.view:hover {
    background-color: alpha(@theme_selected_bg_color, 0.6);
}

.content-view.view:selected,
.content-view.view:active {
    background-color: @theme_selected_bg_color;
}

.content-view.view:disabled {
    background-color: shade(@theme_base_color, 0.9);
}

GdMainIconView.content-view {
    -GdMainIconView-icon-size: 40;
}

GtkIconView.content-view.check {
    background-color: transparent;
}

GtkIconView.content-view.check:active {
    background-color: transparent;
}

.content-view.view.check,
.content-view.view.check:active {
    background-color: transparent;
}

GtkIconView.content-view.check:hover,
GtkIconView.content-view.check:disabled,
GtkIconView.content-view.check:selected {
    background-color: transparent;
}

/****************
 * drawing area *
 ****************/
GtkDrawingArea {
    background-color: transparent;
}

GtkDrawingArea:disabled {
    background-color: shade(@theme_base_color, 0.9);
}

/***********
 * gtkhtml *
 ***********/
GtkHTML {
    background-color: @theme_base_color;
    color: @theme_text_color;
}

/***********
*sclaendar *
************/
calendar {
    padding: 0;
}

calendar:indeterminate {
    color: mix(@theme_fg_color, @theme_bg_color, 0.5);
}

calendar.view {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    border-radius: 0;
    background-color: @theme_base_color;
    background-image: none;
}

calendar.header {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    border-radius: 0;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );
}

GtkCalendarbutton,
GtkCalendarbutton:hover,
GtkCalendarbutton:disabled {
    border-width: 0;
    background-color: transparent;
    background-image: none;
}

.highlight,
GtkCalendar.highlight {
    border-width: 0;
    background-color: transparent;
    color: @theme_selected_bg_color;
}

/******************
 * combobox entry *
 ******************/
.primary-toolbar combobox combobox-entry .entry,
.primary-toolbar combobox combobox-entry .entry:active,
.primary-toolbar combobox combobox-entry .entry:focus,
.primary-toolbar combobox combobox-entry .entry:disabled,
combobox combobox-entry .entry,
combobox combobox-entry .entry:active,
combobox combobox-entry .entry:focus,
combobox combobox-entry .entry:disabled {
    border-width: 1px 0 1px 1px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.primary-toolbar combobox combobox-entry button,
.primary-toolbar combobox combobox-entry button:hover,
.primary-toolbar combobox combobox-entry button:active,
.primary-toolbar combobox combobox-entry button:checked,
.primary-toolbar combobox combobox-entry button:disabled,
combobox combobox-entry button,
combobox combobox-entry button:hover,
combobox combobox-entry button:active,
combobox combobox-entry button:checked,
combobox combobox-entry button:disabled {
    border-width: 1px 1px 1px 1px;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

combobox arrow {
    -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
    min-height: 16px;
    min-width: 16px;
}

combobox:drop(active) {
    box-shadow: none;
}

/*********
 * entry *
 *********/
entry {
    padding: 3px;
    border-width: 1px;
    border-style: solid;
    border-top-color: shade(@theme_bg_color, 0.6);
    border-right-color: shade(@theme_bg_color, 0.7);
    border-left-color: shade(@theme_bg_color, 0.7);
    border-bottom-color: shade(@theme_bg_color, 0.72);
    border-radius: 3px;
    background-color: @theme_base_color;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_base_color, 0.99),
                                      @theme_base_color
                                      );

    color: @theme_text_color;
}

entry:active,
entry:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-color: @theme_base_color;
}

entry:selected,
entry:selected:focus {
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

entry:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-color: alpha(@theme_base_color, 0.6);
    background-image: none;
    color: mix(@theme_text_color, @theme_base_color, 0.4);
}

entry progressbar,
entry progressbar:focus {
    border-width: 0;
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.15),
                                      shade(@theme_selected_bg_color, 0.95)
                                      );

    color: @theme_selected_fg_color;
}

entry progressbar.pulse,
entry progressbar.pulse:focus {
    background-image: linear-gradient(to top, 
                                      transparent 2px,
                                      white 2px,
                                      white 3px,
                                      @borders 3px,
                                      @borders 5px,
                                      transparent 5px);
}

/************
 * label    *
 ************/
label.separator {
    color: @theme_text_color;
}

label.separator:backdrop {
    color: @theme_bg_color;
}

label selection {
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

label:disabled {
    color: shade(@theme_text_color, 0.50);
}

label:disabled:backdrop {
    color: shade(@theme_text_color, 0.50);
}

label:backdrop {
    color: @theme_text_color;
}

/************
 * expander *
 ************/
expander {
    color: alpha(currentColor, 0.7);
}

expander:hover {
    color: alpha(currentColor, 0.8);
}

expander:active {
    color: alpha(currentColor, 0.9);
}

expander arrow {
    min-width: 16px;
    min-height: 16px;
    -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
}

expander arrow:dir(rtl) {
    -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl");
}

expander arrow:hover {
    color: white;
}

expander arrow:checked {
    -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

/**************
 * list boxes *
 **************/
list {
    background-image: none;
    background-color: transparent;
}

list row {
    border: none;
    border-radius: 0;
    padding: 3px;
    background-image: none;
    background-color: transparent;
}

list row:hover {
    background-image: none;
    background-color: shade(@theme_bg_color, 1.02);
}

list row:selected {
    background-image: none;
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

/*********
 * frame *
*********/
frame,
.frame {
    border: 1px solid shade(@theme_bg_color, 0.7);
    border-radius: 0;
}

.frame.flat,
frame.flat {
    border: none;
    box-shadow: none;
}

.frameactionbar
frameactionbar {
    padding: 6px;
    border-width: 1px 0 0;
}

/*******************
 * scrolled window *
 *******************/
scrolledwindow.frame {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.7);
    border-radius: 0;
}

/* avoid double borders when a viewport is
 * packed into a GtkScrolledWindow */
scrolledwindow viewport.frame {
    border-style: none;
}

/************
 * iconview *
 ************/
GtkIconView.view.cell:selected,
GtkIconView.view.cell:selected:focus {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );

    color: @theme_selected_fg_color;
}

.content-view rubberband,
.content-view.view.rubberband,
view.rubberband,
view rubberband,
flowbox rubberband,
rubberband,
.rubberband {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.9);
    border-radius: 0;
    background-color: alpha(@theme_selected_bg_color, 0.3);
}

/***********
 * infobar *
 ***********/
infobar {
    border-width: 0;
    border-style: none;
}

.info {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@info_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@info_bg_color, 1.1),
                                      shade(@info_bg_color, 1.0)
                                      );

    color: @info_fg_color;
}

.info button {
    border-top-color: shade(@info_bg_color, 0.8);
    border-right-color: shade(@info_bg_color, 0.72);
    border-left-color: shade(@info_bg_color, 0.72);
    border-bottom-color: shade(@info_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@info_bg_color, 1.02), 1.05),
                                      shade(shade(@info_bg_color, 1.02), 0.97)
                                      );

    color: @info_fg_color;
}

.info button:hover {
    border-top-color: shade(@info_bg_color, 0.85);
    border-right-color: shade(@info_bg_color, 0.78);
    border-left-color: shade(@info_bg_color, 0.78);
    border-bottom-color: shade(@info_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@info_bg_color, 1.15),
                                      shade(@info_bg_color, 1.07)
                                      );
}

.info button:active,
.info button:checked {
    border-color: shade(@info_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@info_bg_color, 0.85), 1.05),
                                      shade(shade(@info_bg_color, 0.85), 0.97)
                                      );
}

.info button:active:hover,
.info button:checked:hover {
    border-top-color: shade(@info_bg_color, 0.85);
    border-right-color: shade(@info_bg_color, 0.78);
    border-left-color: shade(@info_bg_color, 0.78);
    border-bottom-color: shade(@info_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@info_bg_color, 1.15),
                                      shade(@info_bg_color, 1.07)
                                      );
}

.info button.close {
    color: @info_fg_color;
}

.info button.close:hover {
    background-image: linear-gradient(to bottom,
                                      alpha(white, 0.3),
                                      alpha(white, 0.2) 30%,
                                      alpha(black, 0.02));
}

.info button.close:active {
    color: @info_fg_color;
    background-image: linear-gradient(to bottom,
                                      alpha(black, 0.1),
                                      transparent);
}

.warning {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@warning_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@warning_bg_color, 1.1),
                                      shade(@warning_bg_color, 1.0)
                                      );

    color: @warning_fg_color;
}

.warning button {
    border-top-color: shade(@warning_bg_color, 0.8);
    border-right-color: shade(@warning_bg_color, 0.72);
    border-left-color: shade(@warning_bg_color, 0.72);
    border-bottom-color: shade(@warning_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@warning_bg_color, 1.02), 1.05),
                                      shade(shade(@warning_bg_color, 1.02), 0.97)
                                      );

    color: @warning_fg_color;
}

.warning button:hover {
    border-top-color: shade(@warning_bg_color, 0.85);
    border-right-color: shade(@warning_bg_color, 0.78);
    border-left-color: shade(@warning_bg_color, 0.78);
    border-bottom-color: shade(@warning_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@warning_bg_color, 1.15),
                                      shade(@warning_bg_color, 1.07)
                                      );
}

.warning button:active,
.warning button:checked {
    border-color: shade(@warning_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@warning_bg_color, 0.85), 1.05),
                                      shade(shade(@warning_bg_color, 0.85), 0.97)
                                      );
}

.warning button:active:hover,
.warning button:checked:hover {
    border-top-color: shade(@warning_bg_color, 0.85);
    border-right-color: shade(@warning_bg_color, 0.78);
    border-left-color: shade(@warning_bg_color, 0.78);
    border-bottom-color: shade(@warning_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@warning_bg_color, 1.15),
                                      shade(@warning_bg_color, 1.07)
                                      );
}

.warning button.close {
    color: @warning_fg_color;
}

.warning button.close:hover {
    background-image: linear-gradient(to bottom,
                                      alpha(white, 0.3),
                                      alpha(white, 0.2) 30%,
                                      alpha(black, 0.02));
}

.warning button.close:active {
    color: @warning_fg_color;
    background-image: linear-gradient(to bottom,
                                      alpha(black, 0.1),
                                      transparent);
}

.question {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@question_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@question_bg_color, 1.1),
                                      shade(@question_bg_color, 1.0)
                                      );

    color: @question_fg_color;
}

.question button {
    border-top-color: shade(@question_bg_color, 0.8);
    border-right-color: shade(@question_bg_color, 0.72);
    border-left-color: shade(@question_bg_color, 0.72);
    border-bottom-color: shade(@question_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@question_bg_color, 1.02), 1.05),
                                      shade(shade(@question_bg_color, 1.02), 0.97)
                                      );

    color: @question_fg_color;
}

.question button:hover {
    border-top-color: shade(@question_bg_color, 0.85);
    border-right-color: shade(@question_bg_color, 0.78);
    border-left-color: shade(@question_bg_color, 0.78);
    border-bottom-color: shade(@question_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@question_bg_color, 1.15),
                                      shade(@question_bg_color, 1.07)
                                      );
}

.question button:active,
.question button:checked {
    border-color: shade(@question_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@question_bg_color, 0.85), 1.05),
                                      shade(shade(@question_bg_color, 0.85), 0.97)
                                      );
}

.question button:active:hover,
.question button:checked:hover {
    border-top-color: shade(@question_bg_color, 0.85);
    border-right-color: shade(@question_bg_color, 0.78);
    border-left-color: shade(@question_bg_color, 0.78);
    border-bottom-color: shade(@question_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@question_bg_color, 1.15),
                                      shade(@question_bg_color, 1.07)
                                      );
}

.question button.close {
    color: @question_fg_color;
}

.question button.close:hover {
    background-image: linear-gradient(to bottom,
                                      alpha(white, 0.3),
                                      alpha(white, 0.2) 30%,
                                      alpha(black, 0.02));
}

.question button.close:active {
    color: @question_fg_color;
    background-image: linear-gradient(to bottom,
                                      alpha(black, 0.1),
                                      transparent);
}

.error {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@error_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@error_bg_color, 1.1),
                                      shade(@error_bg_color, 1.0)
                                      );

    color: @error_fg_color;
}

.error button {
    border-top-color: shade(@error_bg_color, 0.8);
    border-right-color: shade(@error_bg_color, 0.72);
    border-left-color: shade(@error_bg_color, 0.72);
    border-bottom-color: shade(@error_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@error_bg_color, 1.02), 1.05),
                                      shade(shade(@error_bg_color, 1.02), 0.97)
                                      );

    color: @error_fg_color;
}

.error button:hover {
    border-top-color: shade(@error_bg_color, 0.85);
    border-right-color: shade(@error_bg_color, 0.78);
    border-left-color: shade(@error_bg_color, 0.78);
    border-bottom-color: shade(@error_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@error_bg_color, 1.15),
                                      shade(@error_bg_color, 1.07)
                                      );
}

.error button:active,
.error button:checked {
    border-color: shade(@error_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@error_bg_color, 0.85), 1.05),
                                      shade(shade(@error_bg_color, 0.85), 0.97)
                                      );
}

.error button:active:hover,
.error button:checked:hover {
    border-top-color: shade(@error_bg_color, 0.85);
    border-right-color: shade(@error_bg_color, 0.78);
    border-left-color: shade(@error_bg_color, 0.78);
    border-bottom-color: shade(@error_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@error_bg_color, 1.15),
                                      shade(@error_bg_color, 1.07)
                                      );
}

.error button.close {
    color: @error_fg_color;
}

.error button.close:hover {
    background-image: linear-gradient(to bottom,
                                      alpha(white, 0.3),
                                      alpha(white, 0.2) 30%,
                                      alpha(black, 0.02));
}

.error button.close:active {
    color: @error_fg_color;
    background-image: linear-gradient(to bottom,
                                      alpha(black, 0.1),
                                      transparent);
}

/*******************
 * symbolic images *
 *******************/
.image {
    color: alpha(currentColor, 0.5);
}

.image:hover {
    color: alpha(currentColor, 0.9);
}

.image:selected,
.image:selected:hover {
    color: @theme_selected_fg_color;
}

view.image,
view.image:hover {
    color: alpha(currentColor, 0.9);
}

view.image:selected,
view.image:selected:hover {
    color: @theme_selected_fg_color;
}

/*****************
 * miscellaneous *
 *****************/
floating-bar {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.7);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.1),
                                      shade(@theme_bg_color, 0.9)
                                      );

    color: @theme_fg_color;
}

floating-bar.top {
    border-top-width: 0;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
}

floating-bar.right {
    border-right-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

floating-bar.bottom {
    border-bottom-width: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

floating-bar.left {
    border-left-width: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

floating-bar button {
    border-style: none;
    background-color: transparent;
    background-image: none;
}

view.dim-label,
.dim-label {
    color: alpha(currentColor, 0.5);
}

.dnd {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.9);
}

.grip {
    background-color: transparent;
}

.arrow {
    color: alpha(currentColor, 0.7);
}

/********
 * menu *
 ********/
GtkTreeMenu.menu,
GtkMenuToolButton.menu,
combobox .menu {
    background-color: @menu_bg_color;
}

.primary-toolbar .menu,
.primary-toolbar button .menu,
toolbar .menu,
toolbar .primary-toolbar .menu,
headerbar .menu,
headerbar .primary-toolbar .menu,
.menu {
    padding: 0;
    border-radius: 0;
    border-width: 1px;
    border-style: solid;
    border-color: shade(@menu_bg_color, 0.7);
    background-color: @menu_bg_color;
    color: @menu_fg_color;
}

/* Hover-effect on play-button in ubuntu soundmenu */
.menu:selected {
    background-color: @selected_bg_color;
}

.menubutton:hover,
.menubutton:active,
.menubutton:checked,
.menubutton:active:disabled,
.menubutton:checked:disabled,
.menubutton:disabled,
.menubutton {
    border-width: 0;
    background-color: @menu_bg_color;
    background-image: none;
}

.context-menu {
    font: initial;
}

/* ubuntu software center menu */
#toolbar-popup {
    background-color: @menu_bg_color;
    color: @menu_fg_color;
}

menu menuitem arrow,
.menu menuitem arrow {
    min-height: 16px;
    min-width: 16px;
}

menu menuitem arrow:dir(ltr),
.menu menuitem arrow:dir(ltr) {
    -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
    margin-left: 10px;
}

menu menuitem arrow:dir(rtl),
.menu menuitem arrow:dir(rtl) {
    -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl");
    margin-right: 10px;
}

/***********
 * menubar *
 ***********/
menubar,
.menubar {
    -GtkWidget-window-dragging: true;

    border-style: none;
    background-color: @menubar_bg_color;
    background-image: none;
    color: @menubar_fg_color;
}

/***************
 * menubaritem *
 ***************/
menubar menuitem,
.menubar.menuitem,
.menubar .menuitem {
    padding: 3px 8px;
    min-width: 20px;
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    color: @menubar_fg_color;
}

menubar menuitem:hover,
.menubar.menuitem:hover,
.menubar .menuitem:hover {
    border-color: shade(@theme_selected_bg_color, 1.1);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );

    color: @theme_selected_fg_color;
}

menubar menuitem *:hover,
.menubar .menuitem *:hover {
    color: @theme_selected_fg_color;
}

/************
 * menuitem *
 ************/
GtkTreeMenu .menuitem {
    padding: 0;
    border-width: 0;
}

menu,
menuitem,
menu menuitem {
    padding: 3px;
    min-width: 40px;
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    border-radius: 0;
    background-color: transparent;
    background-image: none;
    color: @menu_fg_color;
}

menu menuitem:active,
menu menuitem:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );
}

menu menuitem:active,
menu menuitem *:active,
menu menuitem:hover,
menu menuitem *:hover {
    color: @theme_selected_fg_color;
}

menu menuitem:disabled {
    color: mix(@menu_fg_color, @menu_bg_color, 0.4);
}

menuitem checkbutton,
menuitem radiobutton,
menuitem checkbutton:hover,
menuitem radiobutton:hover,
menuitem checkbutton:disabled,
menuitem radiobutton:disabled {
    border-style: none;
    background-color: transparent;
    background-image: none;
}

menuitem checkbutton:active,
menuitem radiobutton:active {
    border-style: none;
    background-color: transparent;
}

menuitem GtkCalendar:indeterminate {
    color: mix(@menu_fg_color, @menu_bg_color, 0.5);
}

menuitem GtkCalendarbutton {
    border-style: none;
    background-color: transparent;
    background-image: none;
}

menuitem entry {
    border-color: shade(@menu_bg_color, 0.7);
    background-color: @menu_bg_color;
    background-image: none;
    color: @menu_fg_color;
}

menuitem entry:active,
menuitem entry:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

menuitem accelerator {
    color: alpha(@menu_fg_color, 0.6);
}

menuitem accelerator:hover {
    color: alpha(@theme_selected_fg_color, 0.8);
}

menuitem accelerator:disabled {
    color: alpha(mix(@menu_fg_color, @menu_bg_color, 0.5), 0.7);
}

GtkModelMenuItem GtkBox GtkImage {
    padding-right: 4px;
}

/************
 * popovers *
 ************/
popover {
    margin: 10px;
    padding: 2px;
    border-radius: 3px;
    border-color: shade(@menu_bg_color, 0.8);
    border-width: 1px;
    border-style: solid;
    background-clip: border-box;
    background-image: none;
    background-color: @menu_bg_color;
    color: @menu_fg_color;
    box-shadow: 0 2px 3px alpha(black, 0.5);
}

popover.background {
    background-image: none;
    background-color: @menu_bg_color;
}

popover:backdrop {
    box-shadow: none;
}

popover.osd {
    box-shadow: 0 2px 7px 3px alpha(black, 0.5);
}

popover > list,
popover > .view,
popover > toolbar {
    background-image: none;
    background-color: transparent;
}

popover list {
    color: @menu_fg_color;
}

popover list:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );
    color: @theme_selected_fg_color;
}

popover .frame {
    border: 1px solid mix(@menu_bg_color, @menu_fg_color, 0.12);
    border-radius: 2px;
}

popover entry {
    border-color: mix(@menu_bg_color, @menu_fg_color, 0.12);
    background-color: @menu_bg_color;
    background-image: none;
    color: @menu_fg_color;
}

popover entry:hover,
popover entry:focus,
popover entry:active {
    border-color: mix(@menu_bg_color, @menu_fg_color, 0.21);
}

popover.osd > toolbar button {
    border-radius: 0;
    border-width: 0;
    background-image: none;
    background-color: transparent;
}

popover separator {
    border: 0;
    background-color: transparent;
    color: alpha(currentColor, 0.5);
    font-size: 80%;
    font-weight: bold;
}

.menuitembutton {
    color: @theme_fg_color;
}

.menuitembutton,
.menuitembutton:active,
.menuitembutton:checked,
.menuitembutton:disabled,
.menuitembutton:active:disabled,
.menuitembutton:checked:disabled {
    background-color: transparent;
    background-image: none;
    border-width: 1px;
    box-shadow: none;
    color: @menu_fg_color;
}

.menuitembutton:active:hover,
.menuitembutton:checked:hover,
.menuitembutton:hover,
.menuitembutton:selected {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );
    color: @theme_selected_fg_color;
}

GtkModelButtonbutton {
    color: @menu_fg_color;
}

GtkModelButtonbutton:active,
GtkModelButtonbutton:checked,
GtkModelButtonbutton:disabled,
GtkModelButtonbutton:active:disabled,
GtkModelButtonbutton:checked:disabled,
GtkModelButtonbutton {
    background-color: transparent;
    background-image: none;
    border-color: transparent;
    border-image: none;
    border-width: 1px;
    box-shadow: none;
}

GtkModelButtonbutton:active:hover,
GtkModelButtonbutton:checked:hover,
GtkModelButtonbutton:hover,
GtkModelButtonbutton:selected {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.2),
                                      shade(@theme_selected_bg_color, 1.0)
                                      );
    color: @theme_selected_fg_color;
    text-shadow: none;
    border-width: 1px;
}

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

notebook > header {
    padding: 1px;
    border-color: @dark_shadow;
    border-width: 1px;
    background-color: @panel_bg_color;
}

notebook > header:backdrop {
    border-color: @dark_shadow;
    background-color: @panel_bg_color;
}

notebook > header tabs {
    margin: -1px;
}

notebook > header.top {
    border-bottom-style: solid;
}

notebook > header.top > tabs {
    margin-bottom: -2px;
}

notebook > header.top > tabs > tab:hover {
    box-shadow: inset 0 -3px @light_shadow;
}

notebook > header.top > tabs > tab:backdrop {
    box-shadow: none;
}

notebook > header.top > tabs > tab:checked {
    box-shadow: inset 0 -3px @tab_checked_color;
}

notebook > header.bottom {
    border-top-style: solid;
}

notebook > header.bottom > tabs {
    margin-top: -2px;
}

notebook > header.bottom > tabs > tab:hover {
    box-shadow: inset 0 3px @light_shadow;
}

notebook > header.bottom > tabs > tab:backdrop {
    box-shadow: none;
}

notebook > header.bottom > tabs > tab:checked {
    box-shadow: inset 0 3px @tab_checked_color;
}

notebook > header.left {
    border-right-style: solid;
}

notebook > header.left > tabs {
    margin-right: -2px;
}

notebook > header.left > tabs > tab:hover {
    box-shadow: inset -3px 0 @light_shadow;
}

notebook > header.left > tabs > tab:backdrop {
    box-shadow: none;
}

notebook > header.left > tabs > tab:checked {
    box-shadow: inset -3px 0 @tab_checked_color;
}

notebook > header.right {
    border-left-style: solid;
}

notebook > header.right > tabs {
    margin-left: -2px;
}

notebook > header.right > tabs > tab:hover {
    box-shadow: inset 3px 0 @light_shadow;
}

notebook > header.right > tabs > tab:backdrop {
    box-shadow: none;
}

notebook > header.right > tabs > tab:checked {
    box-shadow: inset 3px 0 @tab_checked_color;
}

notebook > header.top > tabs > arrow {
    border-top-style: none;
}

notebook > header.bottom > tabs > arrow {
    border-bottom-style: none;
}

notebook > header.top > tabs > arrow,
notebook > header.bottom > tabs > arrow {
    margin-left: -5px;
    margin-right: -5px;
    padding-left: 4px;
    padding-right: 4px;
}

notebook > header.top > tabs > arrow.down,
notebook > header.bottom > tabs > arrow.down {
    -gtk-icon-source: -gtk-icontheme("pan-start-symbolic");
}

notebook > header.top > tabs > arrow.up,
notebook > header.bottom > tabs > arrow.up {
    -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
}

notebook > header.left > tabs > arrow {
    border-left-style: none;
}

notebook > header.right > tabs > arrow {
    border-right-style: none;
}

notebook > header.left > tabs > arrow,
notebook > header.right > tabs > arrow {
    margin-top: -5px;
    margin-bottom: -5px;
    padding-top: 4px;
    padding-bottom: 4px;
}

notebook > header.left > tabs > arrow.down,
notebook > header.right > tabs > arrow.down {
    -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

notebook > header.left > tabs > arrow.up,
notebook > header.right > tabs > arrow.up {
    -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

notebook > header > tabs > arrow {
    min-height: 16px;
    min-width: 16px;
    border-radius: 0;
}

notebook > header > tabs > arrow:hover:not(:active):not(:backdrop) {
    background-clip: padding-box;
    background-image: none;
    background-color: shade(@theme_text_color, 0.30);
    border-color: transparent;
    box-shadow: none;
}

notebook > header > tabs > arrow:disabled {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px shade(@theme_text_color, 0.30);
    text-shadow: none;
    -gtk-icon-shadow: none;
}

notebook > header tab,
notebook > header tab:backdrop {
    min-height: 24px;
    min-width: 24px;
    padding: 3px 8px;
    outline-offset: -5px;
    color: shade(@theme_text_color, 0.70);
    font-weight: bold;
    border-width: 1px;
    border-color: transparent;
}

notebook > header tab > label:backdrop {
    color: shade(@theme_text_color, 0.70);
}

notebook > header tab:hover {
    color: shade(@theme_text_color, 0.80);
}

notebook > header tab:hover.reorderable-page {
    border-color: @dark_shadow;
    background-color: rgba(57, 63, 63, 0.2);
}

notebook > header tab:backdrop.reorderable-page {
    border-color: transparent;
    background-color: transparent;
}

notebook > header tab:checked,
notebook > header tab:backdrop:checked,
notebook > header tab:checked > label:backdrop {
    background-color: @panel_bg_color;
    color: @theme_selected_fg_color
}

notebook > header tab:checked.reorderable-page,
notebook > header tab:backdrop:checked.reorderable-page {
    border-color: @dark_shadow;
    background-color: @panel_bg_color;
}

notebook > header tab:checked.reorderable-page:hover {
    background-color: @panel_bg_color;
}

notebook > header tab button.flat {
    padding: 0;
    margin-top: 4px;
    margin-bottom: 4px;
    min-width: 20px;
    min-height: 20px;
}

notebook > header tab button.flat:hover {
    color: currentColor;
}

notebook > header tab button.flat,
notebook > header tab button.flat:backdrop {
    color: alpha(currentColor,0.3);
}

notebook > header tab button.flat:last-child {
    margin-left: 4px;
    margin-right: -4px;
}

notebook > header tab button.flat:first-child {
    margin-left: -4px;
    margin-right: 4px;
}

notebook > header.top tabs,
notebook > header.bottom tabs {
    padding-left: 4px;
    padding-right: 4px;
}

notebook > header.top tabs:not(:only-child),
notebook > header.bottom tabs:not(:only-child) {
    margin-left: 3px;
    margin-right: 3px;
}

notebook > header.top tabs:not(:only-child):first-child,
notebook > header.bottom tabs:not(:only-child):first-child {
    margin-left: -1px;
}

notebook > header.top tabs:not(:only-child):last-child,
notebook > header.bottom tabs:not(:only-child):last-child {
    margin-right: -1px;
}

notebook > header.top tabs tab,
notebook > header.bottom tabs tab {
    margin-left: 4px;
    margin-right: 4px;
}

notebook > header.top tabs tab.reorderable-page,
notebook > header.bottom tabs tab.reorderable-page {
    border-style: none solid;
}

notebook > header.left tabs,
notebook > header.right tabs {
    padding-top: 4px;
    padding-bottom: 4px;
}

notebook > header.left tabs:not(:only-child),
notebook > header.right tabs:not(:only-child) {
    margin-top: 3px;
    margin-bottom: 3px;
}

notebook > header.left tabs:not(:only-child):first-child,
notebook > header.right tabs:not(:only-child):first-child {
    margin-top: -1px;
}

notebook > header.left tabs:not(:only-child):last-child,
notebook > header.right tabs:not(:only-child):last-child {
    margin-bottom: -1px;
}

notebook > header.left tabs tab,
notebook > header.right tabs tab {
    margin-top: 4px;
    margin-bottom: 4px;
}

notebook > header.left tabs tab.reorderable-page,
notebook > header.right tabs tab.reorderable-page {
    border-style: solid none;
}

notebook > header.top tab {
    padding-bottom: 4px;
}

notebook > header.bottom tab {
    padding-top: 4px;
}

notebook > stack:not(:only-child) {
    background-color: @panel_bg_color;
}

notebook > stack:not(:only-child):backdrop {
    background-color: @panel_bg_color;
}

/******************
 * pane separator *
 ******************/
paned > separator {
    min-width: 4px;
    min-height: 4px;
    background-color: @theme_bg_color;
    color: transparent;
}

/*************************
 * progressbar and scale *
 *************************/
progressbar {
    padding: 0;
    border-width: 1px;
    border-radius: 6px;
    color: @theme_text_color;
}

progressbar progress {
    min-height: 4px;
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.7);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.15),
                                      shade(@theme_selected_bg_color, 0.95)
                                      );
}

progressbar.vertical progress {
    min-width: 4px;
    border-width: 1px;
    border-style:solid;
    border-color:transparent;
    border-radius: 3px;
    background-image: linear-gradient(to right,
                                      shade(@theme_selected_bg_color, 1.15),
                                      shade(@theme_selected_bg_color, 0.95)
                                      );
}

progressbar trough {
    min-height: 6px;
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 0.95),
                                      shade(@theme_bg_color, 1.15)
                                      );
}

progressbar.vertical trough {
    min-width: 6px;
    border-width: 1px;
    border-style:solid;
    background-image: linear-gradient(to right,
                                      shade(@theme_bg_color, 0.95),
                                      shade(@theme_bg_color, 1.15)
                                      );
}

/* level bars as used for password quality or remaining power */
levelbar block {
    min-width: 26px;
    min-height: 1px;

    background-color: transparent;
}

levelbar.vertical block {
    min-width: 1px;
    min-height: 26px;

    background-color: transparent;
}

levelbar trough {
    border: 1px solid;
    padding: 1px;
    border-radius: 1px;
    border-color: shade(@theme_bg_color, 0.4);
    box-shadow: inset 0 0 0 1px @light_shadow;
}

levelbar trough:backdrop {
    border-color: shade(@theme_bg_color, 0.4);
    box-shadow: inset 0 0 0 1px @light_shadow;
}

levelbar.horizontal.discrete block,
levelbar.vertical.discrete block
 {
    border: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.7);
}

levelbar block:not(.empty) {
    padding: 2px;
    border-radius: 2px;
}

levelbar.horizontal.discrete block {
    margin: 0 1px;
}

levelbar.vertical.discrete block {
    margin: 1px 0;
}

levelbar block.high {
    border-color: shade(@success_color, 0.85);
    background-image: linear-gradient(to bottom,
                                      shade(@success_color, 1.2),
                                      @success_color 75%,
                                      shade(@success_color, 0.95)
                                      );
}

levelbar block.low {
    border-color: shade(@warning_bg_color, 0.80);
    background-image: linear-gradient(to bottom,
                                      shade(@warning_bg_color, 1.3),
                                      @warning_bg_color 75%,
                                      shade(@warning_bg_color, 0.9)
                                      );
}

levelbar block.empty {
    border-color: alpha(@theme_fg_color, 0.1);
    background-color: transparent;
    background-image: none;
}

scale {
    min-height: 10px;
    min-width: 10px;
    padding: 8px;
}

scale trough,
scale fill,
scale trough:backdrop,
scale fill:backdrop {
    border: 1px solid @dark_shadow;
    border-radius: 1px;
    background-color: @theme_bg_color;
    box-shadow: none;
}

scale trough:disabled,
scale fill:disabled,
scale trough:backdrop:disabled,
scale fill:backdrop:disabled {
    border-color: @dark_shadow;
    background-color: shade(@theme_bg_color, 0.7);
}

scale highlight,
scale highlight:backdrop {
    border: 1px solid shade(@theme_selected_bg_color, 0.7);
    border-radius: 1px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_selected_bg_color, 0.9), 1.1),
                                      shade(shade(@theme_selected_bg_color, 0.9), 0.9)
                                      );
}

scale highlight:disabled,
scale highlight:backdrop:disabled {
    border-color: transparent;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 0.1),
                                      shade(@theme_selected_bg_color, 0.3)
                                      );

}

scale fill,
scale highlight {
    margin: -1px;
}

scale slider {
    min-height: 12px;
    min-width: 12px;
    margin: -6px;
}

scale.fine-tune.horizontal {
    padding-top: 9px;
    padding-bottom: 9px;
    min-height: 16px;
}

scale.fine-tune.vertical {
    padding-left: 9px;
    padding-right: 9px;
    min-width: 16px;
}

scale.fine-tune slider {
    margin: -6px;
}

scale.fine-tune fill,
scale.fine-tune highlight,
scale.fine-tune trough {
    border-radius: 5px;
    -gtk-outline-radius: 7px;
}

scale trough {
    outline-offset: 2px;
    -gtk-outline-radius: 5px;
}

scale slider,
scale slider:backdrop {
    border-width: 2px;
    border-style: solid;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.2),
                                      shade(@theme_bg_color, 0.97)
                                     );
    border-color: @dark_shadow;
    border: 2px solid @light_shadow;
    border-radius: 100%;
}

scale slider:hover {
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.4),
                                      shade(@theme_selected_bg_color, 1.2)
                                     );
    border-color: transparent;
}

scale slider:active {
    border-color: @theme_selected_fg_color;
}

scale slider:disabled,
scale slider:backdrop:disabled {
    border-width: 2px;
    border-style: solid;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 0.5),
                                      shade(@theme_bg_color, 0.7)
                                     );
    border-color: @light_shadow;
    border: 2px solid @light_shadow;
}

scale value,
scale marks {
    color: alpha(currentColor,0.4);
}

scale marks.top {
    margin-bottom: 6px;
    margin-top: -12px;
}

scale marks.bottom {
    margin-top: 6px;
    margin-bottom: -12px;
}

scale marks.top {
    margin-right: 6px;
    margin-left: -12px;
}

scale marks.bottom {
    margin-left: 6px;
    margin-right: -12px;
}

scale.fine-tune marks.top {
    margin-bottom: 6px;
    margin-top: -9px;
}

scale.fine-tune marks.bottom {
    margin-top: 6px;
    margin-bottom: -9px;
}

scale.fine-tune marks.top {
    margin-right: 6px;
    margin-left: -9px;
}

scale.fine-tune marks.bottom {
    margin-left: 6px;
    margin-right: -9px;
}

scale.horizontal indicator {
    min-height: 6px;
    min-width: 1px;
}

scale.horizontal.fine-tune indicator {
    min-height: 3px;
}

scale.vertical indicator {
    min-height: 1px;
    min-width: 6px;
}

scale.vertical.fine-tune indicator {
    min-width: 3px;
}


/*************
 *scrollbar *
 *************/
scrollbar {
    background-color: @theme_bg_color;
    transition: 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    -GtkScrollbar-has-backward-stepper: false;
    -GtkScrollbar-has-forward-stepper: false;
}

scrollbar.top {
    border-bottom: 1px solid @dark_shadow;
}

scrollbar.bottom {
    border-top: 1px solid @dark_shadow;
}

scrollbar.left {
    border-right: 1px solid @dark_shadow;
}

scrollbar.right {
    border-left: 1px solid @dark_shadow;
}

scrollbar:backdrop {
    background-color: @theme_bg_color;
    border-color: @dark_shadow;
    transition: 200ms ease-out;
}

scrollbar slider {
    min-width: 6px;
    min-height: 6px;
    margin: -1px;
    border: 4px solid transparent;
    border-radius: 8px;
    background-clip: padding-box;
    background-color: shade(@theme_fg_color, 0.70);
}

scrollbar slider:hover {
    background-color: @theme_fg_color;
}

scrollbar slider:hover:active {
    background-color: @theme_selected_fg_color;
}

scrollbar slider:backdrop {
    background-color: @theme_bg_color;
}

scrollbar slider:disabled {
    background-color: transparent;
}

scrollbar.fine-tune slider {
    min-width: 4px;
    min-height: 4px;
}

scrollbar.fine-tune.horizontal slider {
    border-width: 5px 4px;
}

scrollbar.fine-tune.vertical slider {
    border-width: 4px 5px;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering) {
    border-color: transparent;
    opacity: 0.4;
    background-color: transparent;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering) slider {
    margin: 0;
    min-width: 3px;
    min-height: 3px;
    background-color: @theme_fg_color;
    border: 1px solid black;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering) button {
    min-width: 5px;
    min-height: 5px;
    background-color: @theme_fg_color;
    background-clip: padding-box;
    border-radius: 100%;
    border: 1px solid black;
    -gtk-icon-source: none;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering).horizontal slider {
    margin: 0 2px;
    min-width: 40px;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering).horizontal button {
    margin: 1px 2px;
    min-width: 5px;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering).vertical slider {
    margin: 2px 0;
    min-height: 40px;
}

scrollbar.overlay-indicator:not(.dragging):not(.hovering).vertical button {
    margin: 2px 1px;
    min-height: 5px;
}

scrollbar.overlay-indicator.dragging,
scrollbar.overlay-indicator.hovering {
    opacity: 0.8;
}

scrollbar.horizontal slider {
    min-width: 40px;
}

scrollbar.vertical slider {
    min-height: 40px;
}

scrollbar button {
    padding: 0;
    min-width: 12px;
    min-height: 12px;
    border-style: none;
    border-radius: 0;
    transition-property: min-height, min-width, color;
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px @theme_selected_fg_color;
    text-shadow: none;
    -gtk-icon-shadow: none;
    color: #a6a8a7;
}

scrollbar button:hover {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px @theme_selected_fg_color;
    text-shadow: none;
    -gtk-icon-shadow: none;
    color: #cacbc9;
}

scrollbar button:active, scrollbar button:checked {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px @theme_selected_fg_color;
    text-shadow: none;
    -gtk-icon-shadow: none;
    color: @theme_selected_fg_color;
}

scrollbar button:disabled {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px @theme_selected_fg_color;
    text-shadow: none;
    -gtk-icon-shadow: none;
    color: rgba(166, 168, 167, 0.2);
}

scrollbar button:backdrop {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px @theme_selected_fg_color;
    text-shadow: none;
    -gtk-icon-shadow: none;
    color: #5d6262;
}

scrollbar button:backdrop:disabled {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 1px @theme_selected_fg_color;
    text-shadow: none;
    -gtk-icon-shadow: none;
    color: rgba(93, 98, 98, 0.2);
}

scrollbar.vertical button.down {
    -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

scrollbar.vertical button.up {
    -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

scrollbar.horizontal button.down {
    -gtk-icon-source: -gtk-icontheme("pan-right-symbolic");
}

scrollbar.horizontal button.up {
    -gtk-icon-source: -gtk-icontheme("pan-left-symbolic");
}

treeview ~ scrollbar.vertical {
    border-top: 1px solid #1c1f1f;
    margin-top: -1px;
}

/*************
 * separator *
 *************/
sidebar.separator,
sidebar.view.separator,
sidebar .view.separator,
view.separator,
.separator {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.9);
    color: shade(@theme_bg_color, 0.9);
}

button .separator,
button.separator {
    border-color: transparent;
}

button .separator:disabled,
button.separator:disabled {
    border-color: transparent;
}

.primary-toolbar GtkSeparatorToolItem,
.primary-toolbar .separator,
.primary-toolbar .separator:disabled,
toolbar GtkSeparatorToolItem,
toolbar .separator,
toolbar .separator:disabled {
    -GtkWidget-window-dragging: true;

    border-color: shade(@toolbar_bg_color, 0.95);
    color: shade(@toolbar_bg_color, 0.95);
}

headerbar GtkSeparatorToolItem,
headerbar .separator,
headerbar .separator:disabled,
.titlebar GtkSeparatorToolItem,
.titlebar .separator,
.titlebar .separator:disabled {
    -GtkWidget-window-dragging: true;

    border-color: shade(@titlebar_bg_color, 0.95);
    color: shade(@titlebar_bg_color, 0.95);
}

.primary-toolbar button .separator,
.primary-toolbar button.separator,
toolbar button .separator,
toolbar button.separator {
    border-color: shade(@toolbar_bg_color, 0.95);
}

headerbar button .separator,
headerbar button.separator,
.titlebar button .separator,
.titlebar button.separator {
    border-color: shade(@titlebar_bg_color, 0.95);
}

.primary-toolbar button .separator:disabled,
.primary-toolbar button.separator:disabled,
toolbar button .separator:disabled,
toolbar button.separator:disabled {
    border-color: shade(@toolbar_bg_color, 0.85);
}

headerbar button .separator:disabled,
headerbar button.separator:disabled,
.titlebar button .separator:disabled,
.titlebar button.separator:disabled {
    border-color: shade(@titlebar_bg_color, 0.85);
}

.menuitem.separator,
.menuitem .separator {
    border-style: none;
    color: shade(@menu_bg_color, 0.9);
}

combobox .separator {
    -GtkWidget-horizontal-separator: 0;
    -GtkWidget-vertical-separator: 0;

    border-style: none;

}

/***********
 *sidebar *
 ***********/
sidebar,
sidebar.view,
sidebar .view,
sidebar GtkScrolledWindow {
    background-color: mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1);
    color: mix(@theme_text_color, @theme_base_color, 0.3);
    /* Don't use symbolic icons in thesidebar */
    -gtk-icon-style: regular;
}

sidebar row:selected,
sidebar row:selected:hover,
sidebar row:selected:focus,
sidebar .view row:selected,
sidebar .view row:selected:hover,
sidebar .view row:selected:focus {
    border-width: 1px 0;
    border-style: solid;
    border-top-color: shade(@theme_bg_color, 0.85);
    border-bottom-color: shade(@theme_bg_color, 1.12);
    background-image: linear-gradient(to bottom,
                                      shade(mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1), 0.87),
                                      shade(mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1), 0.95) 10%,
                                      shade(mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1), 0.99) 92%,
                                      shade(mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1), 0.92)
                                      );

    color: mix(@theme_text_color, @theme_base_color, 0.3);
}

sidebar row:hover,
sidebar .view row:hover {
    border-color: mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.3);
    background-color: mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.3);
    background-image: none;
    color: @theme_text_color;
}

sidebar scrollbar.trough {
    background-image: linear-gradient(to right,
                                      shade(mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1), 0.9),
                                      shade(mix(shade(@theme_base_color, 0.9), shade(@theme_selected_bg_color, 1.35), 0.1), 1.1)
                                      );
}

sidebar .frame {
    border-width: 0;
}

/**************
 * spinbutton *
 **************/
spinbutton button {
    color: mix(@theme_text_color, @theme_base_color, 0.4);
    padding: 2px 3px;
    border-width: 0;
    border-radius: 0;
    border-style: none;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 1px 0 shade(@theme_base_color, 0.9);
}

spinbutton button:disabled {
    color: mix(@theme_text_color, @theme_base_color, 0.7);
    box-shadow: inset 1px 0 shade(@theme_base_color, 0.9);
}

spinbutton button:active,
spinbutton button:checked,
spinbutton button:hover {
    color: @theme_fg_color;
}

spinbutton button:first-child {
    border-radius: 3px 0 0 3px;
    box-shadow: none;
}

spinbutton button:last-child {
    border-radius: 0 3px 3px 0;
}

spinbutton button:dir(rtl) {
    box-shadow: inset -1px 0 shade(@theme_base_color, 0.9);
}

spinbutton.vertical button {
    border-width: 1px;
    border-style: solid;
    border-top-color: shade(@theme_bg_color, 0.8);
    border-right-color: shade(@theme_bg_color, 0.72);
    border-left-color: shade(@theme_bg_color, 0.72);
    border-bottom-color: shade(@theme_bg_color, 0.7);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );

    color: @theme_fg_color;
    box-shadow: none;
}

spinbutton.vertical button:hover {
    border-top-color: shade(@theme_bg_color, 0.85);
    border-right-color: shade(@theme_bg_color, 0.78);
    border-left-color: shade(@theme_bg_color, 0.78);
    border-bottom-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

spinbutton.vertical button:active,
spinbutton.vertical button:checked {
    border-color: shade(@theme_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.85), 1.05),
                                      shade(shade(@theme_bg_color, 0.85), 0.97)
                                      );
}

spinbutton.vertical button:active:hover,
spinbutton.vertical button:checked:hover {
    border-top-color: shade(@theme_bg_color, 0.85);
    border-right-color: shade(@theme_bg_color, 0.78);
    border-left-color: shade(@theme_bg_color, 0.78);
    border-bottom-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

spinbutton.vertical button:focus,
spinbutton.vertical button:hover:focus,
spinbutton.vertical button:active:focus,
spinbutton.vertical button:checked:focus,
spinbutton.vertical button:active:hover:focus,
spinbutton.vertical button:checked:hover:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

spinbutton.vertical button:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.95), 1.05),
                                      shade(shade(@theme_bg_color, 0.95), 0.97)
                                      );

    color: mix(@theme_fg_color, @theme_bg_color, 0.4);
}

spinbutton.vertical button:first-child {
    border-width: 1px;
    border-bottom-width: 0;
    border-radius: 3px;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

spinbutton.vertical button:last-child {
    border-width: 1px;
    border-top-width: 0;
    border-radius: 3px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

spinbutton.vertical.entry {
    border-width: 1px;
    border-style: solid;
    border-radius: 0;
}

/***********
 * spinner *
 ***********/
@keyframes spinner {
    to { -gtk-icon-transform: rotate(1turn); }
}

spinner {
    -gtk-icon-source: -gtk-icontheme("process-working-symbolic");
    color: @theme_fg_color;
    opacity: 0;
}

spinner:checked {
    animation: spinner 1s infinite linear;
    opacity: 1;
}

spinner:checked:backdrop {
    color: @theme_fg_color;
}

spinner:checked:disabled {
    opacity: 0.5;
}

.menu spinner,
menu spinner,
.menu spinner:hover,
.primary-toolbar spinner {
    color: @theme_selected_bg_color;
    border: none;
    box-shadow: none;
}

/*************
 * statusbar *
 *************/
statusbar {
    padding: 3px;
    color: @theme_fg_color;
}

statusbar frame {
    border-width: 0;
}

/**********
 * switch *
 **********/
switch {
    padding: 0;
    border-radius: 3px;
    font: bold condensed;
}

switch slider {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );
}

switch slider:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.95), 1.05),
                                      shade(shade(@theme_bg_color, 0.95), 0.97)
                                      );
}

switch trough {
    border-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 0.95),
                                      shade(@theme_bg_color, 1.15)
                                      );

    color: @theme_fg_color;
}

switch trough:active {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 0.95),
                                      shade(@theme_selected_bg_color, 1.15)
                                      );

    color: @theme_selected_fg_color;
}

switch trough:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.95), 0.95),
                                      shade(shade(@theme_bg_color, 0.95), 1.15)
                                      );

    color: mix(@theme_fg_color, @theme_bg_color, 0.4);
}

/************
 * textview *
 ************/
textview,
GtkTextView {
    background-color: @theme_base_color;
    color: @theme_text_color;
}

/*****************
 * color chooser *
 *****************/
colorswatch,
colorswatch:selected {
    border-width: 1px;
    border-style: solid;
    border-color: alpha(black, 0.3);
    border-radius: 1px;
    background-color: transparent;
    background-clip: border-box;
}

colorswatch:hover,
colorswatch:selected:hover {
    border-color: alpha(black, 0.5);
}

colorswatch.color-dark:hover {
}

colorswatch.color-light:hover {
}

colorswatch.color-light:selected:hover,
colorswatch.color-dark:selected:hover {
    background-image: none;
}

colorswatch.left,
colorswatch:first-child {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

colorswatch.right,
colorswatch:last-child {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

colorswatch:only-child {
    border-radius: 3px;
}

colorswatch.top {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

colorswatch.bottom {
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

GtkColorChooserWidget #add-color-button {
    background-clip: padding-box;
    border-color: alpha(black, 0.3);
    background-color: shade(@theme_bg_color, 0.95);
    color: @theme_fg_color;
}

GtkColorChooserWidget #add-color-button:hover {
    border-color: alpha(black, 0.5);
    background-color: shade(@theme_bg_color, 0.90);
    color: @theme_fg_color;
}

.color-active-badge,
.color-active-badge:selected {
    border-width: 1px;
    border-style: solid;
    border-width: 2px;
    background-color: transparent;
}

.color-active-badge.color-light,
.color-active-badge.color-light:hover {
    border-color: alpha(black, 0.3);
    color: alpha(black, 0.3);
}

.color-active-badge.color-dark,
.color-active-badge.color-dark:hover {
    border-color: alpha(white, 0.3);
    color: alpha(white, 0.3);
}

GtkColorEditor colorswatch {
    border-radius: 3px;
}

GtkColorEditor colorswatch.color-dark:hover,
GtkColorEditor colorswatch.color-light:hover {
    background-image: none;
    border-color: alpha(black, 0.3);
}

GtkColorButtonbutton {
    padding: 2px;
}

/**************
 * header-bar *
 **************/
.titlebar:not(headerbar),
headerbar {
    padding: 6px;
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: shade(@titlebar_bg_color, 0.7);
    background-color: @titlebar_bg_color;
    background-image: linear-gradient(to bottom,
                                      shade(@titlebar_bg_color, 1.0),
                                      shade(@titlebar_bg_color, 0.88)
                                      );

    color: @titlebar_fg_color;
}

headerbar button.text-button {
    padding: 4px;
}

headerbar button.image-button {
    padding: 6px;
}

.titlebar:not(headerbar) .title,
headerbar .title {
    font: bold;
    padding: 0 12px;
}

.titlebar:not(headerbar) .subtitle,
headerbar .subtitle {
    font: smaller;
    padding: 0 12px;
}

headerbar combobox,
headerbar button {
    border-top-color: shade(@titlebar_bg_color, 0.8);
    border-right-color: shade(@titlebar_bg_color, 0.72);
    border-left-color: shade(@titlebar_bg_color, 0.72);
    border-bottom-color: shade(@titlebar_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@titlebar_bg_color, 1.02), 1.05),
                                      shade(shade(@titlebar_bg_color, 1.02), 0.97)
                                      );

    color: @titlebar_fg_color;
}

headerbar button:hover {
    border-top-color: shade(@titlebar_bg_color, 0.85);
    border-right-color: shade(@titlebar_bg_color, 0.78);
    border-left-color: shade(@titlebar_bg_color, 0.78);
    border-bottom-color: shade(@titlebar_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@titlebar_bg_color, 1.15),
                                      shade(@titlebar_bg_color, 1.07)
                                      );
}

headerbar button:active,
headerbar button:checked {
    border-color: shade(@titlebar_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@titlebar_bg_color, 0.85), 1.05),
                                      shade(shade(@titlebar_bg_color, 0.85), 0.97)
                                      );
}

headerbar button:active:hover,
headerbar button:checked:hover {
    border-top-color: shade(@titlebar_bg_color, 0.85);
    border-right-color: shade(@titlebar_bg_color, 0.78);
    border-left-color: shade(@titlebar_bg_color, 0.78);
    border-bottom-color: shade(@titlebar_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@titlebar_bg_color, 1.15),
                                      shade(@titlebar_bg_color, 1.07)
                                      );
}

headerbar button:focus,
headerbar button:hover:focus,
headerbar button:active:focus,
headerbar button:checked:focus,
headerbar button:active:hover:focus,
headerbar button:checked:hover:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

headerbar button:disabled {
    border-color: shade(@titlebar_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@titlebar_bg_color, 0.95), 1.05),
                                      shade(shade(@titlebar_bg_color, 0.95), 0.97)
                                      );
}

headerbar button:active:disabled,
headerbar button:checked:disabled {
    border-color: shade(@titlebar_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@titlebar_bg_color, 0.95), 1.05),
                                      shade(shade(@titlebar_bg_color, 0.95), 0.97)
                                      );
}

headerbar .entry {
    border-top-color: shade(@titlebar_bg_color, 0.6);
    border-right-color: shade(@titlebar_bg_color, 0.7);
    border-left-color: shade(@titlebar_bg_color, 0.7);
    border-bottom-color: shade(@titlebar_bg_color, 0.72);
}

headerbar .entry:active,
headerbar .entry:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

/***********
 * toolbar *
 ***********/
toolbar {
    padding: 6px;
    border-style: none;
    background-color: @toolbar_bg_color;
    background-image: linear-gradient(to bottom,
                                      shade(@toolbar_bg_color, 1.0),
                                      shade(@toolbar_bg_color, 0.88)
                                      );

    color: @toolbar_fg_color;
}

toolbar button {
    padding: 2px;
}

toolbar button.text-button {
    padding: 2px 4px;
}

toolbar button.image-button {
    padding: 3px 2px 2px 3px;
}

toolbar:disabled {
    background-color: shade(@toolbar_bg_color, 0.9);
    color: mix(@toolbar_fg_color, @toolbar_bg_color, 0.5);
}

/* menubar toolbars */
toolbar.menubar {
    -GtkToolbar-button-relief: normal;
}

/*******************
 * primary-toolbar *
 *******************/
.primary-toolbar,
.primary-toolbar toolbar,
.primary-toolbar toolbar {
    -GtkWidget-window-dragging: true;

    padding: 2px;
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: shade(@toolbar_bg_color, 0.7);
    background-color: @toolbar_bg_color;
    background-image: linear-gradient(to bottom,
                                      shade(@toolbar_bg_color, 1.0),
                                      shade(@toolbar_bg_color, 0.88)
                                      );

    color: @toolbar_fg_color;
}

.primary-toolbar combobox,
.primary-toolbar button {
    padding: 2px;
    border-width: 1px;
    border-color: transparent;
    border-radius: 3px;
    background-color: transparent;
    background-image: none;
    color: @toolbar_fg_color;
}

.primary-toolbar combobox.flat,
.primary-toolbar button.flat,
.primary-toolbar combobox.flat,
.primary-toolbar button.flat,
toolbar combobox.flat,
toolbar button.flat,
.primary-toolbar combobox.flat:disabled,
.primary-toolbar button.flat:disabled,
.primary-toolbar combobox.flat:disabled,
.primary-toolbar button.flat:disabled,
toolbar combobox.flat:disabled,
toolbar button.flat:disabled {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
}

.primary-toolbar .raised button,
.primary-toolbar .raisedbutton,
toolbar combobox,
toolbar button {
    border-top-color: shade(@toolbar_bg_color, 0.8);
    border-right-color: shade(@toolbar_bg_color, 0.72);
    border-left-color: shade(@toolbar_bg_color, 0.72);
    border-bottom-color: shade(@toolbar_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@toolbar_bg_color, 1.02), 1.05),
                                      shade(shade(@toolbar_bg_color, 1.02), 0.97)
                                      );

    color: @toolbar_fg_color;
}

.primary-toolbar button:hover,
toolbar button:hover {
    border-top-color: shade(@toolbar_bg_color, 0.85);
    border-right-color: shade(@toolbar_bg_color, 0.78);
    border-left-color: shade(@toolbar_bg_color, 0.78);
    border-bottom-color: shade(@toolbar_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@toolbar_bg_color, 1.15),
                                      shade(@toolbar_bg_color, 1.07)
                                      );
}

.primary-toolbar button:active,
.primary-toolbar button:checked,
toolbar button:active,
toolbar button:checked {
    border-color: shade(@toolbar_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@toolbar_bg_color, 0.85), 1.05),
                                      shade(shade(@toolbar_bg_color, 0.85), 0.97)
                                      );
}

.primary-toolbar button:active:hover,
.primary-toolbar button:checked:hover,
toolbar button:active:hover,
toolbar button:checked:hover {
    border-top-color: shade(@toolbar_bg_color, 0.85);
    border-right-color: shade(@toolbar_bg_color, 0.78);
    border-left-color: shade(@toolbar_bg_color, 0.78);
    border-bottom-color: shade(@toolbar_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@toolbar_bg_color, 1.15),
                                      shade(@toolbar_bg_color, 1.07)
                                      );
}

.primary-toolbar button:focus,
.primary-toolbar button:hover:focus,
.primary-toolbar button:active:focus,
.primary-toolbar button:checked:focus,
.primary-toolbar button:active:hover:focus,
.primary-toolbar button:checked:hover:focus,
toolbar button:focus,
toolbar button:hover:focus,
toolbar button:active:focus,
toolbar button:checked:focus,
toolbar button:active:hover:focus,
toolbar button:checked:hover:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

.primary-toolbar button:disabled,
toolbar button:disabled {
    border-color: shade(@toolbar_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@toolbar_bg_color, 0.95), 1.05),
                                      shade(shade(@toolbar_bg_color, 0.95), 0.97)
                                      );
}

.primary-toolbar button:active:disabled,
.primary-toolbar button:checked:disabled,
toolbar button:active:disabled,
toolbar button:checked:disabled {
    border-color: shade(@toolbar_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@toolbar_bg_color, 0.95), 1.05),
                                      shade(shade(@toolbar_bg_color, 0.95), 0.97)
                                      );
}

.primary-toolbar .entry,
toolbar .entry {
    border-top-color: shade(@toolbar_bg_color, 0.6);
    border-right-color: shade(@toolbar_bg_color, 0.7);
    border-left-color: shade(@toolbar_bg_color, 0.7);
    border-bottom-color: shade(@toolbar_bg_color, 0.72);
}

.primary-toolbar .entry:active,
.primary-toolbar .entry:focus,
toolbar .entry:active,
toolbar .entry:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

/* inline-toolbar */
.inline-toolbar toolbar {
    -GtkToolbar-button-relief: normal;

    padding: 2px;
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    border-radius: 0;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 0.93),
                                      @theme_bg_color
                                      );
}

.inline-toolbar toolbar:last-child {
    border-width: 0 1px 1px 1px;
    border-bottom-color: shade(@theme_bg_color, 0.76);
    border-color: shade(@theme_bg_color, 0.7);
    border-radius: 0;
}

.inline-toolbar toolbar button {
    padding: 4px;
    border-width: 1px 0 1px 1px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    border-radius: 0;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );

    color: @theme_fg_color;
}

.inline-toolbar toolbar button:hover {
    border-bottom-color: shade(@theme_bg_color, 0.75);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

.inline-toolbar toolbar button:active,
.inline-toolbar toolbar button:checked {
    border-color: shade(@theme_bg_color, 0.6);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.85), 1.05),
                                      shade(shade(@theme_bg_color, 0.85), 0.97)
                                      );
}

.inline-toolbar toolbar button:active:hover,
.inline-toolbar toolbar button:checked:hover {
    border-bottom-color: shade(@theme_bg_color, 0.75);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

.inline-toolbar toolbar button:focus,
.inline-toolbar toolbar button:hover:focus,
.inline-toolbar toolbar button:active:focus,
.inline-toolbar toolbar button:checked:focus,
.inline-toolbar toolbar button:active:hover:focus,
.inline-toolbar toolbar button:checked:hover:focus {
    border-color: shade(@theme_selected_bg_color, 0.8);
}

.inline-toolbar toolbar button:disabled,
.inline-toolbar toolbar GtkToolButton button:disabled {
    border-color: shade(@theme_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.95), 1.05),
                                      shade(shade(@theme_bg_color, 0.95), 0.97)
                                      );
}

/******************
 * linked buttons *
 *****************/
/* set up shadows for visual separation */
.linked button,
.inline-toolbar toolbar button,
.inline-toolbar toolbar GtkToolButton button,
.inline-toolbar toolbar GtkToolButton > button {
    padding: 6px;

    box-shadow: inset -1px 0 shade(@theme_bg_color, 0.8),
                inset 1px 1px alpha(@light_shadow, 0.4);
}

.linked button:active,
.linked button:checked,
.inline-toolbar toolbar button:active,
.inline-toolbar toolbar button:checked,
.inline-toolbar toolbar GtkToolButton button:active,
.inline-toolbar toolbar GtkToolButton button:checked,
.inline-toolbar toolbar GtkToolButton > button:active,
.inline-toolbar toolbar GtkToolButton > button:checked {
    box-shadow: inset -1px 0 shade(@theme_bg_color, 0.8),
                inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

.linked button:disabled,
.inline-toolbar toolbar button:disabled,
.inline-toolbar toolbar GtkToolButton button:disabled,
.inline-toolbar toolbar GtkToolButton > button:disabled {
    box-shadow: inset -1px 0 shade(@theme_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.2);
}

/* remove box shadow from last-child and only-child */
.linked button:active:disabled:last-child,
.linked button:checked:disabled:last-child,
.linked button:active:disabled:only-child,
.linked button:checked:disabled:only-child,
.inline-toolbar toolbar button:active:disabled:last-child,
.inline-toolbar toolbar button:checked:disabled:last-child,
.inline-toolbar toolbar button:active:disabled:only-child,
.inline-toolbar toolbar button:checked:disabled:only-child,
.inline-toolbar toolbar GtkToolButton:last-child > button:active:disabled,
.inline-toolbar toolbar GtkToolButton:last-child > button:checked:disabled,
.inline-toolbar toolbar GtkToolButton:only-child > button:active:disabled,
.inline-toolbar toolbar GtkToolButton:only-child > button:checked:disabled {
    box-shadow: none;
}

/* add back the inset shadow effect */
.linked button:last-child,
.linked button:only-child,
.inline-toolbar toolbar button:last-child,
.inline-toolbar toolbar button:only-child,
.inline-toolbar toolbar GtkToolButton:last-child > button,
.inline-toolbar toolbar GtkToolButton:only-child > button {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.4),
                inset -1px 0 alpha(@light_shadow, 0.4);
}


.linked button:disabled:last-child,
.linked button:disabled:only-child,
.inline-toolbar toolbar button:disabled:last-child,
.inline-toolbar toolbar button:disabled:only-child,
.inline-toolbar toolbar GtkToolButton:last-child > button:disabled,
.inline-toolbar toolbar GtkToolButton:only-child > button:disabled {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

.linked button:active:last-child,
.linked button:checked:last-child,
.linked button:active:only-child,
.linked button:checked:only-child,
.inline-toolbar toolbar button:active:last-child,
.inline-toolbar toolbar button:checked:last-child,
.inline-toolbar toolbar button:active:only-child,
.inline-toolbar toolbar button:checked:only-child,
.inline-toolbar toolbar GtkToolButton:last-child > button:active,
.inline-toolbar toolbar GtkToolButton:last-child > button:checked,
.inline-toolbar toolbar GtkToolButton:only-child > button:active,
.inline-toolbar toolbar GtkToolButton:only-child > button:checked {
    box-shadow: inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

/* middle button */
.linked .entry,
.linked button,
.linked button:active,
.linked button:checked,
.linked button:active:hover,
.linked button:checked:hover,
.linked button:disabled,
.inline-toolbar toolbar button,
.inline-toolbar toolbar button:active,
.inline-toolbar toolbar button:checked,
.inline-toolbar toolbar button:disabled,
.inline-toolbar toolbar GtkToolButton button,
.inline-toolbar toolbar GtkToolButton button:active,
.inline-toolbar toolbar GtkToolButton button:checked,
.inline-toolbar toolbar GtkToolButton button:disabled {
    border-width: 1px;
    border-radius: 0;
    border-right-width: 0;
    border-left-width: 0;
}

/*leftmost button */
.linked .entry:first-child,
.linked button:first-child,
.linked button:active:first-child,
.linked button:checked:first-child,
.linked button:active:hover:first-child,
.linked button:checked:hover:first-child,
.linked button:disabled:first-child,
.inline-toolbar toolbar button:first-child,
.inline-toolbar toolbar button:active:first-child,
.inline-toolbar toolbar button:checked:first-child,
.inline-toolbar toolbar button:disabled:first-child,
.inline-toolbar toolbar GtkToolButton:first-child button,
.inline-toolbar toolbar GtkToolButton:first-child button:active,
.inline-toolbar toolbar GtkToolButton:first-child button:checked,
.inline-toolbar toolbar GtkToolButton:first-child button:disabled {
    border-width: 1px;
    border-radius: 3px;
    border-right-width: 0;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

/* rightmost button */
.linked .entry:last-child,
.linked button:last-child,
.linked button:active:last-child,
.linked button:checked:last-child,
.linked button:active:hover:last-child,
.linked button:checked:hover:last-child,
.linked button:disabled:last-child,
.inline-toolbar toolbar button:last-child,
.inline-toolbar toolbar button:active:last-child,
.inline-toolbar toolbar button:checked:last-child,
.inline-toolbar toolbar button:disabled:last-child,
.inline-toolbar toolbar GtkToolButton:last-child button,
.inline-toolbar toolbar GtkToolButton:last-child button:active,
.inline-toolbar toolbar GtkToolButton:last-child button:checked,
.inline-toolbar toolbar GtkToolButton:last-child button:disabled {
    border-width: 1px;
    border-radius: 3px;
    border-left-width: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

/* linked single button */
.linked .entry:only-child,
.linked button:only-child,
.linked button:active:only-child,
.linked button:checked:only-child,
.linked button:active:hover:only-child,
.linked button:checked:hover:only-child,
.linked button:disabled:only-child,
.inline-toolbar toolbar button:only-child,
.inline-toolbar toolbar button:active:only-child,
.inline-toolbar toolbar button:checked:only-child,
.inline-toolbar toolbar button:disabled:only-child,
.inline-toolbar toolbar GtkToolButton:only-child button,
.inline-toolbar toolbar GtkToolButton:only-child button:active,
.inline-toolbar toolbar GtkToolButton:only-child button:checked,
.inline-toolbar toolbar GtkToolButton:only-child button:disabled {
    border-width: 1px;
    border-radius: 3px;
}

/* linked button shadows (vertical) */
.linked.vertical button,
.inline-toolbar toolbar.vertical button,
.inline-toolbar toolbar.vertical GtkToolButton > button {
    box-shadow: inset 0 -1px shade(@theme_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.4),
                inset -1px 0 alpha(@light_shadow, 0.4);
}

.linked.vertical button:active,
.linked.vertical button:checked,
.inline-toolbar toolbar.vertical button:active,
.inline-toolbar toolbar.vertical button:checked,
.inline-toolbar toolbar.vertical GtkToolButton > button:active,
.inline-toolbar toolbar.vertical GtkToolButton > button:checked {
    box-shadow: inset 0 -1px shade(@theme_bg_color, 0.8),
                inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

.linked.vertical button:disabled,
.inline-toolbar toolbar.vertical button:disabled,
.inline-toolbar toolbar.vertical GtkToolButton > button:disabled {
    box-shadow: inset 0 -1px shade(@theme_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

/* remove box shadow from last-child and only-child */
.linked.vertical button:active:disabled:last-child,
.linked.vertical button:checked:disabled:last-child,
.linked.vertical button:active:disabled:only-child,
.linked.vertical button:checked:disabled:only-child,
.inline-toolbar toolbar.vertical button:active:disabled:last-child,
.inline-toolbar toolbar.vertical button:checked:disabled:last-child,
.inline-toolbar toolbar.vertical button:active:disabled:only-child,
.inline-toolbar toolbar.vertical button:checked:disabled:only-child,
.inline-toolbar toolbar.vertical GtkToolButton:last-child > button:active:disabled,
.inline-toolbar toolbar.vertical GtkToolButton:last-child > button:checked:disabled,
.inline-toolbar toolbar.vertical GtkToolButton:only-child > button:active:disabled,
.inline-toolbar toolbar.vertical GtkToolButton:only-child > button:checked:disabled {
    box-shadow: none;
}

/* add back the inset shadow effect */
.linked.vertical button:last-child,
.linked.vertical button:only-child,
.inline-toolbar toolbar.vertical button:last-child,
.inline-toolbar toolbar.vertical button:only-child,
.inline-toolbar toolbar.vertical GtkToolButton:last-child > button,
.inline-toolbar toolbar.vertical GtkToolButton:only-child > button {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.4),
                inset -1px 0 alpha(@light_shadow, 0.4);
}

.linked.vertical button:disabled:last-child,
.linked.vertical button:disabled:only-child,
.inline-toolbar toolbar.vertical button:disabled:last-child,
.inline-toolbar toolbar.vertical button:disabled:only-child,
.inline-toolbar toolbar.vertical GtkToolButton:last-child > button:disabled,
.inline-toolbar toolbar.vertical GtkToolButton:only-child > button:disabled {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

.linked.vertical button:active:last-child,
.linked.vertical button:checked:last-child,
.linked.vertical button:active:only-child,
.linked.vertical button:checked:only-child,
.inline-toolbar toolbar.vertical button:active:last-child,
.inline-toolbar toolbar.vertical button:checked:last-child,
.inline-toolbar toolbar.vertical button:active:only-child,
.inline-toolbar toolbar.vertical button:checked:only-child,
.inline-toolbar toolbar.vertical GtkToolButton:last-child > button:active,
.inline-toolbar toolbar.vertical GtkToolButton:last-child > button:checked,
.inline-toolbar toolbar.vertical GtkToolButton:only-child > button:active,
.inline-toolbar toolbar.vertical GtkToolButton:only-child > button:checked {
    box-shadow: inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

/* middle button (vertical) */
.linked.vertical .entry,
.linked.vertical button,
.linked.vertical button:active,
.linked.vertical button:checked,
.linked.vertical button:active:hover,
.linked.vertical button:checked:hover,
.linked.vertical button:disabled {
    border-width: 1px;
    border-radius: 0;
    border-top-width: 0;
    border-bottom-width: 0;
}

/* top button (vertical) */
.linked.vertical .entry:first-child,
.linked.vertical button:first-child,
.linked.vertical button:active:first-child,
.linked.vertical button:checked:first-child,
.linked.vertical button:active:hover:first-child,
.linked.vertical button:checked:hover:first-child,
.linked.vertical button:disabled:first-child {
    border-width: 1px;
    border-radius: 3px;
    border-bottom-width: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

/* bottom button (vertical) */
.linked.vertical .entry:last-child,
.linked.vertical button:last-child,
.linked.vertical button:active:last-child,
.linked.vertical button:checked:last-child,
.linked.vertical button:active:hover:last-child,
.linked.vertical button:checked:hover:last-child,
.linked.vertical button:disabled:last-child {
    border-width: 1px;
    border-radius: 3px;
    border-top-width: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* linked single button (vertical) */
.linked.vertical .entry:only-child,
.linked.vertical button:only-child,
.linked.vertical button:active:only-child,
.linked.vertical button:checked:only-child,
.linked.vertical button:active:hover:only-child,
.linked.vertical button:checked:hover:only-child,
.linked.vertical button:disabled:only-child {
    border-width: 1px;
    border-radius: 3px;
}

/* linked toolbar buttons */
.primary-toolbar button.raised.linked,
.primary-toolbar .raised.linked button,
toolbar button.raised.linked,
toolbar .raised.linked button,
toolbar .linked button {
    box-shadow: inset -1px 0 shade(@toolbar_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.4);
}

.primary-toolbar button.raised.linked:active,
.primary-toolbar button.raised.linked:checked,
.primary-toolbar .raised.linked button:active,
.primary-toolbar .raised.linked button:checked,
toolbar button.raised.linked:active,
toolbar button.raised.linked:checked,
toolbar .raised.linked button:active,
toolbar .raised.linked button:checked,
toolbar .linked button:active,
toolbar .linked button:checked {
    box-shadow: inset -1px 0 shade(@toolbar_bg_color, 0.8),
                inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

.primary-toolbar button.raised.linked:disabled,
.primary-toolbar .raised.linked button:disabled,
toolbar button.raised.linked:disabled,
toolbar .raised.linked button:disabled,
toolbar .linked button:disabled {
    box-shadow: inset -1px 0 shade(@toolbar_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.2);
}

/* remove box shadow from last-child and only-child */
.primary-toolbar button:active:disabled.raised.linked:last-child,
.primary-toolbar button:checked:disabled.raised.linked:last-child,
.primary-toolbar button:active:disabled.raised.linked:only-child,
.primary-toolbar button:checked:disabled.raised.linked:only-child,
.primary-toolbar .raised.linked button:active:disabled:last-child,
.primary-toolbar .raised.linked button:checked:disabled:last-child,
.primary-toolbar .raised.linked button:active:disabled:only-child,
.primary-toolbar .raised.linked button:checked:disabled:only-child,
toolbar button:active:disabled.raised.linked:last-child,
toolbar button:checked:disabled.raised.linked:last-child,
toolbar button:active:disabled.raised.linked:only-child,
toolbar button:checked:disabled.raised.linked:only-child,
toolbar .raised.linked button:active:disabled:last-child,
toolbar .raised.linked button:checked:disabled:last-child,
toolbar .raised.linked button:active:disabled:only-child,
toolbar .raised.linked button:checked:disabled:only-child,
toolbar .linked button:active:disabled:last-child,
toolbar .linked button:checked:disabled:last-child,
toolbar .linked button:active:disabled:only-child
toolbar .linked button:checked:disabled:only-child {
    box-shadow: none;
}

/* add back the inset shadow effect */
.primary-toolbar button.raised.linked:last-child,
.primary-toolbar button.raised.linked:only-child,
.primary-toolbar .raised.linked button:last-child,
.primary-toolbar .raised.linked button:only-child,
toolbar button.raised.linked:last-child,
toolbar button.raised.linked:only-child,
toolbar .raised.linked button:last-child,
toolbar .raised.linked button:only-child,
toolbar .linked button:last-child,
toolbar .linked button:only-child {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.4),
                inset -1px 0 alpha(@light_shadow, 0.4);
}

.primary-toolbar button:disabled.raised.linked:last-child,
.primary-toolbar button:disabled.raised.linked:only-child,
.primary-toolbar .raised.linked button:disabled:last-child,
.primary-toolbar .raised.linked button:disabled:only-child,
toolbar button:disabled.raised.linked:last-child,
toolbar button:disabled.raised.linked:only-child,
toolbar .raised.linked button:disabled:last-child,
toolbar .raised.linked button:disabled:only-child,
toolbar .linked button:disabled:last-child,
toolbar .linked button:disabled:only-child {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

.primary-toolbar button:active.raised.linked:last-child,
.primary-toolbar button:checked.raised.linked:last-child,
.primary-toolbar button:active.raised.linked:only-child,
.primary-toolbar button:checked.raised.linked:only-child,
.primary-toolbar .raised.linked button:active:last-child,
.primary-toolbar .raised.linked button:checked:last-child,
.primary-toolbar .raised.linked button:active:only-child,
.primary-toolbar .raised.linked button:checked:only-child,
toolbar button:active.raised.linked:last-child,
toolbar button:checked.raised.linked:last-child,
toolbar button:active.raised.linked:only-child,
toolbar button:checked.raised.linked:only-child,
toolbar .raised.linked button:active:last-child,
toolbar .raised.linked button:checked:last-child,
toolbar .raised.linked button:active:only-child,
toolbar .raised.linked button:checked:only-child,
toolbar .linked button:active:last-child,
toolbar .linked button:checked:last-child,
toolbar .linked button:active:only-child,
toolbar .linked button:checked:only-child {
    box-shadow: inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

/* middle button */
.primary-toolbar button.raised.linked,
.primary-toolbar button.raised.linked:active,
.primary-toolbar button.raised.linked:checked,
.primary-toolbar button.raised.linked:disabled,
.primary-toolbar .raised.linked button,
.primary-toolbar .raised.linked button:active,
.primary-toolbar .raised.linked button:checked,
.primary-toolbar .raised.linked button:disabled,
toolbar button.raised.linked,
toolbar button.raised.linked:active,
toolbar button.raised.linked:checked,
toolbar button.raised.linked:disabled,
toolbar .raised.linked button,
toolbar .raised.linked button:active,
toolbar .raised.linked button:checked,
toolbar .raised.linked button:disabled,
toolbar .linked button,
toolbar .linked button:active,
toolbar .linked button:checked,
toolbar .linked button:disabled {
    border-width: 1px;
    border-radius: 0;
    border-right-width: 0;
    border-left-width: 0;
}

/* leftmost button */
.primary-toolbar button.raised.linked:first-child,
.primary-toolbar button.raised.linked:active:first-child,
.primary-toolbar button.raised.linked:checked:first-child,
.primary-toolbar button.raised.linked:disabled:first-child,
.primary-toolbar .raised.linked button:first-child,
.primary-toolbar .raised.linked button:active:first-child,
.primary-toolbar .raised.linked button:checked:first-child,
.primary-toolbar .raised.linked button:disabled:first-child,
toolbar button.raised.linked:first-child,
toolbar button.raised.linked:active:first-child,
toolbar button.raised.linked:checked:first-child,
toolbar button.raised.linked:disabled:first-child,
toolbar .raised.linked button:first-child,
toolbar .raised.linked button:active:first-child,
toolbar .raised.linked button:checked:first-child,
toolbar .raised.linked button:disabled:first-child,
toolbar .linked button:first-child,
toolbar .linked button:active:first-child,
toolbar .linked button:checked:first-child,
toolbar .linked button:disabled:first-child {
    border-width: 1px;
    border-radius: 3px;
    border-right-width: 0;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

/* rightmost button */
.primary-toolbar button.raised.linked:last-child,
.primary-toolbar button.raised.linked:active:last-child,
.primary-toolbar button.raised.linked:checked:last-child,
.primary-toolbar button.raised.linked:disabled:last-child,
.primary-toolbar .raised.linked button:last-child,
.primary-toolbar .raised.linked button:active:last-child,
.primary-toolbar .raised.linked button:checked:last-child,
.primary-toolbar .raised.linked button:disabled:last-child,
toolbar button.raised.linked:last-child,
toolbar button.raised.linked:active:last-child,
toolbar button.raised.linked:checked:last-child,
toolbar button.raised.linked:disabled:last-child,
toolbar .raised.linked button:last-child,
toolbar .raised.linked button:active:last-child,
toolbar .raised.linked button:checked:last-child,
toolbar .raised.linked button:disabled:last-child,
toolbar .linked button:last-child,
toolbar .linked button:active:last-child,
toolbar .linked button:checked:last-child,
toolbar .linked button:disabled:last-child {
    border-width: 1px;
    border-radius: 3px;
    border-left-width: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

/* linked single button */
.primary-toolbar button.raised.linked:only-child,
.primary-toolbar button.raised.linked:active:only-child,
.primary-toolbar button.raised.linked:checked:only-child,
.primary-toolbar button.raised.linked:disabled:only-child,
.primary-toolbar .raised.linked button:only-child,
.primary-toolbar .raised.linked button:active:only-child,
.primary-toolbar .raised.linked button:checked:only-child,
.primary-toolbar .raised.linked button:disabled:only-child,
toolbar button.raised.linked:only-child,
toolbar button.raised.linked:active:only-child,
toolbar button.raised.linked:checked:only-child,
toolbar button.raised.linked:disabled:only-child,
toolbar .raised.linked button:only-child,
toolbar .raised.linked button:active:only-child,
toolbar .raised.linked button:checked:only-child,
toolbar .raised.linked button:disabled:only-child,
toolbar .linked button:only-child,
toolbar .linked button:active:only-child,
toolbar .linked button:checked:only-child,
toolbar .linked button:disabled:only-child {
    border-width: 1px;
    border-radius: 3px;
}

/* linked titlebar buttons */
headerbar button.raised.linked,
headerbar .raised.linked button,
headerbar .linked button {
    box-shadow: inset -1px 0 shade(@titlebar_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.4);
}

headerbar button.raised.linked:active,
headerbar button.raised.linked:checked,
headerbar .raised.linked button:active,
headerbar .raised.linked button:checked,
headerbar .linked button:active,
headerbar .linked button:checked {
    box-shadow: inset -1px 0 shade(@titlebar_bg_color, 0.8),
                inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

headerbar button.raised.linked:disabled,
headerbar .raised.linked button:disabled,
headerbar .linked button:disabled {
    box-shadow: inset -1px 0 shade(@titlebar_bg_color, 0.8),
		inset 1px 1px alpha(@light_shadow, 0.2);
}

/* remove box shadow from last-child and only-child */
headerbar button:active:disabled.raised.linked:last-child,
headerbar button:checked:disabled.raised.linked:last-child,
headerbar button:active:disabled.raised.linked:only-child,
headerbar button:checked:disabled.raised.linked:only-child,
headerbar .raised.linked button:active:disabled:last-child,
headerbar .raised.linked button:checked:disabled:last-child,
headerbar .raised.linked button:active:disabled:only-child,
headerbar .raised.linked button:checked:disabled:only-child,
headerbar .linked button:active:disabled:last-child,
headerbar .linked button:checked:disabled:last-child,
headerbar .linked button:active:disabled:only-child,
headerbar .linked button:checked:disabled:only-child {
    box-shadow: none;
}

/* add back the inset shadow effect */
headerbar button.raised.linked:last-child,
headerbar button.raised.linked:only-child,
headerbar .raised.linked button:last-child,
headerbar .raised.linked button:only-child,
headerbar .linked button:last-child,
headerbar .linked button:only-child {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.4),
                inset -1px 0 alpha(@light_shadow, 0.4);
}

headerbar button:disabled.raised.linked:last-child,
headerbar button:disabled.raised.linked:only-child,
headerbar .raised.linked button:disabled:last-child,
headerbar .raised.linked button:disabled:only-child,
headerbar .linked button:disabled:last-child,
headerbar .linked button:disabled:only-child {
    box-shadow: inset 1px 1px alpha(@light_shadow, 0.2),
                inset -1px 0 alpha(@light_shadow, 0.2);
}

headerbar button:active.raised.linked:last-child,
headerbar button:checked.raised.linked:last-child,
headerbar button:active.raised.linked:only-child,
headerbar button:checked.raised.linked:only-child,
headerbar .raised.linked button:active:last-child,
headerbar .raised.linked button:checked:last-child,
headerbar .raised.linked button:active:only-child,
headerbar .raised.linked button:checked:only-child,
headerbar .linked button:active:last-child,
headerbar .linked button:checked:last-child,
headerbar .linked button:active:only-child,
headerbar .linked button:checked:only-child {
    box-shadow: inset 1px 1px alpha(@dark_shadow, 0.06),
                inset -1px -1px alpha(@dark_shadow, 0.06);
}

/* middle button */
headerbar button.raised.linked,
headerbar button.raised.linked:active,
headerbar button.raised.linked:checked,
headerbar button.raised.linked:disabled,
headerbar .raised.linked button,
headerbar .raised.linked button:active,
headerbar .raised.linked button:checked,
headerbar .raised.linked button:disabled,
headerbar .linked button,
headerbar .linked button:active,
headerbar .linked button:checked,
headerbar .linked button:disabled {
    border-width: 1px;
    border-radius: 0;
    border-right-width: 0;
    border-left-width: 0;
}

/* leftmost button */
headerbar button.raised.linked:first-child,
headerbar button.raised.linked:active:first-child,
headerbar button.raised.linked:checked:first-child,
headerbar button.raised.linked:disabled:first-child,
headerbar .raised.linked button:first-child,
headerbar .raised.linked button:active:first-child,
headerbar .raised.linked button:checked:first-child,
headerbar .raised.linked button:disabled:first-child,
headerbar .linked button:first-child,
headerbar .linked button:active:first-child,
headerbar .linked button:checked:first-child,
headerbar .linked button:disabled:first-child {
    border-width: 1px;
    border-radius: 3px;
    border-right-width: 0;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

/* rightmost button */
headerbar button.raised.linked:last-child,
headerbar button.raised.linked:active:last-child,
headerbar button.raised.linked:checked:last-child,
headerbar button.raised.linked:disabled:last-child,
headerbar .raised.linked button:last-child,
headerbar .raised.linked button:active:last-child,
headerbar .raised.linked button:checked:last-child,
headerbar .raised.linked button:disabled:last-child,
headerbar .linked button:last-child,
headerbar .linked button:active:last-child,
headerbar .linked button:checked:last-child,
headerbar .linked button:disabled:last-child {
    border-width: 1px;
    border-radius: 3px;
    border-left-width: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

/* linked single button */
headerbar button.raised.linked:only-child,
headerbar button.raised.linked:active:only-child,
headerbar button.raised.linked:checked:only-child,
headerbar button.raised.linked:disabled:only-child,
headerbar .raised.linked button:only-child,
headerbar .raised.linked button:active:only-child,
headerbar .raised.linked button:checked:only-child,
headerbar .raised.linked button:disabled:only-child,
headerbar .linked button:only-child,
headerbar .linked button:active:only-child,
headerbar .linked button:checked:only-child,
headerbar .linked button:disabled:only-child {
    border-width: 1px;
    border-radius: 3px;
}

/***********
 * tooltip *
 ***********/
tooltip,
tooltip.background {
    padding: 4px 4px;
    border-width: 1px;
    border-style: solid;
    border-color: alpha(@theme_tooltip_bg_color, 0.7);
    border-radius: 3px;
    background-color: alpha(@theme_tooltip_bg_color, 0.7);
    background-image: none;
    color: @theme_tooltip_fg_color;
}

tooltip * {
    background-color: @theme_tooltip_bg_color;
    color: @theme_tooltip_fg_color;
}

/************
 * treeview *
 ************/
treeview {
    -treeview-vertical-separator: 0;
}

treeview.dnd {
    border-width: 1px;
    border-style: solid;
    border-color: @theme_selected_bg_color;
    border-radius: 0;
}

treeview entry {
    border-radius: 0;
    background-color: @theme_base_color;
    background-image: none;
}

treeview.view.separator {
    min-height: 2px; 
}

/************
 * viewport *
 ************/
view frame {
    border-width: 0;
}

view {
    background-color: @theme_base_color;
    color: @theme_text_color;
}

view:disabled,
view:disabled:disabled {
    background-color: shade(@theme_base_color, 0.9);
    color: mix(@theme_fg_color, @theme_bg_color, 0.5);
}

view:selected,
view:selected:focus {
    background-color: @theme_selected_bg_color;
    color: @theme_selected_fg_color;
}

/**************
 *actionbar *
 **************/
actionbar {
    padding: 6px;
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.0),
                                      shade(@theme_bg_color, 0.88)
                                      );
}

actionbar button.text-button {
    padding: 4px;
}

actionbar button.image-button {
    padding: 6px;
}

actionbar .title {
    font: bold;
    padding: 0 12px;
}

actionbar .subtitle {
    font: smaller;
    padding: 0 12px;
}

/***************
 * search bars *
 ***************/
searchbar {
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    background-color: shade(@theme_bg_color, 0.98);
}

searchbar button.close-button {
    padding: 4px;
}

/***********
 * dialogs *
 ***********/
GtkMessageDialog,
.prompt {
    -GtkDialog-content-area-border: 0;
    -GtkDialog-action-area-border: 0;
    -GtkDialog-button-spacing: 0;

    margin: 0;
    padding: 0;
}

/********************
 * various choosers *
 ********************/
GtkFontButton .separator,
GtkFileChooserButton .separator {
    -GtkWidget-horizontal-separator: 0;
    -GtkWidget-vertical-separator: 0;
}

GtkFontButton GtkLabel:last-child {
    color: alpha(currentColor, 0.7);
}

GtkFileChooserButton GtkImage:last-child {
    color: alpha(currentColor, 0.7);
}

/*********************
 * app notifications *
 *********************/
.app-notification {
    border-style: solid;
    border-color: shade(@theme_base_color, 0.7);
    border-width: 0 1px 1px 1px;
    border-radius: 0 0 3px 3px;
    padding: 8px;
    background-color: @theme_base_color;
    background-image: none;
    color: @theme_text_color;
}

/*******
 * osd *
 *******/
.background.osd {
    color: @osd_fg;
    background-color: @osd_bg;
}

GtkOverlay.osd {
    background-color: transparent;
}

.osd.frame {
    background-clip: border-box;
    background-origin: border-box;
}

.osdbutton,
.osd button {
    padding: 4px;
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    border-radius: 2px;
    background-color: transparent;
    background-image: none;
    color: @osd_fg;
}

.osdbutton:hover,
.osdbutton:hover,
.osd button:hover {
    border-color: shade(@osd_bg, 0.6);
    background-color: shade(@osd_bg, 1.15);
    background-image: none;
}

.osdbutton:active,
.osdbutton:checked,
.osd button:active,
.osd button:checked,
.osd GtkMenuButtonbutton:active,
.osd GtkMenuButtonbutton:checked {
    border-color: shade(@osd_bg, 0.4);
    background-color: shade(@osd_bg, 0.65);
    background-image: linear-gradient(to bottom,
                                      shade(@osd_bg, 0.5),
                                      shade(@osd_bg, 0.75)
                                      );
}

.osdbutton:active:hover,
.osdbutton:checked:hover,
.osd button:active:hover,
.osd button:checked:hover,
.osd GtkMenuButtonbutton:active:hover {
    border-color: shade(@osd_bg, 0.4);
}

.osdbutton:disabled,
.osd button:disabled {
    border-color: transparent;
    background-color: shade(@osd_bg, 0.9);
    background-image: none;
}

.osdbutton:active:disabled,
.osdbutton:checked:disabled,
.osd button:active:disabled,
.osd button:checked:disabled {
    background-color: shade(@osd_bg, 0.80);
    background-image: none;
}

.osdtoolbar {
    -GtkToolbar-button-relief: normal;

    padding: 4px;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    border-color: shade(@osd_bg, 0.8);
    background-color: @osd_bg;
    background-image: none;
    color: @osd_fg;
}

.osdtoolbar button {
    padding: 4px;
    border-width: 1px;
    border-style: solid;
    border-color: shade(@osd_bg, 0.8);
    border-radius: 3px;
    background-color: shade(@osd_bg, 1.05);
    background-image: none;
    color: @osd_fg;
}

.osdtoolbar button:hover {
    border-color: shade(@osd_bg, 0.7);
    background-color: shade(@osd_bg, 1.15);
    background-image: none;
}

.osdtoolbar button:active,
.osdtoolbar button:checked {
    border-color: shade(@osd_bg, 0.8);
    background-color: shade(@osd_bg, 0.95);
    background-image: none;
}

.osdtoolbar button:active:hover,
.osdtoolbar button:checked:hover {
    border-color: shade(@osd_bg, 0.7);
}

.osdtoolbar button:focus,
.osdtoolbar button:hover:focus,
.osdtoolbar button:active:focus,
.osdtoolbar button:checked:focus,
.osdtoolbar button:active:hover:focus,
.osdtoolbar button:checked:hover:focus {
    border-color: shade(@osd_bg, 0.7);
}

.osdtoolbar button:disabled {
    border-color: shade(@osd_bg, 0.85);
    background-color: shade(@osd_bg, 0.9);
    background-image: none;
}

.osdtoolbar button:active:disabled,
.osdtoolbar button:checked:disabled {
    border-color: shade(@osd_bg, 0.75);
    background-color: shade(@osd_bg, 0.80);
    background-image: none;
}

.osdtoolbar button:first-child {
    border-radius: 3px 0 0 3px;
    border-width: 1px 0 1px 1px;
    box-shadow: inset -1px 0 shade(@osd_bg, 0.9);
}

.osdtoolbar button:last-child {
    box-shadow: none;
    border-radius: 0 3px 3px 0;
    border-width: 1px 1px 1px 0;
}

.osdtoolbar button:only-child,
.osdtoolbar GtkToolButton button,
.osdtoolbar GtkToolButton:only-child button,
.osdtoolbar GtkToolButton:last-child button,
.osdtoolbar GtkToolButton:first-child button {
    border-width: 1px;
    border-radius: 3px;
    border-style: solid;
}

.osdtoolbar .separator {
    color: shade(@osd_bg, 0.9);
}

/* used by gnome-settings-daemon's media-keys OSD */
.osd.trough {
    background-color: shade(@osd_bg, 0.8);
}

.osd.progressbar {
    background-color: @osd_fg;
}

.osd scale slider {
    background-color: shade(@osd_bg, 1.08);
    background-image: none;
    /* we will draw the border using box shadow for now */
    box-shadow: inset 1px 0 shade(@osd_bg, 0.7),
                inset 0 1px shade(@osd_bg, 0.7),
                inset -1px 0 shade(@osd_bg, 0.6),
                inset 0 -1px shade(@osd_bg, 0.6);
}

.osd scale slider:hover {
    box-shadow: inset 1px 0 shade(@osd_bg, 0.6),
                inset 0 1px shade(@osd_bg, 0.6),
                inset -1px 0 shade(@osd_bg, 0.5),
                inset 0 -1px shade(@osd_bg, 0.5);
}

.osd scale slider:disabled {
    background-color: shade(@osd_bg, 0.9);
    background-image: none;
    box-shadow: inset 1px 0 shade(@osd_bg, 0.8),
                inset 0 1px shade(@osd_bg, 0.8),
                inset -1px 0 shade(@osd_bg, 0.8),
                inset 0 -1px shade(@osd_bg, 0.8);
}

.osd scale trough {
    border-color: shade(@osd_bg, 0.7);
    background-color: shade(@osd_bg, 0.9);
    background-image: none;
}

.osd scale trough.highlight {
    border-color: @theme_selected_bg_color;
    background-color: @theme_selected_bg_color;
    background-image: none;
}

.osd scale trough:disabled,
.osd scale trough.highlight:disabled {
    border-color: shade(@osd_bg, 0.9);
    background-color: shade(@osd_bg, 0.95);
    background-image: none;
}

.osd progressbar,
progressbar.osd {
    -progressbar-xspacing: 0;
    -progressbar-yspacing: 2px;
    -progressbar-min-horizontal-bar-height: 2px;

    padding: 0;
}

.osd progressbar.trough,
progressbar.osd.trough {
    padding: 0;
    border-style: none;
    border-radius: 0;
    background-image: none;
    background-color: transparent;
}

.osd progressbar.progressbar,
progressbar.osd.progressbar {
    border-style: none;
    border-radius: 0;
    background-color: @theme_selected_bg_color;
    background-image: none;
}

.osd .view,
.osd.view {
    background-color: @osd_base;
}

.osd scrollbar.trough {
    background-color: @osd_bg;
}

.osd scrollbar.slider {
    border-width: 1px;
    border-color: shade(@osd_bg, 0.7);
    border-radius: 0;
    background-color: shade(@osd_bg, 0.9);
}

.osd scrollbar.slider:hover {
    border-color: shade(@osd_bg, 0.7);
    background-color: shade(@osd_bg, 0.8);
}

.osd scrollbar.slider:active,
.osd scrollbar.slider:checked {
    border-color: shade(@theme_selected_bg_color, 0.9);
    background-color: @theme_selected_bg_color;
}

.osd GtkIconView.cell:selected,
.osd GtkIconView.cell:selected:focus {
    background-color: transparent;
    border-style: solid;
    border-width: 3px;
    border-color: @osd_fg;
    outline-color: transparent;
}

/* used by Documents */
.osd .page-thumbnail {
    border-style: solid;
    border-width: 1px;
    border-color: shade(@osd_bg, 0.9);
    /* when there's no pixbuf yet */
    background-color: @osd_bg;
}

/******************************
 * destructive action buttons *
 ******************************/
button.destructive-action {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@error_color, 0.8);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@error_color, 1.2), 1.05),
                                      shade(shade(@error_color, 1.2), 0.97)
                                      );

    color: @theme_selected_fg_color;
    box-shadow: none;
}

button.destructive-action:hover {
    border-color: shade(@error_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(mix(@theme_base_color, @error_color, 0.7), 1.05),
                                      shade(mix(@theme_base_color, @error_color, 0.7), 0.97)
                                      );
}

button.destructive-action:active,
button.destructive-action:checked {
    border-color: shade(@error_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@error_color, 1.2), 1.05),
                                      shade(shade(@error_color, 1.2), 0.97)
                                      );
}

button.destructive-action:hover:active,
button.destructive-action:hover:checked {
    border-color: shade(@error_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(mix(@theme_base_color, @error_color, 0.7), 1.05),
                                      shade(mix(@theme_base_color, @error_color, 0.7), 0.97)
                                      );
}

/******************************
 * suggested action buttons *
 ******************************/
button.suggested-action {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.8);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );

    color: @theme_fg_color;
}

button.suggested-action:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

button.suggested-action:active,
button.suggested-action:checked {
    border-color: shade(@theme_selected_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.85), 1.05),
                                      shade(shade(@theme_bg_color, 0.85), 0.97)
                                      );
}

button.suggested-action:hover:active,
button.suggested-action:hover:checked {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

/******************
 * selection mode *
 ******************/
.selection-modeheaderbar,
.selection-modetoolbar {
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.9);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_selected_bg_color, 1.3),
                                      shade(@theme_selected_bg_color, 1.1)
                                      );

    color: shade(@theme_selected_bg_color, 0.9);
}

.selection-modeheaderbar {
    border-top-color: shade(@theme_selected_bg_color, 1.2);
    border-bottom-color: @theme_selected_bg_color;
}

.selection-modetoolbar {
    padding: 4px;
}

/* regular button */
.selection-modeheaderbar button,
.selection-modetoolbar button,
.selection-modetoolbar GtkToolButton button {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.8);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_selected_bg_color, 1.2), 1.05),
                                      shade(shade(@theme_selected_bg_color, 1.2), 0.97)
                                      );

    color: @theme_selected_fg_color;
    box-shadow: none;
}

.selection-modeheaderbar button:hover,
.selection-modetoolbar button:hover,
.selection-modetoolbar GtkToolButton button:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 1.05),
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 0.97)
                                      );
}

.selection-modeheaderbar button:active,
.selection-modeheaderbar button:checked,
.selection-modetoolbar button:active,
.selection-modetoolbar button:checked,
.selection-modetoolbar GtkToolButton button:active,
.selection-modetoolbar GtkToolButton button:checked {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_selected_bg_color, 1.2), 1.05),
                                      shade(shade(@theme_selected_bg_color, 1.2), 0.97)
                                      );
}

.selection-modeheaderbar button:hover:active,
.selection-modeheaderbar button:hover:checked,
.selection-modetoolbar button:hover:active,
.selection-modetoolbar button:hover:checked,
.selection-modetoolbar GtkToolButton button:hover:active,
.selection-modetoolbar GtkToolButton button:hover:checked {
    border-color: shade(@theme_selected_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 1.05),
                                      shade(mix(@theme_base_color, @theme_selected_bg_color, 0.7), 0.97)
                                      );
}

/* suggested button */
.selection-modeheaderbar button.suggested-action,
.selection-modetoolbar button.suggested-action,
.selection-modetoolbar GtkToolButton.suggested-action button {
    border-width: 1px;
    border-style: solid;
    border-color: shade(@theme_selected_bg_color, 0.8);
    border-radius: 3px;
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 1.02), 1.05),
                                      shade(shade(@theme_bg_color, 1.02), 0.97)
                                      );

    color: @theme_fg_color;
}

.selection-modeheaderbar button.suggested-action:hover,
.selection-modetoolbar button.suggested-action:hover,
.selection-modetoolbar GtkToolButton.suggested-action button:hover {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

.selection-modeheaderbar button.suggested-action:active,
.selection-modeheaderbar button.suggested-action:checked,
.selection-modetoolbar button.suggested-action:active,
.selection-modetoolbar button.suggested-action:checked,
.selection-modetoolbar GtkToolButton.suggested-action:active,
.selection-modetoolbar GtkToolButton.suggested-action:checked {
    border-color: shade(@theme_selected_bg_color, 0.7);
    background-image: linear-gradient(to bottom,
                                      shade(shade(@theme_bg_color, 0.85), 1.05),
                                      shade(shade(@theme_bg_color, 0.85), 0.97)
                                      );
}

.selection-modeheaderbar button.suggested-action:hover:active,
.selection-modeheaderbar button.suggested-action:hover:checked,
.selection-modetoolbar button.suggested-action:hover:active,
.selection-modetoolbar button.suggested-action:hover:checked,
.selection-modetoolbar GtkToolButton.suggested-action button:hover:active,
.selection-modetoolbar GtkToolButton.suggested-action button:hover:checked {
    border-color: shade(@theme_selected_bg_color, 0.8);
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

/* menu button */
.selection-modeheaderbar .selection-menubutton,
.selection-modetoolbar .selection-menubutton {
    border-style: none;
    background-color: transparent;
    background-image: none;
    color: shade(@theme_selected_bg_color, 0.7);
}

.selection-modetoolbar .dim-label,
.selection-modetoolbar .selection-menubutton .dim-label {
    color: shade(@theme_selected_bg_color, 0.6);
}

.selection-modeheaderbar .selection-menubutton:hover,
.selection-modetoolbar .dim-label:hover,
.selection-modetoolbar .selection-menubutton:hover,
.selection-modetoolbar .selection-menubutton .dim-label:hover {
    color: shade(@theme_selected_bg_color, 0.6);
}

.selection-modeheaderbar .selection-menubutton:active,
.selection-modeheaderbar .selection-menubutton:checked,
.selection-modetoolbar .selection-menubutton:active,
.selection-modetoolbar .selection-menubutton:checked {
    color: shade(@theme_selected_bg_color, 0.7);
    box-shadow: none;
}

/*************************
 * touch text selections *
 *************************/
GtkBubbleWindow {
    border-radius: 3px;
    background-clip: border-box;
}

GtkBubbleWindow.osd.background {
    background-color: @osd_bg;
}

GtkBubbleWindow toolbar {
    background-color: transparent;
}

/*******
 * CSD *
 *******/
.titlebar {
    border-radius: 4px 4px 0 0;
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );

    color: @theme_bg_color;
}

.tiled .titlebar {
    border-radius: 3px;
}

.maximized .titlebar {
    border-radius: 0;
}

/* this is the default titlebar that is added by GTK
 * when client-side decorations are in use and the application
 * did not set a custom titlebar.
 */
.titlebar.default-decoration {
    border: none;
    box-shadow: none;
}

.titlebar .title {
    font: bold;
    color: @titlebar_fg_color;
    text-shadow: 0 1px shade(@titlebar_bg_color, 1.1);
}

.titlebar:backdrop {
    background-image: linear-gradient(to bottom,
                                      shade(@theme_bg_color, 1.15),
                                      shade(@theme_bg_color, 1.07)
                                      );
}

.titlebar .title:backdrop {
    color: @titlebar_fg_color;
    text-shadow: 0 1px shade(@titlebar_bg_color, 1.05);
}

.titlebar .titlebutton {
    padding: 4px;
    border-style: none;
    background: none;
    color: mix(@titlebar_fg_color, @titlebar_bg_color, 0.3);
    -gtk-icon-shadow: 0 1px shade(@titlebar_bg_color, 1.1);
    box-shadow: none;
}

.titlebar .titlebutton:hover,
.titlebar .titlebutton:hover:focus {
    background: none;
    color: @titlebar_fg_color;
    box-shadow: none;
}

.titlebar .titlebutton:active,
.titlebar .titlebutton:checked,
.titlebar .titlebutton:active:hover,
.titlebar .titlebutton:checked:hover {
    background: none;
    color: @theme_selected_bg_color;
    box-shadow: none;
}

.titlebar .titlebutton:backdrop {
    background-image: none;
    color: mix(@titlebar_fg_color, @titlebar_bg_color, 0.6);
    -gtk-icon-shadow: 0 1px shade(@titlebar_bg_color, 1.05);
}

.window-frame {
    border-style: none;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 3px 7px alpha(black, 0.7),
                0 0 0 1px alpha(black, 0.3);

    /* this is used for the resize cursor area */
    margin: 10px;
}

.window-frame.tiled {
    border-radius: 0;
}

.window-frame:backdrop {
    box-shadow: 0 3px 5px alpha(black, 0.5),
                0 0 0 1px alpha(black, 0.2);
}

.window-frame.csd.popup {
    border-style: none;
    border-radius: 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.window-frame.csdtooltip {
    border-radius: 4px;
    box-shadow: none;
}
