.functions-overlay {
  position: absolute;
  top: 38.3%;
  left: 2.68%;
  z-index: 4;
  width: 21.25cqw;
  height: 36cqw;
  padding: 1.1cqw;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.985);
  border: 1px solid rgba(215, 223, 220, 0.96);
  border-radius: 0.78cqw;
  box-shadow: 0 0.72cqw 2.1cqw rgba(18, 48, 39, 0.13);
}

.functions-heading h2,
.functions-heading p,
.function-tip {
  margin: 0;
}

.functions-heading h2 {
  font-size: 1.22cqw;
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}

.functions-heading p {
  margin-top: 0.26cqw;
  color: #4d5854;
  font-size: 0.76cqw;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.function-list {
  display: grid;
  gap: 0.38cqw;
  margin-top: 1.02cqw;
}

.function-item {
  position: relative;
  display: grid;
  grid-template-columns: 2.35cqw minmax(0, 1fr) 1.42cqw;
  align-items: center;
  gap: 0.62cqw;
  min-height: 3.1cqw;
  padding: 0.3cqw 0.42cqw 0.3cqw 0.66cqw;
  background: #ffffff;
  border: 1px solid rgba(217, 224, 223, 0.98);
  border-radius: 0.56cqw;
  box-shadow: 0 0.34cqw 0.84cqw rgba(18, 48, 39, 0.08);
  user-select: none;
}

.function-item:hover,
.function-item:focus-visible,
.function-item.is-active,
.function-item.is-dragging {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.function-item.is-dragging {
  opacity: 0.72;
  transform: scale(0.992);
}

.function-icon {
  display: grid;
  place-items: center;
  width: 2.35cqw;
  height: 2.35cqw;
  overflow: hidden;
}

.function-icon img {
  display: block;
  width: 2.2cqw;
  height: 2.2cqw;
  object-fit: contain;
  pointer-events: none;
}

.function-name {
  overflow: hidden;
  min-width: 0;
  color: #202726;
  font-size: 0.93cqw;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.function-controls {
  position: absolute;
  top: 50%;
  right: 2.02cqw;
  display: grid;
  grid-template-rows: repeat(2, 1.12cqw);
  gap: 0.16cqw;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 160ms ease;
}

.function-item:hover .function-controls,
.function-item:focus-within .function-controls,
.function-item.is-active .function-controls {
  opacity: 1;
  pointer-events: auto;
}

.function-move,
.function-grip {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #4d5754;
  background: transparent;
  border: 0;
  border-radius: 0.34cqw;
}

.function-move {
  width: 1.22cqw;
  height: 1.12cqw;
  font-size: 0.82cqw;
  font-weight: 850;
  line-height: 1;
}

.function-move:disabled {
  cursor: default;
  opacity: 0.24;
}

.function-grip {
  width: 1.42cqw;
  height: 2.35cqw;
  touch-action: none;
}

.function-grip span {
  color: #2c3432;
  font-size: 1.05cqw;
  font-weight: 850;
  line-height: 0.62;
  letter-spacing: 0;
  writing-mode: vertical-rl;
}

.function-move:hover:not(:disabled),
.function-move:focus-visible,
.function-grip:hover,
.function-grip:focus-visible {
  color: var(--brand-strong);
  background: rgba(0, 107, 69, 0.08);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.function-tip {
  display: grid;
  grid-template-columns: 1.65cqw minmax(0, 1fr);
  align-items: center;
  gap: 0.58cqw;
  margin-top: 1.12cqw;
  color: #4d5754;
  font-size: 0.72cqw;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.function-tip img {
  display: block;
  width: 1.55cqw;
  height: 1.55cqw;
  object-fit: contain;
}
