.gridtree .header {
  font-weight: bold;
}

.gridtree > .treeroot .header > span {
  padding-left: 20px;
}

.gridtree > .treeroot {
  grid-row-start: 1;
  grid-row-end: 1;
}

/* Graceful degradation if the JavaScript code doesn't run */
.gridtree > .treeroot li > span:not(:first-child) {
  display: none;
  margin-top: -16px;
}

.gridtree > .treeroot li > span:first-child {
  margin-top: 2px;
  margin-bottom: 2px;
}

.gridtree > .treeroot li > span:first-child + span,
.gridtree > .treeroot li > span:first-child + input.collapsible-check + span
{
  display: inline;
  position: absolute;
  left: 320px;
  width: 120px;
}

.gridtree > .treeroot li > span:first-child + span + span,
.gridtree > .treeroot li > span:first-child + input.collapsible-check + span + span
{
  display: inline;
  position: absolute;
  left: 440px;
  width: 120px;
}

.gridtree > .treeroot li > span:first-child + span + span + span,
.gridtree > .treeroot li > span:first-child + input.collapsible-check + span + span + span
{
  display: inline;
  position: absolute;
  left: 580px;
  width: 120px;
}

/* Credit where credit is due:  Ryan Seddon of The CSS Ninja:
 * https://www.thecssninja.com/css/css-tree-menu
 *
 * This code is derived from his examples.
 */

/* CSS Tree menu styles */
.gridtree > .treeroot ul
{
	padding: 0 0 0 30px;
	width: 300px;
}

.gridtree > .treeroot > ul {
  padding: 0 0 0 20px;
}
	.gridtree > .treeroot li 
	{ 
		position: relative; 
		margin-left: -15px;
		list-style: none;
	}
	.gridtree > .treeroot li.file
	{
		margin-left: -1px !important;
	}

	.gridtree > .treeroot li input.collapsible-check
	{
		position: absolute;
		left: 0;
		margin-left: 0;
		opacity: 0;
		z-index: 2;
		cursor: pointer;
		height: 1em;
		width: 1em;
		top: 0;
	}
		.gridtree > .treeroot li input.collapsible-check ~ ul:last-child
		{
			background: url(../icons/plusicon.svg) 40px 0 no-repeat;
			margin: -1.25em 0 0 -44px; /* 15px */
			height: 16px;
		}
		.gridtree > .treeroot li input.collapsible-check ~ ul:last-child > li
        {
          display: none;
          margin-left: -14px !important;
          padding-left: 1px;
        }
	.gridtree > .treeroot li.collapsible span:first-child
	{
		/*background: url(folder-horizontal.png) 15px 1px no-repeat;*/
		cursor: pointer;
		display: block;
		padding-left: 12px;
	}

	.gridtree > .treeroot li.collapsible input.collapsible-check:checked ~ ul:last-child
	{
		background-image: url(../icons/minusicon.svg);
		margin: -1.25em 0 0 -44px; /* 20px */
		padding: 1.563em 0 0 80px;
		height: auto;
	}
  
  .gridtree > .treeroot li.collapsible input.collapsible-check:checked ~ ul:last-child > li
  {
    display: list-item;
  }

