#toolbar {
  -webkit-app-region: drag;
  display: flex;
  justify-content: center;

  padding-top: 10px;
  padding-bottom: 10px;

  /* to avoid Mac top-left controls (close/minimize/zoom) */
  padding-left: 80px;
}
#toolbar .column {
  display: flex;
  flex-wrap: nowrap;
}
#toolbar .column:first-child {
  flex: 1;
  min-width: 550px; /* prevent brush tools from collapsing by default */
  max-width: 550px;

  height: 10vw;
  max-height: 130px; /* never larger than child element group */
  margin-top: -10px; /* flush with top */
  align-items: flex-end;
  overflow: hidden;
}
#toolbar.with-workspace-small .column:first-child {
  min-width: 280px; /* allow brush tools to collapse at smaller workspace widths */
}
#toolbar .column:last-child {
  padding-right: 80px;
}

.with-script-visible #toolbar,
.with-scenes-visible #toolbar {
  /* if script OR scenes visible, don't bother accomodating for Mac top-left controls*/
  padding-left: 10px;
}

/*
 * groups
 */
#toolbar .group {
  display: flex;
  position: relative;
}
#toolbar .group:not(:last-child):not(.group_tools):not(.group_colors) {
  margin-right: 10px;
}
#toolbar .group:not(.group_tools) {
  display: flex;
  align-items: flex-start;

  border-radius: 8px;
  padding: 6px 6px 0 6px;
}

/*
 * buttons and their icons
 */
#toolbar .button {
  -webkit-app-region: no-drag;
  display: flex;
}
#toolbar .button > svg {
  pointer-events: none;
}

#toolbar .group:not(.group_tools):not(.group_colors) .button:hover {
  background-color: #444;
}

#toolbar .group:not(.group_tools):not(.group_colors) .button.active,
#toolbar .group:not(.group_tools):not(.group_colors) .button.active:hover {
  background-color: #222;
}
#toolbar .icon {
  width: 100%;
  height: 100%;

  --color1: #888;
  --color2: #555;
  filter: drop-shadow( 0px 1px 0px rgba(0, 0, 0, 0.3) );
}
#toolbar .group:not(.group_tools):not(.group_colors) .icon {
  min-width: 30px;
  min-height: 30px;
  max-width: 35px;
  max-height: 35px;
}

/*
 * brush tools: layout
 */
#toolbar .group_tools {
  flex: 1;

  height: 130px;

  display: flex;
  align-items: flex-start;

  margin-right: 45px;
}
#toolbar .group_tools .button,
#toolbar .group_tools .icon-toolbar-tool {
  width: 100%;
  height: 100%;
  max-height: 100%;
}
#toolbar .group_tools .button {
  position: relative;
  overflow: hidden;
  height: 100%;
}

/*
 * REDUCED WIDTH
 */
 /* hide undo/redo */
#toolbar.with-workspace-small .column .group.group_undo_redo {
  display: none;
}
/* normal width: space out the buttons */
#toolbar .group:not(.group_tools):not(.group_colors) .button {
  position: relative;
  top: 2px;
  left: 2px;
  padding: 15px;

  border-radius: 5px;
}
#toolbar.with-toolbar-small .group:not(.group_tools):not(.group_colors) .button {
  top: 9px;
  padding: 6px;
}
/* reduced width: don't space out the buttons */
#toolbar.with-toolbar-small.with-workspace-small .group:not(.group_tools):not(.group_colors) .button {
  top: -2px;
  margin: 0;
  padding: 0;
}
/* reduced width: less space above toolbar colors */
#toolbar.with-workspace-small .toolbar-colors {
  margin-top: 0;
}

#toolbar.with-workspace-small .group_tools {
  margin-right: 15px;
}
.with-scenes-visible #toolbar.with-workspace-small .group_tools {
  margin-left: 5px;
}



/*
 * brush tools: graphics
 */
#toolbar .group_tools .button {
  padding: 0 9px;
}

#toolbar .group_tools .button .icon-toolbar-tool {
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;

  height: 85%;

  filter: brightness(100%) drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.4));
  transition: height 0.15s ease-out;
}

#toolbar .group_tools .button:hover .icon-toolbar-tool {
  height: 100%;
  filter: brightness(130%) drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.4));
  transition: height 0.125s ease-in-out;
}
#toolbar .group_tools .button.active .icon-toolbar-tool {
  height: 100%;
  filter: brightness(160%) drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.4));
  transition: height 0.125s ease-in-out;
}

