/* tg-trigger start */

tg-trigger {
  display: inline-block;
  position: relative;
  z-index: 0;
}

tg-trigger::before {
  content: "";
  width: 10px;
  height: calc(100% - 15px);
  position: absolute;
  top: 15px;
  left: 0;
  margin: 0;
  padding: 0;
  background-color: var(--color);
  /* border-color: var(--color);
      border-width: 2px;
      border-style: solid; */
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

tg-trigger::after {
  content: "";
  height: 20px;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  /* border-width: 2px;
      border-style: solid; */
  background-color: var(--color);
  /* border-color: var(--border); */
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  border-top-right-radius: 5px;
}

/* tg-trigger end */
/* tg-context start */

tg-context {
  position: relative;
  display: inline-block;
}

/* tg-summary start */
tg-context tg-summary,
tg-trigger tg-summary {
  position: relative;
  display: inline-block;
  background-color: var(--color);
  border-color: var(--border);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 25px;
}

tg-details tg-summary::before {
  content: "▶";
}
tg-details[open] tg-summary::before {
  content: "▼";
}

/* tg-summary end */

/* tg-details start */
tg-context tg-details,
tg-trigger tg-details {
  margin: 0;
}

/* tg-details end */

/* slot style */
tg-trigger tg-summary,
tg-context tg-summary,
tg-step,
tg-context {
  -webkit-mask: url(/images/slot.svg) 40px bottom, linear-gradient(#000, #000);
  -webkit-mask-composite: destination-out;
  -webkit-mask-repeat: no-repeat;
  mask-image: url(/images/slot.svg#slot-cutout-path), transparent;
  mask-composite: exclude;
  mask-position: 17px bottom, left top;
  mask-size: 40px 12px, auto auto;
  mask-repeat: no-repeat;
}

tg-trigger tg-summary,
tg-context tg-summary {
  mask-position: 28px bottom, left top;
}

/* end slot style */

tg-input-param {
  display: inline-flex;
  flex-wrap: nowrap;
  max-height: 1.6em;
}
tg-input-param input {
  width: 4em;
  margin-left: 0.4em;
  padding-left: 1.5em;
  border: 2px inset #333;
  background: left / contain no-repeat #fff
    url(../images/fa-svg/regular/question-circle.svg);
  background-color: var(--color);
  border-color: var(--border);
  background-image: var(--image);
}

tg-truth-param {
  display: inline-flex;
  flex-wrap: nowrap;
  max-height: 1.6em;
}
tg-truth-param input {
  width: 4em;
  margin-left: 0.4em;
  padding-left: 1.5em;
  border: 2px inset #333;
}

tg-select-param {
  display: inline-flex;
  flex-wrap: nowrap;
  max-height: 1.6em;
}

tg-block-param {
  display: inline-flex;
  flex-wrap: nowrap;
  max-height: 1.6em;
}
tg-block-param label {
  margin-left: 0.2em;
}
tg-block-param input {
  width: 4em;
  margin-left: 0.4em;
  padding-left: 1.5em;
  border: 2px inset #333;
  background: left / contain no-repeat #fff
    url(../images/fa-svg/regular/question-circle.svg);
  background-color: var(--color);
  border-color: var(--border);
  background-image: var(--image);
}
tg-block-param input[readonly] {
  background-color: #ccc;
}

/* tg-hat begins */

tg-hat {
  content: "";
  position: relative;
  display: block;
  fill: var(--color);
  stroke: var(--color);
  margin: 0;
  padding: 0;
  width: 100px;
  height: 12px;
  left: 15px;
  overflow: hidden;
}

tg-hat::before {
  content: "";
  position: absolute;
  display: block;
  width: 100px;
  height: 100px;
  left: -15px;
  background-color: var(--color);
  border-color: var(--border);
  border-width: 2px;
  border-style: solid;
  border-radius: 100%;
}

/* tg-hat ends */

/* tg-locals begins */
tg-locals {
  /* Container for values local to a block */
  position: relative;
  display: flex;
  flex-direction: row;
  background-color: white;
  align-items: center; /* align on cross-axis (vertical) */
  justify-content: flex-start; /* align on main axis (horizontal) */
  padding: 1px;
  border-radius: 5px;
  height: fit-content;
}
.tg-locals > tg-value {
  flex: 0 0 0;
  /* margin-bottom: 0;
  margin-right: 1px; */
}

/* .blockmenu tg-locals {
  display: none;
} */

/* tg-locals ends */

/* tg-returns begins */

tg-returns {
  position: relative;
  display: inline-block;
  padding: 1px;
  background-color: white;
  border-radius: 5px;
  border: 3px inset grey;
  margin-left: 2em;
}
tg-returns tg-value {
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 80%;
}

/* tg-returns ends */

/* tg-contains begins */

tg-contains {
  position: relative;
  min-height: 1.25em;
  padding-bottom: 14px;
  padding: 0.5em;
  padding-top: 5px;
  padding-bottom: 1em;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  overflow-x: visible;
}

tg-contains.script,
.blockmenu > details > tg-contains {
  overflow: auto;
}

tg-contains > tg-step,
tg-contains > tg-context {
  margin: 5px;
  margin-top: -16px;
}

tg-contains.script > tg-step,
tg-contains.script > tg-context,
tg-contains.script > tg-value,
tg-contains.script > tg-trigger,
.blockmenu tg-contains > tg-step,
.blockmenu tg-contains > tg-context,
.blockmenu tg-contains > tg-value,
.blockmenu tg-contains > tg-trigger {
  margin-top: 12px;
}

tg-details tg-contains {
  display: none;
}

tg-details[open] tg-contains {
  display: flex;
}

tg-context > tg-details > tg-contains::before,
tg-trigger > tg-details > tg-contains::before {
  position: absolute;
  left: 5px;
  top: -5px;
  content: "";
  height: calc(100% - 20px);
  width: 10px;
  display: block;
  border-radius: 8px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--color);
  clip-path: polygon(0% 0%, 50% 0%, 50% 100%, 0% 100%);
}

/* tg-contains ends */

tg-value {
  display: inline-block;
  border-radius: 5px;
  border-style: solid;
  padding: 5px;
  padding-left: 1.5em;
  background: left / 1em no-repeat #fff
    url(../images/fa-svg/regular/question-circle.svg);
  background-color: var(--color);
  border-color: var(--border);
  background-image: var(--image);
}

tg-step {
  display: inline-block;
  border-radius: 5px;
  position: relative;
  z-index: 0;
}
tg-step header {
  background-color: var(--color);
  border-color: var(--border);
  border-width: 2px;
  border-style: solid;
}

/* HEADER STYLE */
tg-context header,
tg-trigger header,
tg-step header {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding: 0.3em 0.5em;
}

tg-step header {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

tg-context {
  display: inline-block;
  position: relative;
  z-index: 0;
}
tg-context::before {
  content: "";
  width: 10px;
  height: calc(100% - 15px);
  position: absolute;
  top: 15px;
  left: 0;
  margin: 0;
  padding: 0;
  background-color: var(--color);
  /* border-color: var(--color);
      border-width: 2px;
      border-style: solid; */
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}
tg-context::after {
  content: "";
  height: 20px;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  /* border-width: 2px;
      border-style: solid; */
  background-color: var(--color);
  /* border-color: var(--border); */
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  border-top-right-radius: 5px;
}

.name {
  margin-right: 0.5em;
}

/* hide non-block siblings in a tg-socket */

tg-socket > tg-value ~ input,
tg-socket > input {
  display: none;
}

tg-socket > input:only-child {
  display: revert;
}
