{
   tabSpacing     = 1;
   firstTabOffset = 3;
   minTabSize     = 70;
   maxTabSize     = 300;

   backgroundCollapsed = (
      { rect = (   0, W-1,   0,   0 ); color = '#3F3F3F'; requisite = window_main_or_key; },
      { rect = (   0, W-1,   0,   0 ); color = '#878787'; requisiteMask = window_main_or_key; }
   );

   background = (
      { rect = (   0, W-1,   0,   0 ); color = '#3F3F3F'; requisite = window_main_or_key; },
      { rect = (   0, W-1,   1,   1 ); color = '#999999'; requisite = window_main_or_key; },
      { rect = (   0, W-1,   2, H-3 ); color = '#777777'; requisite = window_main_or_key; },
      { rect = (   0, W-1, H-2, H-2 ); color = '#3F3F3F'; requisite = window_main_or_key; },
      { rect = (   0, W-1, H-1, H-1 ); color = '#AEAEAE'; requisite = window_main_or_key; },

      { rect = (   0, W-1,   0,   0 ); color = '#878787'; requisiteMask = window_main_or_key; },
      { rect = (   0, W-1,   1,   1 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; },
      { rect = (   0, W-1,   2, H-3 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; },
      { rect = (   0, W-1, H-2, H-2 ); color = '#878787'; requisiteMask = window_main_or_key; },
      { rect = (   0, W-1, H-1, H-1 ); color = '#C9C9C9'; requisiteMask = window_main_or_key; },

      { rect = (   0,   W,   2, H-3 ); action = 'didDoubleClickTabBar:'; requisite = mouse_double_clicked; },
   );

   tab = (
      // Right border
      { rect = ( W-1, W-1,   2, H-3 ); color = '#8C8C8C'; requisite = window_main_or_key; },
      { rect = ( W-1, W-1,   1,   1 ); color = '#A8A8A8'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|dragged'; },
      { rect = ( W-1, W-1,   2, H-3 ); color = '#B2B2B2'; requisiteMask = 'window_main_or_key'; },
      { rect = ( W-1, W-1,   1,   1 ); color = '#C5C5C5'; requisiteMask = 'window_main_or_key|dragged'; },

      // Splitter between tabs (1 px to the right of our current)
      { rect = (   W,   W,   2, H-3 ); color = '#3B3B3B'; requisite = window_main_or_key; },
      { rect = (   W,   W,   1,   1 ); color = '#4B4B4B'; requisite = window_main_or_key; },
      { rect = (   W,   W,   2, H-3 ); color = '#525252'; requisiteMask = window_main_or_key; },
      { rect = (   W,   W,   1,   1 ); color = '#5D5D5D'; requisiteMask = window_main_or_key; },

      // Background – first tab
      { rect = ("-${firstTabOffset}", W-2,   2, H-3 ); color = '#777777'; requisite = 'window_main_or_key|first'; requisiteMask = 'window_main_or_key|first'; },
      { rect = ("-${firstTabOffset}", W-2,   2, H-3 ); color = '#A5A5A5'; requisite = 'first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; },
      { rect = ("-${firstTabOffset}", W-2,   2, H-3 ); color = '#6E6E6E'; requisite = 'window_main_or_key|mouse_inside|first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; },
      { rect = ("-${firstTabOffset}", W-2,   2, H-3 ); color = '#979797'; requisite = 'mouse_inside|first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; },
      // Background – other tabs
      { rect = ("1", W-2,   2, H-3 ); color = '#777777'; requisite = 'window_main_or_key'; requisiteMask = 'window_main_or_key|first'; },
      { rect = ("1", W-2,   2, H-3 ); color = '#A5A5A5'; requisiteMask = 'window_main_or_key|mouse_inside|first'; },
      { rect = ("1", W-2,   2, H-3 ); color = '#6E6E6E'; requisite = 'window_main_or_key|mouse_inside'; requisiteMask = 'window_main_or_key|mouse_inside|first'; },
      { rect = ("1", W-2,   2, H-3 ); color = '#979797'; requisite = 'mouse_inside'; requisiteMask = 'window_main_or_key|mouse_inside|first'; },

      // Left border — first tab should not have this
      { rect = (   0,   0,   2, H-3 ); color = '#8C8C8C'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; },
      { rect = (   0,   0,   1,   1 ); color = '#A8A8A8'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first|dragged'; },
      { rect = (   0,   0,   2, H-3 ); color = '#B2B2B2'; requisiteMask = 'window_main_or_key|first'; },
      { rect = (   0,   0,   1,   1 ); color = '#C5C5C5'; requisiteMask = 'window_main_or_key|first|dragged'; },

      // Splitter between tabs (1 px to the left of our current)
      { rect = (  -1,  -1,   2, H-3 ); color = '#3B3B3B'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; },
      { rect = (  -1,  -1,   1,   1 ); color = '#4B4B4B'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; },
      { rect = (  -1,  -1,   2, H-3 ); color = '#525252'; requisiteMask = 'window_main_or_key|first'; },
      { rect = (  -1,  -1,   1,   1 ); color = '#5D5D5D'; requisiteMask = 'window_main_or_key|first'; },

      { include = tabMain; },
   );

   tabSelected = (
      { rect = (  -2,  -1,   1,   1 ); color = '#999999'; requisite = window_main_or_key; },
      { rect = (   W, "W+1", 1,   1 ); color = '#999999'; requisite = window_main_or_key; },
      { rect = (  -2,  -1,   1,   1 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; },
      { rect = (   W, "W+1", 1,   1 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; },
      { rect = (  -1,   W,   2, H-1 ); color = 'windowBackgroundColor'; requisite = window_main_or_key; },
      { rect = (  -1,   W,   2, H-1 ); color = 'windowBackgroundColor'; requisiteMask = window_main_or_key; },

      { rect = (  -2,  -2,   2, H-3 ); color = '#777777'; requisite = window_main_or_key; },
      { rect = (  -2,  -2,   2, H-3 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; },
      { rect = (  -1,  -1,   2, H-2 ); color = '#575757'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   2, H-2 ); color = '#797979'; requisiteMask = window_main_or_key; },

      { rect = ( "W+1", "W+1",   2, H-3 ); color = '#777777'; requisite = window_main_or_key; },
      { rect = ( "W+1", "W+1",   2, H-3 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; },
      { rect = (   W,   W,   2, H-2 ); color = '#575757'; requisite = window_main_or_key; },
      { rect = (   W,   W,   2, H-2 ); color = '#797979'; requisiteMask = window_main_or_key; },

      { rect = (   0,   W,   2,   2 ); color = '#575757'; requisite = window_main_or_key; },
      { rect = (   0,   W,   2,   2 ); color = '#797979'; requisiteMask = window_main_or_key; },
      { rect = (   0,   W,   3,   3 ); color = '#A8A8A8'; requisite = window_main_or_key; },
      { rect = (   0,   W,   3,   3 ); color = '#D7D7D7'; requisiteMask = window_main_or_key; },

      { rect = (  -1,  -1,   2,   2 ); color = '#999999'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   2,   2 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; },

      { rect = (  -1,  -1,   2,   2 ); color = '#707070'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   2,   2 ); color = '#9C9C9C'; requisiteMask = window_main_or_key; },
      { rect = (  -1,  -1,   3,   3 ); color = '#676767'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   3,   3 ); color = '#8F8F8F'; requisiteMask = window_main_or_key; },
      { rect = (  -1,  -1,   4,   4 ); color = '#606060'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   4,   4 ); color = '#858585'; requisiteMask = window_main_or_key; },
      { rect = (  -1,  -1,   5,   5 ); color = '#5B5B5B'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   5,   5 ); color = '#7E7E7E'; requisiteMask = window_main_or_key; },
      { rect = (  -1,  -1,   6,   6 ); color = '#595959'; requisite = window_main_or_key; },
      { rect = (  -1,  -1,   6,   6 ); color = '#7B7B7B'; requisiteMask = window_main_or_key; },

      { rect = (   0,   0,   2,   2 ); color = '#626262'; requisite = window_main_or_key; },
      { rect = (   0,   0,   2,   2 ); color = '#888888'; requisiteMask = window_main_or_key; },
      { rect = (   0,   0,   3,   3 ); color = '#727272'; requisite = window_main_or_key; },
      { rect = (   0,   0,   3,   3 ); color = '#9B9B9B'; requisiteMask = window_main_or_key; },
      { rect = (   0,   0,   4,   4 ); color = '#868686'; requisite = window_main_or_key; },
      { rect = (   0,   0,   4,   4 ); color = '#B6B6B6'; requisiteMask = window_main_or_key; },
      { rect = (   0,   0,   5,   5 ); color = '#8C8C8C'; requisite = window_main_or_key; },
      { rect = (   0,   0,   5,   5 ); color = '#C2C2C2'; requisiteMask = window_main_or_key; },
      { rect = (   0,   0,   6,   6 ); color = '#939393'; requisite = window_main_or_key; },
      { rect = (   0,   0,   6,   6 ); color = '#CBCBCB'; requisiteMask = window_main_or_key; },

      { rect = (   W,   W,   2,   2 ); color = '#707070'; requisite = window_main_or_key; },
      { rect = (   W,   W,   2,   2 ); color = '#9C9C9C'; requisiteMask = window_main_or_key; },
      { rect = (   W,   W,   3,   3 ); color = '#676767'; requisite = window_main_or_key; },
      { rect = (   W,   W,   3,   3 ); color = '#8F8F8F'; requisiteMask = window_main_or_key; },
      { rect = (   W,   W,   4,   4 ); color = '#606060'; requisite = window_main_or_key; },
      { rect = (   W,   W,   4,   4 ); color = '#858585'; requisiteMask = window_main_or_key; },
      { rect = (   W,   W,   5,   5 ); color = '#5B5B5B'; requisite = window_main_or_key; },
      { rect = (   W,   W,   5,   5 ); color = '#7E7E7E'; requisiteMask = window_main_or_key; },
      { rect = (   W,   W,   6,   6 ); color = '#595959'; requisite = window_main_or_key; },
      { rect = (   W,   W,   6,   6 ); color = '#7B7B7B'; requisiteMask = window_main_or_key; },

      { rect = ( W-1, W-1,   2,   2 ); color = '#626262'; requisite = window_main_or_key; },
      { rect = ( W-1, W-1,   2,   2 ); color = '#888888'; requisiteMask = window_main_or_key; },
      { rect = ( W-1, W-1,   3,   3 ); color = '#727272'; requisite = window_main_or_key; },
      { rect = ( W-1, W-1,   3,   3 ); color = '#9B9B9B'; requisiteMask = window_main_or_key; },
      { rect = ( W-1, W-1,   4,   4 ); color = '#868686'; requisite = window_main_or_key; },
      { rect = ( W-1, W-1,   4,   4 ); color = '#B6B6B6'; requisiteMask = window_main_or_key; },
      { rect = ( W-1, W-1,   5,   5 ); color = '#8C8C8C'; requisite = window_main_or_key; },
      { rect = ( W-1, W-1,   5,   5 ); color = '#C2C2C2'; requisiteMask = window_main_or_key; },
      { rect = ( W-1, W-1,   6,   6 ); color = '#939393'; requisite = window_main_or_key; },
      { rect = ( W-1, W-1,   6,   6 ); color = '#CBCBCB'; requisiteMask = window_main_or_key; },

      { include = tabMain; },
   );

   // ============
   // = Includes =
   // ============

   tabMain = (
      { rect = (   1, W-2,   2, H-3 ); action = 'selectTab:'; requisite = mouse_clicked; toolTip = 1; },
      { rect = (   1, W-2,   2, H-3 ); action = 'dragTab:'; requisite = mouse_dragged; },
      { rect = (   1, W-2,   2, H-3 ); action = 'didDoubleClickTab:'; requisite = mouse_double_clicked; },
      { rect = (  23, W-8,   4, H-6 ); text = { shadow = 1; }; },

      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_inside|modified';               requisite = '';                                    image = "TabClose";                  },
      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_inside|modified';               requisite = 'modified';                            image = "TabClose_Modified";         },
      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_inside|modified|mouse_clicked'; requisite = 'mouse_inside';                        image = "TabClose_Rollover";         },
      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_inside|modified|mouse_clicked'; requisite = 'mouse_inside|modified';               image = "TabClose_ModifiedRollover"; },
      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_inside|modified|mouse_clicked'; requisite = 'mouse_clicked|mouse_inside';          image = "TabClose_Pressed";          },
      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_inside|modified|mouse_clicked'; requisite = 'mouse_clicked|mouse_inside|modified'; image = "TabClose_ModifiedPressed";  },

      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_clicked|option'; requisite = 'mouse_clicked';        action = 'performCloseTab:';       preventWindowOrdering = 1; },
      { rect = (   3,  14,   4,  16 ); requisiteMask = 'mouse_clicked|option'; requisite = 'mouse_clicked|option'; action = 'performCloseOtherTabs:'; preventWindowOrdering = 1; },
   );
}