#toolbar #toolbar-light-pencil {
  flex: 135;
}
#toolbar #toolbar-light-pencil .icon {
  background-image: url(../img/toolbar-brush-tools-0.png);
  /*background-position: 0 130%;*/
}
#toolbar #toolbar-pencil {
  flex: 106;
}
#toolbar #toolbar-pencil .icon {
  background-image: url(../img/toolbar-brush-tools-1.png);
  /*background-position: 0 130%;*/
}
#toolbar #toolbar-pen {
  flex: 120;
  /*background-position: 0 100%;*/
}
#toolbar #toolbar-pen .icon {
  background-image: url(../img/toolbar-brush-tools-2.png);
  /*background-position: 0 110%;*/
}
#toolbar #toolbar-brush {
  flex: 134;
}
#toolbar #toolbar-brush .icon {
  background-image: url(../img/toolbar-brush-tools-3.png);
  /*background-position: 0 100%;*/
}
#toolbar #toolbar-tone {
  flex: 134;
}
#toolbar #toolbar-tone .icon {
  background-image: url(../img/toolbar-brush-tools-6.png);
  /*background-position: 0 100%;*/
}
#toolbar #toolbar-note-pen {
  flex: 108;
}
#toolbar #toolbar-note-pen .icon {
  background-image: url(../img/toolbar-brush-tools-4.png);
  /*background-position: 0 125%;*/
}
#toolbar #toolbar-eraser {
  flex: 218;
}
#toolbar #toolbar-eraser .icon {
  background-image: url(../img/toolbar-brush-tools-5.png);
  /*background-position: 0 135%;*/
}


/*
 * colors
 */
#toolbar .toolbar-colors {
  display: flex;
  margin-top: 10px;
  margin-left: 10px;
  margin-right: 10px;
}
#toolbar .toolbar-colors_column {
  display: flex;
  background-color: #292929;
}
#toolbar .toolbar-colors_column:first-child {
  border-top-left-radius: 5px;
  /*border-top-right-radius: 5px;*/
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
  width: 44px;
  height: 44px;
  /*height: auto;*/
  padding: 8px;
  flex-direction: column;
  position: relative;
}
#toolbar .toolbar-colors_column:last-child {
  /*border-top-left-radius: 5px;*/
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  /*border-bottom-left-radius: 5px;*/
  padding: 8px 8px 8px 4px;
  height: 32px;
  position: relative;
}
/* draw concave side connection */
#toolbar .toolbar-colors_column:last-child:before {
  position: absolute;
  content: " ";
  display: block;
  background-color: #292929;
  width: 5px;
  height: 5px;
  bottom: -5px;
  left: 0;
}
#toolbar .toolbar-colors_column:last-child:after {
  position: absolute;
  content: " ";
  display: block;
  background-color: #333;
  border-top: 5px solid #333;
  border-left: 5px solid #333;
  border-top-left-radius: 5px;
  width: 5px;
  height: 5px;
  bottom: -10px;
  left: 0;
}
#toolbar .group .toolbar-colors .button {
  padding: 0;
  margin: 0;
  
  width: 100%;
  height: 100%;
}
#toolbar .toolbar-colors .icon {
  width: 100%;
  height: 100%;
  filter: none;
}
#toolbar .toolbar-colors .button:not(:last-child) {
  margin-right: 10px;
}
#toolbar .toolbar-colors .icon.icon-toolbar-color_current {
  border-radius: 4px;
  background-color: black;
}
#toolbar .toolbar-colors .icon.icon-toolbar-color_palette {
  border-radius: 4px;
  background-color: white;
  width: 32px;
}

#toolbar.with-workspace-small .toolbar-colors .icon.icon-toolbar-color_palette {
  width: 24px;
}
#toolbar.with-workspace-small .column:last-child {
  padding-right: 0;
}


#toolbar.with-workspace-small .toolbar-colors {
  margin-left: 0;
  margin-right: 0;
}
#toolbar.with-workspace-small .toolbar-colors_column:first-child {
  padding: 4px;
  width: 33px;
  height: 33px;
}
#toolbar.with-workspace-small .toolbar-colors_column:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  padding: 4px 4px 4px 2px;
  height: 24px;
}
#toolbar .toolbar-colors .button:not(:last-child) {
  margin-right: 6px;
}
/*
 * brush size controls
 */
.toolbar-brush-modifier-controls {
  position: absolute;
  margin-top: 52px;
  display: flex;

  width: 66px;
  margin-left: -11px;
  justify-content: space-between;

  -webkit-app-region: no-drag;
}
.toolbar-brush-modifier-controls_size,
.toolbar-brush-modifier-controls_stroke-opacity {
  position: relative;
  padding: 8px 4px;
  font-size: 14px;
  line-height: 1;
  color: #666;
  text-align: center;
  width: auto;
  cursor: ew-resize;
}
#toolbar.with-workspace-small .toolbar-brush-modifier-controls {
  margin-top: 36px;
  margin-left: 0;
  width: 80px;
  justify-content: flex-start;
}
#toolbar.with-workspace-small .toolbar-brush-modifier-controls_size {
  width: 25px;
}
#toolbar.with-workspace-small .toolbar-brush-modifier-controls_stroke-opacity {
  padding: 8px;
}


.toolbar-pomodoro-rest {
  width: 85px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.toolbar-pomodoro-running {
  width: 85px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.toolbar-pomodoro-running-status {
  color: #666;
  margin-left: 7px;
}


/* uncomment for a helpful spacing debugger */
/*
#toolbar .icon-toolbar-tool:after {
  content: ' ';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,255,0.1) 0%, rgba(255,0,0,0.1) 100%);
}
*/
