/* Tool slots mounted on the Christmas-tree carrier. The tree itself is non-interactive. */
.workbench-tree-tools {
  position: absolute;
  left: -2%;
  bottom: 200px;
  z-index: 5;
  width: 380px;
  height: 580px;
  overflow: visible;
  pointer-events: none;
}

.workbench-tree-tool {
  position: absolute;
  margin: 0;
  padding: 0;
  appearance: none;
  pointer-events: auto;
}

.workbench-handoff-card {
  /* The SVG uses a wider viewBox than the carrier box. Keep this hit area
     aligned with the rendered bag as the workbench scales. */
  left: 76%;
  top: 50%;
  width: 32%;
  height: 24%;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  cursor: pointer;
  transform: none;
  transform-origin: center;
}

.workbench-tree-tool-title {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  max-width: 210px;
  padding: 7px 11px;
  border: 1px solid rgba(40, 50, 64, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  color: #263044;
  box-shadow: 0 10px 24px rgba(42, 52, 64, .14);
  font-size: 12px;
  line-height: 1;
  font-weight: 760;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}

.workbench-tree-tool-title::after {
  content: attr(data-desc);
  position: absolute;
  left: 50%;
  top: 50%;
  width: 184px;
  transform: translate(-50%, -50%) scale(.98);
  opacity: 0;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  transition: opacity .18s ease, transform .2s ease;
}

.workbench-tree-tool-title .label-text {
  transition: opacity .14s ease;
}

.workbench-handoff-card:hover .workbench-tree-tool-title,
.workbench-handoff-card:focus-visible .workbench-tree-tool-title {
  min-width: 194px;
  min-height: 52px;
  padding: 10px 13px;
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.workbench-handoff-card:hover .workbench-tree-tool-title .label-text,
.workbench-handoff-card:focus-visible .workbench-tree-tool-title .label-text {
  opacity: 0;
}

.workbench-handoff-card:hover .workbench-tree-tool-title::after,
.workbench-handoff-card:focus-visible .workbench-tree-tool-title::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tool-modal-card.workbench-tree-tool-modal-card {
  width: min(1360px, calc(100vw - 40px));
  height: min(900px, calc(100vh - 40px));
  max-height: none;
  min-height: 0;
  padding: 18px;
  border-radius: 20px;
}

.tool-modal-card.workbench-tree-tool-modal-card .tool-modal-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.workbench-tree-tool-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(40, 50, 64, .12);
  border-radius: 12px;
  background: #f7f8f8;
}

.tool-modal-open-external {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  margin-right: 25px;
  padding: 0;
  border: 1px solid rgba(40, 50, 64, .16);
  border-radius: 7px;
  background: transparent;
  color: #647078;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}

.tool-modal-open-external[hidden] {
  display: none;
}

.tool-modal-open-external svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-modal-open-external:hover,
.tool-modal-open-external:focus-visible {
  outline: none;
  color: #286a63;
  background: #e7f3ef;
  transform: scale(1.08);
}

html.theme-dark .workbench-tree-tool-title {
  background: rgba(38, 42, 48, .96);
  border-color: rgba(223, 231, 229, .18);
  color: #f3f7f5;
}

html.theme-dark .workbench-tree-tool-frame {
  border-color: rgba(223, 231, 229, .16);
  background: #202020;
}

@media (max-width: 920px) {
  .tool-modal-card.workbench-tree-tool-modal-card {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    padding: 12px;
    border-radius: 16px;
  }
}