/* Going back to a grid-based indentation scheme. */
@supports(display: grid) {
  .gridtree {
    display: grid;
    background-color: #fff;
    font-family: monospace;
    font-size: 1em;
  }

  /*
  if (@supports(display: subgrid))
    .gridtree[cellgrouping="subgrid"]
  else if (@supports(display: contents))
    .gridtree[cellgrouping="row-contents"]
  else {
    .gridtree[cellgrouping="none"]
  */

  
  @supports(display: contents) {
    .gridtree[cellgrouping="row-contents"] > div[row] {
      display: contents;
    }
  }

  .gridtree > .treeroot li > span:first-child,
  .gridtree[cellgrouping="row-contents"] > div[row] > span:first-child,
  .gridtree[cellgrouping="none"] > span[row][firstcol]
  {
    width: 250px;
  }

  .gridtree > .treeroot li > span:first-child,
  .gridtree[cellgrouping="row-contents"] > div[row] > span,
  .gridtree[cellgrouping="none"] > span
  {
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .gridtree > *[indent="0"] {
    --indent: 0;
  }
  .gridtree > *[indent="1"] {
    --indent: 1;
  }
  .gridtree > *[indent="2"] {
    --indent: 2;
  }
  .gridtree > *[indent="3"] {
    --indent: 3;
  }
  .gridtree > *[indent="4"] {
    --indent: 4;
  }
  .gridtree > *[indent="5"] {
    --indent: 5;
  }
  .gridtree > *[indent="6"] {
    --indent: 6;
  }
  .gridtree > *[indent="7"] {
    --indent: 7;
  }
  .gridtree > *[indent="8"] {
    --indent: 8;
  }
  .gridtree > *[indent="9"] {
    --indent: 9;
  }

  .gridtree > *[indent="10"] {
    --indent: 10;
  }
  .gridtree > *[indent="11"] {
    --indent: 11;
  }
  .gridtree > *[indent="12"] {
    --indent: 12;
  }
  .gridtree > *[indent="13"] {
    --indent: 13;
  }
  .gridtree > *[indent="14"] {
    --indent: 14;
  }
  .gridtree > *[indent="15"] {
    --indent: 15;
  }
  .gridtree > *[indent="16"] {
    --indent: 16;
  }
  .gridtree > *[indent="17"] {
    --indent: 17;
  }
  .gridtree > *[indent="18"] {
    --indent: 18;
  }
  .gridtree > *[indent="19"] {
    --indent: 19;
  }

  .gridtree[cellgrouping="row-contents"] > div[row][indent] > span:first-child > span.spacer,
  .gridtree[cellgrouping="none"] > span[row][firstcol][indent] > span.spacer {
    padding-right: calc(var(--indent) * 12px);
  }
  /* etc., etc., etc. for different levels of indent. */

  .gridtree[cellgrouping="row-contents"] > div[row] > span:first-child > span:last-child,
  .gridtree[cellgrouping="none"] > span[row][firstcol] > span:last-child {
    padding-left: 18px;
  }

  .gridtree[cellgrouping="none"] > span[row][firstcol] > span[checkspan] + span:last-child {
    padding-left: 2px;
  }
  
  
  .gridtree[cellgrouping="row-contents"] > div[row] > span:first-child > input[type="checkbox"].collapsible-check,
  .gridtree[cellgrouping="none"] > span[row][firstcol] > input[type="checkbox"].collapsible-check
  {
    opacity: 0;
    position: absolute;
  }
  
  .gridtree[cellgrouping="row-contents"] > div[row] > span:first-child > input[type="checkbox"].collapsible-check + span,
  .gridtree[cellgrouping="none"] > span[row][firstcol] > input[type="checkbox"].collapsible-check + span
  {
    background-image: url(../icons/plusicon.svg);
    background-repeat: no-repeat;
    width: 16px;
    height: 16px;
    z-index: 1;
    display: inline-block;
    cursor: pointer;
  }

  /* XXX ajvincent This may be a Firefox vs Chrome bug, in the positioning and sizing of the invisible checkboxes. */
  .gridtree[cellgrouping="row-contents"] > div[row] > span:first-child > input[type="checkbox"].collapsible-check + span
  {
    background-position: 3px 0px;
  }
  
  .gridtree[cellgrouping="row-contents"] > div[row] > span:first-child > input[type="checkbox"].collapsible-check:checked + span,
  .gridtree[cellgrouping="none"] > span[row][firstcol] > input[type="checkbox"].collapsible-check:checked + span
  {
    background-image: url(../icons/minusicon.svg);
  }

  .gridtree[cellgrouping="row-contents"] > div[row] > span:not(.collapsible-check) > input[type="checkbox"],
  .gridtree[cellgrouping="none"] > span[row]:not(.collapsible-check) > input[type="checkbox"] {
    margin-top: 0px;
  }
}
